Re: [PATCH v6] Support auto-merge for meld to follow the vim-diff behavior
- From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
- Date
- Jul 3, 2020, 15:58 UTC
- Message-ID
- <20200703155812.GA4087@danh.dev>
- In-Reply-To
- <xmqqv9j5bc4o.fsf@gitster.c.googlers.com>
On 2020-07-02 18:50:15-0700, Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> So, if we do not know yet, then... > > > then > > + meld_use_auto_merge_option=$(git config mergetool.meld.useAutoMerge) > > + case "$meld_use_auto_merge_option" in > > + [Tt]rue|[Yy]es|[Oo]n|1) > > + meld_use_auto_merge_option=true > > This is sloppy. TRUE is also a valid way to spell 'yes'. > > if o=$(git config --bool 2>/dev/null mergetool.meld.useautomerge) > then > meld_use_auto_merge_option=$o > elif test auto = "$(git config mergetool.meld.useautomerge)" > then > ... auto detect ... > else > meld_use_auto_merge_option=false > fi
Something like this should work if we don't write anything to stderr, except the complain from git-config:
> fatal: bad numeric config value 'auto' for 'mergetool.meld.useautomerge': invalid unit
if o=$(git config --bool mergetool.meld.useautomerge 2>&1) then meld_use_auto_merge_option=$o else case "$o" in *"'auto'"*) ... auto detect ... ;; esac fi
This code block is likely broken if git-config is chatty (trace). I don't know if we have a reliable ways to tell Git to not chatty, though.
-- Danh