-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect core.commentChar during restacking (#84)
Git supports setting `core.commentChar` to change which character it uses for comments in commit messages. This affects the rebase instruction list that restack sees. This change adds support to restack for this configuration. If set, the specified character will be used during restacking; both while searching for comments and when adding comments. Resolves #72
- Loading branch information
Showing
10 changed files
with
221 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kind: Added | ||
body: Support core.commentChar during restacking. | ||
time: 2023-07-05T05:48:52.57829209-07:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
git config core.commentChar 'auto' | ||
git commit --allow-empty -m "empty commit" |
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This fixture contains a simple stack of commits. | ||
# | ||
# o [main] initial commit | ||
# | | ||
# o [foo] foo | ||
# | | ||
# o [bar] bar | ||
# | | ||
# o [baz, wip] baz | ||
# | ||
# It also uses ';' as the comment character. | ||
|
||
die() { | ||
echo >&2 "$@" | ||
exit 1 | ||
} | ||
|
||
add_and_commit() { | ||
[[ $# -eq 1 ]] || die "add_and_commit expects one argument" | ||
|
||
echo "$1" > "$1" | ||
git add "$1" | ||
git commit -m "add $1" | ||
} | ||
|
||
git commit --allow-empty -m "empty commit" | ||
git config core.commentChar ';' | ||
|
||
git checkout -b foo | ||
add_and_commit foo | ||
|
||
git checkout -b bar | ||
add_and_commit bar | ||
|
||
git checkout -b baz | ||
add_and_commit baz | ||
|
||
git checkout -b wip |
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters