• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Mercurial Queues Emulation for Git


Commit MetaInfo

Revisión0f1512b20bf0bdbe6ecd29b2fc5707095b22c8b7 (tree)
Tiempo2022-02-23 01:43:02
AutorKeith Marshall <keith@user...>
CommiterKeith Marshall

Log Message

Robustly interpret "--color" and "--colour" as aliases.

* git-mq-setup.sh (git_mq_getopt): Explicitly match...
(--colour, --no-colour): ...either of these options, rather than...
(--c*, "-]", --no-c*): ...any of these.

* git-mq-setup.shar.in: Before loading...
(git-sh-setup): ...this helper script, scan and rewrite...
($@): ...this list of command line arguments; for any matching...
(--color*): ...this, insert "u" before "r"; also replace...
(--no-color): ...this, with...
(--no-colour): ...this.

Cambiar Resumen

Diferencia incremental

--- a/git-mq-setup.sh
+++ b/git-mq-setup.sh
@@ -10,7 +10,7 @@
1010 # $Id$
1111 #
1212 # Written by Keith Marshall <keith@users.osdn.me>
13-# Copyright (C) 2018, Keith Marshall
13+# Copyright (C) 2018, 2022, Keith Marshall
1414 #
1515 # This file is part of the Git-MQ program suite.
1616 #
@@ -59,8 +59,8 @@
5959 if test "x$mq_optarg" = x
6060 then case $1 in
6161 -*) case $1 in
62- --no-c*) mq_colour=never ;;
63- "-]" | --c*) mq_enable_colour "${2-always}" ;;
62+ --no-colour) mq_colour=never ;;
63+ --colour) mq_enable_colour "${2-always}" ;;
6464 esac; true ;;
6565 *) false ;;
6666 esac
--- a/git-mq-setup.shar.in
+++ b/git-mq-setup.shar.in
@@ -14,7 +14,7 @@ cat <<\ETX
1414 # $Id$
1515 #
1616 # Written by Keith Marshall <keith@users.osdn.me>
17-# Copyright (C) 2018-2020, Keith Marshall
17+# Copyright (C) 2018-2020, 2022, Keith Marshall
1818 #
1919 #
2020 # This file is part of the Git-MQ program suite.
@@ -45,17 +45,24 @@ v,verbose!* generic verbosity selector -- may have no effect"
4545
4646 # For Git-MQ options, such as "--colour", we prefer a spelling convention
4747 # which conforms to "World English" standards; however, git itself adopts
48-# "US English" convention. Thus, we must also declare "--color" as alias
49-# for "--colour", and since this makes most of the possible abbreviations
50-# ambiguous, we must also explicitly declare those abbreviations:
48+# "US English" convention. Thus, we must also accommodate users who will
49+# specify "--color" instead of "--colour", without creating any ambiguity
50+# in the possible abbreviations; to achieve this, we check for "--color",
51+# among the command-line arguments, replacing it with "--colour", BEFORE
52+# we allow git to parse them.
5153 #
52-OPTIONS_SPEC="$OPTIONS_SPEC
53-color?* hidden alias for --colour
54-colo?* hidden alias for --colour
55-col?* hidden alias for --colour
56-co?* hidden alias for --colour
57-],c?* hidden alias for --colour"
54+for mq_argv
55+do case "$mq_argv" in
56+ --color*) mq_argv=`echo $mq_argv | sed 's/^--colo/&u/'` ;;
57+ --no-color) mq_argv="--no-colour" ;;
58+ esac
59+ ${mq_argv_init-true} && { set -- "$mq_argv"; mq_argv_init=false
60+ } || set -- "$@" "$mq_argv"
61+done
5862
63+# Now, we may let git parse the command line, and set up its shell script
64+# processing environment, for use within a git working directory tree.
65+#
5966 SUBDIRECTORY_OK=true . "`git --exec-path`/git-sh-setup" && require_work_tree
6067
6168 libexecdir=`dirname "$0"`