From 540e50900d17cffc40522df8795b27d6f030bed3 Mon Sep 17 00:00:00 2001 From: Marcello Lamonaca Date: Tue, 28 Jan 2025 22:41:37 +0100 Subject: [PATCH 1/4] docs: git: move under `vcs` folder --- docs/misc/{ => vcs}/git.md | 2 +- mkdocs.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) rename docs/misc/{ => vcs}/git.md (99%) diff --git a/docs/misc/git.md b/docs/misc/vcs/git.md similarity index 99% rename from docs/misc/git.md rename to docs/misc/vcs/git.md index 7e09e2e..018d966 100644 --- a/docs/misc/git.md +++ b/docs/misc/vcs/git.md @@ -170,7 +170,7 @@ It's generally recommended creating annotated tags so it's possible to have all ### Branching And Merging -![branch](../img/git_branches.avif "how branches work") +![branch](../../img/git_branches.avif "how branches work") `git branch`: shows branches `git branch -vv`: show branch + last commit + remote status diff --git a/mkdocs.yml b/mkdocs.yml index 304b62e..305d39e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -184,7 +184,8 @@ nav: - Scripting: languages/bash/scripting.md - Commands: languages/bash/commands.md - Misc: - - Git: misc/git.md + - VCS: + - Git: misc/vcs/git.md - GraphQL: misc/graph-ql.md - RegEx: misc/regular-expressions.md - SSH: misc/ssh.md From 5bf918689df7c62cec8af1f7d93e851b15d58567 Mon Sep 17 00:00:00 2001 From: Marcello Lamonaca Date: Tue, 28 Jan 2025 22:41:56 +0100 Subject: [PATCH 2/4] docs: jj: add initial `jj` notes --- docs/misc/vcs/jj.md | 62 +++++++++++++++++++++++++++++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 63 insertions(+) create mode 100644 docs/misc/vcs/jj.md diff --git a/docs/misc/vcs/jj.md b/docs/misc/vcs/jj.md new file mode 100644 index 0000000..27c6aa1 --- /dev/null +++ b/docs/misc/vcs/jj.md @@ -0,0 +1,62 @@ +# Jujustsu (`jj`) + +## Common Commands + +### Status & Log + +`jj status`: show current status of the working copy +`jj log -r|--revisions `: show commits of a given revset +`jj log -r|--revisions ::@`: show all ancestors of the working copy + +### Showing Changes + +`jj show []`: show changes in ``, compared to its parents +`jj diff [-f|--from ] [-t|--to ]`: compare file contents between revisions + +### Describing & Creating Commits + +`jj describe -m|--message `: add a description to the working copy +`jj new -m|--message `: create a new commit after `` with the given description +`jj commit -m|--message `: create and describe a new commit in a single command + +### Deleting Commits + +`jj abandon `: delete the revision `` + +### Merging Commits + +`jj new ...`: create a new commit after listed parents + +### Rebasing Commits + +`jj rebase --source --destination `: rebase `` and descendants onto `` +`jj rebase --source --insert-after|--after `: insert `` and descendants after `` +`jj rebase --source --insert--before|--before `: insert `` and descendants before `` + +### Squashing & Splitting Commits + +`jj squash [-i|--interactive]`: move changes from current revision (`@`) into its parent +`jj squash -f|--from --t|--to|--into `: move changes from `` into `` + +`jj split [-i|--interactive]`: split a revision in two + +### Signing Commits + +`jj sign --key -r|--revisions `: cryptographically sign a revision + +### Managing Bookmarks + +`jj bookmark set -r|--revision|--to `: create or update a bookmark to point to a certain commit +`jj bookmark move -r|--revision|--to [--allow-backwards]`: move bookmark `` to point to `` +`jj bookmark create -r|--revision|--to `: create `` pointing to `` + +## Git Commands + +`jj git init --colocate`: init a colocated jj/git repository +`jj git fetch`: fetch changes from the remote git repository +`jj git push`: push changes to git + +## Operations + +`jj undo []`: undo an operation +`jj operation log`: show list of operations taken diff --git a/mkdocs.yml b/mkdocs.yml index 305d39e..f471a35 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -186,6 +186,7 @@ nav: - Misc: - VCS: - Git: misc/vcs/git.md + - JJ: misc/vcs/jj.md - GraphQL: misc/graph-ql.md - RegEx: misc/regular-expressions.md - SSH: misc/ssh.md From 548d21b3a6004bd367befdea5b5edebe73c86023 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 16:10:33 +0000 Subject: [PATCH 3/4] Github Actions(deps): Bump astral-sh/setup-uv from 5 to 6 Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 5 to 6. - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/v5...v6) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 93946ab..fb7ee64 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v4 - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v6 with: version: "latest" enable-cache: true From e40427a9fc812e307083bf27cfdd0f888f65fa67 Mon Sep 17 00:00:00 2001 From: Marcello Lamonaca Date: Mon, 19 May 2025 13:15:18 +0200 Subject: [PATCH 4/4] regex: clarify lookahead/lookbehind match requirements --- docs/misc/regular-expressions.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/misc/regular-expressions.md b/docs/misc/regular-expressions.md index c18b74e..7d0cddb 100644 --- a/docs/misc/regular-expressions.md +++ b/docs/misc/regular-expressions.md @@ -102,7 +102,10 @@ The *subexpression* is any valid regular expression pattern. The noncapturing gr (?= subexpression) ``` -The *subexpression* is any regular expression pattern. For a match to be successful, the input string must match the regular expression pattern in subexpression, although the matched substring is not included in the match result. A zero-width positive lookahead assertion does not backtrack. +The *subexpression* is any regular expression pattern. For a match to be successful, `subexpression` *must occur* in the input string to the **right** of the current position. + +> **Note**: `subexpression` is not included in the match result. +> **Note**: A zero-width positive lookahead assertion does not backtrack. Typically, a zero-width positive lookahead assertion is found at the end of a regular expression pattern. It defines a substring that must be found at the end of a string for a match to occur but that should not be included in the match. It is also useful for preventing excessive backtracking. @@ -114,7 +117,10 @@ It's possible to use a zero-width positive lookahead assertion to ensure that a (?! subexpression) ``` -The *subexpression* is any regular expression pattern. For the match to be successful, the input string must not match the regular expression pattern in subexpression, although the matched string is not included in the match result. +The *subexpression* is any regular expression pattern. For a match to be successful, `subexpression` *must not occur* in the input string to the **right** of the current position. + +> **Note**: `subexpression` is not included in the match result. +> **Note**: A zero-width negative lookahead assertion does not backtrack. A zero-width negative lookahead assertion is typically used either at the beginning or at the end of a regular expression. At the beginning of a regular expression, it can define a specific pattern that should not be matched when the beginning of the regular expression defines a similar but more general pattern to be matched. In this case, it is often used to limit backtracking. At the end of a regular expression, it can define a subexpression that cannot occur at the end of a match. @@ -124,7 +130,10 @@ A zero-width negative lookahead assertion is typically used either at the beginn (?<= subexpression) ``` -The *subexpression* is any regular expression pattern. For a match to be successful, subexpression must occur at the input string to the left of the current position, although subexpression is not included in the match result. A zero-width positive lookbehind assertion does not backtrack. +The *subexpression* is any regular expression pattern. For a match to be successful, `subexpression` *must occur* in the input string to the **left** of the current position. + +> **Note**: `subexpression` is not included in the match result. +> **Note**:A zero-width positive lookbehind assertion does not backtrack. Zero-width positive lookbehind assertions are typically used at the beginning of regular expressions. The pattern that they define is a precondition for a match, although it is not a part of the match result. @@ -132,17 +141,19 @@ Zero-width positive lookbehind assertions are typically used at the beginning of ```regex title="Regex Syntax" (? subexpression) ``` -Hte *subexpression* is any regular expression pattern. For a match to be successful, subexpression must not occur at the input string to the left of the current position. However, any substring that does not match subexpression is not included in the match result. +The *subexpression* is any regular expression pattern. For a match to be successful, `subexpression` *must not occur* in the input string to the **left** of the current position. + +> **Note**: `subexpression` is not included in the match result. +> **Note**: A zero-width negative lookbehind assertion does not backtrack. Zero-width negative lookbehind assertions are typically used at the beginning of regular expressions. The pattern that they define precludes a match in the string that follows. They are also used to limit backtracking when the last character or characters in a captured group must not be one or more of the characters that match that group's regular expression pattern. ### Atomic groups ```regex title="Regex Syntax" -(?> subexpression ) +(?> subexpression) ``` The *subexpression* is any regular expression pattern.