Skip to contentSkip to conversation

{diff,merge}tool: rename helpers to remove them from tab-completion

PATCH In review David Aguilar 2 participants 2 messages Jun 15, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 {diff,merge}tool: rename helpers to remove them from tab-completion

Users should never run difftool-helper or mergetool-lib directly, so rename them to *--helper and *--lib. This keeps the helper scripts from showing up when using bash tab completion.

---

This is based on the 'pu' branch + the patches
I sent out earlier.

 .gitignore                                         |    4 ++--
 ...it-mergetool-lib.txt => git-mergetool--lib.txt} |   10 +++++-----
 Makefile                                           |    4 ++--
 command-list.txt                                   |    2 +-
 git-difftool-helper.sh => git-difftool--helper.sh  |    6 +++---
 git-difftool.perl                                  |    6 +++---
 git-mergetool-lib.sh => git-mergetool--lib.sh      |    2 +-
 git-mergetool.sh                                   |    2 +-
 8 files changed, 18 insertions(+), 18 deletions(-)
 rename Documentation/{git-mergetool-lib.txt => git-mergetool--lib.txt} (82%)
 rename git-difftool-helper.sh => git-difftool--helper.sh (96%)
 rename git-mergetool-lib.sh => git-mergetool--lib.sh (98%)
.gitignore +2 -2
index 75c154a..757c7f0 100644
@@ -36,7 +36,7 @@ git-diff-files
 git-diff-index
 git-diff-tree
 git-difftool
-git-difftool-helper
+git-difftool--helper
 git-describe
 git-fast-export
 git-fast-import
@@ -80,7 +80,7 @@ git-merge-recursive
 git-merge-resolve
 git-merge-subtree
 git-mergetool
-git-mergetool-lib
+git-mergetool--lib
 git-mktag
 git-mktree
 git-name-rev
Documentation/git-mergetool--lib.txt renamed from Documentation/git-mergetool-lib.txt +5 -5
similarity index 82%
rename from Documentation/git-mergetool-lib.txt
rename to Documentation/git-mergetool--lib.txt
index 7377774..ffda66b 100644
@@ -1,13 +1,13 @@
-git-mergetool-lib(1)
-====================
+git-mergetool--lib(1)
+=====================
 
 NAME
 ----
-git-mergetool-lib - Common git merge tool shell scriptlets
+git-mergetool--lib - Common git merge tool shell scriptlets
 
 SYNOPSIS
 --------
-'. "$(git --exec-path)/git-mergetool-lib"'
+'. "$(git --exec-path)/git-mergetool--lib"'
 
 DESCRIPTION
 -----------
@@ -16,7 +16,7 @@ This is not a command the end user would want to run.  Ever.
 This documentation is meant for people who are studying the
 Porcelain-ish scripts and/or are writing new ones.
 
