Re: [PATCH v3 4/7] git-rebase: error out when incompatible options passed

2 messages, 2 authors, 2018-06-21 · open the first message on its own page

Re: [PATCH v3 4/7] git-rebase: error out when incompatible options passed

From: Junio C Hamano <hidden>
Date: 2018-06-21 20:29:50

Elijah Newren [off-list ref] writes:
+if test -n "$git_am_opt"; then
+	incompatible_opts=$(echo "$git_am_opt" | sed -e 's/ -q//')
This is probably just a taste-thing, but I'd probably prefer to see
the "sed" filter out "-q" alone, and make an effort to leave future
things like "-qx" alone, e.g.

    $(echo " $git_am_opt " | sed -e 's/ -q / /g' -e 's/^ \(.*\) $/\1/')

or something like that.
quoted hunk
+	if test -n "$interactive_rebase"
+	then
+		if test -n "$incompatible_opts"
+		then
+			die "$(gettext "error: cannot combine interactive options (--interactive, --exec, --rebase-merges, --preserve-merges, --keep-empty, --root + --onto) with am options ($incompatible_opts)")"
+		fi
+	fi
+	if test -n "$do_merge"; then
+		if test -n "$incompatible_opts"
+		then
+			die "$(gettext "error: cannot combine merge options (--merge, --strategy, --strategy-option) with am options ($incompatible_opts)")"
+		fi
+	fi
+fi
Not making --merge and --interactive incompatible as the proposed
log message said makes this hunk at manageable complexity, I guess
;-)

Re: [PATCH v3 4/7] git-rebase: error out when incompatible options passed

From: Elijah Newren <hidden>
Date: 2018-06-21 20:41:34

On Thu, Jun 21, 2018 at 1:29 PM, Junio C Hamano [off-list ref] wrote:
Elijah Newren [off-list ref] writes:
quoted
+if test -n "$git_am_opt"; then
+     incompatible_opts=$(echo "$git_am_opt" | sed -e 's/ -q//')
This is probably just a taste-thing, but I'd probably prefer to see
the "sed" filter out "-q" alone, and make an effort to leave future
things like "-qx" alone, e.g.

    $(echo " $git_am_opt " | sed -e 's/ -q / /g' -e 's/^ \(.*\) $/\1/')

or something like that.
Makes sense.
quoted
+     if test -n "$interactive_rebase"
+     then
+             if test -n "$incompatible_opts"
+             then
+                     die "$(gettext "error: cannot combine interactive options (--interactive, --exec, --rebase-merges, --preserve-merges, --keep-empty, --root + --onto) with am options ($incompatible_opts)")"
+             fi
+     fi
+     if test -n "$do_merge"; then
+             if test -n "$incompatible_opts"
+             then
+                     die "$(gettext "error: cannot combine merge options (--merge, --strategy, --strategy-option) with am options ($incompatible_opts)")"
+             fi
+     fi
+fi
Not making --merge and --interactive incompatible as the proposed
log message said makes this hunk at manageable complexity, I guess
;-)
Right, and since --interactive essentially handles --merge just fine
and I'm planning to soon simplify anyway[1], at least once ag/rebase-p
merges to master, I didn't want to make it any more complex.

[1] https://public-inbox.org/git/20180607171344.23331-3-newren@gmail.com/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help