git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-merge: do up-to-date check also for strategies ours, subtree.
@ 2007-08-09 12:08 Gerrit Pape
  2007-08-09 21:11 ` Junio C Hamano
  2007-08-16  6:19 ` [PATCH] git-merge: do up-to-date check also for all strategies Junio C Hamano
  0 siblings, 2 replies; 7+ messages in thread
From: Gerrit Pape @ 2007-08-09 12:08 UTC (permalink / raw)
  To: git, Junio C Hamano

If called with one argument, check also for no_trivial_merge_strategies
whether all the merge can already be reached by HEAD.  Otherwise git-merge
creates an unnecessary commit, e.g.:

 $ (git init && touch foo && git add foo && git commit -m foo) >/dev/null
 $ git merge -s ours master
 Merge made by ours.
 $ git log --pretty=oneline
 d941346f022b7cb70c51d8122de4ae82657ae943 Merge branch 'master'
 68a1d32229917d5d1f4c8f64096d1abde84e9f6b foo
 $

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 git-merge.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-merge.sh b/git-merge.sh
index 5ccf282..e90f62a 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -287,9 +287,6 @@ esac
 echo "$head" >"$GIT_DIR/ORIG_HEAD"
 
 case "$index_merge,$#,$common,$no_commit" in
-f,*)
-	# We've been told not to try anything clever.  Skip to real merge.
-	;;
 ?,*,'',*)
 	# No common ancestors found. We need a real merge.
 	;;
@@ -299,6 +296,9 @@ f,*)
 	finish_up_to_date "Already up-to-date."
 	exit 0
 	;;
+f,*)
+	# We've been told not to try anything clever.  Skip to real merge.
+	;;
 ?,1,"$head",*)
 	# Again the most common case of merging one remote.
 	echo "Updating $(git rev-parse --short $head)..$(git rev-parse --short $1)"
-- 
debian.1.5.3_rc4.1-dirty

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

end of thread, other threads:[~2007-08-16  6:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-09 12:08 [PATCH] git-merge: do up-to-date check also for strategies ours, subtree Gerrit Pape
2007-08-09 21:11 ` Junio C Hamano
2007-08-10  0:01   ` Jeff King
2007-08-10  8:45   ` Junio C Hamano
2007-08-10  8:51     ` Junio C Hamano
2007-08-10 13:58   ` Gerrit Pape
2007-08-16  6:19 ` [PATCH] git-merge: do up-to-date check also for all strategies Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).