-The 'git-mergetool-lib' scriptlet is designed to be sourced (using
+The 'git-mergetool--lib' scriptlet is designed to be sourced (using
 `.`) by other shell scripts to set up functions for working
 with git merge tools.
 
Makefile +2 -2
index 086f9e7..3e56274 100644
@@ -277,14 +277,14 @@ TEST_PROGRAMS =
 
 SCRIPT_SH += git-am.sh
 SCRIPT_SH += git-bisect.sh
-SCRIPT_SH += git-difftool-helper.sh
+SCRIPT_SH += git-difftool--helper.sh
 SCRIPT_SH += git-filter-branch.sh
 SCRIPT_SH += git-lost-found.sh
 SCRIPT_SH += git-merge-octopus.sh
 SCRIPT_SH += git-merge-one-file.sh
 SCRIPT_SH += git-merge-resolve.sh
 SCRIPT_SH += git-mergetool.sh
-SCRIPT_SH += git-mergetool-lib.sh
+SCRIPT_SH += git-mergetool--lib.sh
 SCRIPT_SH += git-parse-remote.sh
 SCRIPT_SH += git-pull.sh
 SCRIPT_SH += git-quiltimport.sh
command-list.txt +1 -1
index 922c815..fd66395 100644
@@ -69,7 +69,7 @@ git-merge-file                          plumbingmanipulators
 git-merge-index                         plumbingmanipulators
 git-merge-one-file                      purehelpers
 git-mergetool                           ancillarymanipulators
-git-mergetool-lib                       purehelpers
+git-mergetool--lib                      purehelpers
 git-merge-tree                          ancillaryinterrogators
 git-mktag                               plumbingmanipulators
 git-mktree                              plumbingmanipulators
git-difftool--helper.sh renamed from git-difftool-helper.sh +3 -3
similarity index 96%
rename from git-difftool-helper.sh
rename to git-difftool--helper.sh
index d174b34..602cd4f 100755
@@ -1,13 +1,13 @@
 #!/bin/sh
-# git-difftool-helper is a GIT_EXTERNAL_DIFF-compatible diff tool launcher.
+# git-difftool--helper is a GIT_EXTERNAL_DIFF-compatible diff tool launcher.
 # This script is typically launched by using the 'git difftool'
 # convenience command.
 #
 # Copyright (c) 2009 David Aguilar
 
-# Load common functions from git-mergetool-lib
+# Load common functions from git-mergetool--lib
 TOOL_MODE=diff
-. git-mergetool-lib
+. git-mergetool--lib
 
 # difftool.prompt controls the default prompt/no-prompt behavior
 # and is overridden with $GIT_DIFFTOOL*_PROMPT.
git-difftool.perl +3 -3
index 985dfe0..948ff7f 100755
@@ -2,11 +2,11 @@
 # Copyright (c) 2009 David Aguilar
 #
 # This is a wrapper around the GIT_EXTERNAL_DIFF-compatible
-# git-difftool-helper script.
+# git-difftool--helper script.
 #
 # This script exports GIT_EXTERNAL_DIFF and GIT_PAGER for use by git.
 # GIT_DIFFTOOL_NO_PROMPT, GIT_DIFFTOOL_PROMPT, and GIT_DIFF_TOOL
-# are exported for use by git-difftool-helper.
+# are exported for use by git-difftool--helper.
 #
 # Any arguments that are unknown to this script are forwarded to 'git diff'.
 
@@ -30,7 +30,7 @@ sub setup_environment
 {
 	$ENV{PATH} = "$DIR:$ENV{PATH}";
 	$ENV{GIT_PAGER} = '';
-	$ENV{GIT_EXTERNAL_DIFF} = 'git-difftool-helper';
+	$ENV{GIT_EXTERNAL_DIFF} = 'git-difftool--helper';
 }
 
 sub exe
git-mergetool--lib.sh renamed from git-mergetool-lib.sh +1 -1
similarity index 98%
rename from git-mergetool-lib.sh
rename to git-mergetool--lib.sh
index 197533e..91d5453 100644
@@ -1,4 +1,4 @@
-# git-mergetool-lib is a library for common merge tool functions
+# git-mergetool--lib is a library for common merge tool functions
 diff_mode() {
 	test $TOOL_MODE = "diff"
 }
git-mergetool.sh +1 -1
index 16562bd..401c107 100755
@@ -13,7 +13,7 @@ SUBDIRECTORY_OK=Yes
 OPTIONS_SPEC=
 TOOL_MODE=merge
 . git-sh-setup
-. git-mergetool-lib
+. git-mergetool--lib
 require_work_tree
 
 # Returns true if the mode reflects a symlink
Signature · 1 line
1.6.2.1.469.gdffc1
#1 lore raw

David Aguilar, 02.04.2009:

Quoted 1 line
Makefile +0 -0

[..]

Makefile TEST_PROGRAMS = · line 290

Quoted 7 lines

SCRIPT_SH += git-merge-resolve.sh
SCRIPT_SH += git-mergetool.sh

Makefile +1 -1
-SCRIPT_SH += git-mergetool-lib.sh
+SCRIPT_SH += git-mergetool--lib.sh
 SCRIPT_SH += git-parse-remote.sh
 SCRIPT_SH += git-pull.sh
 SCRIPT_SH += git-quiltimport.sh

This conflicts with commit 496c021 (Add a script to edit/inspect notes) in 'pu', which seems to be just merged today. If you build your patches on top of 'da/difftool' (99511d8) instead of 'pu', then these conflicts won't arise and avoid hassle.

In fact I already applied all your patches on top 'da/difftool' and not 'pu' all the time, until now.

Thanks for your work on this

Markus