git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-gui: stop using deprecated merge syntax
@ 2016-09-24 11:30 René Scharfe
  2016-09-24 18:22 ` Johannes Sixt
  0 siblings, 1 reply; 7+ messages in thread
From: René Scharfe @ 2016-09-24 11:30 UTC (permalink / raw)
  To: Git List, Pat Thoyts; +Cc: Junio C Hamano, Johannes Sixt, Dennis Kaarsemaker

Starting with v2.5.0 git merge can handle FETCH_HEAD internally and
warns when it's called like 'git merge <message> HEAD <commit>' because
that syntax is deprecated.  Use this feature in git-gui and get rid of
that warning.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
Tested only _very_ lightly!

 git-gui/lib/merge.tcl | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/git-gui/lib/merge.tcl b/git-gui/lib/merge.tcl
index 460d32f..5ab6f8f 100644
--- a/git-gui/lib/merge.tcl
+++ b/git-gui/lib/merge.tcl
@@ -112,12 +112,7 @@ method _start {} {
 	close $fh
 	set _last_merged_branch $branch
 
-	set cmd [list git]
-	lappend cmd merge
-	lappend cmd --strategy=recursive
-	lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
-	lappend cmd HEAD
-	lappend cmd $name
+	set cmd [list git merge --strategy=recursive FETCH_HEAD]
 
 	ui_status [mc "Merging %s and %s..." $current_branch $stitle]
 	set cons [console::new [mc "Merge"] "merge $stitle"]
-- 
2.10.0


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

* Re: [PATCH] git-gui: stop using deprecated merge syntax
  2016-09-24 11:30 [PATCH] git-gui: stop using deprecated merge syntax René Scharfe
@ 2016-09-24 18:22 ` Johannes Sixt
  2016-09-25 18:39   ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Sixt @ 2016-09-24 18:22 UTC (permalink / raw)
  To: René Scharfe
  Cc: Git List, Pat Thoyts, Junio C Hamano, Dennis Kaarsemaker

