Re: [PATCH] merge: make merge state available to prepare-commit-msg hook

2014-01-09 Thread Matthieu Moy
Jonathan Nieder writes: > Matthieu Moy wrote: > >> Jonathan's answer is an option. Another one is > [...] >> So if the cleanup goes wrong, one can notice. > > test_when_finished also makes the test fail if the cleanup failed. Yes, I was mentionning it as opposed to "throwing the code at the topl

Re: [PATCH] merge: make merge state available to prepare-commit-msg hook

2014-01-08 Thread Jonathan Nieder
Matthieu Moy wrote: > Jonathan's answer is an option. Another one is [...] > So if the cleanup goes wrong, one can notice. test_when_finished also makes the test fail if the cleanup failed. Another common strategy is test_expect_success 'my exciting test' ' # this test w

Re: [PATCH] merge: make merge state available to prepare-commit-msg hook

2014-01-08 Thread Matthieu Moy
Ryan Biesemeyer writes: > In this case it was not immediately clear to me how to add cleanup to an > existing > test that dirtied the state of the test repository by leaving behind an > in-progress > merge. Jonathan's answer is an option. Another one is test_expect_success 'cleanup' '

Re: [PATCH] merge: make merge state available to prepare-commit-msg hook

2014-01-08 Thread Jonathan Nieder
Hi, Ryan Biesemeyer wrote: > In this case it was not immediately clear to me how to add cleanup to an > existing > test that dirtied the state of the test repository by leaving behind an > in-progress > merge. I see `test_cleanup` defined in the test lib & related functions, but > see no > exa

Re: [PATCH] merge: make merge state available to prepare-commit-msg hook

2014-01-08 Thread Ryan Biesemeyer
On 2014-01-08, at 20:06Z, Matthieu Moy wrote: > Ryan Biesemeyer writes: > >> index 3573751..89cdfe8 100755 >> --- a/t/t7505-prepare-commit-msg-hook.sh >> +++ b/t/t7505-prepare-commit-msg-hook.sh >> @@ -181,5 +181,27 @@ test_expect_success 'with failing hook (merge)' ' >> test_must_fail gi

Re: [PATCH] merge: make merge state available to prepare-commit-msg hook

2014-01-08 Thread Matthieu Moy
Ryan Biesemeyer writes: > index 3573751..89cdfe8 100755 > --- a/t/t7505-prepare-commit-msg-hook.sh > +++ b/t/t7505-prepare-commit-msg-hook.sh > @@ -181,5 +181,27 @@ test_expect_success 'with failing hook (merge)' ' > test_must_fail git merge other > > ' > +git merge --abort # cleanup, si

Re: [PATCH] merge: make merge state available to prepare-commit-msg hook

2014-01-08 Thread Ryan Biesemeyer
From a1f898fdf560e719d447a544569d5d1457307855 Mon Sep 17 00:00:00 2001 From: Ryan Biesemeyer Date: Wed, 8 Jan 2014 00:47:41 + Subject: [PATCH 2/2] merge: drop unused arg from abort_commit method signature Since abort_commit is no longer responsible for writing merge state, remove the unused a

Re: [PATCH] merge: make merge state available to prepare-commit-msg hook

2014-01-08 Thread Ryan Biesemeyer
From 9b431e5206652cf62ebb09dad4607989976e7748 Mon Sep 17 00:00:00 2001 From: Ryan Biesemeyer Date: Wed, 8 Jan 2014 00:46:41 + Subject: [PATCH 1/2] merge: make prepare_to_commit responsible for write_merge_state When merging, make the prepare-commit-msg hook have access to the merge state in