Commit graph

2423 commits

Author SHA1 Message Date
Junio C Hamano 7a738b40f6 Merge branch 'nd/worktree-cleanup-post-head-protection'
Further preparatory clean-up for "worktree" feature continues.

* nd/worktree-cleanup-post-head-protection:
  worktree: simplify prefixing paths
  worktree: avoid 0{40}, too many zeroes, hard to read
  worktree.c: use is_dot_or_dotdot()
  git-worktree.txt: keep subcommand listing in alphabetical order
  worktree.c: rewrite mark_current_worktree() to avoid strbuf
  completion: support git-worktree
2016-07-06 13:38:11 -07:00
Junio C Hamano deee904aac Merge branch 'tb/complete-status'
The completion script (in contrib/) learned to complete "git
status" options.

* tb/complete-status:
  completion: add git status
  completion: add __git_get_option_value helper
  completion: factor out untracked file modes into a variable
2016-06-27 09:56:54 -07:00
Junio C Hamano 880c267a24 Merge branch 'nb/gnome-keyring-build'
Build improvements for gnome-keyring (in contrib/)

* nb/gnome-keyring-build:
  gnome-keyring: Don't hard-code pkg-config executable
2016-06-27 09:56:51 -07:00
Junio C Hamano be099661f4 Merge branch 'vs/prompt-avoid-unset-variable'
The git-prompt scriptlet (in contrib/) was not friendly with those
who uses "set -u", which has been fixed.

* vs/prompt-avoid-unset-variable:
  git-prompt.sh: Don't error on null ${ZSH,BASH}_VERSION, $short_sha
2016-06-27 09:56:47 -07:00
Heiko Becker 3cddb008c1 gnome-keyring: Don't hard-code pkg-config executable
Helpful if your pkg-config executable has a prefix based on the
architecture, for example.

Signed-off-by: Heiko Becker <heirecka@exherbo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-14 13:06:10 -07:00
Thomas Braun 634d2344e6 completion: add git status
Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-10 11:55:00 -07:00
Thomas Braun 7c599e92aa completion: add __git_get_option_value helper
This function allows to search the commmand line and config
files for an option, long and short, with mandatory value.

The function would return e.g. for the command line
"git status -uno --untracked-files=all" the result
"all" regardless of the config option.

Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-10 11:54:57 -07:00
Thomas Braun 21d2a9e3cc completion: factor out untracked file modes into a variable
Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-10 11:54:49 -07:00
Ville Skyttä 34d8f5a8aa git-prompt.sh: Don't error on null ${ZSH,BASH}_VERSION, $short_sha
When the shell is in "nounset" or "set -u" mode, referencing unset or
null variables results in an error. Protect $ZSH_VERSION and
$BASH_VERSION against that, and initialize $short_sha before use.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-06 13:09:07 -07:00
Nguyễn Thái Ngọc Duy b462c02402 completion: support git-worktree
This adds bare-bone completion support for git-worktree. More advanced
completion (e.g. ref completion in git-worktree-add) can be added later.

--force completion in "worktree add" is left out because that option
should be handled with care.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-24 13:19:21 -07:00
Matthieu Moy 17130a7046 git-multimail: update to release 1.3.1
The changes are described in CHANGES.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-13 12:54:06 -07:00
Junio C Hamano 4bb51aed1e Sync with maint
* maint:
  git-multimail: update to release 1.3.0
2016-05-03 14:52:30 -07:00
Matthieu Moy 4453d76c6a git-multimail: update to release 1.3.0
The changes are described in CHANGES.

Contributions-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Contributions-by: Stefan Tatschner <rumpelsepp@sevenbyte.org>
Contributions-by: Simon P <simon.git@le-huit.fr>
Contributions-by: Leander Hasty <leander@1stplayable.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-03 14:04:27 -07:00
Junio C Hamano f044297614 Merge branch 'mg/complete-cherry-mark-to-log'
The completion scripts (in contrib/) did not include the
"--cherry-mark" option when completing "git log <HT>".

* mg/complete-cherry-mark-to-log:
  completion: complete --cherry-mark for git log
