Skip to content

Commit

Permalink
The log.decorate setting should not influence import-commit.
Browse files Browse the repository at this point in the history
Use --no-decorate in the call to git log that tries to read the commit
message to produce patch names.  Otherwise, if the user has set
log.decorate to short or full, the patch name will be less useful.

Modify the t-034.sh test case to demonstrate that this is needed.

Signed-off-by: Per Cederqvist <[email protected]>
Signed-off-by: Josef 'Jeff' Sipek <[email protected]>
  • Loading branch information
Per Cederqvist committed Jan 22, 2015
1 parent 1c5b478 commit 01bfa90
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion guilt-import-commit
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ disp "About to begin conversion..." >&2
disp "Current head: `git rev-parse \`git_branch\``" >&2

for rev in `git rev-list $rhash`; do
s=`git log --pretty=oneline -1 $rev | cut -c 42-`
s=`git log --no-decorate --pretty=oneline -1 $rev | cut -c 42-`

# Try to convert the first line of the commit message to a
# valid patch name.
Expand Down
2 changes: 2 additions & 0 deletions regression/t-034.out
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ Date: Mon Jan 1 00:00:00 2007 +0000

Signed-off-by: Commiter Name <commiter@email>
% guilt init
% git config log.decorate short
% guilt import-commit base..HEAD
About to begin conversion...
Current head: 2a8b1889aa5066193bac978e6bf5073ffcfa6541
Expand Down Expand Up @@ -259,6 +260,7 @@ Converting 45e81b51 as the_sequence_.lock-_is_forbidden
Converting eebb76e9 as the_sequence_-._is_forbidden
Done.
Current head: d4850419ccc1146c7169f500725ce504b9774ed0
% git config log.decorate no
% guilt push -a
Applying patch..the_sequence_-._is_forbidden.patch
Patch applied.
Expand Down
2 changes: 2 additions & 0 deletions regression/t-034.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ cmd git log

# Import all the commits to guilt.
cmd guilt init
cmd git config log.decorate short
cmd guilt import-commit base..HEAD
cmd git config log.decorate no

for patch in .git/patches/master/*.patch; do
touch -a -m -t "$TOUCH_DATE" "$patch"
Expand Down

0 comments on commit 01bfa90

Please sign in to comment.