* [PATCH] Do not autosquash in case of an implied interactive rebase
@ 2012-05-24 13:52 Vincent van Ravesteijn
2012-05-24 13:57 ` [PATCHv2] " Vincent van Ravesteijn
0 siblings, 1 reply; 6+ messages in thread
From: Vincent van Ravesteijn @ 2012-05-24 13:52 UTC (permalink / raw)
To: git; +Cc: Vincent van Ravesteijn
The option to autosquash is only used in case of an interactive rebase.
When merges are preserved, rebase uses an interactive rebase internally,
but in this case autosquash should still be disabled.
---
git-rebase.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index 24a2840..9148ec2 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -167,6 +167,7 @@ run_specific_rebase () {
if [ "$interactive_rebase" = implied ]; then
GIT_EDITOR=:
export GIT_EDITOR
+ autosquash=
fi
. git-rebase--$type
}
--
1.7.9.msysgit.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCHv2] Do not autosquash in case of an implied interactive rebase
2012-05-24 13:52 [PATCH] Do not autosquash in case of an implied interactive rebase Vincent van Ravesteijn
@ 2012-05-24 13:57 ` Vincent van Ravesteijn
2012-05-25 17:50 ` Junio C Hamano
0 siblings, 1 reply; 6+ messages in thread
From: Vincent van Ravesteijn @ 2012-05-24 13:57 UTC (permalink / raw)
To: git; +Cc: Vincent van Ravesteijn
The option to autosquash is only used in case of an interactive rebase.
When merges are preserved, rebase uses an interactive rebase internally,
but in this case autosquash should still be disabled.
Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
---
git-rebase.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index 24a2840..9148ec2 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -167,6 +167,7 @@ run_specific_rebase () {
if [ "$interactive_rebase" = implied ]; then
GIT_EDITOR=:
export GIT_EDITOR
+ autosquash=
fi
. git-rebase--$type
}
--
1.7.9.msysgit.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCHv2] Do not autosquash in case of an implied interactive rebase
2012-05-24 13:57 ` [PATCHv2] " Vincent van Ravesteijn
@ 2012-05-25 17:50 ` Junio C Hamano
2012-05-28 9:17 ` Vincent van Ravesteijn
0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2012-05-25 17:50 UTC (permalink / raw)
To: Vincent van Ravesteijn; +Cc: git
Vincent van Ravesteijn <vfr@lyx.org> writes:
> The option to autosquash is only used in case of an interactive rebase.
> When merges are preserved, rebase uses an interactive rebase internally,
> but in this case autosquash should still be disabled.
>
> Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
Hrm, what if the end user said "git rebase --autosquash -p" explicitly
from the command line?
I _think_ you are addressing the case where rebase.autosquash is set to
true in the configuration. The handling of that variable that was added
in dd1e5b3 (add configuration variable for --autosquash option of
interactive rebase, 2010-07-14) is not correct. The configuration should
kick in only when the end user did not explicitly give either --autosquash
or --no-autosquash, so the variable $autosquash is logically a tristate
(unknown, set to yes, set to no), initialized to "unknown", set to either
value when --[no-]autosquash option is seen, and fall back to the
configured value _only_ after the option parsing loop exits and the
variable is still set to "unknown". In other words, the current:
autosquash=$(ask rebase.autosquash or default to no)
for each option:
if option == --autosquash: autosquash=yes
if option == --no-autosquash: autosquash=no
is wrong and I think this patch is trying to sweep that real problem under
the rug. Shouldn't the fix be more like the following, learning from what
was done to the "implied interactive rebase" case, to fix the option
parsing loop?
autosquash=unknown
interactive_rebase=unknown
for each option:
if option == --autosquash: autosquash=yes
if option == --no-autosquash: autosquash=no
if option == --preserve-merges:
preserve_merges=yes
if interactive_rebase is unknown:
interactive_rebase=implied
if autosquash is unknown:
autosquash=no
... other options ...
if autosquash is unknown:
autosquash=$(ask rebase.autosquash or default to no)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCHv2] Do not autosquash in case of an implied interactive rebase
2012-05-25 17:50 ` Junio C Hamano
@ 2012-05-28 9:17 ` Vincent van Ravesteijn
2012-05-29 18:41 ` Junio C Hamano
2012-05-29 18:43 ` Junio C Hamano
0 siblings, 2 replies; 6+ messages in thread
From: Vincent van Ravesteijn @ 2012-05-28 9:17 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Op 25-5-2012 19:50, Junio C Hamano schreef:
> Vincent van Ravesteijn<vfr@lyx.org> writes:
>
>> The option to autosquash is only used in case of an interactive rebase.
>> When merges are preserved, rebase uses an interactive rebase internally,
>> but in this case autosquash should still be disabled.
>>
>> Signed-off-by: Vincent van Ravesteijn<vfr@lyx.org>
> Hrm, what if the end user said "git rebase --autosquash -p" explicitly
> from the command line?
The option "--autosquash" is designed to have no effect whenever
"--interactive" is not supplied.
This is what you also argue in another thread
(http://permalink.gmane.org/gmane.comp.version-control.git/198579):
\"And that "I want rebase with --autosquash but I am not going to do any
other editing" is where my suggestion to use "--no-edit" comes from.\"
Or did you mean that you want to imply "--interactive" when
"--autosquash" is explicitly given ?
Vincent
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCHv2] Do not autosquash in case of an implied interactive rebase
2012-05-28 9:17 ` Vincent van Ravesteijn
@ 2012-05-29 18:41 ` Junio C Hamano
2012-05-29 18:43 ` Junio C Hamano
1 sibling, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2012-05-29 18:41 UTC (permalink / raw)
To: Vincent van Ravesteijn; +Cc: git
Vincent van Ravesteijn <vfr@lyx.org> writes:
> Op 25-5-2012 19:50, Junio C Hamano schreef:
>> Vincent van Ravesteijn<vfr@lyx.org> writes:
>>
>>> The option to autosquash is only used in case of an interactive rebase.
>>> When merges are preserved, rebase uses an interactive rebase internally,
>>> but in this case autosquash should still be disabled.
>>>
>>> Signed-off-by: Vincent van Ravesteijn<vfr@lyx.org>
>> Hrm, what if the end user said "git rebase --autosquash -p" explicitly
>> from the command line?
>
> The option "--autosquash" is designed to have no effect whenever
> "--interactive" is not supplied.
Ahh, Ok. I somehow thought "rebase --autosquash" implied "-i".
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCHv2] Do not autosquash in case of an implied interactive rebase
2012-05-28 9:17 ` Vincent van Ravesteijn
2012-05-29 18:41 ` Junio C Hamano
@ 2012-05-29 18:43 ` Junio C Hamano
1 sibling, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2012-05-29 18:43 UTC (permalink / raw)
To: Vincent van Ravesteijn; +Cc: git
Vincent van Ravesteijn <vfr@lyx.org> writes:
> Or did you mean that you want to imply "--interactive" when
> "--autosquash" is explicitly given ?
Come to think of it, it might have been a saner UI design when
f59baa5 (rebase -i --autosquash: auto-squash commits, 2009-12-08)
added this option, but if we want to go that route, we do need to
address the concerns I raised in my response.
But as things stand, i.e. with --autosquash that does not imply -i,
your patch is good.
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-05-29 18:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 13:52 [PATCH] Do not autosquash in case of an implied interactive rebase Vincent van Ravesteijn
2012-05-24 13:57 ` [PATCHv2] " Vincent van Ravesteijn
2012-05-25 17:50 ` Junio C Hamano
2012-05-28 9:17 ` Vincent van Ravesteijn
2012-05-29 18:41 ` Junio C Hamano
2012-05-29 18:43 ` 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).