2016-04-13 14:12:40 -07:00
Junio C Hamano 8b7475aefc Merge branch 'rt/completion-help'
Shell completion (in contrib/) updates.

* rt/completion-help:
  completion: add 'revisions' and 'everyday' to 'git help'
  completion: add option '--guides' to 'git help'
2016-04-13 14:12:29 -07:00
Michael J Gruber d3bfbf91df completion: complete --cherry-mark for git log
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-05 13:53:54 -07:00
Ralf Thielow 4d10b7e1bc completion: add 'revisions' and 'everyday' to 'git help'
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-24 13:09:08 -07:00
Ralf Thielow 716b29db91 completion: add option '--guides' to 'git help'
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-24 13:09:05 -07:00
Junio C Hamano 47847c756b Merge branch 'pw/completion-stash' into maint
* pw/completion-stash:
  completion: fix mis-indentation in _git_stash()
2016-02-22 13:10:20 -08:00
Junio C Hamano 8716bdca26 Merge branch 'pw/completion-stash'
* pw/completion-stash:
  completion: fix mis-indentation in _git_stash()
2016-02-22 10:27:24 -08:00
SZEDER Gábor 59305aeeba completion: fix mis-indentation in _git_stash()
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-22 10:26:04 -08:00
Junio C Hamano 0e35fcb412 Merge branch 'cc/untracked'
Update the untracked cache subsystem and change its primary UI from
"git update-index" to "git config".

* cc/untracked:
  t7063: add tests for core.untrackedCache
  test-dump-untracked-cache: don't modify the untracked cache
  config: add core.untrackedCache
  dir: simplify untracked cache "ident" field
  dir: add remove_untracked_cache()
  dir: add {new,add}_untracked_cache()
  update-index: move 'uc' var declaration
  update-index: add untracked cache notifications
  update-index: add --test-untracked-cache
  update-index: use enum for untracked cache options
  dir: free untracked cache when removing it
2016-02-10 14:20:06 -08:00
Junio C Hamano 081363dde2 Merge branch 'tb/complete-word-diff-regex' into maint
* tb/complete-word-diff-regex:
  completion: complete "diff --word-diff-regex="
2016-02-05 14:54:17 -08:00
Junio C Hamano 0a8748d8e1 Merge branch 'pw/completion-stash' into maint
* pw/completion-stash:
  completion: update completion arguments for stash
2016-02-05 14:54:16 -08:00
Junio C Hamano 39abb2ed48 Merge branch 'pw/completion-show-branch' into maint
* pw/completion-show-branch:
  completion: complete show-branch "--date-order"
2016-02-05 14:54:16 -08:00
Junio C Hamano d509fa44ed Merge branch 'jk/completion-rebase' into maint
* jk/completion-rebase:
  completion: add missing git-rebase options
2016-02-05 14:54:16 -08:00
Junio C Hamano 6a65bdcc8c Merge branch 'dw/subtree-split-do-not-drop-merge' into maint
The "split" subcommand of "git subtree" (in contrib/) incorrectly
skipped merges when it shouldn't, which was corrected.

* dw/subtree-split-do-not-drop-merge:
  contrib/subtree: fix "subtree split" skipped-merge bug
2016-02-05 14:54:15 -08:00
Junio C Hamano ebcdd635c5 Merge branch 'pw/completion-stash'
* pw/completion-stash:
  completion: update completion arguments for stash
2016-02-03 14:16:06 -08:00
Junio C Hamano 47c33b45d1 Merge branch 'pw/completion-show-branch'
* pw/completion-show-branch:
  completion: complete show-branch "--date-order"
2016-02-03 14:16:05 -08:00
Junio C Hamano 103c95dbfb Merge branch 'jk/completion-rebase'
* jk/completion-rebase:
  completion: add missing git-rebase options
2016-02-03 14:16:05 -08:00
Junio C Hamano dd65a9e5e3 Merge branch 'dw/subtree-split-do-not-drop-merge'
The "split" subcommand of "git subtree" (in contrib/) incorrectly
skipped merges when it shouldn't, which was corrected.

