[PATCH] mergetool: don't suggest to continue after last file

2018-08-12 Thread Nicholas Guriev
This eliminates an unnecessary prompt to continue after failed merger.
The patch uses positional parameters to count files in the list. If only
one iteration is remained, the prompt_after_failed_merge function is not
called.

Signed-off-by: Nicholas Guriev 
---
 git-mergetool.sh | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/git-mergetool.sh b/git-mergetool.sh
index c062e3d..d07c7f3 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -491,14 +491,16 @@ main () {
printf "%s\n" "$files"
 
rc=0
-   for i in $files
+   set -- $files
+   while test $# -ne 0
do
printf "\n"
-   if ! merge_file "$i"
+   if ! merge_file "$1"
then
rc=1
-   prompt_after_failed_merge || exit 1
+   test $# -ne 1 && prompt_after_failed_merge || exit 1
fi
+   shift
done
 
exit $rc
-- 
2.7.4



[PATCH v2] status: -i shorthand for --ignored command line option

2018-08-09 Thread Nicholas Guriev
It allows for uniformity with the --untracked-files option. Also
the new short flag saves the number of keys to press for the
typically git-status command.

Signed-off-by: Nicholas Guriev 
---
 Documentation/git-status.txt | 1 +
 builtin/commit.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index d9f422d..cce352a 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -97,6 +97,7 @@ configuration variable documented in linkgit:git-config[1].
(and suppresses the output of submodule summaries when the config option
`status.submoduleSummary` is set).
 
+-i[]::
 --ignored[=]::
Show ignored files as well.
 +
diff --git a/builtin/commit.c b/builtin/commit.c
index 158e3f8..44829b9 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1319,7 +1319,7 @@ int cmd_status(int argc, const char **argv, const char 
*prefix)
  N_("mode"),
  N_("show untracked files, optional modes: all, normal, no. 
(Default: all)"),
  PARSE_OPT_OPTARG, NULL, (intptr_t)"all" },
-   { OPTION_STRING, 0, "ignored", _arg,
+   { OPTION_STRING, 'i', "ignored", _arg,
  N_("mode"),
  N_("show ignored files, optional modes: traditional, 
matching, no. (Default: traditional)"),
  PARSE_OPT_OPTARG, NULL, (intptr_t)"traditional" },
-- 
2.7.4



[PATCH] status: -i shorthand for --ignored command line option

2018-08-08 Thread Nicholas Guriev
This short option saves the number of keys to press for the
typically git-status command.
---
I already sent the patch here, but it doesn't seem reached to the
list. So I send the email (now with DKIM) again and apologize if you
get this twice.

 builtin/commit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index 158e3f8..44829b9 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1319,7 +1319,7 @@ int cmd_status(int argc, const char **argv, const char 
*prefix)
  N_("mode"),
  N_("show untracked files, optional modes: all, normal, no. 
(Default: all)"),
  PARSE_OPT_OPTARG, NULL, (intptr_t)"all" },
-   { OPTION_STRING, 0, "ignored", _arg,
+   { OPTION_STRING, 'i', "ignored", _arg,
  N_("mode"),
  N_("show ignored files, optional modes: traditional, 
matching, no. (Default: traditional)"),
  PARSE_OPT_OPTARG, NULL, (intptr_t)"traditional" },
-- 
2.7.4