# [PATCH] git-merge: record merge strategy in the log message on auto resolved merges

3 messages from 2007-06-25 to 2007-06-25. Participants: Gerrit Pape, Junio C Hamano, Johannes Schindelin.
Thread: https://gitlist.dev/t/8710

## Gerrit Pape, 2007-06-25 07:16

Subject: [PATCH] git-merge: record merge strategy in the log message on auto resolved merges
Message-ID: <20070625071624.7919.qmail@82fa8ed4561cac.315fe32.mid.smarden.org>
URL: https://gitlist.dev/e/20070625071624.7919.qmail%4082fa8ed4561cac.315fe32.mid.smarden.org

```
If a strategy module auto resolved the merge cleanly, record the used
strategy in the log message, e.g.:

  Merge branch 'maint' using strategy ours

Signed-off-by: Gerrit Pape <pape@smarden.org>
---

> I personally find this useful especially for the 'ours' strategy.
Resend, maybe it's not that interesting, there was no followup when sent
the first time.

 git-merge.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/git-merge.sh b/git-merge.sh
index 981d69d..b661f74 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -440,7 +440,8 @@ done
 if test '' != "$result_tree"
 then
     parents=$(git-show-branch --independent "$head" "$@" | sed -e 's/^/-p /')
-    result_commit=$(printf '%s\n' "$merge_msg" | git-commit-tree $result_tree $parents) || exit
+    result_commit=$(printf '%s\n' "$merge_msg using strategy $wt_strategy" |
+	git-commit-tree $result_tree $parents) || exit
     finish "$result_commit" "Merge made by $wt_strategy."
     dropsave
     exit 0
-- 
1.5.2

```

## Junio C Hamano, 2007-06-25 07:50

Subject: Re: [PATCH] git-merge: record merge strategy in the log message on auto resolved merges
Message-ID: <7vk5ts1ni4.fsf@assigned-by-dhcp.pobox.com>
URL: https://gitlist.dev/e/7vk5ts1ni4.fsf%40assigned-by-dhcp.pobox.com
In-Reply-To: <20070625071624.7919.qmail@82fa8ed4561cac.315fe32.mid.smarden.org>

```
Gerrit Pape <pape@smarden.org> writes:

> If a strategy module auto resolved the merge cleanly, record the used
> strategy in the log message, e.g.:
>
>   Merge branch 'maint' using strategy ours
>
> Signed-off-by: Gerrit Pape <pape@smarden.org>
> ---
>
>> I personally find this useful especially for the 'ours' strategy.

I really do not think we want to do this, especially when the
user did not specify anything unusual like "ours".

At least, exclude recursive and octopus out of it, please.

```

## Johannes Schindelin, 2007-06-25 07:53

Subject: Re: [PATCH] git-merge: record merge strategy in the log message on auto resolved merges
Message-ID: <Pine.LNX.4.64.0706250852470.4059@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0706250852470.4059%40racer.site
In-Reply-To: <20070625071624.7919.qmail@82fa8ed4561cac.315fe32.mid.smarden.org>

```
Hi,

On Mon, 25 Jun 2007, Gerrit Pape wrote:

> If a strategy module auto resolved the merge cleanly, record the used
> strategy in the log message

Why only when it merged cleanly? If that information is useful, it is 
_especially_ useful when you had conflicts, so that you know how to 
recreate the merge?

Ciao,
Dscho

```
