All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Documentation/git-bisect.txt: add --no-ff to merge command
@ 2019-10-25 22:20 Mihail Atanassov
  2019-10-26  2:26 ` Jonathan Nieder
  0 siblings, 1 reply; 6+ messages in thread
From: Mihail Atanassov @ 2019-10-25 22:20 UTC (permalink / raw)
  To: git; +Cc: Mihail Atanassov

The hotfix application example uses `git merge --no-commit` to apply
temporary changes to the working tree during a bisect operation. In some
situations this can be a fast-forward and `merge` will apply the hotfix
branch's commits regardless of `--no-commit` (as documented in the `git
merge` manual).

In the pathological case this will make a `git bisect
run` invocation to loop indefinitely between the first bisect step and
the fast-forwarded post-merge HEAD.

Add `--no-ff` to the merge command to avoid this issue, and make a note
of it for the reader.

Signed-off-by: Mihail Atanassov <m.atanassov92@gmail.com>
---
 Documentation/git-bisect.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index 4b45d837a7..58b5585874 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -412,8 +412,10 @@ $ cat ~/test.sh
 #!/bin/sh
 
 # tweak the working tree by merging the hot-fix branch
-# and then attempt a build
-if	git merge --no-commit hot-fix &&
+# and then attempt a build. Note the `--no-ff`: `git merge`
+# will otherwise still apply commits if the current HEAD can be
+# fast-forwarded to the hot-fix branch.
+if	git merge --no-commit --no-ff hot-fix &&
 	make
 then
 	# run project specific test and report its status
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-29  3:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25 22:20 [PATCH] Documentation/git-bisect.txt: add --no-ff to merge command Mihail Atanassov
2019-10-26  2:26 ` Jonathan Nieder
     [not found]   ` <CALs020+0E=7wy-N46BRLrBcKmMSTpcMyZ9WybmgTzb60aCo5PQ@mail.gmail.com>
2019-10-28 22:10     ` Mihail Atanassov
2019-10-28 22:24       ` Jonathan Nieder
2019-10-29  2:24         ` Junio C Hamano
2019-10-29  3:25           ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.