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@xxxxxxxxxxx> --- 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 - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html