New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix regression in 'git {diff,merge}tool --tool-help' #825
Conversation
/submit |
Submitted as pull.825.git.1609179751864.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
a79d0a0
to
2b9dce3
Compare
/submit |
Submitted as pull.825.v2.git.1609184505071.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
This branch is now known as |
This patch series was integrated into seen via git@540925d. |
This patch series was integrated into seen via git@5e08912. |
On the Git mailing list, SZEDER Gábor wrote (reply to this):
|
User |
On the Git mailing list, Philippe Blain wrote (reply to this):
|
User |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Philippe Blain wrote (reply to this):
|
Commit 83bbf9b (mergetool--lib: improve support for vimdiff-style tool variants, 2020-07-29) introduced a regression in the output of `git mergetool --tool-help` and `git difftool --tool-help` [1]. In function 'show_tool_names' in git-mergetool--lib.sh, we loop over the supported mergetools and their variants and accumulate them in the variable 'variants', separating them with a literal '\n'. The code then uses 'echo $variants' to turn these '\n' into newlines, but this behaviour is not portable, it just happens to work in some shells, like dash(1)'s 'echo' builtin. For shells in which 'echo' does not turn '\n' into newlines, the end result is that the only tools that are shown are the existing variants (except the last variant alphabetically), since the variants are separated by actual newlines in '$variants' because of the several 'echo' calls in mergetools/{bc,vimdiff}::list_tool_variants. Fix this bug by embedding an actual line feed into `variants` in show_tool_names(). While at it, replace `sort | uniq` by `sort -u`. To prevent future regressions, add a simple test that checks that a few known tools are correctly shown (let's avoid counting the total number of tools to lessen the maintenance burden when new tools are added or if '--tool-help' learns additional logic, like hiding tools depending on the current platform). [1] https://lore.kernel.org/git/CADtb9DyozjgAsdFYL8fFBEWmq7iz4=prZYVUdH9W-J5CKVS4OA@mail.gmail.com/ Reported-by: Philippe Blain <levraiphilippeblain@gmail.com> Based-on-patch-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
2b9dce3
to
f664219
Compare
This patch series was integrated into seen via git@643f812. |
/submit |
Submitted as pull.825.v3.git.1609981745668.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
This patch series was integrated into seen via git@76dce6c. |
This patch series was integrated into seen via git@a7e94a5. |
This patch series was integrated into seen via git@8e2015f. |
On the Git mailing list, Philippe Blain wrote (reply to this):
|
This patch series was integrated into seen via git@053827b. |
This patch series was integrated into seen via git@c6690bd. |
This patch series was integrated into seen via git@a34cea0. |
This patch series was integrated into seen via git@82989ae. |
This patch series was integrated into seen via git@679f5ef. |
This patch series was integrated into seen via git@a7e200e. |
This patch series was integrated into seen via git@ba0f76b. |
This patch series was integrated into seen via git@0d874c1. |
This patch series was integrated into next via git@ba0f76b. |
This patch series was integrated into seen via git@ba0f76b. |
This patch series was integrated into seen via git@fa7b9bb. |
This patch series was integrated into seen via git@ba0f76b. |
This patch series was integrated into seen via git@bda98ad. |
This patch series was integrated into seen via git@ba0f76b. |
This patch series was integrated into seen via git@f8d755a. |
This patch series was integrated into seen via git@4614585. |
This patch series was integrated into seen via git@073552d. |
This patch series was integrated into next via git@073552d. |
This patch series was integrated into master via git@073552d. |
Closed via 073552d. |
Changes since v1:
v1:
I went with Johannes' suggestion finally because upon further inspection,
René's patch for some reason (I did not debug further) caused to code to never
reach 'any_shown=yes' in show_tool_help, therefore changing the output of the
command.
I guess it's too late for inclusion in 2.30...
CC: Johannes Sixt j6t@kdbg.org, Felipe Contreras felipe.contreras@gmail.com, pudinha rogi@skylittlesystem.org, René Scharfe l.s.r@web.de
cc: SZEDER Gábor szeder.dev@gmail.com
cc: Philippe Blain levraiphilippeblain@gmail.com