Re: [PATCH v3 4/7] git-rebase: error out when incompatible options passed
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 21, 2018, 20:29 UTC
- Message-ID
- <xmqqr2kzsx1l.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180621150023.23533-5-newren@gmail.com>
Elijah Newren <newren@gmail.com> 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.
Show 14 quoted lines
> + 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 ;-)