Compare commits
71 Commits
v2.18.0-rc
...
v2.18.0-rc
Author | SHA1 | Date | |
---|---|---|---|
68372c8879 | |||
549ca8aa7c | |||
4d605b0f38 | |||
8d0d53a8cf | |||
fb6ac9e79a | |||
b2453d3449 | |||
61d48c66ea | |||
3737746120 | |||
40aac22b43 | |||
47cc91310a | |||
431acd2de8 | |||
6f333ff2fb | |||
3e5524907b | |||
e66e8f9be8 | |||
01cbd9eab5 | |||
7fe48cb396 | |||
c45505d081 | |||
643a9ea3e0 | |||
f635b8d17b | |||
a97447a42a | |||
0c5a779c67 | |||
c2c7d17b03 | |||
026b8ef9f7 | |||
6c301adb0a | |||
d6e5484208 | |||
ba928e9740 | |||
95dd4b2b14 | |||
cbb408e6ae | |||
7659bda0f3 | |||
7cb4a974d3 | |||
caf0c98c63 | |||
e1149fd7d9 | |||
2bd108ff65 | |||
2289880f78 | |||
368b4e5906 | |||
14a9bd2898 | |||
c3072c6e4d | |||
f156a0934a | |||
86f0b3727c | |||
2161ed8098 | |||
2a00502b14 | |||
a27cd1ab7f | |||
44f560fc16 | |||
5971b0836e | |||
5340d47107 | |||
590551ca2c | |||
35d515b53f | |||
de613050ef | |||
4d36f88be7 | |||
0ed556d38f | |||
3e4a67b47d | |||
123f631761 | |||
12ecea46e3 | |||
cbc5cf7ce5 | |||
6532f3740b | |||
3301d36b29 | |||
e11dca10cf | |||
65b5f9483e | |||
d9fcc7f871 | |||
84a9713106 | |||
fe902f2cef | |||
1b81d8cb19 | |||
63eae83f8f | |||
3c7777672b | |||
6bb2dc0b94 | |||
e5d7a61953 | |||
0089521cac | |||
60f487ac0e | |||
cfb22a02ab | |||
f318d73915 | |||
75ba897e30 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -182,7 +182,7 @@
|
||||
/gitweb/gitweb.cgi
|
||||
/gitweb/static/gitweb.js
|
||||
/gitweb/static/gitweb.min.*
|
||||
/common-cmds.h
|
||||
/command-list.h
|
||||
*.tar.gz
|
||||
*.dsc
|
||||
*.deb
|
||||
|
@ -6,13 +6,15 @@ Updates since v2.17
|
||||
|
||||
UI, Workflows & Features
|
||||
|
||||
* Rename detection logic in "diff" family that is used in "merge" has
|
||||
* Rename detection logic that is used in "merge" and "cherry-pick" has
|
||||
learned to guess when all of x/a, x/b and x/c have moved to z/a,
|
||||
z/b and z/c, it is likely that x/d added in the meantime would also
|
||||
want to move to z/d by taking the hint that the entire directory
|
||||
'x' moved to 'z'. A bug causing dirty files involved in a rename
|
||||
to be overwritten during merge has also been fixed as part of this
|
||||
work.
|
||||
work. Incidentally, this also avoids updating a file in the
|
||||
working tree after a (non-trivial) merge whose result matches what
|
||||
our side originally had.
|
||||
|
||||
* "git filter-branch" learned to use a different exit code to allow
|
||||
the callers to tell the case where there was no new commits to
|
||||
@ -48,7 +50,7 @@ UI, Workflows & Features
|
||||
have been replaced with a stub that errors out and tells the user
|
||||
there are replacements.
|
||||
|
||||
* The new "checkout-encoding" attribute can ask Git to convert the
|
||||
* The new "working-tree-encoding" attribute can ask Git to convert the
|
||||
contents to the specified encoding when checking out to the working
|
||||
tree (and the other way around when checking in).
|
||||
|
||||
@ -142,6 +144,9 @@ UI, Workflows & Features
|
||||
from the other side; instead, just let cURL library to advertise
|
||||
and negotiate the best one.
|
||||
|
||||
* "git p4" learned to "unshelve" shelved commit from P4.
|
||||
(merge 123f631761 ld/p4-unshelve later to maint).
|
||||
|
||||
|
||||
Performance, Internal Implementation, Development Support etc.
|
||||
|
||||
@ -256,16 +261,6 @@ Performance, Internal Implementation, Development Support etc.
|
||||
repository object (which in turn tells the API which object store
|
||||
the objects are to be located).
|
||||
|
||||
* Rename detection logic in "diff" family that is used in "merge" has
|
||||
learned to guess when all of x/a, x/b and x/c have moved to z/a,
|
||||
z/b and z/c, it is likely that x/d added in the meantime would also
|
||||
want to move to z/d by taking the hint that the entire directory
|
||||
'x' moved to 'z'. A bug causing dirty files involved in a rename
|
||||
to be overwritten during merge has also been fixed as part of this
|
||||
work. Incidentally, this also avoids updating a file in the
|
||||
working tree after a (non-trivial) merge whose result matches what
|
||||
our side originally had.
|
||||
|
||||
* "git pack-objects" needs to allocate tons of "struct object_entry"
|
||||
while doing its work, and shrinking its size helps the performance
|
||||
quite a bit.
|
||||
@ -298,6 +293,15 @@ Performance, Internal Implementation, Development Support etc.
|
||||
to test the moral equivalent of the original without hardcoding the
|
||||
actual object names.
|
||||
|
||||
* The list of commands with their various attributes were spread
|
||||
across a few places in the build procedure, but it now is getting a
|
||||
bit more consolidated to allow more automation.
|
||||
|
||||
* Quite a many tests assumed that newly created refs are made as
|
||||
loose refs using the files backend, which have been updated to use
|
||||
proper plumbing like rev-parse and update-ref, to avoid breakage
|
||||
once we start using different ref backends.
|
||||
|
||||
|
||||
Also contains various documentation updates and code clean-ups.
|
||||
|
||||
@ -496,6 +500,29 @@ Fixes since v2.17
|
||||
which have been corrected.
|
||||
(merge 17154b1576 ma/regex-no-regfree-after-comp-fail later to maint).
|
||||
|
||||
* The import-tars script (in contrib/) has been taught to handle
|
||||
tarballs with overly long paths that use PAX extended headers.
|
||||
(merge 12ecea46e3 pa/import-tars-long-names later to maint).
|
||||
|
||||
* "git rev-parse Y..." etc. misbehaved when given endpoints were
|
||||
not committishes.
|
||||
(merge 0ed556d38f en/rev-parse-invalid-range later to maint).
|
||||
|
||||
* "git pull --recurse-submodules --rebase", when the submodule
|
||||
repository's history did not have anything common between ours and
|
||||
the upstream's, failed to execute. We need to fetch from them to
|
||||
continue even in such a case.
|
||||
(merge 4d36f88be7 jt/submodule-pull-recurse-rebase later to maint).
|
||||
|
||||
* "git remote update" can take both a single remote nickname and a
|
||||
nickname for remote groups, but only one of them was documented.
|
||||
(merge a97447a42a nd/remote-update-doc later to maint).
|
||||
|
||||
* "index-pack --strict" has been taught to make sure that it runs the
|
||||
final object integrity checks after making the freshly indexed
|
||||
packfile available to itself.
|
||||
(merge 3737746120 jk/index-pack-maint later to maint).
|
||||
|
||||
* Other minor doc, test and build updates and code cleanups.
|
||||
(merge 248f66ed8e nd/trace-with-env later to maint).
|
||||
(merge 14ced5562c ys/bisect-object-id-missing-conversion-fix later to maint).
|
||||
@ -527,3 +554,8 @@ Fixes since v2.17
|
||||
(merge 58bd77b66a nd/pack-unreachable-objects-doc later to maint).
|
||||
(merge 4ed79d5203 sg/t6500-no-redirect-of-stdin later to maint).
|
||||
(merge 17b8a2d6cd jk/config-blob-sans-repo later to maint).
|
||||
(merge 590551ca2c rd/tag-doc-lightweight later to maint).
|
||||
(merge 44f560fc16 rd/init-typo later to maint).
|
||||
(merge f156a0934a rd/p4-doc-markup-env later to maint).
|
||||
(merge 2a00502b14 tg/doc-sec-list later to maint).
|
||||
(merge 47cc91310a jk/submodule-fsck-loose-fixup later to maint).
|
||||
|
@ -176,6 +176,12 @@ that is fine, but please mark it as such.
|
||||
[[send-patches]]
|
||||
=== Sending your patches.
|
||||
|
||||
:security-ml: footnoteref:[security-ml,The Git Security mailing list: git-security@googlegroups.com]
|
||||
|
||||
Before sending any patches, please note that patches that may be
|
||||
security relevant should be submitted privately to the Git Security
|
||||
mailing list{security-ml}, instead of the public mailing list.
|
||||
|
||||
Learn to use format-patch and send-email if possible. These commands
|
||||
are optimized for the workflow of sending patches, avoiding many ways
|
||||
your existing e-mail client that is optimized for "multipart/*" mime
|
||||
@ -259,17 +265,24 @@ patch, format it as "multipart/signed", not a text/plain message
|
||||
that starts with `-----BEGIN PGP SIGNED MESSAGE-----`. That is
|
||||
not a text/plain, it's something else.
|
||||
|
||||
:security-ml-ref: footnoteref:[security-ml]
|
||||
|
||||
As mentioned at the beginning of the section, patches that may be
|
||||
security relevant should not be submitted to the public mailing list
|
||||
mentioned below, but should instead be sent privately to the Git
|
||||
Security mailing list{security-ml-ref}.
|
||||
|
||||
Send your patch with "To:" set to the mailing list, with "cc:" listing
|
||||
people who are involved in the area you are touching (the `git
|
||||
contacts` command in `contrib/contacts/` can help to
|
||||
identify them), to solicit comments and reviews.
|
||||
|
||||
:1: footnote:[The current maintainer: gitster@pobox.com]
|
||||
:2: footnote:[The mailing list: git@vger.kernel.org]
|
||||
:current-maintainer: footnote:[The current maintainer: gitster@pobox.com]
|
||||
:git-ml: footnote:[The mailing list: git@vger.kernel.org]
|
||||
|
||||
After the list reached a consensus that it is a good idea to apply the
|
||||
patch, re-send it with "To:" set to the maintainer{1} and "cc:" the
|
||||
list{2} for inclusion.
|
||||
patch, re-send it with "To:" set to the maintainer{current-maintainer} and "cc:" the
|
||||
list{git-ml} for inclusion.
|
||||
|
||||
Do not forget to add trailers such as `Acked-by:`, `Reviewed-by:` and
|
||||
`Tested-by:` lines as necessary to credit people who helped your
|
||||
|
@ -1412,6 +1412,14 @@ credential.<url>.*::
|
||||
credentialCache.ignoreSIGHUP::
|
||||
Tell git-credential-cache--daemon to ignore SIGHUP, instead of quitting.
|
||||
|
||||
completion.commands::
|
||||
This is only used by git-completion.bash to add or remove
|
||||
commands from the list of completed commands. Normally only
|
||||
porcelain commands and a few select others are completed. You
|
||||
can add more commands, separated by space, in this
|
||||
variable. Prefixing the command with '-' will remove it from
|
||||
the existing list.
|
||||
|
||||
include::diff-config.txt[]
|
||||
|
||||
difftool.<tool>.path::
|
||||
|
@ -8,7 +8,7 @@ git-annotate - Annotate file lines with commit information
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git annotate' [options] file [revision]
|
||||
'git annotate' [<options>] <file> [<revision>]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
@ -9,8 +9,8 @@ git-check-attr - Display gitattributes information
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git check-attr' [-a | --all | attr...] [--] pathname...
|
||||
'git check-attr' --stdin [-z] [-a | --all | attr...]
|
||||
'git check-attr' [-a | --all | <attr>...] [--] <pathname>...
|
||||
'git check-attr' --stdin [-z] [-a | --all | <attr>...]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
@ -9,8 +9,8 @@ git-check-ignore - Debug gitignore / exclude files
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git check-ignore' [options] pathname...
|
||||
'git check-ignore' [options] --stdin
|
||||
'git check-ignore' [<options>] <pathname>...
|
||||
'git check-ignore' [<options>] --stdin
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
@ -9,7 +9,7 @@ git-check-mailmap - Show canonical names and email addresses of contacts
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git check-mailmap' [options] <contact>...
|
||||
'git check-mailmap' [<options>] <contact>...
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
|
@ -8,7 +8,7 @@ git-credential-cache - Helper to temporarily store passwords in memory
|
||||
SYNOPSIS
|
||||
--------
|
||||
-----------------------------
|
||||
git config credential.helper 'cache [options]'
|
||||
git config credential.helper 'cache [<options>]'
|
||||
-----------------------------
|
||||
|
||||
DESCRIPTION
|
||||
|
@ -8,7 +8,7 @@ git-credential-store - Helper to store credentials on disk
|
||||
SYNOPSIS
|
||||
--------
|
||||
-------------------
|
||||
git config credential.helper 'store [options]'
|
||||
git config credential.helper 'store [<options>]'
|
||||
-------------------
|
||||
|
||||
DESCRIPTION
|
||||
|
@ -22,7 +22,7 @@ cvspserver stream tcp nowait nobody /usr/bin/git-cvsserver git-cvsserver pserver
|
||||
Usage:
|
||||
|
||||
[verse]
|
||||
'git-cvsserver' [options] [pserver|server] [<directory> ...]
|
||||
'git-cvsserver' [<options>] [pserver|server] [<directory> ...]
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
|
@ -9,11 +9,11 @@ git-diff - Show changes between commits, commit and working tree, etc
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git diff' [options] [<commit>] [--] [<path>...]
|
||||
'git diff' [options] --cached [<commit>] [--] [<path>...]
|
||||
'git diff' [options] <commit> <commit> [--] [<path>...]
|
||||
'git diff' [options] <blob> <blob>
|
||||
'git diff' [options] --no-index [--] <path> <path>
|
||||
'git diff' [<options>] [<commit>] [--] [<path>...]
|
||||
'git diff' [<options>] --cached [<commit>] [--] [<path>...]
|
||||
'git diff' [<options>] <commit> <commit> [--] [<path>...]
|
||||
'git diff' [<options>] <blob> <blob>
|
||||
'git diff' [<options>] --no-index [--] <path> <path>
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
@ -21,7 +21,7 @@ Show changes between the working tree and the index or a tree, changes
|
||||
between the index and a tree, changes between two trees, changes between
|
||||
two blob objects, or changes between two files on disk.
|
||||
|
||||
'git diff' [options] [--] [<path>...]::
|
||||
'git diff' [<options>] [--] [<path>...]::
|
||||
|
||||
This form is to view the changes you made relative to
|
||||
the index (staging area for the next commit). In other
|
||||
@ -29,7 +29,7 @@ two blob objects, or changes between two files on disk.
|
||||
further add to the index but you still haven't. You can
|
||||
stage these changes by using linkgit:git-add[1].
|
||||
|
||||
'git diff' [options] --no-index [--] <path> <path>::
|
||||
'git diff' [<options>] --no-index [--] <path> <path>::
|
||||
|
||||
This form is to compare the given two paths on the
|
||||
filesystem. You can omit the `--no-index` option when
|
||||
@ -38,7 +38,7 @@ two blob objects, or changes between two files on disk.
|
||||
or when running the command outside a working tree
|
||||
controlled by Git.
|
||||
|
||||
'git diff' [options] --cached [<commit>] [--] [<path>...]::
|
||||
'git diff' [<options>] --cached [<commit>] [--] [<path>...]::
|
||||
|
||||
This form is to view the changes you staged for the next
|
||||
commit relative to the named <commit>. Typically you
|
||||
@ -48,7 +48,7 @@ two blob objects, or changes between two files on disk.
|
||||
<commit> is not given, it shows all staged changes.
|
||||
--staged is a synonym of --cached.
|
||||
|
||||
'git diff' [options] <commit> [--] [<path>...]::
|
||||
'git diff' [<options>] <commit> [--] [<path>...]::
|
||||
|
||||
This form is to view the changes you have in your
|
||||
working tree relative to the named <commit>. You can
|
||||
@ -56,18 +56,18 @@ two blob objects, or changes between two files on disk.
|
||||
branch name to compare with the tip of a different
|
||||
branch.
|
||||
|
||||
'git diff' [options] <commit> <commit> [--] [<path>...]::
|
||||
'git diff' [<options>] <commit> <commit> [--] [<path>...]::
|
||||
|
||||
This is to view the changes between two arbitrary
|
||||
<commit>.
|
||||
|
||||
'git diff' [options] <commit>..<commit> [--] [<path>...]::
|
||||
'git diff' [<options>] <commit>..<commit> [--] [<path>...]::
|
||||
|
||||
This is synonymous to the previous form. If <commit> on
|
||||
one side is omitted, it will have the same effect as
|
||||
using HEAD instead.
|
||||
|
||||
'git diff' [options] <commit>\...<commit> [--] [<path>...]::
|
||||
'git diff' [<options>] <commit>\...<commit> [--] [<path>...]::
|
||||
|
||||
This form is to view the changes on the branch containing
|
||||
and up to the second <commit>, starting at a common ancestor
|
||||
@ -87,7 +87,7 @@ and the range notations ("<commit>..<commit>" and
|
||||
"<commit>\...<commit>") do not mean a range as defined in the
|
||||
"SPECIFYING RANGES" section in linkgit:gitrevisions[7].
|
||||
|
||||
'git diff' [options] <blob> <blob>::
|
||||
'git diff' [<options>] <blob> <blob>::
|
||||
|
||||
This form is to view the differences between the raw
|
||||
contents of two blob objects.
|
||||
|
@ -9,7 +9,7 @@ git-fast-export - Git data exporter
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git fast-export [options]' | 'git fast-import'
|
||||
'git fast-export [<options>]' | 'git fast-import'
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
@ -9,7 +9,7 @@ git-fast-import - Backend for fast Git data importers
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
frontend | 'git fast-import' [options]
|
||||
frontend | 'git fast-import' [<options>]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
@ -8,7 +8,7 @@ git-help - Display help information about Git
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git help' [-a|--all] [-g|--guide]
|
||||
'git help' [-a|--all [--verbose]] [-g|--guide]
|
||||
[-i|--info|-m|--man|-w|--web] [COMMAND|GUIDE]
|
||||
|
||||
DESCRIPTION
|
||||
@ -42,6 +42,8 @@ OPTIONS
|
||||
--all::
|
||||
Prints all the available commands on the standard output. This
|
||||
option overrides any given command or guide name.
|
||||
When used with `--verbose` print description for all recognized
|
||||
commands.
|
||||
|
||||
-g::
|
||||
--guides::
|
||||
|
@ -8,8 +8,8 @@ git-interpret-trailers - add or parse structured information in commit messages
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git interpret-trailers' [options] [(--trailer <token>[(=|:)<value>])...] [<file>...]
|
||||
'git interpret-trailers' [options] [--parse] [<file>...]
|
||||
'git interpret-trailers' [<options>] [(--trailer <token>[(=|:)<value>])...] [<file>...]
|
||||
'git interpret-trailers' [<options>] [--parse] [<file>...]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
@ -164,6 +164,31 @@ $ git p4 submit --shelve
|
||||
$ git p4 submit --update-shelve 1234 --update-shelve 2345
|
||||
----
|
||||
|
||||
|
||||
Unshelve
|
||||
~~~~~~~~
|
||||
Unshelving will take a shelved P4 changelist, and produce the equivalent git commit
|
||||
in the branch refs/remotes/p4/unshelved/<changelist>.
|
||||
|
||||
The git commit is created relative to the current origin revision (HEAD by default).
|
||||
If the shelved changelist's parent revisions differ, git-p4 will refuse to unshelve;
|
||||
you need to be unshelving onto an equivalent tree.
|
||||
|
||||
The origin revision can be changed with the "--origin" option.
|
||||
|
||||
If the target branch in refs/remotes/p4/unshelved already exists, the old one will
|
||||
be renamed.
|
||||
|
||||
----
|
||||
$ git p4 sync
|
||||
$ git p4 unshelve 12345
|
||||
$ git show refs/remotes/p4/unshelved/12345
|
||||
<submit more changes via p4 to the same files>
|
||||
$ git p4 unshelve 12345
|
||||
<refuses to unshelve until git is in sync with p4 again>
|
||||
|
||||
----
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
|
||||
@ -337,6 +362,13 @@ These options can be used to modify 'git p4 rebase' behavior.
|
||||
--import-labels::
|
||||
Import p4 labels.
|
||||
|
||||
Unshelve options
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
--origin::
|
||||
Sets the git refspec against which the shelved P4 changelist is compared.
|
||||
Defaults to p4/master.
|
||||
|
||||
DEPOT PATH SYNTAX
|
||||
-----------------
|
||||
The p4 depot path argument to 'git p4 sync' and 'git p4 clone' can
|
||||
@ -392,7 +424,7 @@ dedicating a client spec just for 'git p4'.
|
||||
The name of the client can be given to 'git p4' in multiple ways. The
|
||||
variable 'git-p4.client' takes precedence if it exists. Otherwise,
|
||||
normal p4 mechanisms of determining the client are used: environment
|
||||
variable P4CLIENT, a file referenced by P4CONFIG, or the local host name.
|
||||
variable `P4CLIENT`, a file referenced by `P4CONFIG`, or the local host name.
|
||||
|
||||
|
||||
BRANCH DETECTION
|
||||
@ -461,22 +493,22 @@ General variables
|
||||
~~~~~~~~~~~~~~~~~
|
||||
git-p4.user::
|
||||
User specified as an option to all p4 commands, with '-u <user>'.
|
||||
The environment variable 'P4USER' can be used instead.
|
||||
The environment variable `P4USER` can be used instead.
|
||||
|
||||
git-p4.password::
|
||||
Password specified as an option to all p4 commands, with
|
||||
'-P <password>'.
|
||||
The environment variable 'P4PASS' can be used instead.
|
||||
The environment variable `P4PASS` can be used instead.
|
||||
|
||||
git-p4.port::
|
||||
Port specified as an option to all p4 commands, with
|
||||
'-p <port>'.
|
||||
The environment variable 'P4PORT' can be used instead.
|
||||
The environment variable `P4PORT` can be used instead.
|
||||
|
||||
git-p4.host::
|
||||
Host specified as an option to all p4 commands, with
|
||||
'-h <host>'.
|
||||
The environment variable 'P4HOST' can be used instead.
|
||||
The environment variable `P4HOST` can be used instead.
|
||||
|
||||
git-p4.client::
|
||||
Client specified as an option to all p4 commands, with
|
||||
|
@ -9,7 +9,7 @@ git-pull - Fetch from and integrate with another repository or a local branch
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git pull' [options] [<repository> [<refspec>...]]
|
||||
'git pull' [<options>] [<repository> [<refspec>...]]
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
|
@ -8,9 +8,9 @@ git-rebase - Reapply commits on top of another base tip
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git rebase' [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
|
||||
'git rebase' [-i | --interactive] [<options>] [--exec <cmd>] [--onto <newbase>]
|
||||
[<upstream> [<branch>]]
|
||||
'git rebase' [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
|
||||
'git rebase' [-i | --interactive] [<options>] [--exec <cmd>] [--onto <newbase>]
|
||||
--root [<branch>]
|
||||
'git rebase' --continue | --skip | --abort | --quit | --edit-todo | --show-current-patch
|
||||
|
||||
|
@ -186,8 +186,8 @@ actually prune them.
|
||||
|
||||
'update'::
|
||||
|
||||
Fetch updates for a named set of remotes in the repository as defined by
|
||||
remotes.<group>. If a named group is not specified on the command line,
|
||||
Fetch updates for remotes or remote groups in the repository as defined by
|
||||
remotes.<group>. If neither group nor remote is specified on the command line,
|
||||
the configuration parameter remotes.default will be used; if
|
||||
remotes.default is not defined, all remotes which do not have the
|
||||
configuration parameter remote.<name>.skipDefaultUpdate set to true will
|
||||
|
@ -9,7 +9,7 @@ git-rev-parse - Pick out and massage parameters
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git rev-parse' [ --option ] <args>...
|
||||
'git rev-parse' [<options>] <args>...
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
@ -360,7 +360,7 @@ Example
|
||||
|
||||
------------
|
||||
OPTS_SPEC="\
|
||||
some-command [options] <args>...
|
||||
some-command [<options>] <args>...
|
||||
|
||||
some-command does foo and bar!
|
||||
--
|
||||
@ -385,7 +385,7 @@ When `"$@"` is `-h` or `--help` in the above example, the following
|
||||
usage text would be shown:
|
||||
|
||||
------------
|
||||
usage: some-command [options] <args>...
|
||||
usage: some-command [<options>] <args>...
|
||||
|
||||
some-command does foo and bar!
|
||||
|
||||
|
@ -9,7 +9,7 @@ git-send-email - Send a collection of patches as emails
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git send-email' [options] <file|directory|rev-list options>...
|
||||
'git send-email' [<options>] <file|directory|rev-list options>...
|
||||
'git send-email' --dump-aliases
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@ git-show - Show various types of objects
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git show' [options] [<object>...]
|
||||
'git show' [<options>] [<object>...]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
@ -8,7 +8,7 @@ git-svn - Bidirectional operation between a Subversion repository and Git
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git svn' <command> [options] [arguments]
|
||||
'git svn' <command> [<options>] [<arguments>]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
@ -34,8 +34,8 @@ in the tag message.
|
||||
If `-m <msg>` or `-F <file>` is given and `-a`, `-s`, and `-u <keyid>`
|
||||
are absent, `-a` is implied.
|
||||
|
||||
Otherwise just a tag reference for the SHA-1 object name of the commit object is
|
||||
created (i.e. a lightweight tag).
|
||||
Otherwise, a tag reference that points directly at the given object
|
||||
(i.e., a lightweight tag) is created.
|
||||
|
||||
A GnuPG signed tag object will be created when `-s` or `-u
|
||||
<keyid>` is used. When `-u <keyid>` is not used, the
|
||||
|
@ -8,7 +8,7 @@ git-web--browse - Git helper script to launch a web browser
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git web{litdd}browse' [OPTIONS] URL/FILE ...
|
||||
'git web{litdd}browse' [<options>] <url|file>...
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
@ -164,6 +164,16 @@ foo.bar= ...`) sets `foo.bar` to the empty string which `git config
|
||||
Do not perform optional operations that require locks. This is
|
||||
equivalent to setting the `GIT_OPTIONAL_LOCKS` to `0`.
|
||||
|
||||
--list-cmds=group[,group...]::
|
||||
List commands by group. This is an internal/experimental
|
||||
option and may change or be removed in the future. Supported
|
||||
groups are: builtins, parseopt (builtin commands that use
|
||||
parse-options), main (all commands in libexec directory),
|
||||
others (all other commands in `$PATH` that have git- prefix),
|
||||
list-<category> (see categories in command-list.txt),
|
||||
nohelpers (exclude helper commands), alias and config
|
||||
(retrieve command list from config variable completion.commands)
|
||||
|
||||
GIT COMMANDS
|
||||
------------
|
||||
|
||||
|
@ -3,7 +3,7 @@ gitattributes(5)
|
||||
|
||||
NAME
|
||||
----
|
||||
gitattributes - defining attributes per path
|
||||
gitattributes - Defining attributes per path
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
|
@ -110,8 +110,8 @@ couple of magic command-line options:
|
||||
+
|
||||
---------------------------------------------
|
||||
$ git describe -h
|
||||
usage: git describe [options] <commit-ish>*
|
||||
or: git describe [options] --dirty
|
||||
usage: git describe [<options>] <commit-ish>*
|
||||
or: git describe [<options>] --dirty
|
||||
|
||||
--contains find the tag that comes after the commit
|
||||
--debug debug search strategy on stderr
|
||||
|
@ -3,7 +3,7 @@ gitmodules(5)
|
||||
|
||||
NAME
|
||||
----
|
||||
gitmodules - defining submodule properties
|
||||
gitmodules - Defining submodule properties
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
|
@ -3,7 +3,7 @@ gitrevisions(7)
|
||||
|
||||
NAME
|
||||
----
|
||||
gitrevisions - specifying revisions and ranges for Git
|
||||
gitrevisions - Specifying revisions and ranges for Git
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
GVF=GIT-VERSION-FILE
|
||||
DEF_VER=v2.18.0-rc0
|
||||
DEF_VER=v2.18.0-rc2
|
||||
|
||||
LF='
|
||||
'
|
||||
|
16
Makefile
16
Makefile
@ -795,7 +795,7 @@ LIB_FILE = libgit.a
|
||||
XDIFF_LIB = xdiff/lib.a
|
||||
VCSSVN_LIB = vcs-svn/lib.a
|
||||
|
||||
GENERATED_H += common-cmds.h
|
||||
GENERATED_H += command-list.h
|
||||
|
||||
LIB_H = $(shell $(FIND) . \
|
||||
-name .git -prune -o \
|
||||
@ -2006,9 +2006,9 @@ git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
|
||||
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
|
||||
$(filter %.o,$^) $(LIBS)
|
||||
|
||||
help.sp help.s help.o: common-cmds.h
|
||||
help.sp help.s help.o: command-list.h
|
||||
|
||||
builtin/help.sp builtin/help.s builtin/help.o: common-cmds.h GIT-PREFIX
|
||||
builtin/help.sp builtin/help.s builtin/help.o: command-list.h GIT-PREFIX
|
||||
builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
|
||||
'-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \
|
||||
'-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \
|
||||
@ -2027,9 +2027,9 @@ $(BUILT_INS): git$X
|
||||
ln -s $< $@ 2>/dev/null || \
|
||||
cp $< $@
|
||||
|
||||
common-cmds.h: generate-cmdlist.sh command-list.txt
|
||||
command-list.h: generate-cmdlist.sh command-list.txt
|
||||
|
||||
common-cmds.h: $(wildcard Documentation/git-*.txt)
|
||||
command-list.h: $(wildcard Documentation/git*.txt)
|
||||
$(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh command-list.txt >$@+ && mv $@+ $@
|
||||
|
||||
SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
|
||||
@ -2273,7 +2273,7 @@ else
|
||||
# Dependencies on header files, for platforms that do not support
|
||||
# the gcc -MMD option.
|
||||
#
|
||||
# Dependencies on automatically generated headers such as common-cmds.h
|
||||
# Dependencies on automatically generated headers such as command-list.h
|
||||
# should _not_ be included here, since they are necessary even when
|
||||
# building an object for the first time.
|
||||
|
||||
@ -2653,7 +2653,7 @@ sparse: $(SP_OBJ)
|
||||
style:
|
||||
git clang-format --style file --diff --extensions c,h
|
||||
|
||||
check: common-cmds.h
|
||||
check: command-list.h
|
||||
@if sparse; \
|
||||
then \
|
||||
echo >&2 "Use 'make sparse' instead"; \
|
||||
@ -2901,7 +2901,7 @@ clean: profile-clean coverage-clean
|
||||
$(RM) $(TEST_PROGRAMS) $(NO_INSTALL)
|
||||
$(RM) -r bin-wrappers $(dep_dirs)
|
||||
$(RM) -r po/build/
|
||||
$(RM) *.pyc *.pyo */*.pyc */*.pyo common-cmds.h $(ETAGS_TARGET) tags cscope*
|
||||
$(RM) *.pyc *.pyo */*.pyc */*.pyo command-list.h $(ETAGS_TARGET) tags cscope*
|
||||
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
|
||||
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
|
||||
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
|
||||
|
@ -36,6 +36,9 @@ the body to majordomo@vger.kernel.org. The mailing list archives are
|
||||
available at <https://public-inbox.org/git/>,
|
||||
<http://marc.info/?l=git> and other archival sites.
|
||||
|
||||
Issues which are security relevant should be disclosed privately to
|
||||
the Git Security mailing list <git-security@googlegroups.com>.
|
||||
|
||||
The maintainer frequently sends the "What's cooking" reports that
|
||||
list the current status of various development topics to the mailing
|
||||
list. The discussion following them give a good reference for
|
||||
|
22
alias.c
22
alias.c
@ -1,9 +1,12 @@
|
||||
#include "cache.h"
|
||||
#include "alias.h"
|
||||
#include "config.h"
|
||||
#include "string-list.h"
|
||||
|
||||
struct config_alias_data {
|
||||
const char *alias;
|
||||
char *v;
|
||||
struct string_list *list;
|
||||
};
|
||||
|
||||
static int config_alias_cb(const char *key, const char *value, void *d)
|
||||
@ -11,8 +14,16 @@ static int config_alias_cb(const char *key, const char *value, void *d)
|
||||
struct config_alias_data *data = d;
|
||||
const char *p;
|
||||
|
||||
if (skip_prefix(key, "alias.", &p) && !strcasecmp(p, data->alias))
|
||||
return git_config_string((const char **)&data->v, key, value);
|
||||
if (!skip_prefix(key, "alias.", &p))
|
||||
return 0;
|
||||
|
||||
if (data->alias) {
|
||||
if (!strcasecmp(p, data->alias))
|
||||
return git_config_string((const char **)&data->v,
|
||||
key, value);
|
||||
} else if (data->list) {
|
||||
string_list_append(data->list, p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -26,6 +37,13 @@ char *alias_lookup(const char *alias)
|
||||
return data.v;
|
||||
}
|
||||
|
||||
void list_aliases(struct string_list *list)
|
||||
{
|
||||
struct config_alias_data data = { NULL, NULL, list };
|
||||
|
||||
read_early_config(config_alias_cb, &data);
|
||||
}
|
||||
|
||||
#define SPLIT_CMDLINE_BAD_ENDING 1
|
||||
#define SPLIT_CMDLINE_UNCLOSED_QUOTE 2
|
||||
static const char *split_cmdline_errors[] = {
|
||||
|
12
alias.h
Normal file
12
alias.h
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef __ALIAS_H__
|
||||
#define __ALIAS_H__
|
||||
|
||||
struct string_list;
|
||||
|
||||
char *alias_lookup(const char *alias);
|
||||
int split_cmdline(char *cmdline, const char ***argv);
|
||||
/* Takes a negative value returned by split_cmdline */
|
||||
const char *split_cmdline_strerror(int cmdline_errno);
|
||||
void list_aliases(struct string_list *list);
|
||||
|
||||
#endif
|
@ -411,11 +411,9 @@ static void parse_treeish_arg(const char **argv,
|
||||
}
|
||||
|
||||
#define OPT__COMPR(s, v, h, p) \
|
||||
{ OPTION_SET_INT, (s), NULL, (v), NULL, (h), \
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, (p) }
|
||||
OPT_SET_INT_F(s, NULL, v, h, p, PARSE_OPT_NONEG)
|
||||
#define OPT__COMPR_HIDDEN(s, v, p) \
|
||||
{ OPTION_SET_INT, (s), NULL, (v), NULL, "", \
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_HIDDEN, NULL, (p) }
|
||||
OPT_SET_INT_F(s, NULL, v, "", p, PARSE_OPT_NONEG | PARSE_OPT_HIDDEN)
|
||||
|
||||
static int parse_archive_args(int argc, const char **argv,
|
||||
const struct archiver **ar, struct archiver_args *args,
|
||||
|
12
builtin/am.c
12
builtin/am.c
@ -2231,12 +2231,12 @@ int cmd_am(int argc, const char **argv, const char *prefix)
|
||||
N_("pass -b flag to git-mailinfo"), KEEP_NON_PATCH),
|
||||
OPT_BOOL('m', "message-id", &state.message_id,
|
||||
N_("pass -m flag to git-mailinfo")),
|
||||
{ OPTION_SET_INT, 0, "keep-cr", &keep_cr, NULL,
|
||||
N_("pass --keep-cr flag to git-mailsplit for mbox format"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 1},
|
||||
{ OPTION_SET_INT, 0, "no-keep-cr", &keep_cr, NULL,
|
||||
N_("do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 0},
|
||||
OPT_SET_INT_F(0, "keep-cr", &keep_cr,
|
||||
N_("pass --keep-cr flag to git-mailsplit for mbox format"),
|
||||
1, PARSE_OPT_NONEG),
|
||||
OPT_SET_INT_F(0, "no-keep-cr", &keep_cr,
|
||||
N_("do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"),
|
||||
0, PARSE_OPT_NONEG),
|
||||
OPT_BOOL('c', "scissors", &state.scissors,
|
||||
N_("strip everything before a scissors line")),
|
||||
OPT_PASSTHRU_ARGV(0, "whitespace", &state.git_apply_opts, N_("action"),
|
||||
|
@ -592,8 +592,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
|
||||
OPT__QUIET(&quiet, N_("suppress informational messages")),
|
||||
OPT_SET_INT('t', "track", &track, N_("set up tracking mode (see git-pull(1))"),
|
||||
BRANCH_TRACK_EXPLICIT),
|
||||
{ OPTION_SET_INT, 0, "set-upstream", &track, NULL, N_("do not use"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, BRANCH_TRACK_OVERRIDE },
|
||||
OPT_SET_INT_F(0, "set-upstream", &track, N_("do not use"),
|
||||
BRANCH_TRACK_OVERRIDE, PARSE_OPT_HIDDEN),
|
||||
OPT_STRING('u', "set-upstream-to", &new_upstream, N_("upstream"), N_("change the upstream info")),
|
||||
OPT_BOOL(0, "unset-upstream", &unset_upstream, N_("Unset the upstream info")),
|
||||
OPT__COLOR(&branch_use_color, N_("use colored output")),
|
||||
|
@ -695,12 +695,11 @@ int cmd_difftool(int argc, const char **argv, const char *prefix)
|
||||
N_("use `diff.guitool` instead of `diff.tool`")),
|
||||
OPT_BOOL('d', "dir-diff", &dir_diff,
|
||||
N_("perform a full-directory diff")),
|
||||
{ OPTION_SET_INT, 'y', "no-prompt", &prompt, NULL,
|
||||
OPT_SET_INT_F('y', "no-prompt", &prompt,
|
||||
N_("do not prompt before launching a diff tool"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 0},
|
||||
{ OPTION_SET_INT, 0, "prompt", &prompt, NULL, NULL,
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_HIDDEN,
|
||||
NULL, 1 },
|
||||
0, PARSE_OPT_NONEG),
|
||||
OPT_SET_INT_F(0, "prompt", &prompt, NULL,
|
||||
1, PARSE_OPT_NONEG | PARSE_OPT_HIDDEN),
|
||||
OPT_BOOL(0, "symlinks", &symlinks,
|
||||
N_("use symlinks in dir-diff mode")),
|
||||
OPT_STRING('t', "tool", &difftool_cmd, N_("<tool>"),
|
||||
|
@ -155,9 +155,9 @@ static struct option builtin_fetch_options[] = {
|
||||
N_("deepen history of shallow clone, excluding rev")),
|
||||
OPT_INTEGER(0, "deepen", &deepen_relative,
|
||||
N_("deepen history of shallow clone")),
|
||||
{ OPTION_SET_INT, 0, "unshallow", &unshallow, NULL,
|
||||
N_("convert to a complete repository"),
|
||||
PARSE_OPT_NONEG | PARSE_OPT_NOARG, NULL, 1 },
|
||||
OPT_SET_INT_F(0, "unshallow", &unshallow,
|
||||
N_("convert to a complete repository"),
|
||||
1, PARSE_OPT_NONEG),
|
||||
{ OPTION_STRING, 0, "submodule-prefix", &submodule_prefix, N_("dir"),
|
||||
N_("prepend this to submodule path output"), PARSE_OPT_HIDDEN },
|
||||
{ OPTION_CALLBACK, 0, "recurse-submodules-default",
|
||||
|
@ -886,9 +886,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
|
||||
N_("indicate hit with exit status without output")),
|
||||
OPT_BOOL(0, "all-match", &opt.all_match,
|
||||
N_("show only matches from files that match all patterns")),
|
||||
{ OPTION_SET_INT, 0, "debug", &opt.debug, NULL,
|
||||
N_("show parse tree for grep expression"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1 },
|
||||
OPT_SET_INT_F(0, "debug", &opt.debug,
|
||||
N_("show parse tree for grep expression"),
|
||||
1, PARSE_OPT_HIDDEN),
|
||||
OPT_GROUP(""),
|
||||
{ OPTION_STRING, 'O', "open-files-in-pager", &show_in_pager,
|
||||
N_("pager"), N_("show matching files in the pager"),
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "run-command.h"
|
||||
#include "column.h"
|
||||
#include "help.h"
|
||||
#include "alias.h"
|
||||
|
||||
#ifndef DEFAULT_HELP_FORMAT
|
||||
#define DEFAULT_HELP_FORMAT "man"
|
||||
@ -36,6 +37,7 @@ static const char *html_path;
|
||||
|
||||
static int show_all = 0;
|
||||
static int show_guides = 0;
|
||||
static int verbose;
|
||||
static unsigned int colopts;
|
||||
static enum help_format help_format = HELP_FORMAT_NONE;
|
||||
static int exclude_guides;
|
||||
@ -48,6 +50,7 @@ static struct option builtin_help_options[] = {
|
||||
HELP_FORMAT_WEB),
|
||||
OPT_SET_INT('i', "info", &help_format, N_("show info page"),
|
||||
HELP_FORMAT_INFO),
|
||||
OPT__VERBOSE(&verbose, N_("print command description")),
|
||||
OPT_END(),
|
||||
};
|
||||
|
||||
@ -400,38 +403,6 @@ static void show_html_page(const char *git_cmd)
|
||||
open_html(page_path.buf);
|
||||
}
|
||||
|
||||
static struct {
|
||||
const char *name;
|
||||
const char *help;
|
||||
} common_guides[] = {
|
||||
{ "attributes", N_("Defining attributes per path") },
|
||||
{ "everyday", N_("Everyday Git With 20 Commands Or So") },
|
||||
{ "glossary", N_("A Git glossary") },
|
||||
{ "ignore", N_("Specifies intentionally untracked files to ignore") },
|
||||
{ "modules", N_("Defining submodule properties") },
|
||||
{ "revisions", N_("Specifying revisions and ranges for Git") },
|
||||
{ "tutorial", N_("A tutorial introduction to Git (for version 1.5.1 or newer)") },
|
||||
{ "workflows", N_("An overview of recommended workflows with Git") },
|
||||
};
|
||||
|
||||
static void list_common_guides_help(void)
|
||||
{
|
||||
int i, longest = 0;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(common_guides); i++) {
|
||||
if (longest < strlen(common_guides[i].name))
|
||||
longest = strlen(common_guides[i].name);
|
||||
}
|
||||
|
||||
puts(_("The common Git guides are:\n"));
|
||||
for (i = 0; i < ARRAY_SIZE(common_guides); i++) {
|
||||
printf(" %s ", common_guides[i].name);
|
||||
mput_char(' ', longest - strlen(common_guides[i].name));
|
||||
puts(_(common_guides[i].help));
|
||||
}
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
static const char *check_git_cmd(const char* cmd)
|
||||
{
|
||||
char *alias;
|
||||
@ -463,6 +434,11 @@ int cmd_help(int argc, const char **argv, const char *prefix)
|
||||
|
||||
if (show_all) {
|
||||
git_config(git_help_config, NULL);
|
||||
if (verbose) {
|
||||
setup_pager();
|
||||
list_all_cmds_help();
|
||||
return 0;
|
||||
}
|
||||
printf(_("usage: %s%s"), _(git_usage_string), "\n\n");
|
||||
load_command_list("git-", &main_cmds, &other_cmds);
|
||||
list_commands(colopts, &main_cmds, &other_cmds);
|
||||
|
@ -1482,8 +1482,12 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
|
||||
} else
|
||||
chmod(final_index_name, 0444);
|
||||
|
||||
if (do_fsck_object)
|
||||
add_packed_git(final_index_name, strlen(final_index_name), 0);
|
||||
if (do_fsck_object) {
|
||||
struct packed_git *p;
|
||||
p = add_packed_git(final_index_name, strlen(final_index_name), 0);
|
||||
if (p)
|
||||
install_packed_git(the_repository, p);
|
||||
}
|
||||
|
||||
if (!from_stdin) {
|
||||
printf("%s\n", sha1_to_hex(hash));
|
||||
|
@ -117,7 +117,7 @@ static void copy_templates(const char *template_dir)
|
||||
|
||||
dir = opendir(template_path.buf);
|
||||
if (!dir) {
|
||||
warning(_("templates not found %s"), template_dir);
|
||||
warning(_("templates not found in %s"), template_dir);
|
||||
goto free_return;
|
||||
}
|
||||
|
||||
|
@ -1474,9 +1474,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
|
||||
N_("output all-zero hash in From header")),
|
||||
OPT_BOOL(0, "ignore-if-in-upstream", &ignore_if_in_upstream,
|
||||
N_("don't include a patch matching a commit upstream")),
|
||||
{ OPTION_SET_INT, 'p', "no-stat", &use_patch_format, NULL,
|
||||
N_("show patch format instead of default (patch + stat)"),
|
||||
PARSE_OPT_NONEG | PARSE_OPT_NOARG, NULL, 1},
|
||||
OPT_SET_INT_F('p', "no-stat", &use_patch_format,
|
||||
N_("show patch format instead of default (patch + stat)"),
|
||||
1, PARSE_OPT_NONEG),
|
||||
OPT_GROUP(N_("Messaging")),
|
||||
{ OPTION_CALLBACK, 0, "add-header", NULL, N_("header"),
|
||||
N_("add email header"), 0, header_callback },
|
||||
|
@ -556,9 +556,9 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
|
||||
{ OPTION_CALLBACK, 0, "exclude-standard", &dir, NULL,
|
||||
N_("add the standard git exclusions"),
|
||||
PARSE_OPT_NOARG, option_parse_exclude_standard },
|
||||
{ OPTION_SET_INT, 0, "full-name", &prefix_len, NULL,
|
||||
N_("make the output relative to the project top directory"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL },
|
||||
OPT_SET_INT_F(0, "full-name", &prefix_len,
|
||||
N_("make the output relative to the project top directory"),
|
||||
0, PARSE_OPT_NONEG),
|
||||
OPT_BOOL(0, "recurse-submodules", &recurse_submodules,
|
||||
N_("recurse through submodules")),
|
||||
OPT_BOOL(0, "error-unmatch", &error_unmatch,
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "string-list.h"
|
||||
#include "packfile.h"
|
||||
#include "tag.h"
|
||||
#include "alias.h"
|
||||
|
||||
#define DEFAULT_TWOHEAD (1<<0)
|
||||
#define DEFAULT_OCTOPUS (1<<1)
|
||||
@ -214,9 +215,9 @@ static struct option builtin_merge_options[] = {
|
||||
OPT_BOOL('e', "edit", &option_edit,
|
||||
N_("edit message before committing")),
|
||||
OPT_SET_INT(0, "ff", &fast_forward, N_("allow fast-forward (default)"), FF_ALLOW),
|
||||
{ OPTION_SET_INT, 0, "ff-only", &fast_forward, NULL,
|
||||
N_("abort if fast-forward is not possible"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, FF_ONLY },
|
||||
OPT_SET_INT_F(0, "ff-only", &fast_forward,
|
||||
N_("abort if fast-forward is not possible"),
|
||||
FF_ONLY, PARSE_OPT_NONEG),
|
||||
OPT_RERERE_AUTOUPDATE(&allow_rerere_auto),
|
||||
OPT_BOOL(0, "verify-signatures", &verify_signatures,
|
||||
N_("verify that the named commit has a valid GPG signature")),
|
||||
|
@ -778,13 +778,13 @@ static int merge(int argc, const char **argv, const char *prefix)
|
||||
N_("resolve notes conflicts using the given strategy "
|
||||
"(manual/ours/theirs/union/cat_sort_uniq)")),
|
||||
OPT_GROUP(N_("Committing unmerged notes")),
|
||||
{ OPTION_SET_INT, 0, "commit", &do_commit, NULL,
|
||||
N_("finalize notes merge by committing unmerged notes"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 1},
|
||||
OPT_SET_INT_F(0, "commit", &do_commit,
|
||||
N_("finalize notes merge by committing unmerged notes"),
|
||||
1, PARSE_OPT_NONEG),
|
||||
OPT_GROUP(N_("Aborting notes merge resolution")),
|
||||
{ OPTION_SET_INT, 0, "abort", &do_abort, NULL,
|
||||
N_("abort notes merge"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 1},
|
||||
OPT_SET_INT_F(0, "abort", &do_abort,
|
||||
N_("abort notes merge"),
|
||||
1, PARSE_OPT_NONEG),
|
||||
OPT_END()
|
||||
};
|
||||
|
||||
|
@ -3134,18 +3134,18 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
|
||||
N_("do not create an empty pack output")),
|
||||
OPT_BOOL(0, "revs", &use_internal_rev_list,
|
||||
N_("read revision arguments from standard input")),
|
||||
{ OPTION_SET_INT, 0, "unpacked", &rev_list_unpacked, NULL,
|
||||
N_("limit the objects to those that are not yet packed"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 1 },
|
||||
{ OPTION_SET_INT, 0, "all", &rev_list_all, NULL,
|
||||
N_("include objects reachable from any reference"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 1 },
|
||||
{ OPTION_SET_INT, 0, "reflog", &rev_list_reflog, NULL,
|
||||
N_("include objects referred by reflog entries"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 1 },
|
||||
{ OPTION_SET_INT, 0, "indexed-objects", &rev_list_index, NULL,
|
||||
N_("include objects referred to by the index"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, 1 },
|
||||
OPT_SET_INT_F(0, "unpacked", &rev_list_unpacked,
|
||||
N_("limit the objects to those that are not yet packed"),
|
||||
1, PARSE_OPT_NONEG),
|
||||
OPT_SET_INT_F(0, "all", &rev_list_all,
|
||||
N_("include objects reachable from any reference"),
|
||||
1, PARSE_OPT_NONEG),
|
||||
OPT_SET_INT_F(0, "reflog", &rev_list_reflog,
|
||||
N_("include objects referred by reflog entries"),
|
||||
1, PARSE_OPT_NONEG),
|
||||
OPT_SET_INT_F(0, "indexed-objects", &rev_list_index,
|
||||
N_("include objects referred to by the index"),
|
||||
1, PARSE_OPT_NONEG),
|
||||
OPT_BOOL(0, "stdout", &pack_to_stdout,
|
||||
N_("output pack to stdout")),
|
||||
OPT_BOOL(0, "include-tag", &include_tag,
|
||||
|
@ -282,6 +282,10 @@ static int try_difference(const char *arg)
|
||||
struct commit *a, *b;
|
||||
a = lookup_commit_reference(&start_oid);
|
||||
b = lookup_commit_reference(&end_oid);
|
||||
if (!a || !b) {
|
||||
*dotdot = '.';
|
||||
return 0;
|
||||
}
|
||||
exclude = get_merge_bases(a, b);
|
||||
while (exclude) {
|
||||
struct commit *commit = pop_commit(&exclude);
|
||||
@ -328,12 +332,12 @@ static int try_parent_shorthands(const char *arg)
|
||||
return 0;
|
||||
|
||||
*dotdot = 0;
|
||||
if (get_oid_committish(arg, &oid)) {
|
||||
if (get_oid_committish(arg, &oid) ||
|
||||
!(commit = lookup_commit_reference(&oid))) {
|
||||
*dotdot = '^';
|
||||
return 0;
|
||||
}
|
||||
|
||||
commit = lookup_commit_reference(&oid);
|
||||
if (exclude_parent &&
|
||||
exclude_parent > commit_list_count(commit->parents)) {
|
||||
*dotdot = '^';
|
||||
|
5
cache.h
5
cache.h
@ -1826,11 +1826,6 @@ extern int ws_blank_line(const char *line, int len, unsigned ws_rule);
|
||||
void overlay_tree_on_index(struct index_state *istate,
|
||||
const char *tree_name, const char *prefix);
|
||||
|
||||
char *alias_lookup(const char *alias);
|
||||
int split_cmdline(char *cmdline, const char ***argv);
|
||||
/* Takes a negative value returned by split_cmdline */
|
||||
const char *split_cmdline_strerror(int cmdline_errno);
|
||||
|
||||
/* setup.c */
|
||||
struct startup_info {
|
||||
int have_repository;
|
||||
|
110
command-list.txt
110
command-list.txt
@ -1,23 +1,58 @@
|
||||
# common commands are grouped by themes
|
||||
# these groups are output by 'git help' in the order declared here.
|
||||
# map each common command in the command list to one of these groups.
|
||||
### common groups (do not change this line)
|
||||
init start a working area (see also: git help tutorial)
|
||||
worktree work on the current change (see also: git help everyday)
|
||||
info examine the history and state (see also: git help revisions)
|
||||
history grow, mark and tweak your common history
|
||||
remote collaborate (see also: git help workflows)
|
||||
|
||||
### command list (do not change this line)
|
||||
# command name category [deprecated] [common]
|
||||
# Command classification list
|
||||
# ---------------------------
|
||||
# All supported commands, builtin or external, must be described in
|
||||
# here. This info is used to list commands in various places. Each
|
||||
# command is on one line followed by one or more attributes.
|
||||
#
|
||||
# The first attribute group is mandatory and indicates the command
|
||||
# type. This group includes:
|
||||
#
|
||||
# mainporcelain
|
||||
# ancillarymanipulators
|
||||
# ancillaryinterrogators
|
||||
# foreignscminterface
|
||||
# plumbingmanipulators
|
||||
# plumbinginterrogators
|
||||
# synchingrepositories
|
||||
# synchelpers
|
||||
# purehelpers
|
||||
#
|
||||
# The type names are self explanatory. But if you want to see what
|
||||
# command belongs to what group to get a better picture, have a look
|
||||
# at "git" man page, "GIT COMMANDS" section.
|
||||
#
|
||||
# Commands of type mainporcelain can also optionally have one of these
|
||||
# attributes:
|
||||
#
|
||||
# init
|
||||
# worktree
|
||||
# info
|
||||
# history
|
||||
# remote
|
||||
#
|
||||
# These commands are considered "common" and will show up in "git
|
||||
# help" output in groups. Uncommon porcelain commands must not
|
||||
# specify any of these attributes.
|
||||
#
|
||||
# "complete" attribute is used to mark that the command should be
|
||||
# completable by git-completion.bash. Note that by default,
|
||||
# mainporcelain commands are completable so you don't need this
|
||||
# attribute.
|
||||
#
|
||||
# As part of the Git man page list, the man(5/7) guides are also
|
||||
# specified here, which can only have "guide" attribute and nothing
|
||||
# else.
|
||||
#
|
||||
### command list (do not change this line, also do not change alignment)
|
||||
# command name category [category] [category]
|
||||
git-add mainporcelain worktree
|
||||
git-am mainporcelain
|
||||
git-annotate ancillaryinterrogators
|
||||
git-apply plumbingmanipulators
|
||||
git-apply plumbingmanipulators complete
|
||||
git-archimport foreignscminterface
|
||||
git-archive mainporcelain
|
||||
git-bisect mainporcelain info
|
||||
git-blame ancillaryinterrogators
|
||||
git-blame ancillaryinterrogators complete
|
||||
git-branch mainporcelain history
|
||||
git-bundle mainporcelain
|
||||
git-cat-file plumbinginterrogators
|
||||
@ -27,7 +62,7 @@ git-check-mailmap purehelpers
|
||||
git-checkout mainporcelain history
|
||||
git-checkout-index plumbingmanipulators
|
||||
git-check-ref-format purehelpers
|
||||
git-cherry ancillaryinterrogators
|
||||
git-cherry ancillaryinterrogators complete
|
||||
git-cherry-pick mainporcelain
|
||||
git-citool mainporcelain
|
||||
git-clean mainporcelain
|
||||
@ -36,7 +71,7 @@ git-column purehelpers
|
||||
git-commit mainporcelain history
|
||||
git-commit-graph plumbingmanipulators
|
||||
git-commit-tree plumbingmanipulators
|
||||
git-config ancillarymanipulators
|
||||
git-config ancillarymanipulators complete
|
||||
git-count-objects ancillaryinterrogators
|
||||
git-credential purehelpers
|
||||
git-credential-cache purehelpers
|
||||
@ -50,7 +85,7 @@ git-diff mainporcelain history
|
||||
git-diff-files plumbinginterrogators
|
||||
git-diff-index plumbinginterrogators
|
||||
git-diff-tree plumbinginterrogators
|
||||
git-difftool ancillaryinterrogators
|
||||
git-difftool ancillaryinterrogators complete
|
||||
git-fast-export ancillarymanipulators
|
||||
git-fast-import ancillarymanipulators
|
||||
git-fetch mainporcelain remote
|
||||
@ -59,20 +94,20 @@ git-filter-branch ancillarymanipulators
|
||||
git-fmt-merge-msg purehelpers
|
||||
git-for-each-ref plumbinginterrogators
|
||||
git-format-patch mainporcelain
|
||||
git-fsck ancillaryinterrogators
|
||||
git-fsck ancillaryinterrogators complete
|
||||
git-gc mainporcelain
|
||||
git-get-tar-commit-id ancillaryinterrogators
|
||||
git-grep mainporcelain info
|
||||
git-gui mainporcelain
|
||||
git-hash-object plumbingmanipulators
|
||||
git-help ancillaryinterrogators
|
||||
git-help ancillaryinterrogators complete
|
||||
git-http-backend synchingrepositories
|
||||
git-http-fetch synchelpers
|
||||
git-http-push synchelpers
|
||||
git-imap-send foreignscminterface
|
||||
git-index-pack plumbingmanipulators
|
||||
git-init mainporcelain init
|
||||
git-instaweb ancillaryinterrogators
|
||||
git-instaweb ancillaryinterrogators complete
|
||||
git-interpret-trailers purehelpers
|
||||
gitk mainporcelain
|
||||
git-log mainporcelain info
|
||||
@ -86,7 +121,7 @@ git-merge-base plumbinginterrogators
|
||||
git-merge-file plumbingmanipulators
|
||||
git-merge-index plumbingmanipulators
|
||||
git-merge-one-file purehelpers
|
||||
git-mergetool ancillarymanipulators
|
||||
git-mergetool ancillarymanipulators complete
|
||||
git-merge-tree ancillaryinterrogators
|
||||
git-mktag plumbingmanipulators
|
||||
git-mktree plumbingmanipulators
|
||||
@ -107,28 +142,29 @@ git-quiltimport foreignscminterface
|
||||
git-read-tree plumbingmanipulators
|
||||
git-rebase mainporcelain history
|
||||
git-receive-pack synchelpers
|
||||
git-reflog ancillarymanipulators
|
||||
git-remote ancillarymanipulators
|
||||
git-repack ancillarymanipulators
|
||||
git-replace ancillarymanipulators
|
||||
git-request-pull foreignscminterface
|
||||
git-reflog ancillarymanipulators complete
|
||||
git-remote ancillarymanipulators complete
|
||||
git-repack ancillarymanipulators complete
|
||||
git-replace ancillarymanipulators complete
|
||||
git-request-pull foreignscminterface complete
|
||||
git-rerere ancillaryinterrogators
|
||||
git-reset mainporcelain worktree
|
||||
git-revert mainporcelain
|
||||
git-rev-list plumbinginterrogators
|
||||
git-rev-parse ancillaryinterrogators
|
||||
git-rm mainporcelain worktree
|
||||
git-send-email foreignscminterface
|
||||
git-send-email foreignscminterface complete
|
||||
git-send-pack synchingrepositories
|
||||
git-shell synchelpers
|
||||
git-shortlog mainporcelain
|
||||
git-show mainporcelain info
|
||||
git-show-branch ancillaryinterrogators
|
||||
git-show-branch ancillaryinterrogators complete
|
||||
git-show-index plumbinginterrogators
|
||||
git-show-ref plumbinginterrogators
|
||||
git-sh-i18n purehelpers
|
||||
git-sh-setup purehelpers
|
||||
git-stash mainporcelain
|
||||
git-stage complete
|
||||
git-status mainporcelain info
|
||||
git-stripspace purehelpers
|
||||
git-submodule mainporcelain
|
||||
@ -147,6 +183,22 @@ git-verify-commit ancillaryinterrogators
|
||||
git-verify-pack plumbinginterrogators
|
||||
git-verify-tag ancillaryinterrogators
|
||||
gitweb ancillaryinterrogators
|
||||
git-whatchanged ancillaryinterrogators
|
||||
git-whatchanged ancillaryinterrogators complete
|
||||
git-worktree mainporcelain
|
||||
git-write-tree plumbingmanipulators
|
||||
gitattributes guide
|
||||
gitcli guide
|
||||
gitcore-tutorial guide
|
||||
gitcvs-migration guide
|
||||
gitdiffcore guide
|
||||
giteveryday guide
|
||||
gitglossary guide
|
||||
githooks guide
|
||||
gitignore guide
|
||||
gitmodules guide
|
||||
gitnamespaces guide
|
||||
gitrepository-layout guide
|
||||
gitrevisions guide
|
||||
gittutorial-2 guide
|
||||
gittutorial guide
|
||||
gitworkflows guide
|
||||
|
3
commit.c
3
commit.c
@ -207,6 +207,9 @@ static void prepare_commit_graft(void)
|
||||
|
||||
if (commit_graft_prepared)
|
||||
return;
|
||||
if (!startup_info->have_repository)
|
||||
return;
|
||||
|
||||
graft_file = get_graft_file();
|
||||
read_graft_file(graft_file);
|
||||
/* make sure shallows are read */
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "strbuf.h"
|
||||
#include "version.h"
|
||||
#include "protocol.h"
|
||||
#include "alias.h"
|
||||
|
||||
static char *server_capabilities_v1;
|
||||
static struct argv_array server_capabilities_v2 = ARGV_ARRAY_INIT;
|
||||
|
@ -989,127 +989,11 @@ __git_complete_strategy ()
|
||||
return 1
|
||||
}
|
||||
|
||||
__git_commands () {
|
||||
if test -n "${GIT_TESTING_COMMAND_COMPLETION:-}"
|
||||
then
|
||||
printf "%s" "${GIT_TESTING_COMMAND_COMPLETION}"
|
||||
else
|
||||
git help -a|egrep '^ [a-zA-Z0-9]'
|
||||
fi
|
||||
}
|
||||
|
||||
__git_list_all_commands ()
|
||||
{
|
||||
local i IFS=" "$'\n'
|
||||
for i in $(__git_commands)
|
||||
do
|
||||
case $i in
|
||||
*--*) : helper pattern;;
|
||||
*) echo $i;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
__git_all_commands=
|
||||
__git_compute_all_commands ()
|
||||
{
|
||||
test -n "$__git_all_commands" ||
|
||||
__git_all_commands=$(__git_list_all_commands)
|
||||
}
|
||||
|
||||
__git_list_porcelain_commands ()
|
||||
{
|
||||
local i IFS=" "$'\n'
|
||||
__git_compute_all_commands
|
||||
for i in $__git_all_commands
|
||||
do
|
||||
case $i in
|
||||
*--*) : helper pattern;;
|
||||
applymbox) : ask gittus;;
|
||||
applypatch) : ask gittus;;
|
||||
archimport) : import;;
|
||||
cat-file) : plumbing;;
|
||||
check-attr) : plumbing;;
|
||||
check-ignore) : plumbing;;
|
||||
check-mailmap) : plumbing;;
|
||||
check-ref-format) : plumbing;;
|
||||
checkout-index) : plumbing;;
|
||||
column) : internal helper;;
|
||||
commit-graph) : plumbing;;
|
||||
commit-tree) : plumbing;;
|
||||
count-objects) : infrequent;;
|
||||
credential) : credentials;;
|
||||
credential-*) : credentials helper;;
|
||||
cvsexportcommit) : export;;
|
||||
cvsimport) : import;;
|
||||
cvsserver) : daemon;;
|
||||
daemon) : daemon;;
|
||||
diff-files) : plumbing;;
|
||||
diff-index) : plumbing;;
|
||||
diff-tree) : plumbing;;
|
||||
fast-import) : import;;
|
||||
fast-export) : export;;
|
||||
fsck-objects) : plumbing;;
|
||||
fetch-pack) : plumbing;;
|
||||
fmt-merge-msg) : plumbing;;
|
||||
for-each-ref) : plumbing;;
|
||||
hash-object) : plumbing;;
|
||||
http-*) : transport;;
|
||||
index-pack) : plumbing;;
|
||||
init-db) : deprecated;;
|
||||
local-fetch) : plumbing;;
|
||||
ls-files) : plumbing;;
|
||||
ls-remote) : plumbing;;
|
||||
ls-tree) : plumbing;;
|
||||
mailinfo) : plumbing;;
|
||||
mailsplit) : plumbing;;
|
||||
merge-*) : plumbing;;
|
||||
mktree) : plumbing;;
|
||||
mktag) : plumbing;;
|
||||
pack-objects) : plumbing;;
|
||||
pack-redundant) : plumbing;;
|
||||
pack-refs) : plumbing;;
|
||||
parse-remote) : plumbing;;
|
||||
patch-id) : plumbing;;
|
||||
prune) : plumbing;;
|
||||
prune-packed) : plumbing;;
|
||||
quiltimport) : import;;
|
||||
read-tree) : plumbing;;
|
||||
receive-pack) : plumbing;;
|
||||
remote-*) : transport;;
|
||||
rerere) : plumbing;;
|
||||
rev-list) : plumbing;;
|
||||
rev-parse) : plumbing;;
|
||||
runstatus) : plumbing;;
|
||||
sh-setup) : internal;;
|
||||
shell) : daemon;;
|
||||
show-ref) : plumbing;;
|
||||
send-pack) : plumbing;;
|
||||
show-index) : plumbing;;
|
||||
ssh-*) : transport;;
|
||||
stripspace) : plumbing;;
|
||||
symbolic-ref) : plumbing;;
|
||||
unpack-file) : plumbing;;
|
||||
unpack-objects) : plumbing;;
|
||||
update-index) : plumbing;;
|
||||
update-ref) : plumbing;;
|
||||
update-server-info) : daemon;;
|
||||
upload-archive) : plumbing;;
|
||||
upload-pack) : plumbing;;
|
||||
write-tree) : plumbing;;
|
||||
var) : infrequent;;
|
||||
verify-pack) : infrequent;;
|
||||
verify-tag) : plumbing;;
|
||||
*) echo $i;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
__git_porcelain_commands=
|
||||
__git_compute_porcelain_commands ()
|
||||
{
|
||||
test -n "$__git_porcelain_commands" ||
|
||||
__git_porcelain_commands=$(__git_list_porcelain_commands)
|
||||
__git_all_commands=$(git --list-cmds=main,others,alias,nohelpers)
|
||||
}
|
||||
|
||||
# Lists all set config variables starting with the given section prefix,
|
||||
@ -1127,11 +1011,6 @@ __git_pretty_aliases ()
|
||||
__git_get_config_variables "pretty"
|
||||
}
|
||||
|
||||
__git_aliases ()
|
||||
{
|
||||
__git_get_config_variables "alias"
|
||||
}
|
||||
|
||||
# __git_aliased_command requires 1 argument
|
||||
__git_aliased_command ()
|
||||
{
|
||||
@ -1739,13 +1618,12 @@ _git_help ()
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__git_compute_all_commands
|
||||
__gitcomp "$__git_all_commands $(__git_aliases)
|
||||
attributes cli core-tutorial cvs-migration
|
||||
diffcore everyday gitk glossary hooks ignore modules
|
||||
namespaces repository-layout revisions tutorial tutorial-2
|
||||
workflows
|
||||
"
|
||||
if test -n "$GIT_TESTING_ALL_COMMAND_LIST"
|
||||
then
|
||||
__gitcomp "$GIT_TESTING_ALL_COMMAND_LIST $(git --list-cmds=alias,list-guide) gitk"
|
||||
else
|
||||
__gitcomp "$(git --list-cmds=main,nohelpers,alias,list-guide) gitk"
|
||||
fi
|
||||
}
|
||||
|
||||
_git_init ()
|
||||
@ -3214,7 +3092,7 @@ __git_complete_common () {
|
||||
__git_cmds_with_parseopt_helper=
|
||||
__git_support_parseopt_helper () {
|
||||
test -n "$__git_cmds_with_parseopt_helper" ||
|
||||
__git_cmds_with_parseopt_helper="$(__git --list-parseopt-builtins)"
|
||||
__git_cmds_with_parseopt_helper="$(__git --list-cmds=parseopt)"
|
||||
|
||||
case " $__git_cmds_with_parseopt_helper " in
|
||||
*" $1 "*)
|
||||
@ -3300,8 +3178,14 @@ __git_main ()
|
||||
--help
|
||||
"
|
||||
;;
|
||||
*) __git_compute_porcelain_commands
|
||||
__gitcomp "$__git_porcelain_commands $(__git_aliases)" ;;
|
||||
*)
|
||||
if test -n "$GIT_TESTING_PORCELAIN_COMMAND_LIST"
|
||||
then
|
||||
__gitcomp "$GIT_TESTING_PORCELAIN_COMMAND_LIST"
|
||||
else
|
||||
__gitcomp "$(git --list-cmds=list-mainporcelain,others,nohelpers,alias,list-complete,config)"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
return
|
||||
fi
|
||||
@ -3339,7 +3223,10 @@ __gitk_main ()
|
||||
__git_complete_revlist
|
||||
}
|
||||
|
||||
if [[ -n ${ZSH_VERSION-} ]]; then
|
||||
if [[ -n ${ZSH_VERSION-} ]] &&
|
||||
# Don't define these functions when sourced from 'git-completion.zsh',
|
||||
# it has its own implementations.
|
||||
[[ -z ${GIT_SOURCING_ZSH_COMPLETION-} ]]; then
|
||||
echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2
|
||||
|
||||
autoload -U +X compinit && compinit
|
||||
|
@ -39,7 +39,7 @@ if [ -z "$script" ]; then
|
||||
test -f $e && script="$e" && break
|
||||
done
|
||||
fi
|
||||
ZSH_VERSION='' . "$script"
|
||||
GIT_SOURCING_ZSH_COMPLETION=y . "$script"
|
||||
|
||||
__gitcomp ()
|
||||
{
|
||||
|
@ -63,6 +63,8 @@ foreach my $tar_file (@ARGV)
|
||||
my $have_top_dir = 1;
|
||||
my ($top_dir, %files);
|
||||
|
||||
my $next_path = '';
|
||||
|
||||
while (read(I, $_, 512) == 512) {
|
||||
my ($name, $mode, $uid, $gid, $size, $mtime,
|
||||
$chksum, $typeflag, $linkname, $magic,
|
||||
@ -70,6 +72,13 @@ foreach my $tar_file (@ARGV)
|
||||
$prefix) = unpack 'Z100 Z8 Z8 Z8 Z12 Z12
|
||||
Z8 Z1 Z100 Z6
|
||||
Z2 Z32 Z32 Z8 Z8 Z*', $_;
|
||||
|
||||
unless ($next_path eq '') {
|
||||
# Recover name from previous extended header
|
||||
$name = $next_path;
|
||||
$next_path = '';
|
||||
}
|
||||
|
||||
last unless length($name);
|
||||
if ($name eq '././@LongLink') {
|
||||
# GNU tar extension
|
||||
@ -90,13 +99,31 @@ foreach my $tar_file (@ARGV)
|
||||
Z8 Z1 Z100 Z6
|
||||
Z2 Z32 Z32 Z8 Z8 Z*', $_;
|
||||
}
|
||||
next if $name =~ m{/\z};
|
||||
$mode = oct $mode;
|
||||
$size = oct $size;
|
||||
$mtime = oct $mtime;
|
||||
next if $typeflag == 5; # directory
|
||||
|
||||
if ($typeflag != 1) { # handle hard links later
|
||||
if ($typeflag eq 'x') { # extended header
|
||||
# If extended header, check for path
|
||||
my $pax_header = '';
|
||||
while ($size > 0 && read(I, $_, 512) == 512) {
|
||||
$pax_header = $pax_header . substr($_, 0, $size);
|
||||
$size -= 512;
|
||||
}
|
||||
|
||||
my @lines = split /\n/, $pax_header;
|
||||
foreach my $line (@lines) {
|
||||
my ($len, $entry) = split / /, $line;
|
||||
my ($key, $value) = split /=/, $entry;
|
||||
if ($key eq 'path') {
|
||||
$next_path = $value;
|
||||
}
|
||||
}
|
||||
next;
|
||||
} elsif ($name =~ m{/\z}) { # directory
|
||||
next;
|
||||
} elsif ($typeflag != 1) { # handle hard links later
|
||||
print FI "blob\n", "mark :$next_mark\n";
|
||||
if ($typeflag == 2) { # symbolic link
|
||||
print FI "data ", length($linkname), "\n",
|
||||
|
3
fsck.c
3
fsck.c
@ -1036,7 +1036,8 @@ int fsck_finish(struct fsck_options *options)
|
||||
|
||||
blob = lookup_blob(oid);
|
||||
if (!blob) {
|
||||
ret |= report(options, &blob->object,
|
||||
struct object *obj = lookup_unknown_object(oid->hash);
|
||||
ret |= report(options, obj,
|
||||
FSCK_MSG_GITMODULES_BLOB,
|
||||
"non-blob found at .gitmodules");
|
||||
continue;
|
||||
|
@ -1,50 +1,90 @@
|
||||
#!/bin/sh
|
||||
|
||||
die () {
|
||||
echo "$@" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
command_list () {
|
||||
grep -v '^#' "$1"
|
||||
}
|
||||
|
||||
get_categories () {
|
||||
tr ' ' '\n'|
|
||||
grep -v '^$' |
|
||||
sort |
|
||||
uniq
|
||||
}
|
||||
|
||||
category_list () {
|
||||
command_list "$1" |
|
||||
cut -c 40- |
|
||||
get_categories
|
||||
}
|
||||
|
||||
get_synopsis () {
|
||||
sed -n '
|
||||
/^NAME/,/'"$1"'/H
|
||||
${
|
||||
x
|
||||
s/.*'"$1"' - \(.*\)/N_("\1")/
|
||||
p
|
||||
}' "Documentation/$1.txt"
|
||||
}
|
||||
|
||||
define_categories () {
|
||||
echo
|
||||
echo "/* Command categories */"
|
||||
bit=0
|
||||
category_list "$1" |
|
||||
while read cat
|
||||
do
|
||||
echo "#define CAT_$cat (1UL << $bit)"
|
||||
bit=$(($bit+1))
|
||||
done
|
||||
test "$bit" -gt 32 && die "Urgh.. too many categories?"
|
||||
}
|
||||
|
||||
define_category_names () {
|
||||
echo
|
||||
echo "/* Category names */"
|
||||
echo "static const char *category_names[] = {"
|
||||
bit=0
|
||||
category_list "$1" |
|
||||
while read cat
|
||||
do
|
||||
echo " \"$cat\", /* (1UL << $bit) */"
|
||||
bit=$(($bit+1))
|
||||
done
|
||||
echo " NULL"
|
||||
echo "};"
|
||||
}
|
||||
|
||||
print_command_list () {
|
||||
echo "static struct cmdname_help command_list[] = {"
|
||||
|
||||
command_list "$1" |
|
||||
while read cmd rest
|
||||
do
|
||||
printf " { \"$cmd\", $(get_synopsis $cmd), 0"
|
||||
for cat in $(echo "$rest" | get_categories)
|
||||
do
|
||||
printf " | CAT_$cat"
|
||||
done
|
||||
echo " },"
|
||||
done
|
||||
echo "};"
|
||||
}
|
||||
|
||||
echo "/* Automatically generated by generate-cmdlist.sh */
|
||||
struct cmdname_help {
|
||||
char name[16];
|
||||
char help[80];
|
||||
unsigned char group;
|
||||
const char *name;
|
||||
const char *help;
|
||||
uint32_t category;
|
||||
};
|
||||
|
||||
static const char *common_cmd_groups[] = {"
|
||||
|
||||
grps=grps$$.tmp
|
||||
match=match$$.tmp
|
||||
trap "rm -f '$grps' '$match'" 0 1 2 3 15
|
||||
|
||||
sed -n '
|
||||
1,/^### common groups/b
|
||||
/^### command list/q
|
||||
/^#/b
|
||||
/^[ ]*$/b
|
||||
h;s/^[^ ][^ ]*[ ][ ]*\(.*\)/ N_("\1"),/p
|
||||
g;s/^\([^ ][^ ]*\)[ ].*/\1/w '$grps'
|
||||
' "$1"
|
||||
printf '};\n\n'
|
||||
|
||||
n=0
|
||||
substnum=
|
||||
while read grp
|
||||
do
|
||||
echo "^git-..*[ ]$grp"
|
||||
substnum="$substnum${substnum:+;}s/[ ]$grp/$n/"
|
||||
n=$(($n+1))
|
||||
done <"$grps" >"$match"
|
||||
|
||||
printf 'static struct cmdname_help common_cmds[] = {\n'
|
||||
grep -f "$match" "$1" |
|
||||
sed 's/^git-//' |
|
||||
sort |
|
||||
while read cmd tags
|
||||
do
|
||||
tag=$(echo "$tags" | sed "$substnum; s/[^0-9]//g")
|
||||
sed -n '
|
||||
/^NAME/,/git-'"$cmd"'/H
|
||||
${
|
||||
x
|
||||
s/.*git-'"$cmd"' - \(.*\)/ {"'"$cmd"'", N_("\1"), '$tag'},/
|
||||
p
|
||||
}' "Documentation/git-$cmd.txt"
|
||||
done
|
||||
echo "};"
|
||||
"
|
||||
define_categories "$1"
|
||||
echo
|
||||
define_category_names "$1"
|
||||
echo
|
||||
print_command_list "$1"
|
||||
|
213
git-p4.py
213
git-p4.py
@ -316,12 +316,17 @@ def p4_last_change():
|
||||
results = p4CmdList(["changes", "-m", "1"], skip_info=True)
|
||||
return int(results[0]['change'])
|
||||
|
||||
def p4_describe(change):
|
||||
def p4_describe(change, shelved=False):
|
||||
"""Make sure it returns a valid result by checking for
|
||||
the presence of field "time". Return a dict of the
|
||||
results."""
|
||||
|
||||
ds = p4CmdList(["describe", "-s", str(change)], skip_info=True)
|
||||
cmd = ["describe", "-s"]
|
||||
if shelved:
|
||||
cmd += ["-S"]
|
||||
cmd += [str(change)]
|
||||
|
||||
ds = p4CmdList(cmd, skip_info=True)
|
||||
if len(ds) != 1:
|
||||
die("p4 describe -s %d did not return 1 result: %s" % (change, str(ds)))
|
||||
|
||||
@ -662,6 +667,12 @@ def gitBranchExists(branch):
|
||||
stderr=subprocess.PIPE, stdout=subprocess.PIPE);
|
||||
return proc.wait() == 0;
|
||||
|
||||
def gitUpdateRef(ref, newvalue):
|
||||
subprocess.check_call(["git", "update-ref", ref, newvalue])
|
||||
|
||||
def gitDeleteRef(ref):
|
||||
subprocess.check_call(["git", "update-ref", "-d", ref])
|
||||
|
||||
_gitConfig = {}
|
||||
|
||||
def gitConfig(key, typeSpecifier=None):
|
||||
@ -2411,6 +2422,7 @@ class P4Sync(Command, P4UserMap):
|
||||
self.tempBranches = []
|
||||
self.tempBranchLocation = "refs/git-p4-tmp"
|
||||
self.largeFileSystem = None
|
||||
self.suppress_meta_comment = False
|
||||
|
||||
if gitConfig('git-p4.largeFileSystem'):
|
||||
largeFileSystemConstructor = globals()[gitConfig('git-p4.largeFileSystem')]
|
||||
@ -2421,6 +2433,18 @@ class P4Sync(Command, P4UserMap):
|
||||
if gitConfig("git-p4.syncFromOrigin") == "false":
|
||||
self.syncWithOrigin = False
|
||||
|
||||
self.depotPaths = []
|
||||
self.changeRange = ""
|
||||
self.previousDepotPaths = []
|
||||
self.hasOrigin = False
|
||||
|
||||
# map from branch depot path to parent branch
|
||||
self.knownBranches = {}
|
||||
self.initialParents = {}
|
||||
|
||||
self.tz = "%+03d%02d" % (- time.timezone / 3600, ((- time.timezone % 3600) / 60))
|
||||
self.labels = {}
|
||||
|
||||
# Force a checkpoint in fast-import and wait for it to finish
|
||||
def checkpoint(self):
|
||||
self.gitStream.write("checkpoint\n\n")
|
||||
@ -2429,7 +2453,20 @@ class P4Sync(Command, P4UserMap):
|
||||
if self.verbose:
|
||||
print "checkpoint finished: " + out
|
||||
|
||||
def extractFilesFromCommit(self, commit):
|
||||
def cmp_shelved(self, path, filerev, revision):
|
||||
""" Determine if a path at revision #filerev is the same as the file
|
||||
at revision @revision for a shelved changelist. If they don't match,
|
||||
unshelving won't be safe (we will get other changes mixed in).
|
||||
|
||||
This is comparing the revision that the shelved changelist is *based* on, not
|
||||
the shelved changelist itself.
|
||||
"""
|
||||
ret = p4Cmd(["diff2", "{0}#{1}".format(path, filerev), "{0}@{1}".format(path, revision)])
|
||||
if verbose:
|
||||
print("p4 diff2 path %s filerev %s revision %s => %s" % (path, filerev, revision, ret))
|
||||
return ret["status"] == "identical"
|
||||
|
||||
def extractFilesFromCommit(self, commit, shelved=False, shelved_cl = 0, origin_revision = 0):
|
||||
self.cloneExclude = [re.sub(r"\.\.\.$", "", path)
|
||||
for path in self.cloneExclude]
|
||||
files = []
|
||||
@ -2452,6 +2489,19 @@ class P4Sync(Command, P4UserMap):
|
||||
file["rev"] = commit["rev%s" % fnum]
|
||||
file["action"] = commit["action%s" % fnum]
|
||||
file["type"] = commit["type%s" % fnum]
|
||||
if shelved:
|
||||
file["shelved_cl"] = int(shelved_cl)
|
||||
|
||||
# For shelved changelists, check that the revision of each file that the
|
||||
# shelve was based on matches the revision that we are using for the
|
||||
# starting point for git-fast-import (self.initialParent). Otherwise
|
||||
# the resulting diff will contain deltas from multiple commits.
|
||||
|
||||
if file["action"] != "add" and \
|
||||
not self.cmp_shelved(path, file["rev"], origin_revision):
|
||||
sys.exit("change {0} not based on {1} for {2}, cannot unshelve".format(
|
||||
commit["change"], self.initialParent, path))
|
||||
|
||||
files.append(file)
|
||||
fnum = fnum + 1
|
||||
return files
|
||||
@ -2743,7 +2793,16 @@ class P4Sync(Command, P4UserMap):
|
||||
def streamP4FilesCbSelf(entry):
|
||||
self.streamP4FilesCb(entry)
|
||||
|
||||
fileArgs = ['%s#%s' % (f['path'], f['rev']) for f in filesToRead]
|
||||
fileArgs = []
|
||||
for f in filesToRead:
|
||||
if 'shelved_cl' in f:
|
||||
# Handle shelved CLs using the "p4 print file@=N" syntax to print
|
||||
# the contents
|
||||
fileArg = '%s@=%d' % (f['path'], f['shelved_cl'])
|
||||
else:
|
||||
fileArg = '%s#%s' % (f['path'], f['rev'])
|
||||
|
||||
fileArgs.append(fileArg)
|
||||
|
||||
p4CmdList(["-x", "-", "print"],
|
||||
stdin=fileArgs,
|
||||
@ -2844,11 +2903,15 @@ class P4Sync(Command, P4UserMap):
|
||||
self.gitStream.write(details["desc"])
|
||||
if len(jobs) > 0:
|
||||
self.gitStream.write("\nJobs: %s" % (' '.join(jobs)))
|
||||
self.gitStream.write("\n[git-p4: depot-paths = \"%s\": change = %s" %
|
||||
(','.join(self.branchPrefixes), details["change"]))
|
||||
if len(details['options']) > 0:
|
||||
self.gitStream.write(": options = %s" % details['options'])
|
||||
self.gitStream.write("]\nEOT\n\n")
|
||||
|
||||
if not self.suppress_meta_comment:
|
||||
self.gitStream.write("\n[git-p4: depot-paths = \"%s\": change = %s" %
|
||||
(','.join(self.branchPrefixes), details["change"]))
|
||||
if len(details['options']) > 0:
|
||||
self.gitStream.write(": options = %s" % details['options'])
|
||||
self.gitStream.write("]\n")
|
||||
|
||||
self.gitStream.write("EOT\n\n")
|
||||
|
||||
if len(parent) > 0:
|
||||
if self.verbose:
|
||||
@ -3162,10 +3225,10 @@ class P4Sync(Command, P4UserMap):
|
||||
else:
|
||||
return None
|
||||
|
||||
def importChanges(self, changes):
|
||||
def importChanges(self, changes, shelved=False, origin_revision=0):
|
||||
cnt = 1
|
||||
for change in changes:
|
||||
description = p4_describe(change)
|
||||
description = p4_describe(change, shelved)
|
||||
self.updateOptionDict(description)
|
||||
|
||||
if not self.silent:
|
||||
@ -3235,7 +3298,7 @@ class P4Sync(Command, P4UserMap):
|
||||
print "Parent of %s not found. Committing into head of %s" % (branch, parent)
|
||||
self.commit(description, filesForCommit, branch, parent)
|
||||
else:
|
||||
files = self.extractFilesFromCommit(description)
|
||||
files = self.extractFilesFromCommit(description, shelved, change, origin_revision)
|
||||
self.commit(description, files, self.branch,
|
||||
self.initialParent)
|
||||
# only needed once, to connect to the previous commit
|
||||
@ -3300,17 +3363,23 @@ class P4Sync(Command, P4UserMap):
|
||||
print "IO error with git fast-import. Is your git version recent enough?"
|
||||
print self.gitError.read()
|
||||
|
||||
def openStreams(self):
|
||||
self.importProcess = subprocess.Popen(["git", "fast-import"],
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE);
|
||||
self.gitOutput = self.importProcess.stdout
|
||||
self.gitStream = self.importProcess.stdin
|
||||
self.gitError = self.importProcess.stderr
|
||||
|
||||
def closeStreams(self):
|
||||
self.gitStream.close()
|
||||
if self.importProcess.wait() != 0:
|
||||
die("fast-import failed: %s" % self.gitError.read())
|
||||
self.gitOutput.close()
|
||||
self.gitError.close()
|
||||
|
||||
def run(self, args):
|
||||
self.depotPaths = []
|
||||
self.changeRange = ""
|
||||
self.previousDepotPaths = []
|
||||
self.hasOrigin = False
|
||||
|
||||
# map from branch depot path to parent branch
|
||||
self.knownBranches = {}
|
||||
self.initialParents = {}
|
||||
|
||||
if self.importIntoRemotes:
|
||||
self.refPrefix = "refs/remotes/p4/"
|
||||
else:
|
||||
@ -3497,15 +3566,7 @@ class P4Sync(Command, P4UserMap):
|
||||
b = b[len(self.projectName):]
|
||||
self.createdBranches.add(b)
|
||||
|
||||
self.tz = "%+03d%02d" % (- time.timezone / 3600, ((- time.timezone % 3600) / 60))
|
||||
|
||||
self.importProcess = subprocess.Popen(["git", "fast-import"],
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE);
|
||||
self.gitOutput = self.importProcess.stdout
|
||||
self.gitStream = self.importProcess.stdin
|
||||
self.gitError = self.importProcess.stderr
|
||||
self.openStreams()
|
||||
|
||||
if revision:
|
||||
self.importHeadRevision(revision)
|
||||
@ -3585,11 +3646,7 @@ class P4Sync(Command, P4UserMap):
|
||||
missingP4Labels = p4Labels - gitTags
|
||||
self.importP4Labels(self.gitStream, missingP4Labels)
|
||||
|
||||
self.gitStream.close()
|
||||
if self.importProcess.wait() != 0:
|
||||
die("fast-import failed: %s" % self.gitError.read())
|
||||
self.gitOutput.close()
|
||||
self.gitError.close()
|
||||
self.closeStreams()
|
||||
|
||||
# Cleanup temporary branches created during import
|
||||
if self.tempBranches != []:
|
||||
@ -3721,6 +3778,89 @@ class P4Clone(P4Sync):
|
||||
|
||||
return True
|
||||
|
||||
class P4Unshelve(Command):
|
||||
def __init__(self):
|
||||
Command.__init__(self)
|
||||
self.options = []
|
||||
self.origin = "HEAD"
|
||||
self.description = "Unshelve a P4 changelist into a git commit"
|
||||
self.usage = "usage: %prog [options] changelist"
|
||||
self.options += [
|
||||
optparse.make_option("--origin", dest="origin",
|
||||
help="Use this base revision instead of the default (%s)" % self.origin),
|
||||
]
|
||||
self.verbose = False
|
||||
self.noCommit = False
|
||||
self.destbranch = "refs/remotes/p4/unshelved"
|
||||
|
||||
def renameBranch(self, branch_name):
|
||||
""" Rename the existing branch to branch_name.N
|
||||
"""
|
||||
|
||||
found = True
|
||||
for i in range(0,1000):
|
||||
backup_branch_name = "{0}.{1}".format(branch_name, i)
|
||||
if not gitBranchExists(backup_branch_name):
|
||||
gitUpdateRef(backup_branch_name, branch_name) # copy ref to backup
|
||||
gitDeleteRef(branch_name)
|
||||
found = True
|
||||
print("renamed old unshelve branch to {0}".format(backup_branch_name))
|
||||
break
|
||||
|
||||
if not found:
|
||||
sys.exit("gave up trying to rename existing branch {0}".format(sync.branch))
|
||||
|
||||
def findLastP4Revision(self, starting_point):
|
||||
""" Look back from starting_point for the first commit created by git-p4
|
||||
to find the P4 commit we are based on, and the depot-paths.
|
||||
"""
|
||||
|
||||
for parent in (range(65535)):
|
||||
log = extractLogMessageFromGitCommit("{0}^{1}".format(starting_point, parent))
|
||||
settings = extractSettingsGitLog(log)
|
||||
if settings.has_key('change'):
|
||||
return settings
|
||||
|
||||
sys.exit("could not find git-p4 commits in {0}".format(self.origin))
|
||||
|
||||
def run(self, args):
|
||||
if len(args) != 1:
|
||||
return False
|
||||
|
||||
if not gitBranchExists(self.origin):
|
||||
sys.exit("origin branch {0} does not exist".format(self.origin))
|
||||
|
||||
sync = P4Sync()
|
||||
changes = args
|
||||
sync.initialParent = self.origin
|
||||
|
||||
# use the first change in the list to construct the branch to unshelve into
|
||||
change = changes[0]
|
||||
|
||||
# if the target branch already exists, rename it
|
||||
branch_name = "{0}/{1}".format(self.destbranch, change)
|
||||
if gitBranchExists(branch_name):
|
||||
self.renameBranch(branch_name)
|
||||
sync.branch = branch_name
|
||||
|
||||
sync.verbose = self.verbose
|
||||
sync.suppress_meta_comment = True
|
||||
|
||||
settings = self.findLastP4Revision(self.origin)
|
||||
origin_revision = settings['change']
|
||||
sync.depotPaths = settings['depot-paths']
|
||||
sync.branchPrefixes = sync.depotPaths
|
||||
|
||||
sync.openStreams()
|
||||
sync.loadUserMapFromCache()
|
||||
sync.silent = True
|
||||
sync.importChanges(changes, shelved=True, origin_revision=origin_revision)
|
||||
sync.closeStreams()
|
||||
|
||||
print("unshelved changelist {0} into {1}".format(change, branch_name))
|
||||
|
||||
return True
|
||||
|
||||
class P4Branches(Command):
|
||||
def __init__(self):
|
||||
Command.__init__(self)
|
||||
@ -3775,7 +3915,8 @@ commands = {
|
||||
"rebase" : P4Rebase,
|
||||
"clone" : P4Clone,
|
||||
"rollback" : P4RollBack,
|
||||
"branches" : P4Branches
|
||||
"branches" : P4Branches,
|
||||
"unshelve" : P4Unshelve,
|
||||
}
|
||||
|
||||
|
||||
|
@ -162,7 +162,7 @@ r, reword <commit> = use commit, but edit the commit message
|
||||
e, edit <commit> = use commit, but stop for amending
|
||||
s, squash <commit> = use commit, but meld into previous commit
|
||||
f, fixup <commit> = like \"squash\", but discard this commit's log message
|
||||
x, exec <commit> = run command (the rest of the line) using shell
|
||||
x, exec <command> = run command (the rest of the line) using shell
|
||||
d, drop <commit> = remove commit
|
||||
l, label <label> = label current HEAD with a name
|
||||
t, reset <label> = reset HEAD to a label
|
||||
|
85
git.c
85
git.c
@ -3,6 +3,7 @@
|
||||
#include "exec-cmd.h"
|
||||
#include "help.h"
|
||||
#include "run-command.h"
|
||||
#include "alias.h"
|
||||
|
||||
#define RUN_SETUP (1<<0)
|
||||
#define RUN_SETUP_GENTLY (1<<1)
|
||||
@ -36,7 +37,66 @@ const char git_more_info_string[] =
|
||||
|
||||
static int use_pager = -1;
|
||||
|
||||
static void list_builtins(unsigned int exclude_option, char sep);
|
||||
static void list_builtins(struct string_list *list, unsigned int exclude_option);
|
||||
|
||||
static void exclude_helpers_from_list(struct string_list *list)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
while (i < list->nr) {
|
||||
if (strstr(list->items[i].string, "--"))
|
||||
unsorted_string_list_delete_item(list, i, 0);
|
||||
else
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
static int match_token(const char *spec, int len, const char *token)
|
||||
{
|
||||
int token_len = strlen(token);
|
||||
|
||||
return len == token_len && !strncmp(spec, token, token_len);
|
||||
}
|
||||
|
||||
static int list_cmds(const char *spec)
|
||||
{
|
||||
struct string_list list = STRING_LIST_INIT_DUP;
|
||||
int i;
|
||||
|
||||
while (*spec) {
|
||||
const char *sep = strchrnul(spec, ',');
|
||||
int len = sep - spec;
|
||||
|
||||
if (match_token(spec, len, "builtins"))
|
||||
list_builtins(&list, 0);
|
||||
else if (match_token(spec, len, "main"))
|
||||
list_all_main_cmds(&list);
|
||||
else if (match_token(spec, len, "others"))
|
||||
list_all_other_cmds(&list);
|
||||
else if (match_token(spec, len, "nohelpers"))
|
||||
exclude_helpers_from_list(&list);
|
||||
else if (match_token(spec, len, "alias"))
|
||||
list_aliases(&list);
|
||||
else if (match_token(spec, len, "config"))
|
||||
list_cmds_by_config(&list);
|
||||
else if (len > 5 && !strncmp(spec, "list-", 5)) {
|
||||
struct strbuf sb = STRBUF_INIT;
|
||||
|
||||
strbuf_add(&sb, spec + 5, len - 5);
|
||||
list_cmds_by_category(&list, sb.buf);
|
||||
strbuf_release(&sb);
|
||||
}
|
||||
else
|
||||
die(_("unsupported command listing type '%s'"), spec);
|
||||
spec += len;
|
||||
if (*spec == ',')
|
||||
spec++;
|
||||
}
|
||||
for (i = 0; i < list.nr; i++)
|
||||
puts(list.items[i].string);
|
||||
string_list_clear(&list, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void commit_pager_choice(void) {
|
||||
switch (use_pager) {
|
||||
@ -223,12 +283,19 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
|
||||
}
|
||||
(*argv)++;
|
||||
(*argc)--;
|
||||
} else if (!strcmp(cmd, "--list-builtins")) {
|
||||
list_builtins(0, '\n');
|
||||
exit(0);
|
||||
} else if (!strcmp(cmd, "--list-parseopt-builtins")) {
|
||||
list_builtins(NO_PARSEOPT, ' ');
|
||||
exit(0);
|
||||
} else if (skip_prefix(cmd, "--list-cmds=", &cmd)) {
|
||||
if (!strcmp(cmd, "parseopt")) {
|
||||
struct string_list list = STRING_LIST_INIT_DUP;
|
||||
int i;
|
||||
|
||||
list_builtins(&list, NO_PARSEOPT);
|
||||
for (i = 0; i < list.nr; i++)
|
||||
printf("%s ", list.items[i].string);
|
||||
string_list_clear(&list, 0);
|
||||
exit(0);
|
||||
} else {
|
||||
exit(list_cmds(cmd));
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, _("unknown option: %s\n"), cmd);
|
||||
usage(git_usage_string);
|
||||
@ -511,14 +578,14 @@ int is_builtin(const char *s)
|
||||
return !!get_builtin(s);
|
||||
}
|
||||
|
||||
static void list_builtins(unsigned int exclude_option, char sep)
|
||||
static void list_builtins(struct string_list *out, unsigned int exclude_option)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < ARRAY_SIZE(commands); i++) {
|
||||
if (exclude_option &&
|
||||
(commands[i].option & exclude_option))
|
||||
continue;
|
||||
printf("%s%c", commands[i].cmd, sep);
|
||||
string_list_append(out, commands[i].cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
256
help.c
256
help.c
@ -5,13 +5,127 @@
|
||||
#include "run-command.h"
|
||||
#include "levenshtein.h"
|
||||
#include "help.h"
|
||||
#include "common-cmds.h"
|
||||
#include "command-list.h"
|
||||
#include "string-list.h"
|
||||
#include "column.h"
|
||||
#include "version.h"
|
||||
#include "refs.h"
|
||||
#include "parse-options.h"
|
||||
|
||||
struct category_description {
|
||||
uint32_t category;
|
||||
const char *desc;
|
||||
};
|
||||
static uint32_t common_mask =
|
||||
CAT_init | CAT_worktree | CAT_info |
|
||||
CAT_history | CAT_remote;
|
||||
static struct category_description common_categories[] = {
|
||||
{ CAT_init, N_("start a working area (see also: git help tutorial)") },
|
||||
{ CAT_worktree, N_("work on the current change (see also: git help everyday)") },
|
||||
{ CAT_info, N_("examine the history and state (see also: git help revisions)") },
|
||||
{ CAT_history, N_("grow, mark and tweak your common history") },
|
||||
{ CAT_remote, N_("collaborate (see also: git help workflows)") },
|
||||
{ 0, NULL }
|
||||
};
|
||||
static struct category_description main_categories[] = {
|
||||
{ CAT_mainporcelain, N_("Main Porcelain Commands") },
|
||||
{ CAT_ancillarymanipulators, N_("Ancillary Commands / Manipulators") },
|
||||
{ CAT_ancillaryinterrogators, N_("Ancillary Commands / Interrogators") },
|
||||
{ CAT_foreignscminterface, N_("Interacting with Others") },
|
||||
{ CAT_plumbingmanipulators, N_("Low-level Commands / Manipulators") },
|
||||
{ CAT_plumbinginterrogators, N_("Low-level Commands / Interrogators") },
|
||||
{ CAT_synchingrepositories, N_("Low-level Commands / Synching Repositories") },
|
||||
{ CAT_purehelpers, N_("Low-level Commands / Internal Helpers") },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static const char *drop_prefix(const char *name, uint32_t category)
|
||||
{
|
||||
const char *new_name;
|
||||
|
||||
if (skip_prefix(name, "git-", &new_name))
|
||||
return new_name;
|
||||
if (category == CAT_guide && skip_prefix(name, "git", &new_name))
|
||||
return new_name;
|
||||
return name;
|
||||
|
||||
}
|
||||
|
||||
static void extract_cmds(struct cmdname_help **p_cmds, uint32_t mask)
|
||||
{
|
||||
int i, nr = 0;
|
||||
struct cmdname_help *cmds;
|
||||
|
||||
if (ARRAY_SIZE(command_list) == 0)
|
||||
BUG("empty command_list[] is a sign of broken generate-cmdlist.sh");
|
||||
|
||||
ALLOC_ARRAY(cmds, ARRAY_SIZE(command_list) + 1);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(command_list); i++) {
|
||||
const struct cmdname_help *cmd = command_list + i;
|
||||
|
||||
if (!(cmd->category & mask))
|
||||
continue;
|
||||
|
||||
cmds[nr] = *cmd;
|
||||
cmds[nr].name = drop_prefix(cmd->name, cmd->category);
|
||||
|
||||
nr++;
|
||||
}
|
||||
cmds[nr].name = NULL;
|
||||
*p_cmds = cmds;
|
||||
}
|
||||
|
||||
static void print_command_list(const struct cmdname_help *cmds,
|
||||
uint32_t mask, int longest)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; cmds[i].name; i++) {
|
||||
if (cmds[i].category & mask) {
|
||||
printf(" %s ", cmds[i].name);
|
||||
mput_char(' ', longest - strlen(cmds[i].name));
|
||||
puts(_(cmds[i].help));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int cmd_name_cmp(const void *elem1, const void *elem2)
|
||||
{
|
||||
const struct cmdname_help *e1 = elem1;
|
||||
const struct cmdname_help *e2 = elem2;
|
||||
|
||||
return strcmp(e1->name, e2->name);
|
||||
}
|
||||
|
||||
static void print_cmd_by_category(const struct category_description *catdesc)
|
||||
{
|
||||
struct cmdname_help *cmds;
|
||||
int longest = 0;
|
||||
int i, nr = 0;
|
||||
uint32_t mask = 0;
|
||||
|
||||
for (i = 0; catdesc[i].desc; i++)
|
||||
mask |= catdesc[i].category;
|
||||
|
||||
extract_cmds(&cmds, mask);
|
||||
|
||||
for (i = 0; cmds[i].name; i++, nr++) {
|
||||
if (longest < strlen(cmds[i].name))
|
||||
longest = strlen(cmds[i].name);
|
||||
}
|
||||
QSORT(cmds, nr, cmd_name_cmp);
|
||||
|
||||
for (i = 0; catdesc[i].desc; i++) {
|
||||
uint32_t mask = catdesc[i].category;
|
||||
const char *desc = catdesc[i].desc;
|
||||
|
||||
printf("\n%s\n", _(desc));
|
||||
print_command_list(cmds, mask, longest);
|
||||
}
|
||||
free(cmds);
|
||||
}
|
||||
|
||||
void add_cmdname(struct cmdnames *cmds, const char *name, int len)
|
||||
{
|
||||
struct cmdname *ent;
|
||||
@ -190,42 +304,114 @@ void list_commands(unsigned int colopts,
|
||||
}
|
||||
}
|
||||
|
||||
static int cmd_group_cmp(const void *elem1, const void *elem2)
|
||||
{
|
||||
const struct cmdname_help *e1 = elem1;
|
||||
const struct cmdname_help *e2 = elem2;
|
||||
|
||||
if (e1->group < e2->group)
|
||||
return -1;
|
||||
if (e1->group > e2->group)
|
||||
return 1;
|
||||
return strcmp(e1->name, e2->name);
|
||||
}
|
||||
|
||||
void list_common_cmds_help(void)
|
||||
{
|
||||
int i, longest = 0;
|
||||
int current_grp = -1;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
|
||||
if (longest < strlen(common_cmds[i].name))
|
||||
longest = strlen(common_cmds[i].name);
|
||||
}
|
||||
|
||||
QSORT(common_cmds, ARRAY_SIZE(common_cmds), cmd_group_cmp);
|
||||
|
||||
puts(_("These are common Git commands used in various situations:"));
|
||||
print_cmd_by_category(common_categories);
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
|
||||
if (common_cmds[i].group != current_grp) {
|
||||
printf("\n%s\n", _(common_cmd_groups[common_cmds[i].group]));
|
||||
current_grp = common_cmds[i].group;
|
||||
void list_all_main_cmds(struct string_list *list)
|
||||
{
|
||||
struct cmdnames main_cmds, other_cmds;
|
||||
int i;
|
||||
|
||||
memset(&main_cmds, 0, sizeof(main_cmds));
|
||||
memset(&other_cmds, 0, sizeof(other_cmds));
|
||||
load_command_list("git-", &main_cmds, &other_cmds);
|
||||
|
||||
for (i = 0; i < main_cmds.cnt; i++)
|
||||
string_list_append(list, main_cmds.names[i]->name);
|
||||
|
||||
clean_cmdnames(&main_cmds);
|
||||
clean_cmdnames(&other_cmds);
|
||||
}
|
||||
|
||||
void list_all_other_cmds(struct string_list *list)
|
||||
{
|
||||
struct cmdnames main_cmds, other_cmds;
|
||||
int i;
|
||||
|
||||
memset(&main_cmds, 0, sizeof(main_cmds));
|
||||
memset(&other_cmds, 0, sizeof(other_cmds));
|
||||
load_command_list("git-", &main_cmds, &other_cmds);
|
||||
|
||||
for (i = 0; i < other_cmds.cnt; i++)
|
||||
string_list_append(list, other_cmds.names[i]->name);
|
||||
|
||||
clean_cmdnames(&main_cmds);
|
||||
clean_cmdnames(&other_cmds);
|
||||
}
|
||||
|
||||
void list_cmds_by_category(struct string_list *list,
|
||||
const char *cat)
|
||||
{
|
||||
int i, n = ARRAY_SIZE(command_list);
|
||||
uint32_t cat_id = 0;
|
||||
|
||||
for (i = 0; category_names[i]; i++) {
|
||||
if (!strcmp(cat, category_names[i])) {
|
||||
cat_id = 1UL << i;
|
||||
break;
|
||||
}
|
||||
|
||||
printf(" %s ", common_cmds[i].name);
|
||||
mput_char(' ', longest - strlen(common_cmds[i].name));
|
||||
puts(_(common_cmds[i].help));
|
||||
}
|
||||
if (!cat_id)
|
||||
die(_("unsupported command listing type '%s'"), cat);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
struct cmdname_help *cmd = command_list + i;
|
||||
|
||||
if (!(cmd->category & cat_id))
|
||||
continue;
|
||||
string_list_append(list, drop_prefix(cmd->name, cmd->category));
|
||||
}
|
||||
}
|
||||
|
||||
void list_cmds_by_config(struct string_list *list)
|
||||
{
|
||||
const char *cmd_list;
|
||||
|
||||
/*
|
||||
* There's no actual repository setup at this point (and even
|
||||
* if there is, we don't really care; only global config
|
||||
* matters). If we accidentally set up a repository, it's ok
|
||||
* too since the caller (git --list-cmds=) should exit shortly
|
||||
* anyway.
|
||||
*/
|
||||
if (git_config_get_string_const("completion.commands", &cmd_list))
|
||||
return;
|
||||
|
||||
string_list_sort(list);
|
||||
string_list_remove_duplicates(list, 0);
|
||||
|
||||
while (*cmd_list) {
|
||||
struct strbuf sb = STRBUF_INIT;
|
||||
const char *p = strchrnul(cmd_list, ' ');
|
||||
|
||||
strbuf_add(&sb, cmd_list, p - cmd_list);
|
||||
if (*cmd_list == '-')
|
||||
string_list_remove(list, cmd_list + 1, 0);
|
||||
else
|
||||
string_list_insert(list, sb.buf);
|
||||
strbuf_release(&sb);
|
||||
while (*p == ' ')
|
||||
p++;
|
||||
cmd_list = p;
|
||||
}
|
||||
}
|
||||
|
||||
void list_common_guides_help(void)
|
||||
{
|
||||
struct category_description catdesc[] = {
|
||||
{ CAT_guide, N_("The common Git guides are:") },
|
||||
{ 0, NULL }
|
||||
};
|
||||
print_cmd_by_category(catdesc);
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
void list_all_cmds_help(void)
|
||||
{
|
||||
print_cmd_by_category(main_categories);
|
||||
}
|
||||
|
||||
int is_in_cmdlist(struct cmdnames *c, const char *s)
|
||||
@ -285,6 +471,7 @@ const char *help_unknown_cmd(const char *cmd)
|
||||
{
|
||||
int i, n, best_similarity = 0;
|
||||
struct cmdnames main_cmds, other_cmds;
|
||||
struct cmdname_help *common_cmds;
|
||||
|
||||
memset(&main_cmds, 0, sizeof(main_cmds));
|
||||
memset(&other_cmds, 0, sizeof(other_cmds));
|
||||
@ -299,6 +486,8 @@ const char *help_unknown_cmd(const char *cmd)
|
||||
QSORT(main_cmds.names, main_cmds.cnt, cmdname_compare);
|
||||
uniq(&main_cmds);
|
||||
|
||||
extract_cmds(&common_cmds, common_mask);
|
||||
|
||||
/* This abuses cmdname->len for levenshtein distance */
|
||||
for (i = 0, n = 0; i < main_cmds.cnt; i++) {
|
||||
int cmp = 0; /* avoid compiler stupidity */
|
||||
@ -313,10 +502,10 @@ const char *help_unknown_cmd(const char *cmd)
|
||||
die(_(bad_interpreter_advice), cmd, cmd);
|
||||
|
||||
/* Does the candidate appear in common_cmds list? */
|
||||
while (n < ARRAY_SIZE(common_cmds) &&
|
||||
while (common_cmds[n].name &&
|
||||
(cmp = strcmp(common_cmds[n].name, candidate)) < 0)
|
||||
n++;
|
||||
if ((n < ARRAY_SIZE(common_cmds)) && !cmp) {
|
||||
if (common_cmds[n].name && !cmp) {
|
||||
/* Yes, this is one of the common commands */
|
||||
n++; /* use the entry from common_cmds[] */
|
||||
if (starts_with(candidate, cmd)) {
|
||||
@ -329,6 +518,7 @@ const char *help_unknown_cmd(const char *cmd)
|
||||
main_cmds.names[i]->len =
|
||||
levenshtein(cmd, candidate, 0, 2, 1, 3) + 1;
|
||||
}
|
||||
FREE_AND_NULL(common_cmds);
|
||||
|
||||
QSORT(main_cmds.names, main_cmds.cnt, levenshtein_compare);
|
||||
|
||||
|
10
help.h
10
help.h
@ -1,6 +1,8 @@
|
||||
#ifndef HELP_H
|
||||
#define HELP_H
|
||||
|
||||
struct string_list;
|
||||
|
||||
struct cmdnames {
|
||||
int alloc;
|
||||
int cnt;
|
||||
@ -17,6 +19,14 @@ static inline void mput_char(char c, unsigned int num)
|
||||
}
|
||||
|
||||
extern void list_common_cmds_help(void);
|
||||
extern void list_all_cmds_help(void);
|
||||
extern void list_common_guides_help(void);
|
||||
|
||||
extern void list_all_main_cmds(struct string_list *list);
|
||||
extern void list_all_other_cmds(struct string_list *list);
|
||||
extern void list_cmds_by_category(struct string_list *list,
|
||||
const char *category);
|
||||
extern void list_cmds_by_config(struct string_list *list);
|
||||
extern const char *help_unknown_cmd(const char *cmd);
|
||||
extern void load_command_list(const char *prefix,
|
||||
struct cmdnames *main_cmds,
|
||||
|
@ -1208,7 +1208,7 @@ static int merge_submodule(struct merge_options *o,
|
||||
output(o, 3, _("Fast-forwarding submodule %s to the following commit:"), path);
|
||||
output_commit_title(o, commit_b);
|
||||
} else if (show(o, 2))
|
||||
output(o, 2, _("Fast-forwarding submodule %s to %s"), path, oid_to_hex(b));
|
||||
output(o, 2, _("Fast-forwarding submodule %s"), path);
|
||||
else
|
||||
; /* no output */
|
||||
|
||||
@ -1220,7 +1220,7 @@ static int merge_submodule(struct merge_options *o,
|
||||
output(o, 3, _("Fast-forwarding submodule %s to the following commit:"), path);
|
||||
output_commit_title(o, commit_a);
|
||||
} else if (show(o, 2))
|
||||
output(o, 2, _("Fast-forwarding submodule %s to %s"), path, oid_to_hex(a));
|
||||
output(o, 2, _("Fast-forwarding submodule %s"), path);
|
||||
else
|
||||
; /* no output */
|
||||
|
||||
|
1
pager.c
1
pager.c
@ -2,6 +2,7 @@
|
||||
#include "config.h"
|
||||
#include "run-command.h"
|
||||
#include "sigchain.h"
|
||||
#include "alias.h"
|
||||
|
||||
#ifndef DEFAULT_PAGER
|
||||
#define DEFAULT_PAGER "less"
|
||||
|
@ -49,6 +49,8 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet
|
||||
size_t rlen = strlen(++rhs);
|
||||
is_glob = (1 <= rlen && strchr(rhs, '*'));
|
||||
item->dst = xstrndup(rhs, rlen);
|
||||
} else {
|
||||
item->dst = NULL;
|
||||
}
|
||||
|
||||
llen = (rhs ? (rhs - lhs - 1) : strlen(lhs));
|
||||
@ -202,6 +204,8 @@ void refspec_ref_prefixes(const struct refspec *rs,
|
||||
const struct refspec_item *item = &rs->items[i];
|
||||
const char *prefix = NULL;
|
||||
|
||||
if (item->exact_sha1)
|
||||
continue;
|
||||
if (rs->fetch == REFSPEC_FETCH)
|
||||
prefix = item->src;
|
||||
else if (item->dst)
|
||||
|
@ -42,6 +42,10 @@ void refspec_clear(struct refspec *rs);
|
||||
int valid_fetch_refspec(const char *refspec);
|
||||
|
||||
struct argv_array;
|
||||
/*
|
||||
* Determine what <prefix> values to pass to the peer in ref-prefix lines
|
||||
* (see Documentation/technical/protocol-v2.txt).
|
||||
*/
|
||||
void refspec_ref_prefixes(const struct refspec *rs,
|
||||
struct argv_array *ref_prefixes);
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "worktree.h"
|
||||
#include "oidmap.h"
|
||||
#include "oidset.h"
|
||||
#include "alias.h"
|
||||
|
||||
#define GIT_REFLOG_ACTION "GIT_REFLOG_ACTION"
|
||||
|
||||
@ -3791,7 +3792,7 @@ static const char *label_oid(struct object_id *oid, const char *label,
|
||||
p[i] = save;
|
||||
}
|
||||
}
|
||||
} else if (((len = strlen(label)) == GIT_SHA1_RAWSZ &&
|
||||
} else if (((len = strlen(label)) == the_hash_algo->hexsz &&
|
||||
!get_oid_hex(label, &dummy)) ||
|
||||
(len == 1 && *label == '#') ||
|
||||
hashmap_get_from_hash(&state->labels,
|
||||
|
1
shell.c
1
shell.c
@ -3,6 +3,7 @@
|
||||
#include "exec-cmd.h"
|
||||
#include "strbuf.h"
|
||||
#include "run-command.h"
|
||||
#include "alias.h"
|
||||
|
||||
#define COMMAND_DIR "git-shell-commands"
|
||||
#define HELP_COMMAND COMMAND_DIR "/help"
|
||||
|
@ -1169,8 +1169,10 @@ int submodule_touches_in_range(struct object_id *excl_oid,
|
||||
|
||||
argv_array_push(&args, "--"); /* args[0] program name */
|
||||
argv_array_push(&args, oid_to_hex(incl_oid));
|
||||
argv_array_push(&args, "--not");
|
||||
argv_array_push(&args, oid_to_hex(excl_oid));
|
||||
if (!is_null_oid(excl_oid)) {
|
||||
argv_array_push(&args, "--not");
|
||||
argv_array_push(&args, oid_to_hex(excl_oid));
|
||||
}
|
||||
|
||||
collect_changed_submodules(&subs, &args);
|
||||
ret = subs.nr;
|
||||
|
@ -92,7 +92,10 @@ extern int bad_to_remove_submodule(const char *path, unsigned flags);
|
||||
|
||||
int add_submodule_odb(const char *path);
|
||||
|
||||
/* Checks if there are submodule changes in a..b. */
|
||||
/*
|
||||
* Checks if there are submodule changes in a..b. If a is the null OID,
|
||||
* checks b and all its ancestors instead.
|
||||
*/
|
||||
extern int submodule_touches_in_range(struct object_id *a,
|
||||
struct object_id *b);
|
||||
extern int find_unpushed_submodules(struct oid_array *commits,
|
||||
|
@ -4,11 +4,11 @@ mkdir -p .git/refs/tags
|
||||
|
||||
>sed.script
|
||||
|
||||
# Answer the sha1 has associated with the tag. The tag must exist in .git/refs/tags
|
||||
# Answer the sha1 has associated with the tag. The tag must exist under refs/tags
|
||||
tag () {
|
||||
_tag=$1
|
||||
test -f ".git/refs/tags/$_tag" || error "tag: \"$_tag\" does not exist"
|
||||
cat ".git/refs/tags/$_tag"
|
||||
git rev-parse --verify "refs/tags/$_tag" ||
|
||||
error "tag: \"$_tag\" does not exist"
|
||||
}
|
||||
|
||||
# Generate a commit using the text specified to make it unique and the tree
|
||||
|
@ -25,6 +25,15 @@ test_expect_success "setup" '
|
||||
EOF
|
||||
'
|
||||
|
||||
# make sure to exercise these code paths, the output is a bit tricky
|
||||
# to verify
|
||||
test_expect_success 'basic help commands' '
|
||||
git help >/dev/null &&
|
||||
git help -a >/dev/null &&
|
||||
git help -g >/dev/null &&
|
||||
git help -av >/dev/null
|
||||
'
|
||||
|
||||
test_expect_success "works for commands and guides by default" '
|
||||
configure_help &&
|
||||
git help status &&
|
||||
@ -49,8 +58,23 @@ test_expect_success "--help does not work for guides" "
|
||||
test_i18ncmp expect actual
|
||||
"
|
||||
|
||||
test_expect_success 'git help' '
|
||||
git help >help.output &&
|
||||
test_i18ngrep "^ clone " help.output &&
|
||||
test_i18ngrep "^ add " help.output &&
|
||||
test_i18ngrep "^ log " help.output &&
|
||||
test_i18ngrep "^ commit " help.output &&
|
||||
test_i18ngrep "^ fetch " help.output
|
||||
'
|
||||
test_expect_success 'git help -g' '
|
||||
git help -g >help.output &&
|
||||
test_i18ngrep "^ attributes " help.output &&
|
||||
test_i18ngrep "^ everyday " help.output &&
|
||||
test_i18ngrep "^ tutorial " help.output
|
||||
'
|
||||
|
||||
test_expect_success 'generate builtin list' '
|
||||
git --list-builtins >builtins
|
||||
git --list-cmds=builtins >builtins
|
||||
'
|
||||
|
||||
while read builtin
|
||||
|
@ -65,7 +65,7 @@ reset_to_sane
|
||||
test_expect_success 'symbolic-ref fails to delete real ref' '
|
||||
echo "fatal: Cannot delete refs/heads/foo, not a symbolic ref" >expect &&
|
||||
test_must_fail git symbolic-ref -d refs/heads/foo >actual 2>&1 &&
|
||||
test_path_is_file .git/refs/heads/foo &&
|
||||
git rev-parse --verify refs/heads/foo &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
reset_to_sane
|
||||
|
@ -234,34 +234,34 @@ test_expect_success 'git branch -M master2 master2 should work when master is ch
|
||||
|
||||
test_expect_success 'git branch -v -d t should work' '
|
||||
git branch t &&
|
||||
test_path_is_file .git/refs/heads/t &&
|
||||
git rev-parse --verify refs/heads/t &&
|
||||
git branch -v -d t &&
|
||||
test_path_is_missing .git/refs/heads/t
|
||||
test_must_fail git rev-parse --verify refs/heads/t
|
||||
'
|
||||
|
||||
test_expect_success 'git branch -v -m t s should work' '
|
||||
git branch t &&
|
||||
test_path_is_file .git/refs/heads/t &&
|
||||
git rev-parse --verify refs/heads/t &&
|
||||
git branch -v -m t s &&
|
||||
test_path_is_missing .git/refs/heads/t &&
|
||||
test_path_is_file .git/refs/heads/s &&
|
||||
test_must_fail git rev-parse --verify refs/heads/t &&
|
||||
git rev-parse --verify refs/heads/s &&
|
||||
git branch -d s
|
||||
'
|
||||
|
||||
test_expect_success 'git branch -m -d t s should fail' '
|
||||
git branch t &&
|
||||
test_path_is_file .git/refs/heads/t &&
|
||||
git rev-parse refs/heads/t &&
|
||||
test_must_fail git branch -m -d t s &&
|
||||
git branch -d t &&
|
||||
test_path_is_missing .git/refs/heads/t
|
||||
test_must_fail git rev-parse refs/heads/t
|
||||
'
|
||||
|
||||
test_expect_success 'git branch --list -d t should fail' '
|
||||
git branch t &&
|
||||
test_path_is_file .git/refs/heads/t &&
|
||||
git rev-parse refs/heads/t &&
|
||||
test_must_fail git branch --list -d t &&
|
||||
git branch -d t &&
|
||||
test_path_is_missing .git/refs/heads/t
|
||||
test_must_fail git rev-parse refs/heads/t
|
||||
'
|
||||
|
||||
test_expect_success 'git branch --list -v with --abbrev' '
|
||||
|
@ -313,4 +313,20 @@ test_expect_success 'A root commit can be a cousin, treat it that way' '
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success 'labels that are object IDs are rewritten' '
|
||||
git checkout -b third B &&
|
||||
test_commit I &&
|
||||
third=$(git rev-parse HEAD) &&
|
||||
git checkout -b labels master &&
|
||||
git merge --no-commit third &&
|
||||
test_tick &&
|
||||
git commit -m "Merge commit '\''$third'\'' into labels" &&
|
||||
echo noop >script-from-scratch &&
|
||||
test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
|
||||
test_tick &&
|
||||
git rebase -i -r A &&
|
||||
grep "^label $third-" .git/ORIGINAL-TODO &&
|
||||
! grep "^label $third$" .git/ORIGINAL-TODO
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -726,7 +726,7 @@ test_expect_success 'store updates stash ref and reflog' '
|
||||
git reset --hard &&
|
||||
! grep quux bazzy &&
|
||||
git stash store -m quuxery $STASH_ID &&
|
||||
test $(cat .git/refs/stash) = $STASH_ID &&
|
||||
test $(git rev-parse stash) = $STASH_ID &&
|
||||
git reflog --format=%H stash| grep $STASH_ID &&
|
||||
git stash pop &&
|
||||
grep quux bazzy
|
||||
|
@ -421,6 +421,12 @@ test_expect_success 'index-pack <pack> works in non-repo' '
|
||||
test_path_is_file foo.idx
|
||||
'
|
||||
|
||||
test_expect_success 'index-pack --strict <pack> works in non-repo' '
|
||||
rm -f foo.idx &&
|
||||
nongit git index-pack --strict ../foo.pack &&
|
||||
test_path_is_file foo.idx
|
||||
'
|
||||
|
||||
test_expect_success !PTHREADS,C_LOCALE_OUTPUT 'index-pack --threads=N or pack.threads=N warns when no pthreads' '
|
||||
test_must_fail git index-pack --threads=2 2>err &&
|
||||
grep ^warning: err >warnings &&
|
||||
|
@ -30,7 +30,7 @@ add () {
|
||||
test_tick &&
|
||||
commit=$(echo "$text" | git commit-tree $tree $parents) &&
|
||||
eval "$name=$commit; export $name" &&
|
||||
echo $commit > .git/refs/heads/$branch &&
|
||||
git update-ref "refs/heads/$branch" "$commit" &&
|
||||
eval ${branch}TIP=$commit
|
||||
}
|
||||
|
||||
@ -45,10 +45,10 @@ pull_to_client () {
|
||||
|
||||
case "$heads" in
|
||||
*A*)
|
||||
echo $ATIP > .git/refs/heads/A;;
|
||||
git update-ref refs/heads/A "$ATIP";;
|
||||
esac &&
|
||||
case "$heads" in *B*)
|
||||
echo $BTIP > .git/refs/heads/B;;
|
||||
git update-ref refs/heads/B "$BTIP";;
|
||||
esac &&
|
||||
git symbolic-ref HEAD refs/heads/$(echo $heads \
|
||||
| sed -e "s/^\(.\).*$/\1/") &&
|
||||
@ -92,8 +92,8 @@ test_expect_success 'setup' '
|
||||
cur=$(($cur+1))
|
||||
done &&
|
||||
add B1 $A1 &&
|
||||
echo $ATIP > .git/refs/heads/A &&
|
||||
echo $BTIP > .git/refs/heads/B &&
|
||||
git update-ref refs/heads/A "$ATIP" &&
|
||||
git update-ref refs/heads/B "$BTIP" &&
|
||||
git symbolic-ref HEAD refs/heads/B
|
||||
'
|
||||
|
||||
|
@ -63,7 +63,7 @@ test_expect_success "fetch test" '
|
||||
git commit -a -m "updated by origin" &&
|
||||
cd two &&
|
||||
git fetch &&
|
||||
test -f .git/refs/heads/one &&
|
||||
git rev-parse --verify refs/heads/one &&
|
||||
mine=$(git rev-parse refs/heads/one) &&
|
||||
his=$(cd ../one && git rev-parse refs/heads/master) &&
|
||||
test "z$mine" = "z$his"
|
||||
@ -73,8 +73,8 @@ test_expect_success "fetch test for-merge" '
|
||||
cd "$D" &&
|
||||
cd three &&
|
||||
git fetch &&
|
||||
test -f .git/refs/heads/two &&
|
||||
test -f .git/refs/heads/one &&
|
||||
git rev-parse --verify refs/heads/two &&
|
||||
git rev-parse --verify refs/heads/one &&
|
||||
master_in_two=$(cd ../two && git rev-parse master) &&
|
||||
one_in_two=$(cd ../two && git rev-parse one) &&
|
||||
{
|
||||
|
@ -1121,6 +1121,25 @@ test_expect_success 'fetch exact SHA1' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'fetch exact SHA1 in protocol v2' '
|
||||
mk_test testrepo heads/master hidden/one &&
|
||||
git push testrepo master:refs/hidden/one &&
|
||||
git -C testrepo config transfer.hiderefs refs/hidden &&
|
||||
check_push_result testrepo $the_commit hidden/one &&
|
||||
|
||||
mk_child testrepo child &&
|
||||
git -C child config protocol.version 2 &&
|
||||
|
||||
# make sure $the_commit does not exist here
|
||||
git -C child repack -a -d &&
|
||||
git -C child prune &&
|
||||
test_must_fail git -C child cat-file -t $the_commit &&
|
||||
|
||||
# fetching the hidden object succeeds by default
|
||||
# NEEDSWORK: should this match the v0 behavior instead?
|
||||
git -C child fetch -v ../testrepo $the_commit:refs/heads/copy
|
||||
'
|
||||
|
||||
for configallowtipsha1inwant in true false
|
||||
do
|
||||
test_expect_success "shallow fetch reachable SHA1 (but not a ref), allowtipsha1inwant=$configallowtipsha1inwant" '
|
||||
|
@ -132,4 +132,25 @@ test_expect_success 'pull rebase recursing fails with conflicts' '
|
||||
test_i18ngrep "locally recorded submodule modifications" err
|
||||
'
|
||||
|
||||
test_expect_success 'branch has no merge base with remote-tracking counterpart' '
|
||||
rm -rf parent child &&
|
||||
|
||||
test_create_repo a-submodule &&
|
||||
test_commit -C a-submodule foo &&
|
||||
|
||||
test_create_repo parent &&
|
||||
git -C parent submodule add "$(pwd)/a-submodule" &&
|
||||
git -C parent commit -m foo &&
|
||||
|
||||
git clone parent child &&
|
||||
|
||||
# Reset master so that it has no merge base with
|
||||
# refs/remotes/origin/master.
|
||||
OTHER=$(git -C child commit-tree -m bar \
|
||||
$(git -C child rev-parse HEAD^{tree})) &&
|
||||
git -C child reset --hard "$OTHER" &&
|
||||
|
||||
git -C child pull --recurse-submodules --rebase
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -34,7 +34,7 @@ doit () {
|
||||
|
||||
commit=$(echo $NAME | git commit-tree $T $PARENTS) &&
|
||||
|
||||
echo $commit >.git/refs/tags/$NAME &&
|
||||
git update-ref "refs/tags/$NAME" "$commit" &&
|
||||
echo $commit
|
||||
}
|
||||
|
||||
|
@ -214,4 +214,12 @@ test_expect_success 'rev-list merge^-1x (garbage after ^-1)' '
|
||||
test_must_fail git rev-list merge^-1x
|
||||
'
|
||||
|
||||
test_expect_success 'rev-parse $garbage^@ does not segfault' '
|
||||
test_must_fail git rev-parse $EMPTY_TREE^@
|
||||
'
|
||||
|
||||
test_expect_success 'rev-parse $garbage...$garbage does not segfault' '
|
||||
test_must_fail git rev-parse $EMPTY_TREE...$EMPTY_BLOB
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -65,7 +65,7 @@ test_expect_success setup '
|
||||
test_expect_success "checkout from non-existing branch" '
|
||||
|
||||
git checkout -b delete-me master &&
|
||||
rm .git/refs/heads/delete-me &&
|
||||
git update-ref -d --no-deref refs/heads/delete-me &&
|
||||
test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
|
||||
git checkout master &&
|
||||
test refs/heads/master = "$(git symbolic-ref HEAD)"
|
||||
|
@ -122,6 +122,16 @@ test_expect_success 'transfer.fsckObjects handles odd pack (index)' '
|
||||
test_must_fail git -C dst.git index-pack --strict --stdin <odd.pack
|
||||
'
|
||||
|
||||
test_expect_success 'index-pack --strict works for non-repo pack' '
|
||||
rm -rf dst.git &&
|
||||
git init --bare dst.git &&
|
||||
cp odd.pack dst.git &&
|
||||
test_must_fail git -C dst.git index-pack --strict odd.pack 2>output &&
|
||||
# Make sure we fail due to bad gitmodules content, not because we
|
||||
# could not read the blob in the first place.
|
||||
grep gitmodulesName output
|
||||
'
|
||||
|
||||
test_expect_success 'fsck detects symlinked .gitmodules file' '
|
||||
git init symlink &&
|
||||
(
|
||||
@ -135,13 +145,10 @@ test_expect_success 'fsck detects symlinked .gitmodules file' '
|
||||
tricky="[foo]bar=true" &&
|
||||
content=$(git hash-object -w ../.gitmodules) &&
|
||||
target=$(printf "$tricky" | git hash-object -w --stdin) &&
|
||||
tree=$(
|
||||
{
|
||||
printf "100644 blob $content\t$tricky\n" &&
|
||||
printf "120000 blob $target\t.gitmodules\n"
|
||||
} | git mktree
|
||||
) &&
|
||||
commit=$(git commit-tree $tree) &&
|
||||
{
|
||||
printf "100644 blob $content\t$tricky\n" &&
|
||||
printf "120000 blob $target\t.gitmodules\n"
|
||||
} | git mktree &&
|
||||
|
||||
# Check not only that we fail, but that it is due to the
|
||||
# symlink detector; this grep string comes from the config
|
||||
@ -151,4 +158,22 @@ test_expect_success 'fsck detects symlinked .gitmodules file' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'fsck detects non-blob .gitmodules' '
|
||||
git init non-blob &&
|
||||
(
|
||||
cd non-blob &&
|
||||
|
||||
# As above, make the funny tree directly to avoid index
|
||||
# restrictions.
|
||||
mkdir subdir &&
|
||||
cp ../.gitmodules subdir/file &&
|
||||
git add subdir/file &&
|
||||
git commit -m ok &&
|
||||
git ls-tree HEAD | sed s/subdir/.gitmodules/ | git mktree &&
|
||||
|
||||
test_must_fail git fsck 2>output &&
|
||||
grep gitmodulesBlob output
|
||||
)
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -215,7 +215,8 @@ test_expect_success "multi-fetch continues to work" "
|
||||
"
|
||||
|
||||
test_expect_success "multi-fetch works off a 'clean' repository" '
|
||||
rm -r "$GIT_DIR/svn" "$GIT_DIR/refs/remotes" "$GIT_DIR/logs" &&
|
||||
rm -rf "$GIT_DIR/svn" "$GIT_DIR/refs/remotes" &&
|
||||
git reflog expire --all --expire=all &&
|
||||
mkdir "$GIT_DIR/svn" &&
|
||||
git svn multi-fetch
|
||||
'
|
||||
|
138
t/t9832-unshelve.sh
Executable file
138
t/t9832-unshelve.sh
Executable file
@ -0,0 +1,138 @@
|
||||
#!/bin/sh
|
||||
|
||||
last_shelved_change () {
|
||||
p4 changes -s shelved -m1 | cut -d " " -f 2
|
||||
}
|
||||
|
||||
test_description='git p4 unshelve'
|
||||
|
||||
. ./lib-git-p4.sh
|
||||
|
||||
test_expect_success 'start p4d' '
|
||||
start_p4d
|
||||
'
|
||||
|
||||
test_expect_success 'init depot' '
|
||||
(
|
||||
cd "$cli" &&
|
||||
echo file1 >file1 &&
|
||||
p4 add file1 &&
|
||||
p4 submit -d "change 1" &&
|
||||
: >file_to_delete &&
|
||||
p4 add file_to_delete &&
|
||||
p4 submit -d "file to delete"
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'initial clone' '
|
||||
git p4 clone --dest="$git" //depot/@all
|
||||
'
|
||||
|
||||
test_expect_success 'create shelved changelist' '
|
||||
(
|
||||
cd "$cli" &&
|
||||
p4 edit file1 &&
|
||||
echo "a change" >>file1 &&
|
||||
echo "new file" >file2 &&
|
||||
p4 add file2 &&
|
||||
p4 delete file_to_delete &&
|
||||
p4 opened &&
|
||||
p4 shelve -i <<EOF
|
||||
Change: new
|
||||
Description:
|
||||
Test commit
|
||||
|
||||
Further description
|
||||
Files:
|
||||
//depot/file1
|
||||
//depot/file2
|
||||
//depot/file_to_delete
|
||||
EOF
|
||||
|
||||
) &&
|
||||
(
|
||||
cd "$git" &&
|
||||
change=$(last_shelved_change) &&
|
||||
git p4 unshelve $change &&
|
||||
git show refs/remotes/p4/unshelved/$change | grep -q "Further description" &&
|
||||
git cherry-pick refs/remotes/p4/unshelved/$change &&
|
||||
test_path_is_file file2 &&
|
||||
test_cmp file1 "$cli"/file1 &&
|
||||
test_cmp file2 "$cli"/file2 &&
|
||||
test_path_is_missing file_to_delete
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'update shelved changelist and re-unshelve' '
|
||||
test_when_finished cleanup_git &&
|
||||
(
|
||||
cd "$cli" &&
|
||||
change=$(last_shelved_change) &&
|
||||
echo "file3" >file3 &&
|
||||
p4 add -c $change file3 &&
|
||||
p4 shelve -i -r <<EOF &&
|
||||
Change: $change
|
||||
Description:
|
||||
Test commit
|
||||
|
||||
Further description
|
||||
Files:
|
||||
//depot/file1
|
||||
//depot/file2
|
||||
//depot/file3
|
||||
//depot/file_to_delete
|
||||
EOF
|
||||
p4 describe $change
|
||||
) &&
|
||||
(
|
||||
cd "$git" &&
|
||||
change=$(last_shelved_change) &&
|
||||
git p4 unshelve $change &&
|
||||
git diff refs/remotes/p4/unshelved/$change.0 refs/remotes/p4/unshelved/$change | grep -q file3
|
||||
)
|
||||
'
|
||||
|
||||
# This is the tricky case where the shelved changelist base revision doesn't
|
||||
# match git-p4's idea of the base revision
|
||||
#
|
||||
# We will attempt to unshelve a change that is based on a change one commit
|
||||
# ahead of p4/master
|
||||
|
||||
test_expect_success 'create shelved changelist based on p4 change ahead of p4/master' '
|
||||
git p4 clone --dest="$git" //depot/@all &&
|
||||
(
|
||||
cd "$cli" &&
|
||||
p4 revert ... &&
|
||||
p4 edit file1 &&
|
||||
echo "foo" >>file1 &&
|
||||
p4 submit -d "change:foo" &&
|
||||
p4 edit file1 &&
|
||||
echo "bar" >>file1 &&
|
||||
p4 shelve -i <<EOF &&
|
||||
Change: new
|
||||
Description:
|
||||
Change to be unshelved
|
||||
Files:
|
||||
//depot/file1
|
||||
EOF
|
||||
change=$(last_shelved_change) &&
|
||||
p4 describe -S $change | grep -q "Change to be unshelved"
|
||||
)
|
||||
'
|
||||
|
||||
# Now try to unshelve it. git-p4 should refuse to do so.
|
||||
test_expect_success 'try to unshelve the change' '
|
||||
test_when_finished cleanup_git &&
|
||||
(
|
||||
change=$(last_shelved_change) &&
|
||||
cd "$git" &&
|
||||
test_must_fail git p4 unshelve $change 2>out.txt &&
|
||||
grep -q "cannot unshelve" out.txt
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'kill p4d' '
|
||||
kill_p4d
|
||||
'
|
||||
|
||||
test_done
|
@ -13,7 +13,7 @@ complete ()
|
||||
return 0
|
||||
}
|
||||
|
||||
# Be careful when updating this list:
|
||||
# Be careful when updating these lists:
|
||||
#
|
||||
# (1) The build tree may have build artifact from different branch, or
|
||||
# the user's $PATH may have a random executable that may begin
|
||||
@ -30,7 +30,8 @@ complete ()
|
||||
# completion for "git <TAB>", and a plumbing is excluded. "add",
|
||||
# "filter-branch" and "ls-files" are listed for this.
|
||||
|
||||
GIT_TESTING_COMMAND_COMPLETION='add checkout check-attr filter-branch ls-files'
|
||||
GIT_TESTING_ALL_COMMAND_LIST='add checkout check-attr filter-branch ls-files'
|
||||
GIT_TESTING_PORCELAIN_COMMAND_LIST='add checkout filter-branch'
|
||||
|
||||
. "$GIT_BUILD_DIR/contrib/completion/git-completion.bash"
|
||||
|
||||
@ -180,7 +181,7 @@ test_expect_success '__git_find_repo_path - cwd is a .git directory' '
|
||||
test_expect_success '__git_find_repo_path - parent is a .git directory' '
|
||||
echo "$ROOT/.git" >expected &&
|
||||
(
|
||||
cd .git/refs/heads &&
|
||||
cd .git/objects &&
|
||||
__git_find_repo_path &&
|
||||
echo "$__git_repo_path" >"$actual"
|
||||
) &&
|
||||
@ -1350,17 +1351,6 @@ test_expect_success '__git_pretty_aliases' '
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success '__git_aliases' '
|
||||
cat >expect <<-EOF &&
|
||||
ci
|
||||
co
|
||||
EOF
|
||||
test_config alias.ci commit &&
|
||||
test_config alias.co checkout &&
|
||||
__git_aliases >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success 'basic' '
|
||||
run_completion "git " &&
|
||||
# built-in
|
||||
@ -1670,13 +1660,6 @@ test_expect_success 'sourcing the completion script clears cached commands' '
|
||||
verbose test -z "$__git_all_commands"
|
||||
'
|
||||
|
||||
test_expect_success 'sourcing the completion script clears cached porcelain commands' '
|
||||
__git_compute_porcelain_commands &&
|
||||
verbose test -n "$__git_porcelain_commands" &&
|
||||
. "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
|
||||
verbose test -z "$__git_porcelain_commands"
|
||||
'
|
||||
|
||||
test_expect_success !GETTEXT_POISON 'sourcing the completion script clears cached merge strategies' '
|
||||
__git_compute_merge_strategies &&
|
||||
verbose test -n "$__git_merge_strategies" &&
|
||||
|
@ -148,7 +148,7 @@ test_expect_success 'prompt - inside .git directory' '
|
||||
test_expect_success 'prompt - deep inside .git directory' '
|
||||
printf " (GIT_DIR!)" >expected &&
|
||||
(
|
||||
cd .git/refs/heads &&
|
||||
cd .git/objects &&
|
||||
__git_ps1 >"$actual"
|
||||
) &&
|
||||
test_cmp expected "$actual"
|
||||
|
Reference in New Issue
Block a user