git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Octopus merge: unique (?) to git, but is it useful?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 3, 2008, 22:08 UTC
Message-ID
<7vk5h6189b.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080603203924.GA6588@neumann>
SZEDER Gábor <szeder@ira.uka.de> writes:
Show 30 quoted lines
> On Tue, Jun 03, 2008 at 12:30:34PM -0700, Junio C Hamano wrote:
>> > ...  It
>> > fails at the line 'EDITOR=: git commit -a'.
>> 
>> Sorry, because it works for me (and presumably for many others --- I
>> haven't seen anybody else reporting the breakage you have), you need to
>> help others to diagnose it with a bit more details.
> With debug and verbose options it says following:
>
> * expecting success: 
>
>         git rev-parse second master >expect &&
>         test_must_fail git merge second master &&
>         git checkout master g &&
>         echo "here comes the breakage" &&
>         EDITOR=: git commit -a &&
>         echo "survived!" &&
>         git cat-file commit HEAD | sed -n -e "s/^parent //p" -e "/^$/q" >actual &&
>         test_cmp expect actual
>
>
>
> *** Please tell me who you are.
> ...
> * failed 1 among 18 test(s)
> make: *** [t7502-commit.sh] Error 1
>
> My /bin/sh is dash, but it breaks with bash, too.
>
> What else could/should I provide?
Thanks, this is good enough.

I think the problem comes from the global removal of the two environment variables, GIT_COMMITTER_{EMAIL,NAME} by an ealier bb1ae3f (commit: Show committer if automatic, 2008-05-04).

Here is a potential fix.

The first hunk is the more relevant one; although the second one is also a fix, it is independent. It is a fix to unnecessarily loosely written test that was done in early February.

 t/t7502-commit.sh |   44 ++++++++++++++++++++++++--------------------
 1 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 22a13f7..7b659b9 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -171,13 +171,16 @@ sed '$d' < expect.tmp > expect
 rm -f expect.tmp
 echo "# Committer:
 #" >> expect
-unset GIT_COMMITTER_EMAIL
-unset GIT_COMMITTER_NAME
 
 test_expect_success 'committer is automatic' '
 
 	echo >>negative &&
-	git commit -e -m "sample"
+	(
+		unset GIT_COMMITTER_EMAIL
+		unset GIT_COMMITTER_NAME
+		# must fail because there is no change
+		test_must_fail git commit -e -m "sample"
+	) &&
 	head -n 8 .git/COMMIT_EDITMSG |	\
 	sed "s/^# Committer: .*/# Committer:/" >actual &&
 	test_cmp expect actual
@@ -193,23 +196,24 @@ chmod +x .git/FAKE_EDITOR
 
 test_expect_success 'do not fire editor in the presence of conflicts' '
 
-	git clean
-	echo f>g
-	git add g
-	git commit -myes
-	git branch second
-	echo master>g
-	echo g>h
-	git add g h
-	git commit -mmaster
-	git checkout second
-	echo second>g
-	git add g
-	git commit -msecond
-	git cherry-pick -n master
-	echo "editor not started" > .git/result
-	GIT_EDITOR=`pwd`/.git/FAKE_EDITOR git commit && exit 1  # should fail
-	test "`cat .git/result`" = "editor not started"
+	git clean -f &&
+	echo f >g &&
+	git add g &&
+	git commit -myes &&
+	git branch second &&
+	echo master >g
+	echo g >h
+	git add g h &&
+	git commit -mmaster &&
+	git checkout second &&
+	echo second >g
+	git add g &&
+	git commit -msecond &&
+	# Must fail due to conflict
+	test_must_fail git cherry-pick -n master &&
+	echo "editor not started" >.git/result &&
+	test_must_fail GIT_EDITOR="$(pwd)/.git/FAKE_EDITOR" git commit &&
+	test "$(cat .git/result)" = "editor not started"
 '
 
 pwd=`pwd`
Previous: SZEDER GáborNext: SZEDER Gábor
Message 11 of 30 in “Octopus merge: unique (?) to git, but is it useful?”
  1. Jakub NarebskiJun 3, 2008
  2. Linus TorvaldsJun 3, 2008
  3. Junio C HamanoJun 3, 2008
  4. Junio C HamanoJun 3, 2008
  5. Johannes SchindelinJun 3, 2008
  6. Junio C HamanoJun 3, 2008
  7. Johannes SchindelinJun 3, 2008
  8. SZEDER GáborJun 3, 2008
  9. Junio C HamanoJun 3, 2008
  10. SZEDER GáborJun 3, 2008
  11. Junio C HamanoJun 3, 2008
  12. SZEDER GáborJun 3, 2008
  13. Jeff KingJun 4, 2008
  14. Junio C HamanoJun 4, 2008
  15. Linus TorvaldsJun 3, 2008
  16. Miklos VajnaJun 3, 2008
  17. Junio C HamanoJun 4, 2008
  18. Junio C HamanoJun 3, 2008
  19. Jakub NarebskiJun 3, 2008
  20. Junio C HamanoJun 3, 2008
  21. Jakub NarebskiJun 3, 2008
  22. Junio C HamanoJun 3, 2008
  23. Linus TorvaldsJun 3, 2008
  24. Commit annotations (was:: Octopus merge: unique (?) to git, but is it useful?)Jakub Narebski, Jun 3, 2008
  25. Johannes SchindelinJun 3, 2008
  26. Johan HerlandJun 3, 2008
  27. Daniel VilleneuveJun 3, 2008
  28. Matthieu MoyJun 3, 2008
  29. Jakub NarebskiJun 3, 2008
  30. Matthieu MoyJun 3, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.