Re: git-mergetool reverse file ordering
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Aug 17, 2016, 07:35 UTC
- Message-ID
- <1c089d6b-0acc-a5da-91bf-1887b6eaedbb@kdbg.org>
- In-Reply-To
- <20160817064612.GA14619@gmail.com>
Am 17.08.2016 um 08:46 schrieb David Aguilar:
> The only thing that using diff-files doesn't address is the > rerere support in mergetool where it processes the files in > the order specified by "git rerere remaining". This is why I > initially thought we needed a generic sort-like command.
I see. This is actually an important code path. How about this code structure:
if test $# -eq 0 then cd_to_toplevel
if test -e "$GIT_DIR/MERGE_RR" then set -- $(git rerere remaining) fi fi files=$(git diff-files --name-only --diff-filter=U -- "$@")
This does not require an enhancement of rerere-remaining and still captures all three cases that currently go through separate branches. (Throw in some version of --ignore-submodules= if necessary, but I guess it is not.)
We do have a problem if there are file names with spaces, but it is not a new problem.
Show 13 quoted lines
> The patches could then be: > > 1. switch to diff-files, add tests, and document how > diff.orderFile affects mergetool. > > 2. Teach mergetool about the "-O<orderFile>" flag so that it can > override the configuration, and add tests. It could be > argued that this should be squashed into (1). > > 3. (optional) teach "rerere remaining" to honor the > -O<orderfile> flag and teach mergetool to supply the option. > > Sound good?
Sure, except that 3. won't be necessary.
-- Hannes