* dw/subtree-split-do-not-drop-merge:
  contrib/subtree: fix "subtree split" skipped-merge bug
2016-02-03 14:16:03 -08:00
Junio C Hamano cc329f65a3 Merge branch 'tb/complete-word-diff-regex'
* tb/complete-word-diff-regex:
  completion: complete "diff --word-diff-regex="
2016-02-03 14:16:03 -08:00
Junio C Hamano da94a08967 Merge branch 'dg/subtree-test'
* dg/subtree-test:
  contrib/subtree: Make testing easier
2016-02-03 14:16:00 -08:00
Christian Couder 435ec090ec config: add core.untrackedCache
When we know that mtime on directory as given by the environment
is usable for the purpose of untracked cache, we may want the
untracked cache to be always used without any mtime test or
kernel name check being performed.

Also when we know that mtime is not usable for the purpose of
untracked cache, for example because the repo is shared over a
network file system, we may want the untracked-cache to be
automatically removed from the index.

Allow the user to express such preference by setting the
'core.untrackedCache' configuration variable, which can take
'keep', 'false', or 'true' and default to 'keep'.

When read_index_from() is called, it now adds or removes the
untracked cache in the index to respect the value of this
variable. So it does nothing if the value is `keep` or if the
variable is unset; it adds the untracked cache if the value is
`true`; and it removes the cache if the value is `false`.

`git update-index --[no-|force-]untracked-cache` still adds the
untracked cache to, or removes it, from the index, but this
shows a warning if it goes against the value of
core.untrackedCache, because the next time the index is read
the untracked cache will be added or removed if the
configuration is set to do so.

Also `--untracked-cache` used to check that the underlying
operating system and file system change `st_mtime` field of a
directory if files are added or deleted in that directory. But
because those tests take a long time, `--untracked-cache` no
longer performs them. Instead, there is now
`--test-untracked-cache` to perform the tests. This change
makes `--untracked-cache` the same as `--force-untracked-cache`.

This last change is backward incompatible and should be
mentioned in the release notes.

Helped-by: Duy Nguyen <pclouds@gmail.com>
Helped-by: Torsten Bögershausen <tboegi@web.de>
Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

read-cache: Duy'sfixup

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-27 12:30:00 -08:00
Junio C Hamano f9219c0b32 Merge branch 'js/pull-rebase-i'
"git pull --rebase" has been extended to allow invoking
"rebase -i".

* js/pull-rebase-i:
  completion: add missing branch.*.rebase values
  remote: handle the config setting branch.*.rebase=interactive
  pull: allow interactive rebase with --rebase=interactive
2016-01-26 15:40:28 -08:00
Paul Wagland d7d4ca87a9 completion: update completion arguments for stash
Add --all and --include-untracked to the git stash save completions.
Add --quiet to the git stash drop completions.
Update git stash branch so that the first argument expands out to the
possible branch names, and the other arguments expand to the stash
names.

Signed-off-by: Paul Wagland <paul@kungfoocoder.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-26 10:37:11 -08:00
Paul Wagland f7c2e1a042 completion: complete show-branch "--date-order"
Signed-off-by: Paul Wagland <paul@kungfoocoder.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-25 15:15:26 -08:00
John Keeping fa4b5e3a35 completion: add missing git-rebase options
This adds the --no-* variants where those are documented in
git-rebase(1).

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-25 15:13:54 -08:00
Junio C Hamano e572fef9d4 Merge branch 'ep/shell-command-substitution-style'
A shell script style update to change `command substitution` into
$(command substitution).  Coverts contrib/ and much of the t/
directory contents.

