Compare commits
41 Commits
Author | SHA1 | Date | |
---|---|---|---|
c5e5f60305 | |||
c0d3a38293 | |||
77e8466fb9 | |||
64da6e20de | |||
97a449ee30 | |||
8bb45b25b2 | |||
d951615daa | |||
29b67543d3 | |||
689b8c290d | |||
16758621d5 | |||
b39c3612eb | |||
4551d03541 | |||
e9e921981d | |||
7c0be4da5c | |||
3fc0d131c5 | |||
738820a913 | |||
cc1b8d8bc6 | |||
e3ff352c73 | |||
c69f921560 | |||
031f82f751 | |||
07cb9a369e | |||
3ac4440801 | |||
d3f69766c4 | |||
354d9f861b | |||
5f02d31597 | |||
e7b3cea0f7 | |||
eb0bcd0fbe | |||
003c6abdb2 | |||
460ccd0e19 | |||
8324b977ae | |||
7283bbc70a | |||
b599672316 | |||
ef0065034a | |||
9b25048318 | |||
4d128884fb | |||
97915544f8 | |||
08565bdb4b | |||
dd9314cc2a | |||
6e359978e9 | |||
1123c67cee | |||
9517e6b843 |
35
Documentation/RelNotes-1.7.0.1.txt
Normal file
35
Documentation/RelNotes-1.7.0.1.txt
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
Git v1.7.0.1 Release Notes
|
||||||
|
==========================
|
||||||
|
|
||||||
|
Fixes since v1.7.0
|
||||||
|
------------------
|
||||||
|
|
||||||
|
* In a freshly created repository "rev-parse HEAD^0" complained that
|
||||||
|
it is dangling symref, even though "rev-parse HEAD" didn't.
|
||||||
|
|
||||||
|
* "git show :no-such-name" tried to access the index without bounds
|
||||||
|
check, leading to a potential segfault.
|
||||||
|
|
||||||
|
* Message from "git cherry-pick" was harder to read and use than necessary
|
||||||
|
when it stopped due to conflicting changes.
|
||||||
|
|
||||||
|
* We referred to ".git/refs/" throughout the documentation when we
|
||||||
|
meant to talk about abstract notion of "ref namespace". Because
|
||||||
|
people's repositories often have packed refs these days, this was
|
||||||
|
confusing.
|
||||||
|
|
||||||
|
* "git diff --output=/path/that/cannot/be/written" did not correctly
|
||||||
|
error out.
|
||||||
|
|
||||||
|
* "git grep -e -pattern-that-begin-with-dash paths..." could not be
|
||||||
|
spelled as "git grep -- -pattern-that-begin-with-dash paths..." which
|
||||||
|
would be a GNU way to use "--" as "end of options".
|
||||||
|
|
||||||
|
* "git grep" compiled with threading support tried to access an
|
||||||
|
uninitialized mutex on boxes with a single CPU.
|
||||||
|
|
||||||
|
* "git stash pop -q --index" failed because the unnecessary --index
|
||||||
|
option was propagated to "git stash drop" that is internally run at the
|
||||||
|
end.
|
||||||
|
|
||||||
|
And other minor fixes and documentation updates.
|
@ -680,9 +680,7 @@ color.grep::
|
|||||||
|
|
||||||
color.grep.match::
|
color.grep.match::
|
||||||
Use customized color for matches. The value of this variable
|
Use customized color for matches. The value of this variable
|
||||||
may be specified as in color.branch.<slot>. It is passed using
|
may be specified as in color.branch.<slot>.
|
||||||
the environment variables 'GREP_COLOR' and 'GREP_COLORS' when
|
|
||||||
calling an external 'grep'.
|
|
||||||
|
|
||||||
color.interactive::
|
color.interactive::
|
||||||
When set to `always`, always use colors for interactive prompts
|
When set to `always`, always use colors for interactive prompts
|
||||||
|
@ -19,8 +19,9 @@ status if it is not.
|
|||||||
|
|
||||||
A reference is used in git to specify branches and tags. A
|
A reference is used in git to specify branches and tags. A
|
||||||
branch head is stored under the `$GIT_DIR/refs/heads` directory, and
|
branch head is stored under the `$GIT_DIR/refs/heads` directory, and
|
||||||
a tag is stored under the `$GIT_DIR/refs/tags` directory. git
|
a tag is stored under the `$GIT_DIR/refs/tags` directory (or, if refs
|
||||||
imposes the following rules on how references are named:
|
are packed by `git gc`, as entries in the `$GIT_DIR/packed-refs` file).
|
||||||
|
git imposes the following rules on how references are named:
|
||||||
|
|
||||||
. They can include slash `/` for hierarchical (directory)
|
. They can include slash `/` for hierarchical (directory)
|
||||||
grouping, but no slash-separated component can begin with a
|
grouping, but no slash-separated component can begin with a
|
||||||
|
@ -29,7 +29,7 @@ arguments will in addition merge the remote master branch into the
|
|||||||
current master branch, if any.
|
current master branch, if any.
|
||||||
|
|
||||||
This default configuration is achieved by creating references to
|
This default configuration is achieved by creating references to
|
||||||
the remote branch heads under `$GIT_DIR/refs/remotes/origin` and
|
the remote branch heads under `refs/remotes/origin` and
|
||||||
by initializing `remote.origin.url` and `remote.origin.fetch`
|
by initializing `remote.origin.url` and `remote.origin.fetch`
|
||||||
configuration variables.
|
configuration variables.
|
||||||
|
|
||||||
|
@ -197,13 +197,13 @@ FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].)
|
|||||||
Show untracked files (Default: 'all').
|
Show untracked files (Default: 'all').
|
||||||
+
|
+
|
||||||
The mode parameter is optional, and is used to specify
|
The mode parameter is optional, and is used to specify
|
||||||
the handling of untracked files. The possible options are:
|
the handling of untracked files.
|
||||||
|
+
|
||||||
|
The possible options are:
|
||||||
+
|
+
|
||||||
--
|
|
||||||
- 'no' - Show no untracked files
|
- 'no' - Show no untracked files
|
||||||
- 'normal' - Shows untracked files and directories
|
- 'normal' - Shows untracked files and directories
|
||||||
- 'all' - Also shows individual files in untracked directories.
|
- 'all' - Also shows individual files in untracked directories.
|
||||||
--
|
|
||||||
+
|
+
|
||||||
See linkgit:git-config[1] for configuration variable
|
See linkgit:git-config[1] for configuration variable
|
||||||
used to change the default for when the option is not
|
used to change the default for when the option is not
|
||||||
|
@ -18,7 +18,7 @@ higher level wrapper of this command, instead.
|
|||||||
Invokes 'git-upload-pack' on a possibly remote repository
|
Invokes 'git-upload-pack' on a possibly remote repository
|
||||||
and asks it to send objects missing from this repository, to
|
and asks it to send objects missing from this repository, to
|
||||||
update the named heads. The list of commits available locally
|
update the named heads. The list of commits available locally
|
||||||
is found out by scanning local $GIT_DIR/refs/ and sent to
|
is found out by scanning the local refs/ hierarchy and sent to
|
||||||
'git-upload-pack' running on the other end.
|
'git-upload-pack' running on the other end.
|
||||||
|
|
||||||
This command degenerates to download everything to complete the
|
This command degenerates to download everything to complete the
|
||||||
@ -44,8 +44,8 @@ OPTIONS
|
|||||||
locked against repacking.
|
locked against repacking.
|
||||||
|
|
||||||
--thin::
|
--thin::
|
||||||
Spend extra cycles to minimize the number of objects to be sent.
|
Fetch a "thin" pack, which records objects in deltified form based
|
||||||
Use it on slower connection.
|
on objects not included in the pack to reduce network traffic.
|
||||||
|
|
||||||
--include-tag::
|
--include-tag::
|
||||||
If the remote side supports it, annotated tags objects will
|
If the remote side supports it, annotated tags objects will
|
||||||
|
@ -22,12 +22,12 @@ SYNOPSIS
|
|||||||
[-A <post-context>] [-B <pre-context>] [-C <context>]
|
[-A <post-context>] [-B <pre-context>] [-C <context>]
|
||||||
[-f <file>] [-e] <pattern>
|
[-f <file>] [-e] <pattern>
|
||||||
[--and|--or|--not|(|)|-e <pattern>...] [<tree>...]
|
[--and|--or|--not|(|)|-e <pattern>...] [<tree>...]
|
||||||
[--] [<path>...]
|
[--] [<pathspec>...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
Look for specified patterns in the working tree files, blobs
|
Look for specified patterns in the tracked files in the work tree, blobs
|
||||||
registered in the index file, or given tree objects.
|
registered in the index file, or blobs in given tree objects.
|
||||||
|
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
@ -49,7 +49,7 @@ OPTIONS
|
|||||||
Don't match the pattern in binary files.
|
Don't match the pattern in binary files.
|
||||||
|
|
||||||
--max-depth <depth>::
|
--max-depth <depth>::
|
||||||
For each pathspec given on command line, descend at most <depth>
|
For each <pathspec> given on command line, descend at most <depth>
|
||||||
levels of directories. A negative value means no limit.
|
levels of directories. A negative value means no limit.
|
||||||
|
|
||||||
-w::
|
-w::
|
||||||
@ -168,12 +168,19 @@ OPTIONS
|
|||||||
|
|
||||||
\--::
|
\--::
|
||||||
Signals the end of options; the rest of the parameters
|
Signals the end of options; the rest of the parameters
|
||||||
are <path> limiters.
|
are <pathspec> limiters.
|
||||||
|
|
||||||
|
<pathspec>...::
|
||||||
|
If given, limit the search to paths matching at least one pattern.
|
||||||
|
Both leading paths match and glob(7) patterns are supported.
|
||||||
|
|
||||||
Example
|
Example
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
git grep 'time_t' -- '*.[ch]'::
|
||||||
|
Looks for `time_t` in all tracked .c and .h files in the working
|
||||||
|
directory and its subdirectories.
|
||||||
|
|
||||||
git grep -e \'#define\' --and \( -e MAX_PATH -e PATH_MAX \)::
|
git grep -e \'#define\' --and \( -e MAX_PATH -e PATH_MAX \)::
|
||||||
Looks for a line that has `#define` and either `MAX_PATH` or
|
Looks for a line that has `#define` and either `MAX_PATH` or
|
||||||
`PATH_MAX`.
|
`PATH_MAX`.
|
||||||
|
@ -46,14 +46,10 @@ OPTIONS
|
|||||||
'git repack'.
|
'git repack'.
|
||||||
|
|
||||||
--fix-thin::
|
--fix-thin::
|
||||||
It is possible for 'git pack-objects' to build
|
Fix a "thin" pack produced by `git pack-objects --thin` (see
|
||||||
"thin" pack, which records objects in deltified form based on
|
linkgit:git-pack-objects[1] for details) by adding the
|
||||||
objects not included in the pack to reduce network traffic.
|
excluded objects the deltified objects are based on to the
|
||||||
Those objects are expected to be present on the receiving end
|
pack. This option only makes sense in conjunction with --stdin.
|
||||||
and they must be included in the pack for that pack to be self
|
|
||||||
contained and indexable. Without this option any attempt to
|
|
||||||
index a thin pack will fail. This option only makes sense in
|
|
||||||
conjunction with --stdin.
|
|
||||||
|
|
||||||
--keep::
|
--keep::
|
||||||
Before moving the index into its final destination
|
Before moving the index into its final destination
|
||||||
|
@ -21,16 +21,21 @@ DESCRIPTION
|
|||||||
Reads list of objects from the standard input, and writes a packed
|
Reads list of objects from the standard input, and writes a packed
|
||||||
archive with specified base-name, or to the standard output.
|
archive with specified base-name, or to the standard output.
|
||||||
|
|
||||||
A packed archive is an efficient way to transfer set of objects
|
A packed archive is an efficient way to transfer a set of objects
|
||||||
between two repositories, and also is an archival format which
|
between two repositories as well as an access efficient archival
|
||||||
is efficient to access. The packed archive format (.pack) is
|
format. In a packed archive, an object is either stored as a
|
||||||
designed to be self contained so that it can be unpacked without
|
compressed whole or as a difference from some other object.
|
||||||
any further information, but for fast, random access to the objects
|
The latter is often called a delta.
|
||||||
in the pack, a pack index file (.idx) will be generated.
|
|
||||||
|
|
||||||
Placing both in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or
|
The packed archive format (.pack) is designed to be self-contained
|
||||||
|
so that it can be unpacked without any further information. Therefore,
|
||||||
|
each object that a delta depends upon must be present within the pack.
|
||||||
|
|
||||||
|
A pack index file (.idx) is generated for fast, random access to the
|
||||||
|
objects in the pack. Placing both the index file (.idx) and the packed
|
||||||
|
archive (.pack) in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or
|
||||||
any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES)
|
any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES)
|
||||||
enables git to read from such an archive.
|
enables git to read from the pack archive.
|
||||||
|
|
||||||
The 'git unpack-objects' command can read the packed archive and
|
The 'git unpack-objects' command can read the packed archive and
|
||||||
expand the objects contained in the pack into "one-file
|
expand the objects contained in the pack into "one-file
|
||||||
@ -38,10 +43,6 @@ one-object" format; this is typically done by the smart-pull
|
|||||||
commands when a pack is created on-the-fly for efficient network
|
commands when a pack is created on-the-fly for efficient network
|
||||||
transport by their peers.
|
transport by their peers.
|
||||||
|
|
||||||
In a packed archive, an object is either stored as a compressed
|
|
||||||
whole, or as a difference from some other object. The latter is
|
|
||||||
often called a delta.
|
|
||||||
|
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-------
|
-------
|
||||||
@ -73,7 +74,7 @@ base-name::
|
|||||||
--all::
|
--all::
|
||||||
This implies `--revs`. In addition to the list of
|
This implies `--revs`. In addition to the list of
|
||||||
revision arguments read from the standard input, pretend
|
revision arguments read from the standard input, pretend
|
||||||
as if all refs under `$GIT_DIR/refs` are specified to be
|
as if all refs under `refs/` are specified to be
|
||||||
included.
|
included.
|
||||||
|
|
||||||
--include-tag::
|
--include-tag::
|
||||||
@ -179,6 +180,16 @@ base-name::
|
|||||||
Add --no-reuse-object if you want to force a uniform compression
|
Add --no-reuse-object if you want to force a uniform compression
|
||||||
level on all data no matter the source.
|
level on all data no matter the source.
|
||||||
|
|
||||||
|
--thin::
|
||||||
|
Create a "thin" pack by omitting the common objects between a
|
||||||
|
sender and a receiver in order to reduce network transfer. This
|
||||||
|
option only makes sense in conjunction with --stdout.
|
||||||
|
+
|
||||||
|
Note: A thin pack violates the packed archive format by omitting
|
||||||
|
required objects and is thus unusable by git without making it
|
||||||
|
self-contained. Use `git index-pack --fix-thin`
|
||||||
|
(see linkgit:git-index-pack[1]) to restore the self-contained property.
|
||||||
|
|
||||||
--delta-base-offset::
|
--delta-base-offset::
|
||||||
A packed archive can express base object of a delta as
|
A packed archive can express base object of a delta as
|
||||||
either 20-byte object name or as an offset in the
|
either 20-byte object name or as an offset in the
|
||||||
|
@ -17,7 +17,7 @@ NOTE: In most cases, users should run 'git gc', which calls
|
|||||||
'git prune'. See the section "NOTES", below.
|
'git prune'. See the section "NOTES", below.
|
||||||
|
|
||||||
This runs 'git fsck --unreachable' using all the refs
|
This runs 'git fsck --unreachable' using all the refs
|
||||||
available in `$GIT_DIR/refs`, optionally with additional set of
|
available in `refs/`, optionally with additional set of
|
||||||
objects specified on the command line, and prunes all unpacked
|
objects specified on the command line, and prunes all unpacked
|
||||||
objects unreachable from any of these head objects from the object database.
|
objects unreachable from any of these head objects from the object database.
|
||||||
In addition, it
|
In addition, it
|
||||||
|
@ -69,11 +69,11 @@ nor in any Push line of the corresponding remotes file---see below).
|
|||||||
|
|
||||||
--all::
|
--all::
|
||||||
Instead of naming each ref to push, specifies that all
|
Instead of naming each ref to push, specifies that all
|
||||||
refs under `$GIT_DIR/refs/heads/` be pushed.
|
refs under `refs/heads/` be pushed.
|
||||||
|
|
||||||
--mirror::
|
--mirror::
|
||||||
Instead of naming each ref to push, specifies that all
|
Instead of naming each ref to push, specifies that all
|
||||||
refs under `$GIT_DIR/refs/` (which includes but is not
|
refs under `refs/` (which includes but is not
|
||||||
limited to `refs/heads/`, `refs/remotes/`, and `refs/tags/`)
|
limited to `refs/heads/`, `refs/remotes/`, and `refs/tags/`)
|
||||||
be mirrored to the remote repository. Newly created local
|
be mirrored to the remote repository. Newly created local
|
||||||
refs will be pushed to the remote end, locally updated refs
|
refs will be pushed to the remote end, locally updated refs
|
||||||
@ -96,7 +96,7 @@ nor in any Push line of the corresponding remotes file---see below).
|
|||||||
the same as prefixing all refs with a colon.
|
the same as prefixing all refs with a colon.
|
||||||
|
|
||||||
--tags::
|
--tags::
|
||||||
All refs under `$GIT_DIR/refs/tags` are pushed, in
|
All refs under `refs/tags` are pushed, in
|
||||||
addition to refspecs explicitly listed on the command
|
addition to refspecs explicitly listed on the command
|
||||||
line.
|
line.
|
||||||
|
|
||||||
@ -141,9 +141,10 @@ useful if you write an alias or script around 'git push'.
|
|||||||
|
|
||||||
--thin::
|
--thin::
|
||||||
--no-thin::
|
--no-thin::
|
||||||
These options are passed to 'git send-pack'. Thin
|
These options are passed to linkgit:git-send-pack[1]. A thin transfer
|
||||||
transfer spends extra cycles to minimize the number of
|
significantly reduces the amount of sent data when the sender and
|
||||||
objects to be sent and meant to be used on slower connection.
|
receiver share many of the same objects in common. The default is
|
||||||
|
\--thin.
|
||||||
|
|
||||||
-v::
|
-v::
|
||||||
--verbose::
|
--verbose::
|
||||||
|
@ -101,15 +101,14 @@ OPTIONS
|
|||||||
abbreviation mode.
|
abbreviation mode.
|
||||||
|
|
||||||
--all::
|
--all::
|
||||||
Show all refs found in `$GIT_DIR/refs`.
|
Show all refs found in `refs/`.
|
||||||
|
|
||||||
--branches[=pattern]::
|
--branches[=pattern]::
|
||||||
--tags[=pattern]::
|
--tags[=pattern]::
|
||||||
--remotes[=pattern]::
|
--remotes[=pattern]::
|
||||||
Show all branches, tags, or remote-tracking branches,
|
Show all branches, tags, or remote-tracking branches,
|
||||||
respectively (i.e., refs found in `$GIT_DIR/refs/heads`,
|
respectively (i.e., refs found in `refs/heads`,
|
||||||
`$GIT_DIR/refs/tags`, or `$GIT_DIR/refs/remotes`,
|
`refs/tags`, or `refs/remotes`, respectively).
|
||||||
respectively).
|
|
||||||
+
|
+
|
||||||
If a `pattern` is given, only refs matching the given shell glob are
|
If a `pattern` is given, only refs matching the given shell glob are
|
||||||
shown. If the pattern does not contain a globbing character (`?`,
|
shown. If the pattern does not contain a globbing character (`?`,
|
||||||
@ -189,7 +188,7 @@ blobs contained in a commit.
|
|||||||
`g`, and an abbreviated object name.
|
`g`, and an abbreviated object name.
|
||||||
|
|
||||||
* A symbolic ref name. E.g. 'master' typically means the commit
|
* A symbolic ref name. E.g. 'master' typically means the commit
|
||||||
object referenced by $GIT_DIR/refs/heads/master. If you
|
object referenced by refs/heads/master. If you
|
||||||
happen to have both heads/master and tags/master, you can
|
happen to have both heads/master and tags/master, you can
|
||||||
explicitly say 'heads/master' to tell git which one you mean.
|
explicitly say 'heads/master' to tell git which one you mean.
|
||||||
When ambiguous, a `<name>` is disambiguated by taking the
|
When ambiguous, a `<name>` is disambiguated by taking the
|
||||||
@ -198,15 +197,15 @@ blobs contained in a commit.
|
|||||||
. if `$GIT_DIR/<name>` exists, that is what you mean (this is usually
|
. if `$GIT_DIR/<name>` exists, that is what you mean (this is usually
|
||||||
useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD` and `MERGE_HEAD`);
|
useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD` and `MERGE_HEAD`);
|
||||||
|
|
||||||
. otherwise, `$GIT_DIR/refs/<name>` if exists;
|
. otherwise, `refs/<name>` if exists;
|
||||||
|
|
||||||
. otherwise, `$GIT_DIR/refs/tags/<name>` if exists;
|
. otherwise, `refs/tags/<name>` if exists;
|
||||||
|
|
||||||
. otherwise, `$GIT_DIR/refs/heads/<name>` if exists;
|
. otherwise, `refs/heads/<name>` if exists;
|
||||||
|
|
||||||
. otherwise, `$GIT_DIR/refs/remotes/<name>` if exists;
|
. otherwise, `refs/remotes/<name>` if exists;
|
||||||
|
|
||||||
. otherwise, `$GIT_DIR/refs/remotes/<name>/HEAD` if exists.
|
. otherwise, `refs/remotes/<name>/HEAD` if exists.
|
||||||
+
|
+
|
||||||
HEAD names the commit your changes in the working tree is based on.
|
HEAD names the commit your changes in the working tree is based on.
|
||||||
FETCH_HEAD records the branch you fetched from a remote repository
|
FETCH_HEAD records the branch you fetched from a remote repository
|
||||||
@ -217,6 +216,9 @@ you can change the tip of the branch back to the state before you ran
|
|||||||
them easily.
|
them easily.
|
||||||
MERGE_HEAD records the commit(s) you are merging into your branch
|
MERGE_HEAD records the commit(s) you are merging into your branch
|
||||||
when you run 'git merge'.
|
when you run 'git merge'.
|
||||||
|
+
|
||||||
|
Note that any of the `refs/*` cases above may come either from
|
||||||
|
the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
|
||||||
|
|
||||||
* A ref followed by the suffix '@' with a date specification
|
* A ref followed by the suffix '@' with a date specification
|
||||||
enclosed in a brace
|
enclosed in a brace
|
||||||
|
@ -48,8 +48,8 @@ OPTIONS
|
|||||||
Run verbosely.
|
Run verbosely.
|
||||||
|
|
||||||
--thin::
|
--thin::
|
||||||
Spend extra cycles to minimize the number of objects to be sent.
|
Send a "thin" pack, which records objects in deltified form based
|
||||||
Use it on slower connection.
|
on objects not included in the pack to reduce network traffic.
|
||||||
|
|
||||||
<host>::
|
<host>::
|
||||||
A remote host to house the repository. When this
|
A remote host to house the repository. When this
|
||||||
|
@ -20,8 +20,8 @@ DESCRIPTION
|
|||||||
-----------
|
-----------
|
||||||
|
|
||||||
Shows the commit ancestry graph starting from the commits named
|
Shows the commit ancestry graph starting from the commits named
|
||||||
with <rev>s or <globs>s (or all refs under $GIT_DIR/refs/heads
|
with <rev>s or <globs>s (or all refs under refs/heads
|
||||||
and/or $GIT_DIR/refs/tags) semi-visually.
|
and/or refs/tags) semi-visually.
|
||||||
|
|
||||||
It cannot show more than 29 branches and commits at a time.
|
It cannot show more than 29 branches and commits at a time.
|
||||||
|
|
||||||
@ -37,8 +37,8 @@ OPTIONS
|
|||||||
|
|
||||||
<glob>::
|
<glob>::
|
||||||
A glob pattern that matches branch or tag names under
|
A glob pattern that matches branch or tag names under
|
||||||
$GIT_DIR/refs. For example, if you have many topic
|
refs/. For example, if you have many topic
|
||||||
branches under $GIT_DIR/refs/heads/topic, giving
|
branches under refs/heads/topic, giving
|
||||||
`topic/*` would show all of them.
|
`topic/*` would show all of them.
|
||||||
|
|
||||||
-r::
|
-r::
|
||||||
@ -176,7 +176,7 @@ EXAMPLE
|
|||||||
-------
|
-------
|
||||||
|
|
||||||
If you keep your primary branches immediately under
|
If you keep your primary branches immediately under
|
||||||
`$GIT_DIR/refs/heads`, and topic branches in subdirectories of
|
`refs/heads`, and topic branches in subdirectories of
|
||||||
it, having the following in the configuration file may help:
|
it, having the following in the configuration file may help:
|
||||||
|
|
||||||
------------
|
------------
|
||||||
|
@ -33,7 +33,7 @@ A stash is by default listed as "WIP on 'branchname' ...", but
|
|||||||
you can give a more descriptive message on the command line when
|
you can give a more descriptive message on the command line when
|
||||||
you create one.
|
you create one.
|
||||||
|
|
||||||
The latest stash you created is stored in `$GIT_DIR/refs/stash`; older
|
The latest stash you created is stored in `refs/stash`; older
|
||||||
stashes are found in the reflog of this reference and can be named using
|
stashes are found in the reflog of this reference and can be named using
|
||||||
the usual reflog syntax (e.g. `stash@\{0}` is the most recently
|
the usual reflog syntax (e.g. `stash@\{0}` is the most recently
|
||||||
created stash, `stash@\{1}` is the one before it, `stash@\{2.hours.ago}`
|
created stash, `stash@\{1}` is the one before it, `stash@\{2.hours.ago}`
|
||||||
|
@ -43,9 +43,10 @@ unreleased) version of git, that is available from 'master'
|
|||||||
branch of the `git.git` repository.
|
branch of the `git.git` repository.
|
||||||
Documentation for older releases are available here:
|
Documentation for older releases are available here:
|
||||||
|
|
||||||
* link:v1.7.0/git.html[documentation for release 1.7.0]
|
* link:v1.7.0.1/git.html[documentation for release 1.7.0.1]
|
||||||
|
|
||||||
* release notes for
|
* release notes for
|
||||||
|
link:RelNotes-1.7.0.1.txt[1.7.0.1],
|
||||||
link:RelNotes-1.7.0.txt[1.7.0].
|
link:RelNotes-1.7.0.txt[1.7.0].
|
||||||
|
|
||||||
* link:v1.6.6.2/git.html[documentation for release 1.6.6.2]
|
* link:v1.6.6.2/git.html[documentation for release 1.6.6.2]
|
||||||
|
@ -511,7 +511,8 @@ command to run to merge ancestor's version (`%O`), current
|
|||||||
version (`%A`) and the other branches' version (`%B`). These
|
version (`%A`) and the other branches' version (`%B`). These
|
||||||
three tokens are replaced with the names of temporary files that
|
three tokens are replaced with the names of temporary files that
|
||||||
hold the contents of these versions when the command line is
|
hold the contents of these versions when the command line is
|
||||||
built.
|
built. Additionally, %L will be replaced with the conflict marker
|
||||||
|
size (see below).
|
||||||
|
|
||||||
The merge driver is expected to leave the result of the merge in
|
The merge driver is expected to leave the result of the merge in
|
||||||
the file named with `%A` by overwriting it, and exit with zero
|
the file named with `%A` by overwriting it, and exit with zero
|
||||||
|
@ -225,26 +225,26 @@ endif::git-rev-list[]
|
|||||||
|
|
||||||
--all::
|
--all::
|
||||||
|
|
||||||
Pretend as if all the refs in `$GIT_DIR/refs/` are listed on the
|
Pretend as if all the refs in `refs/` are listed on the
|
||||||
command line as '<commit>'.
|
command line as '<commit>'.
|
||||||
|
|
||||||
--branches[=pattern]::
|
--branches[=pattern]::
|
||||||
|
|
||||||
Pretend as if all the refs in `$GIT_DIR/refs/heads` are listed
|
Pretend as if all the refs in `refs/heads` are listed
|
||||||
on the command line as '<commit>'. If `pattern` is given, limit
|
on the command line as '<commit>'. If `pattern` is given, limit
|
||||||
branches to ones matching given shell glob. If pattern lacks '?',
|
branches to ones matching given shell glob. If pattern lacks '?',
|
||||||
'*', or '[', '/*' at the end is implied.
|
'*', or '[', '/*' at the end is implied.
|
||||||
|
|
||||||
--tags[=pattern]::
|
--tags[=pattern]::
|
||||||
|
|
||||||
Pretend as if all the refs in `$GIT_DIR/refs/tags` are listed
|
Pretend as if all the refs in `refs/tags` are listed
|
||||||
on the command line as '<commit>'. If `pattern` is given, limit
|
on the command line as '<commit>'. If `pattern` is given, limit
|
||||||
tags to ones matching given shell glob. If pattern lacks '?', '*',
|
tags to ones matching given shell glob. If pattern lacks '?', '*',
|
||||||
or '[', '/*' at the end is implied.
|
or '[', '/*' at the end is implied.
|
||||||
|
|
||||||
--remotes[=pattern]::
|
--remotes[=pattern]::
|
||||||
|
|
||||||
Pretend as if all the refs in `$GIT_DIR/refs/remotes` are listed
|
Pretend as if all the refs in `refs/remotes` are listed
|
||||||
on the command line as '<commit>'. If `pattern`is given, limit
|
on the command line as '<commit>'. If `pattern`is given, limit
|
||||||
remote tracking branches to ones matching given shell glob.
|
remote tracking branches to ones matching given shell glob.
|
||||||
If pattern lacks '?', '*', or '[', '/*' at the end is implied.
|
If pattern lacks '?', '*', or '[', '/*' at the end is implied.
|
||||||
@ -259,9 +259,9 @@ endif::git-rev-list[]
|
|||||||
ifndef::git-rev-list[]
|
ifndef::git-rev-list[]
|
||||||
--bisect::
|
--bisect::
|
||||||
|
|
||||||
Pretend as if the bad bisection ref `$GIT_DIR/refs/bisect/bad`
|
Pretend as if the bad bisection ref `refs/bisect/bad`
|
||||||
was listed and as if it was followed by `--not` and the good
|
was listed and as if it was followed by `--not` and the good
|
||||||
bisection refs `$GIT_DIR/refs/bisect/good-*` on the command
|
bisection refs `refs/bisect/good-*` on the command
|
||||||
line.
|
line.
|
||||||
endif::git-rev-list[]
|
endif::git-rev-list[]
|
||||||
|
|
||||||
@ -561,10 +561,10 @@ Bisection Helpers
|
|||||||
|
|
||||||
Limit output to the one commit object which is roughly halfway between
|
Limit output to the one commit object which is roughly halfway between
|
||||||
included and excluded commits. Note that the bad bisection ref
|
included and excluded commits. Note that the bad bisection ref
|
||||||
`$GIT_DIR/refs/bisect/bad` is added to the included commits (if it
|
`refs/bisect/bad` is added to the included commits (if it
|
||||||
exists) and the good bisection refs `$GIT_DIR/refs/bisect/good-*` are
|
exists) and the good bisection refs `refs/bisect/good-*` are
|
||||||
added to the excluded commits (if they exist). Thus, supposing there
|
added to the excluded commits (if they exist). Thus, supposing there
|
||||||
are no refs in `$GIT_DIR/refs/bisect/`, if
|
are no refs in `refs/bisect/`, if
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
$ git rev-list --bisect foo ^bar ^baz
|
$ git rev-list --bisect foo ^bar ^baz
|
||||||
@ -585,7 +585,7 @@ one.
|
|||||||
--bisect-vars::
|
--bisect-vars::
|
||||||
|
|
||||||
This calculates the same as `--bisect`, except that refs in
|
This calculates the same as `--bisect`, except that refs in
|
||||||
`$GIT_DIR/refs/bisect/` are not used, and except that this outputs
|
`refs/bisect/` are not used, and except that this outputs
|
||||||
text ready to be eval'ed by the shell. These lines will assign the
|
text ready to be eval'ed by the shell. These lines will assign the
|
||||||
name of the midpoint revision to the variable `bisect_rev`, and the
|
name of the midpoint revision to the variable `bisect_rev`, and the
|
||||||
expected number of commits to be tested after `bisect_rev` is tested
|
expected number of commits to be tested after `bisect_rev` is tested
|
||||||
@ -599,7 +599,7 @@ number of commits to be tested if `bisect_rev` turns out to be bad to
|
|||||||
|
|
||||||
This outputs all the commit objects between the included and excluded
|
This outputs all the commit objects between the included and excluded
|
||||||
commits, ordered by their distance to the included and excluded
|
commits, ordered by their distance to the included and excluded
|
||||||
commits. Refs in `$GIT_DIR/refs/bisect/` are not used. The farthest
|
commits. Refs in `refs/bisect/` are not used. The farthest
|
||||||
from them is displayed first. (This is the only one displayed by
|
from them is displayed first. (This is the only one displayed by
|
||||||
`--bisect`.)
|
`--bisect`.)
|
||||||
+
|
+
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
GVF=GIT-VERSION-FILE
|
GVF=GIT-VERSION-FILE
|
||||||
DEF_VER=v1.7.0
|
DEF_VER=v1.7.0.1
|
||||||
|
|
||||||
LF='
|
LF='
|
||||||
'
|
'
|
||||||
|
@ -2006,7 +2006,7 @@ static int find_pos(struct image *img,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If match_begining or match_end is specified, there is no
|
* If match_beginning or match_end is specified, there is no
|
||||||
* point starting from a wrong line that will never match and
|
* point starting from a wrong line that will never match and
|
||||||
* wander around and wait for a match at the specified end.
|
* wander around and wait for a match at the specified end.
|
||||||
*/
|
*/
|
||||||
|
@ -219,9 +219,10 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
|
|||||||
"exit with zero when there's no error", 'e'),
|
"exit with zero when there's no error", 'e'),
|
||||||
OPT_SET_INT('p', NULL, &opt, "pretty-print object's content", 'p'),
|
OPT_SET_INT('p', NULL, &opt, "pretty-print object's content", 'p'),
|
||||||
OPT_SET_INT(0, "batch", &batch,
|
OPT_SET_INT(0, "batch", &batch,
|
||||||
"show info and content of objects feeded on stdin", BATCH),
|
"show info and content of objects fed from the standard input",
|
||||||
|
BATCH),
|
||||||
OPT_SET_INT(0, "batch-check", &batch,
|
OPT_SET_INT(0, "batch-check", &batch,
|
||||||
"show info about objects feeded on stdin",
|
"show info about objects fed from the standard input",
|
||||||
BATCH_CHECK),
|
BATCH_CHECK),
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
|
@ -41,7 +41,7 @@ static const char implicit_ident_advice[] =
|
|||||||
"on your username and hostname. Please check that they are accurate.\n"
|
"on your username and hostname. Please check that they are accurate.\n"
|
||||||
"You can suppress this message by setting them explicitly:\n"
|
"You can suppress this message by setting them explicitly:\n"
|
||||||
"\n"
|
"\n"
|
||||||
" git config --global user.name Your Name\n"
|
" git config --global user.name \"Your Name\"\n"
|
||||||
" git config --global user.email you@example.com\n"
|
" git config --global user.email you@example.com\n"
|
||||||
"\n"
|
"\n"
|
||||||
"If the identity used for this commit is wrong, you can fix it with:\n"
|
"If the identity used for this commit is wrong, you can fix it with:\n"
|
||||||
|
@ -408,15 +408,25 @@ static int pathspec_matches(const char **paths, const char *name, int max_depth)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void *lock_and_read_sha1_file(const unsigned char *sha1, enum object_type *type, unsigned long *size)
|
||||||
|
{
|
||||||
|
void *data;
|
||||||
|
|
||||||
|
if (use_threads) {
|
||||||
|
read_sha1_lock();
|
||||||
|
data = read_sha1_file(sha1, type, size);
|
||||||
|
read_sha1_unlock();
|
||||||
|
} else {
|
||||||
|
data = read_sha1_file(sha1, type, size);
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
static void *load_sha1(const unsigned char *sha1, unsigned long *size,
|
static void *load_sha1(const unsigned char *sha1, unsigned long *size,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
enum object_type type;
|
enum object_type type;
|
||||||
char *data;
|
void *data = lock_and_read_sha1_file(sha1, &type, size);
|
||||||
|
|
||||||
read_sha1_lock();
|
|
||||||
data = read_sha1_file(sha1, &type, size);
|
|
||||||
read_sha1_unlock();
|
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
error("'%s': unable to read %s", name, sha1_to_hex(sha1));
|
error("'%s': unable to read %s", name, sha1_to_hex(sha1));
|
||||||
@ -605,10 +615,7 @@ static int grep_tree(struct grep_opt *opt, const char **paths,
|
|||||||
void *data;
|
void *data;
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
|
|
||||||
read_sha1_lock();
|
data = lock_and_read_sha1_file(entry.sha1, &type, &size);
|
||||||
data = read_sha1_file(entry.sha1, &type, &size);
|
|
||||||
read_sha1_unlock();
|
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
die("unable to read tree (%s)",
|
die("unable to read tree (%s)",
|
||||||
sha1_to_hex(entry.sha1));
|
sha1_to_hex(entry.sha1));
|
||||||
@ -861,6 +868,16 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
|
|||||||
PARSE_OPT_STOP_AT_NON_OPTION |
|
PARSE_OPT_STOP_AT_NON_OPTION |
|
||||||
PARSE_OPT_NO_INTERNAL_HELP);
|
PARSE_OPT_NO_INTERNAL_HELP);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* skip a -- separator; we know it cannot be
|
||||||
|
* separating revisions from pathnames if
|
||||||
|
* we haven't even had any patterns yet
|
||||||
|
*/
|
||||||
|
if (argc > 0 && !opt.pattern_list && !strcmp(argv[0], "--")) {
|
||||||
|
argv++;
|
||||||
|
argc--;
|
||||||
|
}
|
||||||
|
|
||||||
/* First unrecognized non-option token */
|
/* First unrecognized non-option token */
|
||||||
if (argc > 0 && !opt.pattern_list) {
|
if (argc > 0 && !opt.pattern_list) {
|
||||||
append_grep_pattern(&opt, argv[0], "command line", 0,
|
append_grep_pattern(&opt, argv[0], "command line", 0,
|
||||||
|
@ -1089,7 +1089,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* We cannot move this anywhere earlier because we do want to
|
* We cannot move this anywhere earlier because we do want to
|
||||||
* know if --root was given explicitly from the comand line.
|
* know if --root was given explicitly from the command line.
|
||||||
*/
|
*/
|
||||||
rev.show_root_diff = 1;
|
rev.show_root_diff = 1;
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ static void prune_object_dir(const char *path)
|
|||||||
/*
|
/*
|
||||||
* Write errors (particularly out of space) can result in
|
* Write errors (particularly out of space) can result in
|
||||||
* failed temporary packs (and more rarely indexes and other
|
* failed temporary packs (and more rarely indexes and other
|
||||||
* files begining with "tmp_") accumulating in the object
|
* files beginning with "tmp_") accumulating in the object
|
||||||
* and the pack directories.
|
* and the pack directories.
|
||||||
*/
|
*/
|
||||||
static void remove_temporary_files(const char *path)
|
static void remove_temporary_files(const char *path)
|
||||||
|
@ -38,6 +38,7 @@ static const char * const cherry_pick_usage[] = {
|
|||||||
static int edit, no_replay, no_commit, mainline, signoff;
|
static int edit, no_replay, no_commit, mainline, signoff;
|
||||||
static enum { REVERT, CHERRY_PICK } action;
|
static enum { REVERT, CHERRY_PICK } action;
|
||||||
static struct commit *commit;
|
static struct commit *commit;
|
||||||
|
static const char *commit_name;
|
||||||
static int allow_rerere_auto;
|
static int allow_rerere_auto;
|
||||||
|
|
||||||
static const char *me;
|
static const char *me;
|
||||||
@ -49,7 +50,6 @@ static void parse_args(int argc, const char **argv)
|
|||||||
const char * const * usage_str =
|
const char * const * usage_str =
|
||||||
action == REVERT ? revert_usage : cherry_pick_usage;
|
action == REVERT ? revert_usage : cherry_pick_usage;
|
||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
const char *arg;
|
|
||||||
int noop;
|
int noop;
|
||||||
struct option options[] = {
|
struct option options[] = {
|
||||||
OPT_BOOLEAN('n', "no-commit", &no_commit, "don't automatically commit"),
|
OPT_BOOLEAN('n', "no-commit", &no_commit, "don't automatically commit"),
|
||||||
@ -64,19 +64,13 @@ static void parse_args(int argc, const char **argv)
|
|||||||
|
|
||||||
if (parse_options(argc, argv, NULL, options, usage_str, 0) != 1)
|
if (parse_options(argc, argv, NULL, options, usage_str, 0) != 1)
|
||||||
usage_with_options(usage_str, options);
|
usage_with_options(usage_str, options);
|
||||||
arg = argv[0];
|
|
||||||
|
|
||||||
if (get_sha1(arg, sha1))
|
commit_name = argv[0];
|
||||||
die ("Cannot find '%s'", arg);
|
if (get_sha1(commit_name, sha1))
|
||||||
commit = (struct commit *)parse_object(sha1);
|
die ("Cannot find '%s'", commit_name);
|
||||||
|
commit = lookup_commit_reference(sha1);
|
||||||
if (!commit)
|
if (!commit)
|
||||||
die ("Could not find %s", sha1_to_hex(sha1));
|
exit(1);
|
||||||
if (commit->object.type == OBJ_TAG) {
|
|
||||||
commit = (struct commit *)
|
|
||||||
deref_tag((struct object *)commit, arg, strlen(arg));
|
|
||||||
}
|
|
||||||
if (commit->object.type != OBJ_COMMIT)
|
|
||||||
die ("'%s' does not point to a commit", arg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *get_oneline(const char *message)
|
static char *get_oneline(const char *message)
|
||||||
@ -204,25 +198,27 @@ static void set_author_ident_env(const char *message)
|
|||||||
sha1_to_hex(commit->object.sha1));
|
sha1_to_hex(commit->object.sha1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *help_msg(const unsigned char *sha1)
|
static char *help_msg(const char *name)
|
||||||
{
|
{
|
||||||
static char helpbuf[1024];
|
struct strbuf helpbuf = STRBUF_INIT;
|
||||||
char *msg = getenv("GIT_CHERRY_PICK_HELP");
|
char *msg = getenv("GIT_CHERRY_PICK_HELP");
|
||||||
|
|
||||||
if (msg)
|
if (msg)
|
||||||
return msg;
|
return msg;
|
||||||
|
|
||||||
strcpy(helpbuf, " After resolving the conflicts,\n"
|
strbuf_addstr(&helpbuf, " After resolving the conflicts,\n"
|
||||||
"mark the corrected paths with 'git add <paths>' "
|
"mark the corrected paths with 'git add <paths>' or 'git rm <paths>'\n"
|
||||||
"or 'git rm <paths>' and commit the result.");
|
"and commit the result");
|
||||||
|
|
||||||
if (action == CHERRY_PICK) {
|
if (action == CHERRY_PICK) {
|
||||||
sprintf(helpbuf + strlen(helpbuf),
|
strbuf_addf(&helpbuf, " with: \n"
|
||||||
"\nWhen commiting, use the option "
|
"\n"
|
||||||
"'-c %s' to retain authorship and message.",
|
" git commit -c %s\n",
|
||||||
find_unique_abbrev(sha1, DEFAULT_ABBREV));
|
name);
|
||||||
}
|
}
|
||||||
return helpbuf;
|
else
|
||||||
|
strbuf_addch(&helpbuf, '.');
|
||||||
|
return strbuf_detach(&helpbuf, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct tree *empty_tree(void)
|
static struct tree *empty_tree(void)
|
||||||
@ -409,7 +405,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
|
|||||||
if (commit_lock_file(&msg_file) < 0)
|
if (commit_lock_file(&msg_file) < 0)
|
||||||
die ("Error wrapping up %s", defmsg);
|
die ("Error wrapping up %s", defmsg);
|
||||||
fprintf(stderr, "Automatic %s failed.%s\n",
|
fprintf(stderr, "Automatic %s failed.%s\n",
|
||||||
me, help_msg(commit->object.sha1));
|
me, help_msg(commit_name));
|
||||||
rerere(allow_rerere_auto);
|
rerere(allow_rerere_auto);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -567,7 +567,7 @@ static int git_show_branch_config(const char *var, const char *value, void *cb)
|
|||||||
return config_error_nonbool(var);
|
return config_error_nonbool(var);
|
||||||
/*
|
/*
|
||||||
* default_arg is now passed to parse_options(), so we need to
|
* default_arg is now passed to parse_options(), so we need to
|
||||||
* mimick the real argv a bit better.
|
* mimic the real argv a bit better.
|
||||||
*/
|
*/
|
||||||
if (!default_num) {
|
if (!default_num) {
|
||||||
default_alloc = 20;
|
default_alloc = 20;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2009 Andrzej K. Haczewski <ahaczewski@gmail.com>
|
* Copyright (C) 2009 Andrzej K. Haczewski <ahaczewski@gmail.com>
|
||||||
*
|
*
|
||||||
* DISCLAMER: The implementation is Git-specific, it is subset of original
|
* DISCLAIMER: The implementation is Git-specific, it is subset of original
|
||||||
* Pthreads API, without lots of other features that Git doesn't use.
|
* Pthreads API, without lots of other features that Git doesn't use.
|
||||||
* Git also makes sure that the passed arguments are valid, so there's
|
* Git also makes sure that the passed arguments are valid, so there's
|
||||||
* no need for double-checking.
|
* no need for double-checking.
|
||||||
|
@ -504,7 +504,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Don't do destructive transforms with git:// as that
|
* Don't do destructive transforms with git:// as that
|
||||||
* protocol code does '[]' dewrapping of its own.
|
* protocol code does '[]' unwrapping of its own.
|
||||||
*/
|
*/
|
||||||
if (host[0] == '[') {
|
if (host[0] == '[') {
|
||||||
end = strchr(host + 1, ']');
|
end = strchr(host + 1, ']');
|
||||||
|
@ -967,9 +967,8 @@ class P4Sync(Command):
|
|||||||
elif file["type"] == "symlink":
|
elif file["type"] == "symlink":
|
||||||
mode = "120000"
|
mode = "120000"
|
||||||
# p4 print on a symlink contains "target\n", so strip it off
|
# p4 print on a symlink contains "target\n", so strip it off
|
||||||
last = contents.pop()
|
data = ''.join(contents)
|
||||||
last = last[:-1]
|
contents = [data[:-1]]
|
||||||
contents.append(last)
|
|
||||||
|
|
||||||
if self.isWindows and file["type"].endswith("text"):
|
if self.isWindows and file["type"].endswith("text"):
|
||||||
mangled = []
|
mangled = []
|
||||||
|
@ -344,7 +344,7 @@ sub parsekeyvaluepair
|
|||||||
|
|
||||||
Key and value strings may be enclosed in quotes, in which case
|
Key and value strings may be enclosed in quotes, in which case
|
||||||
whitespace inside the quotes is preserved. Additionally, an equal
|
whitespace inside the quotes is preserved. Additionally, an equal
|
||||||
sign may be included in the key by preceeding it with a backslash.
|
sign may be included in the key by preceding it with a backslash.
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
"key1 "=value1
|
"key1 "=value1
|
||||||
|
2
daemon.c
2
daemon.c
@ -407,7 +407,7 @@ static void parse_host_and_port(char *hostport, char **host,
|
|||||||
|
|
||||||
end = strchr(hostport, ']');
|
end = strchr(hostport, ']');
|
||||||
if (!end)
|
if (!end)
|
||||||
die("Invalid reqeuest ('[' without ']')");
|
die("Invalid request ('[' without ']')");
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
*host = hostport + 1;
|
*host = hostport + 1;
|
||||||
if (!end[1])
|
if (!end[1])
|
||||||
|
4
diff.c
4
diff.c
@ -2893,6 +2893,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
|
|||||||
;
|
;
|
||||||
else if (!prefixcmp(arg, "--output=")) {
|
else if (!prefixcmp(arg, "--output=")) {
|
||||||
options->file = fopen(arg + strlen("--output="), "w");
|
options->file = fopen(arg + strlen("--output="), "w");
|
||||||
|
if (!options->file)
|
||||||
|
die_errno("Could not open '%s'", arg + strlen("--output="));
|
||||||
options->close_file = 1;
|
options->close_file = 1;
|
||||||
} else
|
} else
|
||||||
return 0;
|
return 0;
|
||||||
@ -3642,7 +3644,7 @@ static void diffcore_skip_stat_unmatch(struct diff_options *diffopt)
|
|||||||
struct diff_filepair *p = q->queue[i];
|
struct diff_filepair *p = q->queue[i];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 1. Entries that come from stat info dirtyness
|
* 1. Entries that come from stat info dirtiness
|
||||||
* always have both sides (iow, not create/delete),
|
* always have both sides (iow, not create/delete),
|
||||||
* one side of the object name is unknown, with
|
* one side of the object name is unknown, with
|
||||||
* the same mode and size. Keep the ones that
|
* the same mode and size. Keep the ones that
|
||||||
|
2
dir.c
2
dir.c
@ -1044,7 +1044,7 @@ int remove_path(const char *name)
|
|||||||
slash = dirs + (slash - name);
|
slash = dirs + (slash - name);
|
||||||
do {
|
do {
|
||||||
*slash = '\0';
|
*slash = '\0';
|
||||||
} while (rmdir(dirs) && (slash = strrchr(dirs, '/')));
|
} while (rmdir(dirs) == 0 && (slash = strrchr(dirs, '/')));
|
||||||
free(dirs);
|
free(dirs);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -776,6 +776,5 @@ do
|
|||||||
go_next
|
go_next
|
||||||
done
|
done
|
||||||
|
|
||||||
git gc --auto
|
|
||||||
|
|
||||||
rm -fr "$dotest"
|
rm -fr "$dotest"
|
||||||
|
git gc --auto
|
||||||
|
@ -221,6 +221,7 @@ show_stash () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
apply_stash () {
|
apply_stash () {
|
||||||
|
applied_stash=
|
||||||
unstash_index=
|
unstash_index=
|
||||||
|
|
||||||
while test $# != 0
|
while test $# != 0
|
||||||
@ -242,6 +243,9 @@ apply_stash () {
|
|||||||
if test $# = 0
|
if test $# = 0
|
||||||
then
|
then
|
||||||
have_stash || die 'Nothing to apply'
|
have_stash || die 'Nothing to apply'
|
||||||
|
applied_stash="$ref_stash@{0}"
|
||||||
|
else
|
||||||
|
applied_stash="$*"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# stash records the work tree, and is a merge between the
|
# stash records the work tree, and is a merge between the
|
||||||
@ -415,8 +419,7 @@ pop)
|
|||||||
shift
|
shift
|
||||||
if apply_stash "$@"
|
if apply_stash "$@"
|
||||||
then
|
then
|
||||||
test -z "$unstash_index" || shift
|
drop_stash "$applied_stash"
|
||||||
drop_stash "$@"
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
branch)
|
branch)
|
||||||
|
2
git.c
2
git.c
@ -527,7 +527,7 @@ int main(int argc, const char **argv)
|
|||||||
break;
|
break;
|
||||||
if (was_alias) {
|
if (was_alias) {
|
||||||
fprintf(stderr, "Expansion of alias '%s' failed; "
|
fprintf(stderr, "Expansion of alias '%s' failed; "
|
||||||
"'%s' is not a git-command\n",
|
"'%s' is not a git command\n",
|
||||||
cmd, argv[0]);
|
cmd, argv[0]);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
2
help.c
2
help.c
@ -350,7 +350,7 @@ const char *help_unknown_cmd(const char *cmd)
|
|||||||
return assumed;
|
return assumed;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "git: '%s' is not a git-command. See 'git --help'.\n", cmd);
|
fprintf(stderr, "git: '%s' is not a git command. See 'git --help'.\n", cmd);
|
||||||
|
|
||||||
if (SIMILAR_ENOUGH(best_similarity)) {
|
if (SIMILAR_ENOUGH(best_similarity)) {
|
||||||
fprintf(stderr, "\nDid you mean %s?\n",
|
fprintf(stderr, "\nDid you mean %s?\n",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define LEVENSHTEIN_H
|
#define LEVENSHTEIN_H
|
||||||
|
|
||||||
int levenshtein(const char *string1, const char *string2,
|
int levenshtein(const char *string1, const char *string2,
|
||||||
int swap_penalty, int substition_penalty,
|
int swap_penalty, int substitution_penalty,
|
||||||
int insertion_penalty, int deletion_penalty);
|
int insertion_penalty, int deletion_penalty);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
2
path.c
2
path.c
@ -610,7 +610,7 @@ int daemon_avoid_alias(const char *p)
|
|||||||
/*
|
/*
|
||||||
* This resurrects the belts and suspenders paranoia check by HPA
|
* This resurrects the belts and suspenders paranoia check by HPA
|
||||||
* done in <435560F7.4080006@zytor.com> thread, now enter_repo()
|
* done in <435560F7.4080006@zytor.com> thread, now enter_repo()
|
||||||
* does not do getcwd() based path canonicalizations.
|
* does not do getcwd() based path canonicalization.
|
||||||
*
|
*
|
||||||
* sl becomes true immediately after seeing '/' and continues to
|
* sl becomes true immediately after seeing '/' and continues to
|
||||||
* be true as long as dots continue after that without intervening
|
* be true as long as dots continue after that without intervening
|
||||||
|
@ -204,14 +204,14 @@ sub repository {
|
|||||||
$dir = $opts{Directory};
|
$dir = $opts{Directory};
|
||||||
|
|
||||||
unless (-d "$dir/refs" and -d "$dir/objects" and -e "$dir/HEAD") {
|
unless (-d "$dir/refs" and -d "$dir/objects" and -e "$dir/HEAD") {
|
||||||
# Mimick git-rev-parse --git-dir error message:
|
# Mimic git-rev-parse --git-dir error message:
|
||||||
throw Error::Simple("fatal: Not a git repository: $dir");
|
throw Error::Simple("fatal: Not a git repository: $dir");
|
||||||
}
|
}
|
||||||
my $search = Git->repository(Repository => $dir);
|
my $search = Git->repository(Repository => $dir);
|
||||||
try {
|
try {
|
||||||
$search->command('symbolic-ref', 'HEAD');
|
$search->command('symbolic-ref', 'HEAD');
|
||||||
} catch Git::Error::Command with {
|
} catch Git::Error::Command with {
|
||||||
# Mimick git-rev-parse --git-dir error message:
|
# Mimic git-rev-parse --git-dir error message:
|
||||||
throw Error::Simple("fatal: Not a git repository: $dir");
|
throw Error::Simple("fatal: Not a git repository: $dir");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
refs.c
2
refs.c
@ -706,7 +706,7 @@ int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
|
|||||||
|
|
||||||
has_glob_specials = strpbrk(pattern, "?*[");
|
has_glob_specials = strpbrk(pattern, "?*[");
|
||||||
if (!has_glob_specials) {
|
if (!has_glob_specials) {
|
||||||
/* Append impiled '/' '*' if not present. */
|
/* Append implied '/' '*' if not present. */
|
||||||
if (real_pattern.buf[real_pattern.len - 1] != '/')
|
if (real_pattern.buf[real_pattern.len - 1] != '/')
|
||||||
strbuf_addch(&real_pattern, '/');
|
strbuf_addch(&real_pattern, '/');
|
||||||
/* No need to check for '*', there is none. */
|
/* No need to check for '*', there is none. */
|
||||||
|
9
rerere.c
9
rerere.c
@ -364,7 +364,7 @@ static int find_conflict(struct string_list *conflict)
|
|||||||
static int merge(const char *name, const char *path)
|
static int merge(const char *name, const char *path)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
mmfile_t cur, base, other;
|
mmfile_t cur = {NULL, 0}, base = {NULL, 0}, other = {NULL, 0};
|
||||||
mmbuffer_t result = {NULL, 0};
|
mmbuffer_t result = {NULL, 0};
|
||||||
|
|
||||||
if (handle_file(path, NULL, rerere_path(name, "thisimage")) < 0)
|
if (handle_file(path, NULL, rerere_path(name, "thisimage")) < 0)
|
||||||
@ -372,8 +372,10 @@ static int merge(const char *name, const char *path)
|
|||||||
|
|
||||||
if (read_mmfile(&cur, rerere_path(name, "thisimage")) ||
|
if (read_mmfile(&cur, rerere_path(name, "thisimage")) ||
|
||||||
read_mmfile(&base, rerere_path(name, "preimage")) ||
|
read_mmfile(&base, rerere_path(name, "preimage")) ||
|
||||||
read_mmfile(&other, rerere_path(name, "postimage")))
|
read_mmfile(&other, rerere_path(name, "postimage"))) {
|
||||||
return 1;
|
ret = 1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
ret = ll_merge(&result, path, &base, &cur, "", &other, "", 0);
|
ret = ll_merge(&result, path, &base, &cur, "", &other, "", 0);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
FILE *f = fopen(path, "w");
|
FILE *f = fopen(path, "w");
|
||||||
@ -387,6 +389,7 @@ static int merge(const char *name, const char *path)
|
|||||||
strerror(errno));
|
strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
free(cur.ptr);
|
free(cur.ptr);
|
||||||
free(base.ptr);
|
free(base.ptr);
|
||||||
free(other.ptr);
|
free(other.ptr);
|
||||||
|
2
setup.c
2
setup.c
@ -206,7 +206,7 @@ int is_inside_work_tree(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* set_work_tree() is only ever called if you set GIT_DIR explicitely.
|
* set_work_tree() is only ever called if you set GIT_DIR explicitly.
|
||||||
* The old behaviour (which we retain here) is to set the work tree root
|
* The old behaviour (which we retain here) is to set the work tree root
|
||||||
* to the cwd, unless overridden by the config, the command line, or
|
* to the cwd, unless overridden by the config, the command line, or
|
||||||
* GIT_WORK_TREE.
|
* GIT_WORK_TREE.
|
||||||
|
@ -280,8 +280,7 @@ int dwim_ref(const char *str, int len, unsigned char *sha1, char **ref)
|
|||||||
*ref = xstrdup(r);
|
*ref = xstrdup(r);
|
||||||
if (!warn_ambiguous_refs)
|
if (!warn_ambiguous_refs)
|
||||||
break;
|
break;
|
||||||
} else if ((flag & REF_ISSYMREF) &&
|
} else if ((flag & REF_ISSYMREF) && strcmp(fullref, "HEAD"))
|
||||||
(len != 4 || strcmp(str, "HEAD")))
|
|
||||||
warning("ignoring dangling symref %s.", fullref);
|
warning("ignoring dangling symref %s.", fullref);
|
||||||
}
|
}
|
||||||
free(last_branch);
|
free(last_branch);
|
||||||
@ -993,6 +992,7 @@ static void diagnose_invalid_index_path(int stage,
|
|||||||
pos = cache_name_pos(filename, namelen);
|
pos = cache_name_pos(filename, namelen);
|
||||||
if (pos < 0)
|
if (pos < 0)
|
||||||
pos = -pos - 1;
|
pos = -pos - 1;
|
||||||
|
if (pos < active_nr) {
|
||||||
ce = active_cache[pos];
|
ce = active_cache[pos];
|
||||||
if (ce_namelen(ce) == namelen &&
|
if (ce_namelen(ce) == namelen &&
|
||||||
!memcmp(ce->name, filename, namelen))
|
!memcmp(ce->name, filename, namelen))
|
||||||
@ -1000,6 +1000,7 @@ static void diagnose_invalid_index_path(int stage,
|
|||||||
"Did you mean ':%d:%s'?",
|
"Did you mean ':%d:%s'?",
|
||||||
filename, stage,
|
filename, stage,
|
||||||
ce_stage(ce), filename);
|
ce_stage(ce), filename);
|
||||||
|
}
|
||||||
|
|
||||||
/* Confusion between relative and absolute filenames? */
|
/* Confusion between relative and absolute filenames? */
|
||||||
fullnamelen = namelen + strlen(prefix);
|
fullnamelen = namelen + strlen(prefix);
|
||||||
@ -1009,6 +1010,7 @@ static void diagnose_invalid_index_path(int stage,
|
|||||||
pos = cache_name_pos(fullname, fullnamelen);
|
pos = cache_name_pos(fullname, fullnamelen);
|
||||||
if (pos < 0)
|
if (pos < 0)
|
||||||
pos = -pos - 1;
|
pos = -pos - 1;
|
||||||
|
if (pos < active_nr) {
|
||||||
ce = active_cache[pos];
|
ce = active_cache[pos];
|
||||||
if (ce_namelen(ce) == fullnamelen &&
|
if (ce_namelen(ce) == fullnamelen &&
|
||||||
!memcmp(ce->name, fullname, fullnamelen))
|
!memcmp(ce->name, fullname, fullnamelen))
|
||||||
@ -1016,6 +1018,7 @@ static void diagnose_invalid_index_path(int stage,
|
|||||||
"Did you mean ':%d:%s'?",
|
"Did you mean ':%d:%s'?",
|
||||||
fullname, filename,
|
fullname, filename,
|
||||||
ce_stage(ce), fullname);
|
ce_stage(ce), fullname);
|
||||||
|
}
|
||||||
|
|
||||||
if (!lstat(filename, &st))
|
if (!lstat(filename, &st))
|
||||||
die("Path '%s' exists on disk, but not in the index.", filename);
|
die("Path '%s' exists on disk, but not in the index.", filename);
|
||||||
|
@ -66,12 +66,12 @@ tagger T A Gger <tagger@example.com> 1234567890 -0000
|
|||||||
This is an invalid tag.
|
This is an invalid tag.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
test_expect_failure 'tag pointing to nonexistent' '
|
test_expect_success 'tag pointing to nonexistent' '
|
||||||
tag=$(git hash-object -w --stdin < invalid-tag) &&
|
tag=$(git hash-object -t tag -w --stdin < invalid-tag) &&
|
||||||
echo $tag > .git/refs/tags/invalid &&
|
echo $tag > .git/refs/tags/invalid &&
|
||||||
git fsck --tags 2>out &&
|
test_must_fail git fsck --tags >out &&
|
||||||
cat out &&
|
cat out &&
|
||||||
grep "could not load tagged object" out &&
|
grep "broken link" out &&
|
||||||
rm .git/refs/tags/invalid
|
rm .git/refs/tags/invalid
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -84,12 +84,12 @@ tagger T A Gger <tagger@example.com> 1234567890 -0000
|
|||||||
This is an invalid tag.
|
This is an invalid tag.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
test_expect_failure 'tag pointing to something else than its type' '
|
test_expect_success 'tag pointing to something else than its type' '
|
||||||
tag=$(git hash-object -w --stdin < wrong-tag) &&
|
tag=$(git hash-object -t tag -w --stdin < wrong-tag) &&
|
||||||
echo $tag > .git/refs/tags/wrong &&
|
echo $tag > .git/refs/tags/wrong &&
|
||||||
git fsck --tags 2>out &&
|
test_must_fail git fsck --tags 2>out &&
|
||||||
cat out &&
|
cat out &&
|
||||||
grep "some sane error message" out &&
|
grep "error in tag.*broken links" out &&
|
||||||
rm .git/refs/tags/wrong
|
rm .git/refs/tags/wrong
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ test_description='Test commit notes'
|
|||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
cat > fake_editor.sh << \EOF
|
cat > fake_editor.sh << \EOF
|
||||||
|
#!/bin/sh
|
||||||
echo "$MSG" > "$1"
|
echo "$MSG" > "$1"
|
||||||
echo "$MSG" >& 2
|
echo "$MSG" >& 2
|
||||||
EOF
|
EOF
|
||||||
|
@ -271,4 +271,12 @@ test_expect_success 'choking "git rm" should not let it die with cruft' '
|
|||||||
test "$status" != 0
|
test "$status" != 0
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'rm removes subdirectories recursively' '
|
||||||
|
mkdir -p dir/subdir/subsubdir &&
|
||||||
|
echo content >dir/subdir/subsubdir/file &&
|
||||||
|
git add dir/subdir/subsubdir/file &&
|
||||||
|
git rm -f dir/subdir/subsubdir/file &&
|
||||||
|
! test -d dir
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
@ -194,6 +194,15 @@ test_expect_success 'pop -q is quiet' '
|
|||||||
test ! -s output.out
|
test ! -s output.out
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'pop -q --index works and is quiet' '
|
||||||
|
echo foo > file &&
|
||||||
|
git add file &&
|
||||||
|
git stash save --quiet &&
|
||||||
|
git stash pop -q --index > output.out 2>&1 &&
|
||||||
|
test foo = "$(git show :file)" &&
|
||||||
|
test ! -s output.out
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'drop -q is quiet' '
|
test_expect_success 'drop -q is quiet' '
|
||||||
git stash &&
|
git stash &&
|
||||||
git stash drop -q > output.out 2>&1 &&
|
git stash drop -q > output.out 2>&1 &&
|
||||||
|
@ -434,4 +434,37 @@ test_expect_success 'grep -Fi' '
|
|||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'setup double-dash tests' '
|
||||||
|
cat >double-dash <<EOF &&
|
||||||
|
--
|
||||||
|
->
|
||||||
|
other
|
||||||
|
EOF
|
||||||
|
git add double-dash
|
||||||
|
'
|
||||||
|
|
||||||
|
cat >expected <<EOF
|
||||||
|
double-dash:->
|
||||||
|
EOF
|
||||||
|
test_expect_success 'grep -- pattern' '
|
||||||
|
git grep -- "->" >actual &&
|
||||||
|
test_cmp expected actual
|
||||||
|
'
|
||||||
|
test_expect_success 'grep -- pattern -- pathspec' '
|
||||||
|
git grep -- "->" -- double-dash >actual &&
|
||||||
|
test_cmp expected actual
|
||||||
|
'
|
||||||
|
test_expect_success 'grep -e pattern -- path' '
|
||||||
|
git grep -e "->" -- double-dash >actual &&
|
||||||
|
test_cmp expected actual
|
||||||
|
'
|
||||||
|
|
||||||
|
cat >expected <<EOF
|
||||||
|
double-dash:--
|
||||||
|
EOF
|
||||||
|
test_expect_success 'grep -e -- -- path' '
|
||||||
|
git grep -e -- -- double-dash >actual &&
|
||||||
|
test_cmp expected actual
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This program can either change modification time of the given
|
* This program can either change modification time of the given
|
||||||
* file(s) or just print it. The program does not change atime nor
|
* file(s) or just print it. The program does not change atime nor
|
||||||
* ctime (their values are explicitely preserved).
|
* ctime (their values are explicitly preserved).
|
||||||
*
|
*
|
||||||
* The mtime can be changed to an absolute value:
|
* The mtime can be changed to an absolute value:
|
||||||
*
|
*
|
||||||
|
@ -171,7 +171,7 @@ static struct child_process *get_helper(struct transport *transport)
|
|||||||
} else if (!strcmp(capname, "connect")) {
|
} else if (!strcmp(capname, "connect")) {
|
||||||
data->connect = 1;
|
data->connect = 1;
|
||||||
} else if (mandatory) {
|
} else if (mandatory) {
|
||||||
die("Unknown madatory capability %s. This remote "
|
die("Unknown mandatory capability %s. This remote "
|
||||||
"helper probably needs newer version of Git.\n",
|
"helper probably needs newer version of Git.\n",
|
||||||
capname);
|
capname);
|
||||||
}
|
}
|
||||||
|
@ -441,6 +441,7 @@ int get_tree_entry(const unsigned char *tree_sha1, const char *name, unsigned ch
|
|||||||
|
|
||||||
if (name[0] == '\0') {
|
if (name[0] == '\0') {
|
||||||
hashcpy(sha1, root);
|
hashcpy(sha1, root);
|
||||||
|
free(tree);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user