From: Alex Riesen Date: Thu, 08 Nov 2007 23:27:52 GMT Subject: Re: [PATCH] Port git commit to C. Message-ID: <20071108232751.GC4899@steel.home> In-Reply-To: <1194541140-3062-1-git-send-email-krh@redhat.com> Kristian Høgsberg, Thu, Nov 08, 2007 17:59:00 +0100: > This makes git commit a builtin and moves git-commit.sh to > contrib/examples. This also removes the git-runstatus > helper, which was mostly just a git-status.sh implementation detail. Applied instead of 00c8febf563da on Junio's pu it breaks t1400: * expecting success: echo TEST >F && git add F && GIT_AUTHOR_DATE="2005-05-26 23:30" \ GIT_COMMITTER_DATE="2005-05-26 23:30" git-commit -m add -a && h_TEST=$(git rev-parse --verify HEAD) echo The other day this did not work. >M && echo And then Bob told me how to fix it. >>M && echo OTHER >F && GIT_AUTHOR_DATE="2005-05-26 23:41" \ GIT_COMMITTER_DATE="2005-05-26 23:41" git-commit -F M -a && h_OTHER=$(git rev-parse --verify HEAD) && GIT_AUTHOR_DATE="2005-05-26 23:44" \ GIT_COMMITTER_DATE="2005-05-26 23:44" git-commit --amend && h_FIXED=$(git rev-parse --verify HEAD) && echo Merged initial commit and a later commit. >M && echo $h_TEST >.git/MERGE_HEAD && GIT_AUTHOR_DATE="2005-05-26 23:45" \ GIT_COMMITTER_DATE="2005-05-26 23:45" git-commit -F M && h_MERGED=$(git rev-parse --verify HEAD) rm -f M Created initial commit 2bc82dd: add 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 F Created commit d244b72: The other day this did not work. 1 files changed, 1 insertions(+), 1 deletions(-) launching editor, log (null) fatal: * no commit message? aborting commit. * ok 28: creating initial files * expecting success: diff expect .git/logs/refs/heads/master 3,4d2 < d244b725ca2c5f8aaacd9df2468b890499380862 C O Mitter 1117151040 +0000 commit (amend): The other day this did not work. < C O Mitter 1117151100 +0000 commit (merge): Merged initial commit and a later commit. * FAIL 29: git-commit logged updates diff expect .git/logs/refs/heads/master Which is not the test actually failed. The failed one is 28, but the last "rm -f M" killed the error because of missed "&&" before it. I believe you need something like this to fix the test: diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index ce045b2..a90824b 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -205,7 +205,7 @@ test_expect_success \ echo $h_TEST >.git/MERGE_HEAD && GIT_AUTHOR_DATE="2005-05-26 23:45" \ GIT_COMMITTER_DATE="2005-05-26 23:45" git-commit -F M && - h_MERGED=$(git rev-parse --verify HEAD) + h_MERGED=$(git rev-parse --verify HEAD) && rm -f M' cat >expect <