Am 24.09.2016 um 13:30 schrieb René Scharfe:
> Starting with v2.5.0 git merge can handle FETCH_HEAD internally and
> warns when it's called like 'git merge <message> HEAD <commit>' because
> that syntax is deprecated.  Use this feature in git-gui and get rid of
> that warning.
>
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---
> Tested only _very_ lightly!
>
>  git-gui/lib/merge.tcl | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/git-gui/lib/merge.tcl b/git-gui/lib/merge.tcl
> index 460d32f..5ab6f8f 100644
> --- a/git-gui/lib/merge.tcl
> +++ b/git-gui/lib/merge.tcl
> @@ -112,12 +112,7 @@ method _start {} {
>  	close $fh
>  	set _last_merged_branch $branch
>
> -	set cmd [list git]
> -	lappend cmd merge
> -	lappend cmd --strategy=recursive
> -	lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
> -	lappend cmd HEAD
> -	lappend cmd $name
> +	set cmd [list git merge --strategy=recursive FETCH_HEAD]
>
>  	ui_status [mc "Merging %s and %s..." $current_branch $stitle]
>  	set cons [console::new [mc "Merge"] "merge $stitle"]
>

Much better than my version. I had left fmt-merge-msg and added --no-log 
to treat merge.log config suitably. But this works too, and is much more 
obvious.

Tested-by: Johannes Sixt <j6t@kdbg.org>

-- Hannes


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

* Re: [PATCH] git-gui: stop using deprecated merge syntax
  2016-09-24 18:22 ` Johannes Sixt
@ 2016-09-25 18:39   ` Junio C Hamano
  2016-09-26 17:23     ` Stefan Beller
  0 siblings, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2016-09-25 18:39 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: René Scharfe, Git List, Pat Thoyts, Dennis Kaarsemaker

Johannes Sixt <j6t@kdbg.org> writes:

> Am 24.09.2016 um 13:30 schrieb René Scharfe:
>> Starting with v2.5.0 git merge can handle FETCH_HEAD internally and
>> warns when it's called like 'git merge <message> HEAD <commit>' because
>> that syntax is deprecated.  Use this feature in git-gui and get rid of
>> that warning.
>>
>> Signed-off-by: Rene Scharfe <l.s.r@web.de>
>> ---
>> Tested only _very_ lightly!
>>
>>  git-gui/lib/merge.tcl | 7 +------
>>  1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/git-gui/lib/merge.tcl b/git-gui/lib/merge.tcl
>> index 460d32f..5ab6f8f 100644
>> --- a/git-gui/lib/merge.tcl
>> +++ b/git-gui/lib/merge.tcl
>> @@ -112,12 +112,7 @@ method _start {} {
>>  	close $fh
>>  	set _last_merged_branch $branch
>>
>> -	set cmd [list git]
>> -	lappend cmd merge
>> -	lappend cmd --strategy=recursive
>> -	lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
>> -	lappend cmd HEAD
>> -	lappend cmd $name
>> +	set cmd [list git merge --strategy=recursive FETCH_HEAD]
>>
>>  	ui_status [mc "Merging %s and %s..." $current_branch $stitle]
>>  	set cons [console::new [mc "Merge"] "merge $stitle"]
>>
>
> Much better than my version. I had left fmt-merge-msg and added
> --no-log to treat merge.log config suitably. But this works too, and
> is much more obvious.
>
> Tested-by: Johannes Sixt <j6t@kdbg.org>

Thanks both.

We can finally deprecate and remove the ancient "git merge" syntax
with this, which should make me happy, but with git-gui maintainer
missing, it nudges me to be an interim maintainer one more time.

Sigh...

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

* Re: [PATCH] git-gui: stop using deprecated merge syntax
  2016-09-25 18:39   ` Junio C Hamano
@ 2016-09-26 17:23     ` Stefan Beller
  2016-10-03  8:30       ` Pat Thoyts
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Beller @ 2016-09-26 17:23 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Johannes Sixt, René Scharfe, Git List, Pat Thoyts,
	Dennis Kaarsemaker

On Sun, Sep 25, 2016 at 11:39 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Johannes Sixt <j6t@kdbg.org> writes:
>
>> Am 24.09.2016 um 13:30 schrieb René Scharfe:
>>> Starting with v2.5.0 git merge can handle FETCH_HEAD internally and
>>> warns when it's called like 'git merge <message> HEAD <commit>' because
>>> that syntax is deprecated.  Use this feature in git-gui and get rid of
>>> that warning.
>>>
>>> Signed-off-by: Rene Scharfe <l.s.r@web.de>
>>> ---
>>> Tested only _very_ lightly!
>>>
>>>  git-gui/lib/merge.tcl | 7 +------
>>>  1 file changed, 1 insertion(+), 6 deletions(-)
>>>
>>> diff --git a/git-gui/lib/merge.tcl b/git-gui/lib/merge.tcl
>>> index 460d32f..5ab6f8f 100644
>>> --- a/git-gui/lib/merge.tcl
>>> +++ b/git-gui/lib/merge.tcl
>>> @@ -112,12 +112,7 @@ method _start {} {
>>>      close $fh
>>>      set _last_merged_branch $branch
>>>
>>> -    set cmd [list git]
>>> -    lappend cmd merge
>>> -    lappend cmd --strategy=recursive
>>> -    lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
>>> -    lappend cmd HEAD
>>> -    lappend cmd $name
>>> +    set cmd [list git merge --strategy=recursive FETCH_HEAD]
>>>
>>>      ui_status [mc "Merging %s and %s..." $current_branch $stitle]
>>>      set cons [console::new [mc "Merge"] "merge $stitle"]
>>>
>>
>> Much better than my version. I had left fmt-merge-msg and added
>> --no-log to treat merge.log config suitably. But this works too, and
>> is much more obvious.
>>
>> Tested-by: Johannes Sixt <j6t@kdbg.org>

Reviewed-by: Stefan Beller <sbeller@google.com>

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

* Re: [PATCH] git-gui: stop using deprecated merge syntax
  2016-09-26 17:23     ` Stefan Beller
@ 2016-10-03  8:30       ` Pat Thoyts
  2016-10-03  9:45         ` René Scharfe
  0 siblings, 1 reply; 7+ messages in thread
From: Pat Thoyts @ 2016-10-03  8:30 UTC (permalink / raw)
  To: Stefan Beller
  Cc: Junio C Hamano, Johannes Sixt, René Scharfe, Git List,
	Dennis Kaarsemaker

Stefan Beller <sbeller@google.com> writes:

>On Sun, Sep 25, 2016 at 11:39 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Johannes Sixt <j6t@kdbg.org> writes:
>>
>>> Am 24.09.2016 um 13:30 schrieb René Scharfe:
>>>> Starting with v2.5.0 git merge can handle FETCH_HEAD internally and
>>>> warns when it's called like 'git merge <message> HEAD <commit>' because
>>>> that syntax is deprecated.  Use this feature in git-gui and get rid of
>>>> that warning.
>>>>
>>>> Signed-off-by: Rene Scharfe <l.s.r@web.de>
>>>> ---
>>>> Tested only _very_ lightly!
>>>>
>>>>  git-gui/lib/merge.tcl | 7 +------
>>>>  1 file changed, 1 insertion(+), 6 deletions(-)
>>>>
>>>> diff --git a/git-gui/lib/merge.tcl b/git-gui/lib/merge.tcl
>>>> index 460d32f..5ab6f8f 100644
>>>> --- a/git-gui/lib/merge.tcl
>>>> +++ b/git-gui/lib/merge.tcl
>>>> @@ -112,12 +112,7 @@ method _start {} {
>>>>      close $fh
>>>>      set _last_merged_branch $branch
>>>>
>>>> -    set cmd [list git]
>>>> -    lappend cmd merge
>>>> -    lappend cmd --strategy=recursive
>>>> -    lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
>>>> -    lappend cmd HEAD
>>>> -    lappend cmd $name
>>>> +    set cmd [list git merge --strategy=recursive FETCH_HEAD]
>>>>
>>>>      ui_status [mc "Merging %s and %s..." $current_branch $stitle]
>>>>      set cons [console::new [mc "Merge"] "merge $stitle"]
>>>>
>>>
>>> Much better than my version. I had left fmt-merge-msg and added
>>> --no-log to treat merge.log config suitably. But this works too, and
>>> is much more obvious.
>>>
>>> Tested-by: Johannes Sixt <j6t@kdbg.org>
>
>Reviewed-by: Stefan Beller <sbeller@google.com>
>

The only problem I see here is that generally git-gui tries to continue
to work with older versions of git as well. So adding a guard using the
git-version procedure should maintain that backwards compatibility.

I suggest:

From c2716458f05893ca88c05ce211a295a330e74590 Mon Sep 17 00:00:00 2001
From:  René Scharfe <l.s.r@web.de>
Date: Sat, 24 Sep 2016 13:30:22 +0200
Subject: [PATCH] git-gui: stop using deprecated merge syntax

Starting with v2.5.0 git merge can handle FETCH_HEAD internally and
warns when it's called like 'git merge <message> HEAD <commit>' because
that syntax is deprecated.  Use this feature in git-gui and get rid of
that warning.

Tested-by: Johannes Sixt <j6t@kdbg.org>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 lib/merge.tcl | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/lib/merge.tcl b/lib/merge.tcl
index 460d32f..2361b78 100644
--- a/lib/merge.tcl
+++ b/lib/merge.tcl
@@ -112,13 +112,16 @@ method _start {} {
 	close $fh
 	set _last_merged_branch $branch
 
-	set cmd [list git]
-	lappend cmd merge
-	lappend cmd --strategy=recursive
-	lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
-	lappend cmd HEAD
-	lappend cmd $name
-
+	if {[git-version >= "2.5.0"]} {
+		set cmd [list git merge --strategy=recursive FETCH_HEAD]
+	} else {
+		set cmd [list git]
+		lappend cmd merge
+		lappend cmd --strategy=recursive
+		lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
+		lappend cmd HEAD
+		lappend cmd $name
+	}
 	ui_status [mc "Merging %s and %s..." $current_branch $stitle]
 	set cons [console::new [mc "Merge"] "merge $stitle"]
 	console::exec $cons $cmd [cb _finish $cons]
-- 
2.10.0.windows.1

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

* Re: [PATCH] git-gui: stop using deprecated merge syntax
  2016-10-03  8:30       ` Pat Thoyts
@ 2016-10-03  9:45         ` René Scharfe
  2016-10-03 23:15           ` Pat Thoyts
  0 siblings, 1 reply; 7+ messages in thread
From: René Scharfe @ 2016-10-03  9:45 UTC (permalink / raw)
  To: patthoyts, Stefan Beller
  Cc: Junio C Hamano, Johannes Sixt, Git List, Dennis Kaarsemaker

Am 03.10.2016 um 10:30 schrieb Pat Thoyts:
> The only problem I see here is that generally git-gui tries to continue
> to work with older versions of git as well. So adding a guard using the
> git-version procedure should maintain that backwards compatibility.

Makes sense for a stand-alone tool.

> I suggest:
>
> From c2716458f05893ca88c05ce211a295a330e74590 Mon Sep 17 00:00:00 2001
> From:  René Scharfe <l.s.r@web.de>
> Date: Sat, 24 Sep 2016 13:30:22 +0200
> Subject: [PATCH] git-gui: stop using deprecated merge syntax
>
> Starting with v2.5.0 git merge can handle FETCH_HEAD internally and
> warns when it's called like 'git merge <message> HEAD <commit>' because
> that syntax is deprecated.  Use this feature in git-gui and get rid of
> that warning.
>
> Tested-by: Johannes Sixt <j6t@kdbg.org>
> Reviewed-by: Stefan Beller <sbeller@google.com>
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

OK, but perhaps move me from From: to Original-patch-by: as the version 
check is a big enough change in itself.  Or add a separate commit for 
it.  Or at least mention that you added the check in the commit message.

Thanks,
René

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

* Re: [PATCH] git-gui: stop using deprecated merge syntax
  2016-10-03  9:45         ` René Scharfe
@ 2016-10-03 23:15           ` Pat Thoyts
  0 siblings, 0 replies; 7+ messages in thread
From: Pat Thoyts @ 2016-10-03 23:15 UTC (permalink / raw)
  To: René Scharfe
  Cc: Stefan Beller, Junio C Hamano, Johannes Sixt, Git List,
	Dennis Kaarsemaker

René Scharfe <l.s.r@web.de> writes:

>Am 03.10.2016 um 10:30 schrieb Pat Thoyts:
>> The only problem I see here is that generally git-gui tries to continue
>> to work with older versions of git as well. So adding a guard using the
>> git-version procedure should maintain that backwards compatibility.
>
>Makes sense for a stand-alone tool.
>
>> I suggest:
>>
>> From c2716458f05893ca88c05ce211a295a330e74590 Mon Sep 17 00:00:00 2001
>> From:  René Scharfe <l.s.r@web.de>
>> Date: Sat, 24 Sep 2016 13:30:22 +0200
>> Subject: [PATCH] git-gui: stop using deprecated merge syntax
>>
>> Starting with v2.5.0 git merge can handle FETCH_HEAD internally and
>> warns when it's called like 'git merge <message> HEAD <commit>' because
>> that syntax is deprecated.  Use this feature in git-gui and get rid of
>> that warning.
>>
>> Tested-by: Johannes Sixt <j6t@kdbg.org>
>> Reviewed-by: Stefan Beller <sbeller@google.com>
>> Signed-off-by: Rene Scharfe <l.s.r@web.de>
>> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
>
>OK, but perhaps move me from From: to Original-patch-by: as the
>version check is a big enough change in itself.  Or add a separate
>commit for it.  Or at least mention that you added the check in the
>commit message.
>
>Thanks,
>René

As this is one of the ones already staged to git's 'next' I'll make this
as a separate commit on top.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

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

end of thread, other threads:[~2016-10-03 23:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-24 11:30 [PATCH] git-gui: stop using deprecated merge syntax René Scharfe
2016-09-24 18:22 ` Johannes Sixt
2016-09-25 18:39   ` Junio C Hamano
2016-09-26 17:23     ` Stefan Beller
2016-10-03  8:30       ` Pat Thoyts
2016-10-03  9:45         ` René Scharfe
2016-10-03 23:15           ` Pat Thoyts

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).