* ep/shell-command-substitution-style: (92 commits)
  t9901-git-web--browse.sh: use the $( ... ) construct for command substitution
  t9501-gitweb-standalone-http-status.sh: use the $( ... ) construct for command substitution
  t9350-fast-export.sh: use the $( ... ) construct for command substitution
  t9300-fast-import.sh: use the $( ... ) construct for command substitution
  t9150-svk-mergetickets.sh: use the $( ... ) construct for command substitution
  t9145-git-svn-master-branch.sh: use the $( ... ) construct for command substitution
  t9138-git-svn-authors-prog.sh: use the $( ... ) construct for command substitution
  t9137-git-svn-dcommit-clobber-series.sh: use the $( ... ) construct for command substitution
  t9132-git-svn-broken-symlink.sh: use the $( ... ) construct for command substitution
  t9130-git-svn-authors-file.sh: use the $( ... ) construct for command substitution
  t9129-git-svn-i18n-commitencoding.sh: use the $( ... ) construct for command substitution
  t9119-git-svn-info.sh: use the $( ... ) construct for command substitution
  t9118-git-svn-funky-branch-names.sh: use the $( ... ) construct for command substitution
  t9114-git-svn-dcommit-merge.sh: use the $( ... ) construct for command substitution
  t9110-git-svn-use-svm-props.sh: use the $( ... ) construct for command substitution
  t9109-git-svn-multi-glob.sh: use the $( ... ) construct for command substitution
  t9108-git-svn-glob.sh: use the $( ... ) construct for command substitution
  t9107-git-svn-migrate.sh: use the $( ... ) construct for command substitution
  t9105-git-svn-commit-diff.sh: use the $( ... ) construct for command substitution
  t9104-git-svn-follow-parent.sh: use the $( ... ) construct for command substitution
  ...
2016-01-22 13:08:46 -08:00
Junio C Hamano a039a79e9d Merge branch 'rm/subtree-unwrap-tags'
"git subtree" (in contrib/) records the tag object name in the
commit log message when a subtree is added using a tag, without
peeling it down to the underlying commit.  The tag needs to be
peeled when "git subtree split" wants to work on the commit, but
the command forgot to do so.

* rm/subtree-unwrap-tags:
  contrib/subtree: unwrap tag refs
2016-01-22 13:08:45 -08:00
Thomas Braun e6414b4645 completion: complete "diff --word-diff-regex="
Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-20 16:18:02 -08:00
Dave Ware 933cfeb90b contrib/subtree: fix "subtree split" skipped-merge bug
'git subtree split' can incorrectly skip a merge even when both parents
act on the subtree, provided the merge results in a tree identical to
one of the parents. Fix by copying the merge if at least one parent is
non-identical, and the non-identical parent is not an ancestor of the
identical parent.

Also, add a test case which checks that a descendant remains a
descendent on the subtree in this case.

Signed-off-by: Dave Ware <davidw@realtimegenomics.com>
Reviewed-by: David A. Greene <greened@obbligato.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-20 14:53:18 -08:00
David A. Greene 43cce5c8ed contrib/subtree: Make testing easier
Add some Makefile dependencies to ensure an updated git-subtree
gets copied to the main area before testing begins.

Signed-off-by: David A. Greene <greened@obbligato.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-19 10:15:20 -08:00
Johannes Schindelin 17c4ddbbaf completion: add missing branch.*.rebase values
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13 13:00:48 -08:00
Junio C Hamano bdd1cc2092 Merge branch 'vl/grep-configurable-threads'
"git grep" can now be configured (or told from the command line)
how many threads to use when searching in the working tree files.

* vl/grep-configurable-threads:
  grep: add --threads=<num> option and grep.threads configuration
  grep: slight refactoring to the code that disables threading
  grep: allow threading even on a single-core machine
2016-01-12 15:16:55 -08:00
Elia Pinto 57eb1bef7d contrib/thunderbird-patch-inline/appp.sh: use the $( ... ) construct for command substitution
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-27 15:33:13 -08:00
Elia Pinto bc32bacc72 contrib/examples/git-revert.sh: use the $( ... ) construct for command substitution
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-27 15:33:13 -08:00
Elia Pinto 6ccca67a74 contrib/examples/git-repack.sh: use the $( ... ) construct for command substitution
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-27 15:33:13 -08:00
Elia Pinto 1a3655264e contrib/examples/git-merge.sh: use the $( ... ) construct for command substitution
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-27 15:33:13 -08:00
Elia Pinto cc301d7e51 contrib/examples/git-fetch.sh: use the $( ... ) construct for command substitution
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-27 15:33:13 -08:00