Compare commits
115 Commits
Author | SHA1 | Date | |
---|---|---|---|
8fc11b5aa9 | |||
6f2eacfeb2 | |||
013049c985 | |||
5f815e5922 | |||
36071af305 | |||
3ac0ebbba4 | |||
8f1d2e6f49 | |||
3be7098ce4 | |||
7d0e65b892 | |||
476e801111 | |||
34c99da2a4 | |||
576cfc86fc | |||
92e802c6cc | |||
c1fe2fe4fe | |||
da6bf70ebf | |||
2ed8e622bf | |||
2961e0ee8b | |||
6ce183216d | |||
aa66c7ec77 | |||
81214e4ddf | |||
353ce81597 | |||
6ff0b1c56c | |||
2ccd2027b0 | |||
10ae7d86c1 | |||
b484ef28fb | |||
e58b97af31 | |||
31f883d1b8 | |||
50b4e0c178 | |||
b6ae5409ea | |||
88fb958baa | |||
d9e08be9d5 | |||
781411ed46 | |||
7f272ca80c | |||
b73cebf437 | |||
0a15217184 | |||
8b32572c74 | |||
4e7a2eccc2 | |||
82f9d58a39 | |||
89438677ab | |||
f1ec72ba1e | |||
17dff84b5e | |||
36cd2cc7d9 | |||
e9add36007 | |||
8eafa3da62 | |||
08337a97a2 | |||
e5f5219a4f | |||
975b31dc6e | |||
c97451ce09 | |||
7e4a2a8483 | |||
7d6fb370bc | |||
6ab58895cd | |||
ac44f3e7c0 | |||
9a84074d08 | |||
695bf722da | |||
bb5ebed731 | |||
c5ced64578 | |||
c63da8d8e8 | |||
1e80e04492 | |||
a14c225661 | |||
e99fcf96de | |||
69310a34cb | |||
7246ed438c | |||
f4a11066cf | |||
8d712aafd2 | |||
8ac4838af4 | |||
50e7b06730 | |||
e4e79a2175 | |||
6689f08735 | |||
9470657ad0 | |||
455c161c47 | |||
21b1aced83 | |||
c2f3bf071e | |||
41f93a2c90 | |||
a3431febfe | |||
4b3511b0f8 | |||
407c8eb0d0 | |||
29e4d36357 | |||
a5c21d6eb7 | |||
913419fcc6 | |||
47dd0d595d | |||
1c15afb934 | |||
1fdfd05db2 | |||
e32faa8adb | |||
ba922ccee7 | |||
d89056c258 | |||
3aadad1b32 | |||
ef1cc2cc21 | |||
42f4570c86 | |||
3af849a3da | |||
112d0bafd6 | |||
ea77e675e5 | |||
d808111ebd | |||
2247efb40b | |||
ad89721508 | |||
c054d64e87 | |||
f7087e2e7c | |||
8872f27b87 | |||
011fbc7f07 | |||
80248b2e48 | |||
01385e2758 | |||
69224716f7 | |||
68283999f8 | |||
3ae854c356 | |||
06bf6ac424 | |||
ee34518d62 | |||
06d900cf28 | |||
e5e3a9d8f9 | |||
1403959cc8 | |||
2a58a9a92e | |||
92811b5767 | |||
c6f60f991f | |||
6677c4665a | |||
8431c4eb09 | |||
988eece42a | |||
31ec6abf88 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -60,7 +60,6 @@ git-merge-stupid
|
|||||||
git-mktag
|
git-mktag
|
||||||
git-name-rev
|
git-name-rev
|
||||||
git-mv
|
git-mv
|
||||||
git-octopus
|
|
||||||
git-pack-redundant
|
git-pack-redundant
|
||||||
git-pack-objects
|
git-pack-objects
|
||||||
git-parse-remote
|
git-parse-remote
|
||||||
@ -120,3 +119,4 @@ git-core.spec
|
|||||||
*.exe
|
*.exe
|
||||||
libgit.a
|
libgit.a
|
||||||
*.o
|
*.o
|
||||||
|
*.py[co]
|
||||||
|
@ -138,7 +138,7 @@ mailing list archives for details).
|
|||||||
git has a couple of alternatives, though, that you may find sufficient
|
git has a couple of alternatives, though, that you may find sufficient
|
||||||
or even superior depending on your use. One is called "git-whatchanged"
|
or even superior depending on your use. One is called "git-whatchanged"
|
||||||
(for obvious reasons) and the other one is called "pickaxe" ("a tool for
|
(for obvious reasons) and the other one is called "pickaxe" ("a tool for
|
||||||
the software archeologist").
|
the software archaeologist").
|
||||||
|
|
||||||
The "git-whatchanged" script is a truly trivial script that can give you
|
The "git-whatchanged" script is a truly trivial script that can give you
|
||||||
a good overview of what has changed in a file or a directory (or an
|
a good overview of what has changed in a file or a directory (or an
|
||||||
|
@ -117,7 +117,7 @@ git specific extension to diff format
|
|||||||
What -p option produces is slightly different from the
|
What -p option produces is slightly different from the
|
||||||
traditional diff format.
|
traditional diff format.
|
||||||
|
|
||||||
1. It is preceeded with a "git diff" header, that looks like
|
1. It is preceded with a "git diff" header, that looks like
|
||||||
this:
|
this:
|
||||||
|
|
||||||
diff --git a/file1 b/file2
|
diff --git a/file1 b/file2
|
||||||
|
@ -18,6 +18,14 @@
|
|||||||
object name of pre- and post-image blob on the "index"
|
object name of pre- and post-image blob on the "index"
|
||||||
line when generating a patch format output.
|
line when generating a patch format output.
|
||||||
|
|
||||||
|
--abbrev[=<n>]::
|
||||||
|
Instead of showing the full 40-byte hexadecimal object
|
||||||
|
name in diff-raw format output and diff-tree header
|
||||||
|
lines, show only handful hexdigits prefix. This is
|
||||||
|
independent of --full-index option above, which controls
|
||||||
|
the diff-patch output format. Non default number of
|
||||||
|
digits can be specified with --abbrev=<n>.
|
||||||
|
|
||||||
-B::
|
-B::
|
||||||
Break complete rewrite changes into pairs of delete and create.
|
Break complete rewrite changes into pairs of delete and create.
|
||||||
|
|
||||||
|
@ -211,10 +211,12 @@ $ git fetch --tags <8>
|
|||||||
|
|
||||||
<1> repeat as needed.
|
<1> repeat as needed.
|
||||||
<2> extract patches from your branch for e-mail submission.
|
<2> extract patches from your branch for e-mail submission.
|
||||||
<3> "pull" fetches from "origin" by default and merges.
|
<3> "pull" fetches from "origin" by default and merges into the
|
||||||
<4> look at the changes since last time we checked, only in the
|
current branch.
|
||||||
|
<4> immediately after pulling, look at the changes done upstream
|
||||||
|
since last time we checked, only in the
|
||||||
area we are interested in.
|
area we are interested in.
|
||||||
<5> fetch from a specific branch from a specific repository and and merge.
|
<5> fetch from a specific branch from a specific repository and merge.
|
||||||
<6> revert the pull.
|
<6> revert the pull.
|
||||||
<7> garbage collect leftover objects from reverted pull.
|
<7> garbage collect leftover objects from reverted pull.
|
||||||
<8> from time to time, obtain official tags from the "origin"
|
<8> from time to time, obtain official tags from the "origin"
|
||||||
@ -330,16 +332,18 @@ master, nor exposed as a part of a stable branch.
|
|||||||
<8> and bundle topic branches still cooking.
|
<8> and bundle topic branches still cooking.
|
||||||
<9> backport a critical fix.
|
<9> backport a critical fix.
|
||||||
<10> create a signed tag.
|
<10> create a signed tag.
|
||||||
<11> make sure I did not accidentally rewound master beyond what I
|
<11> make sure I did not accidentally rewind master beyond what I
|
||||||
already pushed out. "ko" shorthand points at the repository I have
|
already pushed out. "ko" shorthand points at the repository I have
|
||||||
at kernel.org, and looks like this:
|
at kernel.org, and looks like this:
|
||||||
$ cat .git/remotes/ko
|
$ cat .git/remotes/ko
|
||||||
URL: kernel.org:/pub/scm/git/git.git
|
URL: kernel.org:/pub/scm/git/git.git
|
||||||
Pull: master:refs/tags/ko-master
|
Pull: master:refs/tags/ko-master
|
||||||
Pull: maint:refs/tags/ko-maint
|
Pull: maint:refs/tags/ko-maint
|
||||||
Push: master
|
Push: master
|
||||||
Push: +pu
|
Push: +pu
|
||||||
Push: maint
|
Push: maint
|
||||||
|
In the output from "git show-branch", "master" should have
|
||||||
|
everything "ko-master" has.
|
||||||
<12> push out the bleeding edge.
|
<12> push out the bleeding edge.
|
||||||
<13> push the tag out, too.
|
<13> push the tag out, too.
|
||||||
------------
|
------------
|
||||||
@ -357,8 +361,8 @@ and maintain access to the repository by developers.
|
|||||||
* gitlink:git-shell[1] can be used as a 'restricted login shell'
|
* gitlink:git-shell[1] can be used as a 'restricted login shell'
|
||||||
for shared central repository users.
|
for shared central repository users.
|
||||||
|
|
||||||
* link:howto/update-hook-example.txt[update hook howto] has a
|
link:howto/update-hook-example.txt[update hook howto] has a good
|
||||||
good example of managing a shared central repository.
|
example of managing a shared central repository.
|
||||||
|
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
@ -424,3 +428,14 @@ for branch policy control.
|
|||||||
david is the release manager and is the only person who can
|
david is the release manager and is the only person who can
|
||||||
create and push version tags.
|
create and push version tags.
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
HTTP server to support dumb protocol transfer.::
|
||||||
|
+
|
||||||
|
------------
|
||||||
|
dev$ git update-server-info <1>
|
||||||
|
dev$ ftp user@isp.example.com <2>
|
||||||
|
ftp> cp -r .git /home/user/myproject.git
|
||||||
|
|
||||||
|
<1> make sure your info/refs and objects/info/packs are up-to-date
|
||||||
|
<2> upload to public HTTP server hosted by your ISP.
|
||||||
|
------------
|
||||||
|
@ -31,7 +31,7 @@ DISCUSSION
|
|||||||
----------
|
----------
|
||||||
|
|
||||||
The list of <file> given to the command is fed to `git-ls-files`
|
The list of <file> given to the command is fed to `git-ls-files`
|
||||||
command to list files that are not registerd in the index and
|
command to list files that are not registered in the index and
|
||||||
are not ignored/excluded by `$GIT_DIR/info/exclude` file or
|
are not ignored/excluded by `$GIT_DIR/info/exclude` file or
|
||||||
`.gitignore` file in each directory. This means two things:
|
`.gitignore` file in each directory. This means two things:
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ git-am - Apply a series of patches in a mailbox
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
[verse]
|
||||||
'git-am' [--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] <mbox>...
|
'git-am' [--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] <mbox>...
|
||||||
'git-am' [--skip | --resolved]
|
'git-am' [--skip | --resolved]
|
||||||
|
|
||||||
|
@ -8,7 +8,10 @@ git-apply - Apply patch on a git index file and a work tree
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [-z] [<patch>...]
|
[verse]
|
||||||
|
'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply]
|
||||||
|
[--no-add] [--index-info] [--allow-binary-replacement] [-z]
|
||||||
|
[<patch>...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -8,14 +8,15 @@ git-archimport - Import an Arch repository into git
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
`git-archimport` [ -h ] [ -v ] [ -T ] [ -t tempdir ]
|
[verse]
|
||||||
<archive/branch> [ <archive/branch> ]
|
`git-archimport` [-h] [-v] [-o] [-a] [-f] [-T] [-D depth] [-t tempdir]
|
||||||
|
<archive/branch> [ <archive/branch> ]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
Imports a project from one or more Arch repositories. It will follow branches
|
Imports a project from one or more Arch repositories. It will follow branches
|
||||||
and repositories within the namespaces defined by the <archive/branch>
|
and repositories within the namespaces defined by the <archive/branch>
|
||||||
parameters suppplied. If it cannot find the remote branch a merge comes from
|
parameters supplied. If it cannot find the remote branch a merge comes from
|
||||||
it will just import it as a regular commit. If it can find it, it will mark it
|
it will just import it as a regular commit. If it can find it, it will mark it
|
||||||
as a merge whenever possible (see discussion below).
|
as a merge whenever possible (see discussion below).
|
||||||
|
|
||||||
@ -63,6 +64,26 @@ OPTIONS
|
|||||||
Many tags. Will create a tag for every commit, reflecting the commit
|
Many tags. Will create a tag for every commit, reflecting the commit
|
||||||
name in the Arch repository.
|
name in the Arch repository.
|
||||||
|
|
||||||
|
-f::
|
||||||
|
Use the fast patchset import strategy. This can be significantly
|
||||||
|
faster for large trees, but cannot handle directory renames or
|
||||||
|
permissions changes. The default strategy is slow and safe.
|
||||||
|
|
||||||
|
-o::
|
||||||
|
Use this for compatibility with old-style branch names used by
|
||||||
|
earlier versions of git-archimport. Old-style branch names
|
||||||
|
were category--branch, whereas new-style branch names are
|
||||||
|
archive,category--branch--version.
|
||||||
|
|
||||||
|
-D <depth>::
|
||||||
|
Follow merge ancestry and attempt to import trees that have been
|
||||||
|
merged from. Specify a depth greater than 1 if patch logs have been
|
||||||
|
pruned.
|
||||||
|
|
||||||
|
-a::
|
||||||
|
Attempt to auto-register archives at http://mirrors.sourcecontrol.net
|
||||||
|
This is particularly useful with the -D option.
|
||||||
|
|
||||||
-t <tmpdir>::
|
-t <tmpdir>::
|
||||||
Override the default tempdir.
|
Override the default tempdir.
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ git-cat-file - Provide content or type information for repository objects
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-cat-file' (-t | -s | -e | <type>) <object>
|
'git-cat-file' [-t | -s | -e | <type>] <object>
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -26,13 +26,15 @@ imposes the following rules on how refs are named:
|
|||||||
|
|
||||||
. It cannot have ASCII control character (i.e. bytes whose
|
. It cannot have ASCII control character (i.e. bytes whose
|
||||||
values are lower than \040, or \177 `DEL`), space, tilde `~`,
|
values are lower than \040, or \177 `DEL`), space, tilde `~`,
|
||||||
caret `{caret}`, or colon `:` anywhere;
|
caret `{caret}`, colon `:`, question-mark `?`, asterisk `*`,
|
||||||
|
or open bracket `[` anywhere;
|
||||||
|
|
||||||
. It cannot end with a slash `/`.
|
. It cannot end with a slash `/`.
|
||||||
|
|
||||||
These rules makes it easy for shell script based tools to parse
|
These rules makes it easy for shell script based tools to parse
|
||||||
refnames, and also avoids ambiguities in certain refname
|
refnames, pathname expansion by the shell when a refname is used
|
||||||
expressions (see gitlink:git-rev-parse[1]). Namely:
|
unquoted (by mistake), and also avoids ambiguities in certain
|
||||||
|
refname expressions (see gitlink:git-rev-parse[1]). Namely:
|
||||||
|
|
||||||
. double-dot `..` are often used as in `ref1..ref2`, and in some
|
. double-dot `..` are often used as in `ref1..ref2`, and in some
|
||||||
context this notation means `{caret}ref1 ref2` (i.e. not in
|
context this notation means `{caret}ref1 ref2` (i.e. not in
|
||||||
|
@ -8,8 +8,9 @@ git-checkout-index - Copy files from the index to the working directory
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
[verse]
|
||||||
'git-checkout-index' [-u] [-q] [-a] [-f] [-n] [--prefix=<string>]
|
'git-checkout-index' [-u] [-q] [-a] [-f] [-n] [--prefix=<string>]
|
||||||
[--stage=<number>] [--] <file>...
|
[--stage=<number>] [--] <file>...
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -43,7 +43,11 @@ OPTIONS
|
|||||||
The heads to update. This is relative to $GIT_DIR
|
The heads to update. This is relative to $GIT_DIR
|
||||||
(e.g. "HEAD", "refs/heads/master"). When unspecified,
|
(e.g. "HEAD", "refs/heads/master"). When unspecified,
|
||||||
all heads are updated to match the remote repository.
|
all heads are updated to match the remote repository.
|
||||||
|
+
|
||||||
|
Usually all the refs from existing repository are stored
|
||||||
|
under the same name in the new repository. Giving explicit
|
||||||
|
<head> arguments instead writes the object names and refs to
|
||||||
|
the standard output, just like get-fetch-pack does.
|
||||||
|
|
||||||
Author
|
Author
|
||||||
------
|
------
|
||||||
|
@ -8,7 +8,9 @@ git-clone - Clones a repository.
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-clone' [-l [-s]] [-q] [-n] [-u <upload-pack>] <repository> [<directory>]
|
[verse]
|
||||||
|
'git-clone' [-l [-s]] [-q] [-n] [-u <upload-pack>]
|
||||||
|
<repository> [<directory>]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -60,7 +60,8 @@ either `.git/config` file, or using the following environment variables.
|
|||||||
|
|
||||||
(nb "<", ">" and "\n"s are stripped)
|
(nb "<", ">" and "\n"s are stripped)
|
||||||
|
|
||||||
In `.git/config` file, the following items are used:
|
In `.git/config` file, the following items are used for GIT_AUTHOR_NAME and
|
||||||
|
GIT_AUTHOR_EMAIL:
|
||||||
|
|
||||||
[user]
|
[user]
|
||||||
name = "Your Name"
|
name = "Your Name"
|
||||||
|
@ -7,7 +7,9 @@ git-commit - Record your changes
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>] [-e] [--] <file>...
|
[verse]
|
||||||
|
'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]
|
||||||
|
[-e] [--] <file>...
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -66,6 +68,10 @@ OPTIONS
|
|||||||
Update specified paths in the index file before committing.
|
Update specified paths in the index file before committing.
|
||||||
|
|
||||||
|
|
||||||
|
If you make a commit and then found a mistake immediately after
|
||||||
|
that, you can recover from it with gitlink:git-reset[1].
|
||||||
|
|
||||||
|
|
||||||
Author
|
Author
|
||||||
------
|
------
|
||||||
Written by Linus Torvalds <torvalds@osdl.org> and
|
Written by Linus Torvalds <torvalds@osdl.org> and
|
||||||
|
@ -8,8 +8,7 @@ git-cvsexportcommit - Export a commit to a CVS checkout
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
git-cvsexportcommmit.perl
|
'git-cvsexportcommmit' [-h] [-v] [-c] [-p] [PARENTCOMMIT] COMMITID
|
||||||
[ -h ] [ -v ] [ -c ] [ -p ] [PARENTCOMMIT] COMMITID
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
@ -8,10 +8,10 @@ git-cvsimport - Import a CVS repository into git
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-cvsimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ]
|
[verse]
|
||||||
[ -d <CVSROOT> ] [ -p <options-for-cvsps> ]
|
'git-cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>] [-s <subst>]
|
||||||
[ -C <git_repository> ] [ -i ] [ -P <file> ] [ -k ]
|
[-p <options-for-cvsps>] [-C <git_repository>] [-i] [-P <file>]
|
||||||
[ -s <subst> ] [ -m ] [ -M regex ] [ <CVS_module> ]
|
[-m] [-M regex] [<CVS_module>]
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
@ -7,8 +7,9 @@ git-daemon - A really simple server for git repositories.
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
[verse]
|
||||||
'git-daemon' [--verbose] [--syslog] [--inetd | --port=n] [--export-all]
|
'git-daemon' [--verbose] [--syslog] [--inetd | --port=n] [--export-all]
|
||||||
[--timeout=n] [--init-timeout=n] [--strict-paths] [directory...]
|
[--timeout=n] [--init-timeout=n] [--strict-paths] [directory...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -53,7 +53,7 @@ If '--cached' is specified, it allows you to ask:
|
|||||||
contents (the ones I'd write with a "git-write-tree")
|
contents (the ones I'd write with a "git-write-tree")
|
||||||
|
|
||||||
For example, let's say that you have worked on your working directory, updated
|
For example, let's say that you have worked on your working directory, updated
|
||||||
some files in the index and are ready to commit. You want to see eactly
|
some files in the index and are ready to commit. You want to see exactly
|
||||||
*what* you are going to commit is without having to write a new tree
|
*what* you are going to commit is without having to write a new tree
|
||||||
object and compare it that way, and to do that, you just do
|
object and compare it that way, and to do that, you just do
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ NOTE: As with other commands of this type, "git-diff-index" does not
|
|||||||
actually look at the contents of the file at all. So maybe
|
actually look at the contents of the file at all. So maybe
|
||||||
`kernel/sched.c` hasn't actually changed, and it's just that you
|
`kernel/sched.c` hasn't actually changed, and it's just that you
|
||||||
touched it. In either case, it's a note that you need to
|
touched it. In either case, it's a note that you need to
|
||||||
"git-upate-index" it to make the index be in sync.
|
"git-update-index" it to make the index be in sync.
|
||||||
|
|
||||||
NOTE: You can have a mixture of files show up as "has been updated"
|
NOTE: You can have a mixture of files show up as "has been updated"
|
||||||
and "is still dirty in the working directory" together. You can always
|
and "is still dirty in the working directory" together. You can always
|
||||||
|
@ -8,7 +8,9 @@ git-diff-tree - Compares the content and mode of blobs found via two tree object
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] [-t] [-r] [--root] [<common diff options>] <tree-ish> [<tree-ish>] [<path>...]
|
[verse]
|
||||||
|
'git-diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] [-t] [-r]
|
||||||
|
[--root] [<common diff options>] <tree-ish> [<tree-ish>] [<path>...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -62,7 +64,7 @@ separated with a single space are given.
|
|||||||
-s::
|
-s::
|
||||||
By default, "git-diff-tree --stdin" shows differences,
|
By default, "git-diff-tree --stdin" shows differences,
|
||||||
either in machine-readable form (without '-p') or in patch
|
either in machine-readable form (without '-p') or in patch
|
||||||
form (with '-p'). This output can be supressed. It is
|
form (with '-p'). This output can be suppressed. It is
|
||||||
only useful with '-v' flag.
|
only useful with '-v' flag.
|
||||||
|
|
||||||
-v::
|
-v::
|
||||||
|
@ -67,7 +67,7 @@ $ git diff HEAD^ HEAD <3>
|
|||||||
<1> instead of using the tip of the current branch, compare with the
|
<1> instead of using the tip of the current branch, compare with the
|
||||||
tip of "test" branch.
|
tip of "test" branch.
|
||||||
<2> instead of comparing with the tip of "test" branch, compare with
|
<2> instead of comparing with the tip of "test" branch, compare with
|
||||||
the tip of the curren branch, but limit the comparison to the
|
the tip of the current branch, but limit the comparison to the
|
||||||
file "test".
|
file "test".
|
||||||
<3> compare the version before the last commit and the last commit.
|
<3> compare the version before the last commit and the last commit.
|
||||||
------------
|
------------
|
||||||
|
@ -8,7 +8,7 @@ git-fetch-pack - Receive missing objects from another repository.
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
git-fetch-pack [-q] [--exec=<git-upload-pack>] [<host>:]<directory> [<refs>...]
|
git-fetch-pack [-q] [-k] [--exec=<git-upload-pack>] [<host>:]<directory> [<refs>...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -29,6 +29,11 @@ OPTIONS
|
|||||||
Pass '-q' flag to 'git-unpack-objects'; this makes the
|
Pass '-q' flag to 'git-unpack-objects'; this makes the
|
||||||
cloning process less verbose.
|
cloning process less verbose.
|
||||||
|
|
||||||
|
-k::
|
||||||
|
Do not invoke 'git-unpack-objects' on received data, but
|
||||||
|
create a single packfile out of it instead, and store it
|
||||||
|
in the object database.
|
||||||
|
|
||||||
--exec=<git-upload-pack>::
|
--exec=<git-upload-pack>::
|
||||||
Use this to specify the path to 'git-upload-pack' on the
|
Use this to specify the path to 'git-upload-pack' on the
|
||||||
remote side, if is not found on your $PATH.
|
remote side, if is not found on your $PATH.
|
||||||
|
@ -8,7 +8,9 @@ git-format-patch - Prepare patches for e-mail submission.
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-format-patch' [-n | -k] [-o <dir> | --stdout] [-s] [-c] [--mbox] [--diff-options] <his> [<mine>]
|
[verse]
|
||||||
|
'git-format-patch' [-n | -k] [-o <dir> | --stdout] [-s] [-c] [--mbox]
|
||||||
|
[--diff-options] <his> [<mine>]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -96,7 +98,7 @@ git-format-patch -M -B origin::
|
|||||||
|
|
||||||
See Also
|
See Also
|
||||||
--------
|
--------
|
||||||
gitlink:git-am[1], gitlink:git-send-email
|
gitlink:git-am[1], gitlink:git-send-email[1]
|
||||||
|
|
||||||
|
|
||||||
Author
|
Author
|
||||||
|
@ -8,7 +8,9 @@ git-fsck-objects - Verifies the connectivity and validity of the objects in the
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-fsck-objects' [--tags] [--root] [--unreachable] [--cache] [--standalone | --full] [--strict] [<object>*]
|
[verse]
|
||||||
|
'git-fsck-objects' [--tags] [--root] [--unreachable] [--cache]
|
||||||
|
[--standalone | --full] [--strict] [<object>*]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -8,7 +8,7 @@ git-grep - print lines matching a pattern
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-grep' <option>... <pattern> <path>...
|
'git-grep' [<option>...] <pattern> [<path>...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -27,7 +27,6 @@ OPTIONS
|
|||||||
The pattern to look for.
|
The pattern to look for.
|
||||||
|
|
||||||
<path>...::
|
<path>...::
|
||||||
|
|
||||||
Optional paths to limit the set of files to be searched;
|
Optional paths to limit the set of files to be searched;
|
||||||
passed to `git-ls-files`.
|
passed to `git-ls-files`.
|
||||||
|
|
||||||
|
@ -3,12 +3,12 @@ git-http-fetch(1)
|
|||||||
|
|
||||||
NAME
|
NAME
|
||||||
----
|
----
|
||||||
git-http-fetch - Downloads a remote git repository via HTTP
|
git-http-fetch - downloads a remote git repository via HTTP
|
||||||
|
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-http-fetch' [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] commit-id url
|
'git-http-fetch' [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] <commit> <url>
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -8,7 +8,7 @@ git-init-db - Creates an empty git repository
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-init-db' [--template=<template_directory>]
|
'git-init-db' [--template=<template_directory>] [--shared]
|
||||||
|
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
@ -16,6 +16,9 @@ OPTIONS
|
|||||||
--template=<template_directory>::
|
--template=<template_directory>::
|
||||||
Provide the directory in from which templates will be used.
|
Provide the directory in from which templates will be used.
|
||||||
|
|
||||||
|
--shared::
|
||||||
|
Specify that the git repository is to be shared amongst several users.
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -30,7 +33,16 @@ If the object storage directory is specified via the `$GIT_OBJECT_DIRECTORY`
|
|||||||
environment variable then the sha1 directories are created underneath -
|
environment variable then the sha1 directories are created underneath -
|
||||||
otherwise the default `$GIT_DIR/objects` directory is used.
|
otherwise the default `$GIT_DIR/objects` directory is used.
|
||||||
|
|
||||||
`git-init-db` won't hurt an existing repository.
|
A shared repository allows users belonging to the same group to push into that
|
||||||
|
repository. When specifying `--shared` the config variable "core.sharedRepository"
|
||||||
|
is set to 'true' so that directories under `$GIT_DIR` are made group writable
|
||||||
|
(and g+sx, since the git group may be not the primary group of all users).
|
||||||
|
|
||||||
|
|
||||||
|
Running `git-init-db` in an existing repository is safe. It will not overwrite
|
||||||
|
things that are already there. The primary reason for rerunning `git-init-db`
|
||||||
|
is to pick up newly added templates.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
|
@ -13,7 +13,8 @@ SYNOPSIS
|
|||||||
(-[c|d|o|i|s|u|k|m])\*
|
(-[c|d|o|i|s|u|k|m])\*
|
||||||
[-x <pattern>|--exclude=<pattern>]
|
[-x <pattern>|--exclude=<pattern>]
|
||||||
[-X <file>|--exclude-from=<file>]
|
[-X <file>|--exclude-from=<file>]
|
||||||
[--exclude-per-directory=<file>] [--] [<file>]\*
|
[--exclude-per-directory=<file>]
|
||||||
|
[--full-name] [--] [<file>]\*
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -73,10 +74,16 @@ OPTIONS
|
|||||||
H:: cached
|
H:: cached
|
||||||
M:: unmerged
|
M:: unmerged
|
||||||
R:: removed/deleted
|
R:: removed/deleted
|
||||||
C:: modifed/changed
|
C:: modified/changed
|
||||||
K:: to be killed
|
K:: to be killed
|
||||||
? other
|
? other
|
||||||
|
|
||||||
|
--full-name::
|
||||||
|
When run from a subdirectory, the command usually
|
||||||
|
outputs paths relative to the current directory. This
|
||||||
|
option forces paths to be output relative to the project
|
||||||
|
top directory.
|
||||||
|
|
||||||
--::
|
--::
|
||||||
Do not interpret any more arguments as options.
|
Do not interpret any more arguments as options.
|
||||||
|
|
||||||
|
@ -37,6 +37,11 @@ include::merge-options.txt[]
|
|||||||
include::merge-strategies.txt[]
|
include::merge-strategies.txt[]
|
||||||
|
|
||||||
|
|
||||||
|
If you tried a merge which resulted in a complex conflicts and
|
||||||
|
would want to start over, you can recover with
|
||||||
|
gitlink:git-reset[1].
|
||||||
|
|
||||||
|
|
||||||
HOW MERGE WORKS
|
HOW MERGE WORKS
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
git-octopus(1)
|
|
||||||
==============
|
|
||||||
|
|
||||||
NAME
|
|
||||||
----
|
|
||||||
git-octopus - Merge more than two commits.
|
|
||||||
|
|
||||||
|
|
||||||
SYNOPSIS
|
|
||||||
--------
|
|
||||||
'git-octopus'
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
-----------
|
|
||||||
After running 'git fetch', $GIT_DIR/FETCH_HEAD contains the
|
|
||||||
following information, one line per remote ref:
|
|
||||||
|
|
||||||
------------------------------------------------
|
|
||||||
<object name> <ref name> from <repository>
|
|
||||||
------------------------------------------------
|
|
||||||
|
|
||||||
Using this information, create and commit an Octopus merge on
|
|
||||||
top of the current HEAD.
|
|
||||||
|
|
||||||
|
|
||||||
Author
|
|
||||||
------
|
|
||||||
Written by Junio C Hamano <junkio@cox.net>
|
|
||||||
|
|
||||||
|
|
||||||
Documentation
|
|
||||||
--------------
|
|
||||||
Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
|
|
||||||
|
|
||||||
GIT
|
|
||||||
---
|
|
||||||
Part of the gitlink:git[7] suite
|
|
||||||
|
|
@ -46,7 +46,7 @@ base-name::
|
|||||||
output of the command.
|
output of the command.
|
||||||
|
|
||||||
--stdout::
|
--stdout::
|
||||||
Write the pack contents (what would have been writtin to
|
Write the pack contents (what would have been written to
|
||||||
.pack file) out to the standard output.
|
.pack file) out to the standard output.
|
||||||
|
|
||||||
--window and --depth::
|
--window and --depth::
|
||||||
|
@ -104,6 +104,11 @@ merge the remote `origin` head into the current,
|
|||||||
local `master` branch.
|
local `master` branch.
|
||||||
|
|
||||||
|
|
||||||
|
If you tried a pull which resulted in a complex conflicts and
|
||||||
|
would want to start over, you can recover with
|
||||||
|
gitlink:git-reset[1].
|
||||||
|
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
--------
|
--------
|
||||||
gitlink:git-fetch[1], gitlink:git-merge[1]
|
gitlink:git-fetch[1], gitlink:git-merge[1]
|
||||||
|
@ -21,9 +21,9 @@ You can query/set/replace/unset options with this command. The name is
|
|||||||
actually the section and the key separated by a dot, and the value will be
|
actually the section and the key separated by a dot, and the value will be
|
||||||
escaped.
|
escaped.
|
||||||
|
|
||||||
If you want to set/unset an option which can occor on multiple lines, you
|
If you want to set/unset an option which can occur on multiple lines, you
|
||||||
should provide a POSIX regex for the value. If you want to handle the lines
|
should provide a POSIX regex for the value. If you want to handle the lines
|
||||||
*not* matching the regex, just prepend a single exlamation mark in front
|
*not* matching the regex, just prepend a single exclamation mark in front
|
||||||
(see EXAMPLES).
|
(see EXAMPLES).
|
||||||
|
|
||||||
This command will fail if
|
This command will fail if
|
||||||
|
@ -111,6 +111,39 @@ remain there.
|
|||||||
changes still in the working tree.
|
changes still in the working tree.
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
Undo a merge or pull::
|
||||||
|
+
|
||||||
|
------------
|
||||||
|
$ git pull <1>
|
||||||
|
Trying really trivial in-index merge...
|
||||||
|
fatal: Merge requires file-level merging
|
||||||
|
Nope.
|
||||||
|
...
|
||||||
|
Auto-merging nitfol
|
||||||
|
CONFLICT (content): Merge conflict in nitfol
|
||||||
|
Automatic merge failed/prevented; fix up by hand
|
||||||
|
$ git reset --hard <2>
|
||||||
|
|
||||||
|
<1> try to update from the upstream resulted in a lot of
|
||||||
|
conflicts; you were not ready to spend a lot of time merging
|
||||||
|
right now, so you decide to do that later.
|
||||||
|
<2> "pull" has not made merge commit, so "git reset --hard"
|
||||||
|
which is a synonym for "git reset --hard HEAD" clears the mess
|
||||||
|
from the index file and the working tree.
|
||||||
|
|
||||||
|
$ git pull . topic/branch <3>
|
||||||
|
Updating from 41223... to 13134...
|
||||||
|
Fast forward
|
||||||
|
$ git reset --hard ORIG_HEAD <4>
|
||||||
|
|
||||||
|
<3> merge a topic branch into the current branch, which resulted
|
||||||
|
in a fast forward.
|
||||||
|
<4> but you decided that the topic branch is not ready for public
|
||||||
|
consumption yet. "pull" or "merge" always leaves the original
|
||||||
|
tip of the current branch in ORIG_HEAD, so resetting hard to it
|
||||||
|
brings your index file and the working tree back to that state,
|
||||||
|
and resets the tip of the branch to that commit.
|
||||||
|
------------
|
||||||
|
|
||||||
Author
|
Author
|
||||||
------
|
------
|
||||||
|
@ -8,18 +8,19 @@ git-rev-list - Lists commit objects in reverse chronological order
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
[verse]
|
||||||
'git-rev-list' [ \--max-count=number ]
|
'git-rev-list' [ \--max-count=number ]
|
||||||
[ \--max-age=timestamp ]
|
[ \--max-age=timestamp ]
|
||||||
[ \--min-age=timestamp ]
|
[ \--min-age=timestamp ]
|
||||||
[ \--sparse ]
|
[ \--sparse ]
|
||||||
[ \--no-merges ]
|
[ \--no-merges ]
|
||||||
[ \--all ]
|
[ \--all ]
|
||||||
[ [ \--merge-order [ \--show-breaks ] ] | [ \--topo-order ] | ]
|
[ [ \--merge-order [ \--show-breaks ] ] | [ \--topo-order ] ]
|
||||||
[ \--parents ]
|
[ \--parents ]
|
||||||
[ \--objects [ \--unpacked ] ]
|
[ \--objects [ \--unpacked ] ]
|
||||||
[ \--pretty | \--header | ]
|
[ \--pretty | \--header ]
|
||||||
[ \--bisect ]
|
[ \--bisect ]
|
||||||
<commit>... [ \-- <paths>... ]
|
<commit>... [ \-- <paths>... ]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -129,7 +130,7 @@ the marked commit in the list.
|
|||||||
+
|
+
|
||||||
Commits marked with (^) are not parents of the immediately preceding commit.
|
Commits marked with (^) are not parents of the immediately preceding commit.
|
||||||
These "breaks" represent necessary discontinuities implied by trying to
|
These "breaks" represent necessary discontinuities implied by trying to
|
||||||
represent an arbtirary DAG in a linear form.
|
represent an arbitrary DAG in a linear form.
|
||||||
+
|
+
|
||||||
`--show-breaks` is only valid if `--merge-order` is also specified.
|
`--show-breaks` is only valid if `--merge-order` is also specified.
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ Following these N lines, one-line log for each commit is
|
|||||||
displayed, indented N places. If a commit is on the I-th
|
displayed, indented N places. If a commit is on the I-th
|
||||||
branch, the I-th indentation character shows a '+' sign;
|
branch, the I-th indentation character shows a '+' sign;
|
||||||
otherwise it shows a space. Each commit shows a short name that
|
otherwise it shows a space. Each commit shows a short name that
|
||||||
can be used as an exended SHA1 to name that commit.
|
can be used as an extended SHA1 to name that commit.
|
||||||
|
|
||||||
The following example shows three branches, "master", "fixes"
|
The following example shows three branches, "master", "fixes"
|
||||||
and "mhf":
|
and "mhf":
|
||||||
|
@ -11,7 +11,7 @@ SYNOPSIS
|
|||||||
--------
|
--------
|
||||||
'git-svnimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ] [ -d | -D ]
|
'git-svnimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ] [ -d | -D ]
|
||||||
[ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev]
|
[ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev]
|
||||||
[ -b branch_subdir ] [ -t trunk_subdir ] [ -T tag_subdir ]
|
[ -b branch_subdir ] [ -T trunk_subdir ] [ -t tag_subdir ]
|
||||||
[ -s start_chg ] [ -m ] [ -M regex ]
|
[ -s start_chg ] [ -m ] [ -M regex ]
|
||||||
<SVN_repository_URL> [ <path> ]
|
<SVN_repository_URL> [ <path> ]
|
||||||
|
|
||||||
@ -40,17 +40,17 @@ OPTIONS
|
|||||||
-s <start_rev>::
|
-s <start_rev>::
|
||||||
Start importing at this SVN change number. The default is 1.
|
Start importing at this SVN change number. The default is 1.
|
||||||
+
|
+
|
||||||
When importing incementally, you might need to edit the .git/svn2git file.
|
When importing incrementally, you might need to edit the .git/svn2git file.
|
||||||
|
|
||||||
-i::
|
-i::
|
||||||
Import-only: don't perform a checkout after importing. This option
|
Import-only: don't perform a checkout after importing. This option
|
||||||
ensures the working directory and index remain untouched and will
|
ensures the working directory and index remain untouched and will
|
||||||
not create them if they do not exist.
|
not create them if they do not exist.
|
||||||
|
|
||||||
-t <trunk_subdir>::
|
-T <trunk_subdir>::
|
||||||
Name the SVN trunk. Default "trunk".
|
Name the SVN trunk. Default "trunk".
|
||||||
|
|
||||||
-T <tag_subdir>::
|
-t <tag_subdir>::
|
||||||
Name the SVN subdirectory for tags. Default "tags".
|
Name the SVN subdirectory for tags. Default "tags".
|
||||||
|
|
||||||
-b <branch_subdir>::
|
-b <branch_subdir>::
|
||||||
|
@ -12,11 +12,11 @@ SYNOPSIS
|
|||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
A dumb server that does not do on-the-fly pack generations can
|
A dumb server that does not do on-the-fly pack generations must
|
||||||
have some auxiliary information files in $GIT_DIR/info and
|
have some auxiliary information files in $GIT_DIR/info and
|
||||||
$GIT_OBJECT_DIRECTORY/info directories to help clients discover
|
$GIT_OBJECT_DIRECTORY/info directories to help clients discover
|
||||||
what references and packs the server has and make optimized
|
what references and packs the server has. This command
|
||||||
pull decisions. This command generates such auxiliary files.
|
generates such auxiliary files.
|
||||||
|
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
|
@ -297,9 +297,6 @@ gitlink:git-merge[1]::
|
|||||||
gitlink:git-mv[1]::
|
gitlink:git-mv[1]::
|
||||||
Move or rename a file, a directory, or a symlink.
|
Move or rename a file, a directory, or a symlink.
|
||||||
|
|
||||||
gitlink:git-octopus[1]::
|
|
||||||
Merge more than two commits.
|
|
||||||
|
|
||||||
gitlink:git-pull[1]::
|
gitlink:git-pull[1]::
|
||||||
Fetch from and merge with a remote repository.
|
Fetch from and merge with a remote repository.
|
||||||
|
|
||||||
@ -425,7 +422,7 @@ gitlink:git-rev-parse[1]::
|
|||||||
gitlink:git-send-email[1]::
|
gitlink:git-send-email[1]::
|
||||||
Send patch e-mails out of "format-patch --mbox" output.
|
Send patch e-mails out of "format-patch --mbox" output.
|
||||||
|
|
||||||
gitlink:git-symbolic-refs[1]::
|
gitlink:git-symbolic-ref[1]::
|
||||||
Read and modify symbolic refs.
|
Read and modify symbolic refs.
|
||||||
|
|
||||||
gitlink:git-stripspace[1]::
|
gitlink:git-stripspace[1]::
|
||||||
|
@ -19,7 +19,7 @@ hash::
|
|||||||
In git's context, synonym to object name.
|
In git's context, synonym to object name.
|
||||||
|
|
||||||
object database::
|
object database::
|
||||||
Stores a set of "objects", and an individial object is identified
|
Stores a set of "objects", and an individual object is identified
|
||||||
by its object name. The objects usually live in `$GIT_DIR/objects/`.
|
by its object name. The objects usually live in `$GIT_DIR/objects/`.
|
||||||
|
|
||||||
blob object::
|
blob object::
|
||||||
|
@ -111,6 +111,10 @@ Another use suggested on the mailing list is to use this hook to
|
|||||||
implement access control which is finer grained than the one
|
implement access control which is finer grained than the one
|
||||||
based on filesystem group.
|
based on filesystem group.
|
||||||
|
|
||||||
|
The standard output of this hook is sent to /dev/null; if you
|
||||||
|
want to report something to the git-send-pack on the other end,
|
||||||
|
you can redirect your output to your stderr.
|
||||||
|
|
||||||
post-update
|
post-update
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
@ -125,3 +129,7 @@ the outcome of `git-receive-pack`.
|
|||||||
The default post-update hook, when enabled, runs
|
The default post-update hook, when enabled, runs
|
||||||
`git-update-server-info` to keep the information used by dumb
|
`git-update-server-info` to keep the information used by dumb
|
||||||
transport up-to-date.
|
transport up-to-date.
|
||||||
|
|
||||||
|
The standard output of this hook is sent to /dev/null; if you
|
||||||
|
want to report something to the git-send-pack on the other end,
|
||||||
|
you can redirect your output to your stderr.
|
||||||
|
@ -24,7 +24,7 @@ Then do
|
|||||||
git bisect bad master <- mark "master" as the bad state
|
git bisect bad master <- mark "master" as the bad state
|
||||||
git bisect good ORIG_HEAD <- mark ORIG_HEAD as good (or
|
git bisect good ORIG_HEAD <- mark ORIG_HEAD as good (or
|
||||||
whatever other known-good
|
whatever other known-good
|
||||||
thing you booted laste)
|
thing you booted last)
|
||||||
|
|
||||||
and at this point "git bisect" will churn for a while, and tell you what
|
and at this point "git bisect" will churn for a while, and tell you what
|
||||||
the mid-point between those two commits are, and check that state out as
|
the mid-point between those two commits are, and check that state out as
|
||||||
|
@ -10,7 +10,7 @@ The pages under http://www.kernel.org/pub/software/scm/git/docs/
|
|||||||
are built from Documentation/ directory of the git.git project
|
are built from Documentation/ directory of the git.git project
|
||||||
and needed to be kept up-to-date. The www.kernel.org/ servers
|
and needed to be kept up-to-date. The www.kernel.org/ servers
|
||||||
are mirrored and I was told that the origin of the mirror is on
|
are mirrored and I was told that the origin of the mirror is on
|
||||||
the machine master.kernel.org, on which I was given an account
|
the machine $some.kernel.org, on which I was given an account
|
||||||
when I took over git maintainership from Linus.
|
when I took over git maintainership from Linus.
|
||||||
|
|
||||||
The directories relevant to this how-to are these two:
|
The directories relevant to this how-to are these two:
|
||||||
@ -63,7 +63,7 @@ like this:
|
|||||||
EOF
|
EOF
|
||||||
$ chmod +x /pub/scm/git/git.git/hooks/post-update
|
$ chmod +x /pub/scm/git/git.git/hooks/post-update
|
||||||
|
|
||||||
There are three things worth mentioning:
|
There are four things worth mentioning:
|
||||||
|
|
||||||
- The update-hook is run after the repository accepts a "git
|
- The update-hook is run after the repository accepts a "git
|
||||||
push", under my user privilege. It is given the full names
|
push", under my user privilege. It is given the full names
|
||||||
@ -77,6 +77,10 @@ There are three things worth mentioning:
|
|||||||
pull" it does into $HOME/doc-git/docgen/ repository would not
|
pull" it does into $HOME/doc-git/docgen/ repository would not
|
||||||
work correctly.
|
work correctly.
|
||||||
|
|
||||||
|
- The stdout of update hook script is not connected to git
|
||||||
|
push; I run the heavy part of the command inside "at", to
|
||||||
|
receive the execution report via e-mail.
|
||||||
|
|
||||||
- This is still crude and does not protect against simultaneous
|
- This is still crude and does not protect against simultaneous
|
||||||
make invocations stomping on each other. I would need to add
|
make invocations stomping on each other. I would need to add
|
||||||
some locking mechanism for this.
|
some locking mechanism for this.
|
||||||
|
@ -42,8 +42,7 @@ So here is the step-by-step guide how this all works for me.
|
|||||||
|
|
||||||
First create your work tree by cloning Linus's public tree:
|
First create your work tree by cloning Linus's public tree:
|
||||||
|
|
||||||
$ git clone \
|
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git work
|
||||||
master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git work
|
|
||||||
|
|
||||||
Change directory into the cloned tree you just created
|
Change directory into the cloned tree you just created
|
||||||
|
|
||||||
@ -53,7 +52,7 @@ Set up a remotes file so that you can fetch the latest from Linus' master
|
|||||||
branch into a local branch named "linus":
|
branch into a local branch named "linus":
|
||||||
|
|
||||||
$ cat > .git/remotes/linus
|
$ cat > .git/remotes/linus
|
||||||
URL: master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
|
URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
|
||||||
Pull: master:linus
|
Pull: master:linus
|
||||||
^D
|
^D
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ outside world but sometimes useful for private repository.
|
|||||||
. You can be using `objects/info/alternates` mechanism, or
|
. You can be using `objects/info/alternates` mechanism, or
|
||||||
`$GIT_ALTERNATE_OBJECT_DIRECTORIES` mechanism to 'borrow'
|
`$GIT_ALTERNATE_OBJECT_DIRECTORIES` mechanism to 'borrow'
|
||||||
objects from other object stores. A repository with this kind
|
objects from other object stores. A repository with this kind
|
||||||
of incompete object store is not suitable to be published for
|
of incomplete object store is not suitable to be published for
|
||||||
use with dumb transports but otherwise is OK as long as
|
use with dumb transports but otherwise is OK as long as
|
||||||
`objects/info/alternates` points at the right object stores
|
`objects/info/alternates` points at the right object stores
|
||||||
it borrows from.
|
it borrows from.
|
||||||
@ -106,7 +106,7 @@ info/refs::
|
|||||||
up-to-date if the repository is published for dumb
|
up-to-date if the repository is published for dumb
|
||||||
transports. The `git-receive-pack` command, which is
|
transports. The `git-receive-pack` command, which is
|
||||||
run on a remote repository when you `git push` into it,
|
run on a remote repository when you `git push` into it,
|
||||||
runs `hooks/update` hook to help you achive this.
|
runs `hooks/update` hook to help you achieve this.
|
||||||
|
|
||||||
info/grafts::
|
info/grafts::
|
||||||
This file records fake commit ancestry information, to
|
This file records fake commit ancestry information, to
|
||||||
|
@ -27,6 +27,12 @@ SCM, you can skip them during your first pass.
|
|||||||
[NOTE]
|
[NOTE]
|
||||||
And those "too deep" descriptions are often marked as Note.
|
And those "too deep" descriptions are often marked as Note.
|
||||||
|
|
||||||
|
[NOTE]
|
||||||
|
If you are already familiar with another version control system,
|
||||||
|
like CVS, you may want to take a look at
|
||||||
|
link:everyday.html[Everyday GIT in 20 commands or so] first
|
||||||
|
before reading this.
|
||||||
|
|
||||||
|
|
||||||
Creating a git repository
|
Creating a git repository
|
||||||
-------------------------
|
-------------------------
|
||||||
@ -1085,9 +1091,10 @@ lacks and transfers (close to) minimum set of objects.
|
|||||||
HTTP(S)::
|
HTTP(S)::
|
||||||
`http://remote.machine/path/to/repo.git/`
|
`http://remote.machine/path/to/repo.git/`
|
||||||
+
|
+
|
||||||
HTTP and HTTPS transport are used only for downloading. They
|
Downloader from http and https URL
|
||||||
first obtain the topmost commit object name from the remote site
|
first obtains the topmost commit object name from the remote site
|
||||||
by looking at `repo.git/info/refs` file, tries to obtain the
|
by looking at the specified refname under `repo.git/refs/` directory,
|
||||||
|
and then tries to obtain the
|
||||||
commit object by downloading from `repo.git/objects/xx/xxx\...`
|
commit object by downloading from `repo.git/objects/xx/xxx\...`
|
||||||
using the object name of that commit object. Then it reads the
|
using the object name of that commit object. Then it reads the
|
||||||
commit object to find out its parent commits and the associate
|
commit object to find out its parent commits and the associate
|
||||||
@ -1098,7 +1105,9 @@ sometimes also called 'commit walkers'.
|
|||||||
The 'commit walkers' are sometimes also called 'dumb
|
The 'commit walkers' are sometimes also called 'dumb
|
||||||
transports', because they do not require any git aware smart
|
transports', because they do not require any git aware smart
|
||||||
server like git Native transport does. Any stock HTTP server
|
server like git Native transport does. Any stock HTTP server
|
||||||
would suffice.
|
that does not even support directory index would suffice. But
|
||||||
|
you must prepare your repository with `git-update-server-info`
|
||||||
|
to help dumb transport downloaders.
|
||||||
+
|
+
|
||||||
There are (confusingly enough) `git-ssh-fetch` and `git-ssh-upload`
|
There are (confusingly enough) `git-ssh-fetch` and `git-ssh-upload`
|
||||||
programs, which are 'commit walkers'; they outlived their
|
programs, which are 'commit walkers'; they outlived their
|
||||||
@ -1511,12 +1520,13 @@ A recommended workflow for a "project lead" goes like this:
|
|||||||
2. Prepare a public repository accessible to others.
|
2. Prepare a public repository accessible to others.
|
||||||
+
|
+
|
||||||
If other people are pulling from your repository over dumb
|
If other people are pulling from your repository over dumb
|
||||||
transport protocols, you need to keep this repository 'dumb
|
transport protocols (HTTP), you need to keep this repository
|
||||||
transport friendly'. After `git init-db`,
|
'dumb transport friendly'. After `git init-db`,
|
||||||
`$GIT_DIR/hooks/post-update` copied from the standard templates
|
`$GIT_DIR/hooks/post-update` copied from the standard templates
|
||||||
would contain a call to `git-update-server-info` but the
|
would contain a call to `git-update-server-info` but the
|
||||||
`post-update` hook itself is disabled by default -- enable it
|
`post-update` hook itself is disabled by default -- enable it
|
||||||
with `chmod +x post-update`.
|
with `chmod +x post-update`. This makes sure `git-update-server-info`
|
||||||
|
keeps the necessary files up-to-date.
|
||||||
|
|
||||||
3. Push into the public repository from your primary
|
3. Push into the public repository from your primary
|
||||||
repository.
|
repository.
|
||||||
@ -1615,7 +1625,9 @@ cooperation you are probably more familiar with as well.
|
|||||||
For this, set up a public repository on a machine that is
|
For this, set up a public repository on a machine that is
|
||||||
reachable via SSH by people with "commit privileges". Put the
|
reachable via SSH by people with "commit privileges". Put the
|
||||||
committers in the same user group and make the repository
|
committers in the same user group and make the repository
|
||||||
writable by that group.
|
writable by that group. Make sure their umasks are set up to
|
||||||
|
allow group members to write into directories other members
|
||||||
|
have created.
|
||||||
|
|
||||||
You, as an individual committer, then:
|
You, as an individual committer, then:
|
||||||
|
|
||||||
|
19
Makefile
19
Makefile
@ -55,7 +55,7 @@ all:
|
|||||||
# Define USE_STDEV below if you want git to care about the underlying device
|
# Define USE_STDEV below if you want git to care about the underlying device
|
||||||
# change being considered an inode change from the update-cache perspective.
|
# change being considered an inode change from the update-cache perspective.
|
||||||
|
|
||||||
GIT_VERSION = 0.99.9n
|
GIT_VERSION = 1.0.8
|
||||||
|
|
||||||
# CFLAGS and LDFLAGS are for the users to override from the command line.
|
# CFLAGS and LDFLAGS are for the users to override from the command line.
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ SCRIPT_SH = \
|
|||||||
git-cherry.sh git-clone.sh git-commit.sh \
|
git-cherry.sh git-clone.sh git-commit.sh \
|
||||||
git-count-objects.sh git-diff.sh git-fetch.sh \
|
git-count-objects.sh git-diff.sh git-fetch.sh \
|
||||||
git-format-patch.sh git-log.sh git-ls-remote.sh \
|
git-format-patch.sh git-log.sh git-ls-remote.sh \
|
||||||
git-merge-one-file.sh git-octopus.sh git-parse-remote.sh \
|
git-merge-one-file.sh git-parse-remote.sh \
|
||||||
git-prune.sh git-pull.sh git-push.sh git-rebase.sh \
|
git-prune.sh git-pull.sh git-push.sh git-rebase.sh \
|
||||||
git-repack.sh git-request-pull.sh git-reset.sh \
|
git-repack.sh git-request-pull.sh git-reset.sh \
|
||||||
git-resolve.sh git-revert.sh git-sh-setup.sh git-status.sh \
|
git-resolve.sh git-revert.sh git-sh-setup.sh git-status.sh \
|
||||||
@ -175,6 +175,7 @@ LIB_OBJS = \
|
|||||||
quote.o read-cache.o refs.o run-command.o \
|
quote.o read-cache.o refs.o run-command.o \
|
||||||
server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \
|
server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \
|
||||||
tag.o tree.o usage.o config.o environment.o ctype.o copy.o \
|
tag.o tree.o usage.o config.o environment.o ctype.o copy.o \
|
||||||
|
fetch-clone.o \
|
||||||
$(DIFF_OBJS)
|
$(DIFF_OBJS)
|
||||||
|
|
||||||
LIBS = $(LIB_FILE)
|
LIBS = $(LIB_FILE)
|
||||||
@ -396,6 +397,9 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py
|
|||||||
git-cherry-pick: git-revert
|
git-cherry-pick: git-revert
|
||||||
cp $< $@
|
cp $< $@
|
||||||
|
|
||||||
|
# format-patch records GIT_VERSION
|
||||||
|
git-format-patch: Makefile
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) -o $*.o -c $(ALL_CFLAGS) $<
|
$(CC) -o $*.o -c $(ALL_CFLAGS) $<
|
||||||
%.o: %.S
|
%.o: %.S
|
||||||
@ -485,23 +489,16 @@ dist: git.spec git-tar-tree
|
|||||||
rpm: dist
|
rpm: dist
|
||||||
$(RPMBUILD) -ta $(GIT_TARNAME).tar.gz
|
$(RPMBUILD) -ta $(GIT_TARNAME).tar.gz
|
||||||
|
|
||||||
deb: dist
|
|
||||||
rm -rf $(GIT_TARNAME)
|
|
||||||
$(TAR) zxf $(GIT_TARNAME).tar.gz
|
|
||||||
dpkg-source -b $(GIT_TARNAME)
|
|
||||||
cd $(GIT_TARNAME) && fakeroot debian/rules binary
|
|
||||||
|
|
||||||
### Cleaning rules
|
### Cleaning rules
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o $(LIB_FILE)
|
rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o $(LIB_FILE)
|
||||||
rm -f $(PROGRAMS) $(SIMPLE_PROGRAMS) git$X
|
rm -f $(PROGRAMS) $(SIMPLE_PROGRAMS) git$X
|
||||||
rm -f $(filter-out gitk,$(SCRIPTS))
|
rm -f $(filter-out gitk,$(SCRIPTS))
|
||||||
rm -f *.spec *.pyc *.pyo
|
rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo
|
||||||
rm -rf $(GIT_TARNAME)
|
rm -rf $(GIT_TARNAME)
|
||||||
rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
|
rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
|
||||||
rm -f git-core_$(GIT_VERSION)-*.dsc
|
|
||||||
rm -f git-*_$(GIT_VERSION)-*.deb
|
|
||||||
$(MAKE) -C Documentation/ clean
|
$(MAKE) -C Documentation/ clean
|
||||||
$(MAKE) -C templates clean
|
$(MAKE) -C templates clean
|
||||||
$(MAKE) -C t/ clean
|
$(MAKE) -C t/ clean
|
||||||
|
|
||||||
|
28
apply.c
28
apply.c
@ -84,14 +84,11 @@ static void *read_patch_file(int fd, unsigned long *sizep)
|
|||||||
buffer = xrealloc(buffer, alloc);
|
buffer = xrealloc(buffer, alloc);
|
||||||
nr = alloc - size;
|
nr = alloc - size;
|
||||||
}
|
}
|
||||||
nr = read(fd, buffer + size, nr);
|
nr = xread(fd, buffer + size, nr);
|
||||||
if (!nr)
|
if (!nr)
|
||||||
break;
|
break;
|
||||||
if (nr < 0) {
|
if (nr < 0)
|
||||||
if (errno == EAGAIN)
|
|
||||||
continue;
|
|
||||||
die("git-apply: read returned %s", strerror(errno));
|
die("git-apply: read returned %s", strerror(errno));
|
||||||
}
|
|
||||||
size += nr;
|
size += nr;
|
||||||
}
|
}
|
||||||
*sizep = size;
|
*sizep = size;
|
||||||
@ -1006,13 +1003,8 @@ static int read_old_data(struct stat *st, const char *path, void *buf, unsigned
|
|||||||
return error("unable to open %s", path);
|
return error("unable to open %s", path);
|
||||||
got = 0;
|
got = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int ret = read(fd, buf + got, size - got);
|
int ret = xread(fd, buf + got, size - got);
|
||||||
if (ret < 0) {
|
if (ret <= 0)
|
||||||
if (errno == EAGAIN)
|
|
||||||
continue;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!ret)
|
|
||||||
break;
|
break;
|
||||||
got += ret;
|
got += ret;
|
||||||
}
|
}
|
||||||
@ -1596,16 +1588,13 @@ static int try_create_file(const char *path, unsigned int mode, const char *buf,
|
|||||||
|
|
||||||
if (S_ISLNK(mode))
|
if (S_ISLNK(mode))
|
||||||
return symlink(buf, path);
|
return symlink(buf, path);
|
||||||
fd = open(path, O_CREAT | O_EXCL | O_WRONLY | O_TRUNC, (mode & 0100) ? 0777 : 0666);
|
fd = open(path, O_CREAT | O_EXCL | O_WRONLY, (mode & 0100) ? 0777 : 0666);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return -1;
|
return -1;
|
||||||
while (size) {
|
while (size) {
|
||||||
int written = write(fd, buf, size);
|
int written = xwrite(fd, buf, size);
|
||||||
if (written < 0) {
|
if (written < 0)
|
||||||
if (errno == EINTR || errno == EAGAIN)
|
|
||||||
continue;
|
|
||||||
die("writing file %s: %s", path, strerror(errno));
|
die("writing file %s: %s", path, strerror(errno));
|
||||||
}
|
|
||||||
if (!written)
|
if (!written)
|
||||||
die("out of space writing file %s", path);
|
die("out of space writing file %s", path);
|
||||||
buf += written;
|
buf += written;
|
||||||
@ -1646,7 +1635,8 @@ static void create_one_file(const char *path, unsigned mode, const char *buf, un
|
|||||||
}
|
}
|
||||||
if (errno != EEXIST)
|
if (errno != EEXIST)
|
||||||
break;
|
break;
|
||||||
}
|
++nr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
die("unable to write file %s mode %o", path, mode);
|
die("unable to write file %s mode %o", path, mode);
|
||||||
}
|
}
|
||||||
|
2
blob.c
2
blob.c
@ -1,5 +1,5 @@
|
|||||||
#include "blob.h"
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
#include "blob.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
const char *blob_type = "blob";
|
const char *blob_type = "blob";
|
||||||
|
14
cache.h
14
cache.h
@ -81,7 +81,7 @@ struct cache_entry {
|
|||||||
unsigned int ce_size;
|
unsigned int ce_size;
|
||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
unsigned short ce_flags;
|
unsigned short ce_flags;
|
||||||
char name[0];
|
char name[FLEX_ARRAY]; /* more */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CE_NAMEMASK (0x0fff)
|
#define CE_NAMEMASK (0x0fff)
|
||||||
@ -257,7 +257,7 @@ extern int checkout_entry(struct cache_entry *ce, struct checkout *state);
|
|||||||
extern struct alternate_object_database {
|
extern struct alternate_object_database {
|
||||||
struct alternate_object_database *next;
|
struct alternate_object_database *next;
|
||||||
char *name;
|
char *name;
|
||||||
char base[0]; /* more */
|
char base[FLEX_ARRAY]; /* more */
|
||||||
} *alt_odb_list;
|
} *alt_odb_list;
|
||||||
extern void prepare_alt_odb(void);
|
extern void prepare_alt_odb(void);
|
||||||
|
|
||||||
@ -271,7 +271,8 @@ extern struct packed_git {
|
|||||||
unsigned int pack_use_cnt;
|
unsigned int pack_use_cnt;
|
||||||
int pack_local;
|
int pack_local;
|
||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
char pack_name[0]; /* something like ".git/objects/pack/xxxxx.pack" */
|
/* something like ".git/objects/pack/xxxxx.pack" */
|
||||||
|
char pack_name[FLEX_ARRAY]; /* more */
|
||||||
} *packed_git;
|
} *packed_git;
|
||||||
|
|
||||||
struct pack_entry {
|
struct pack_entry {
|
||||||
@ -286,7 +287,7 @@ struct ref {
|
|||||||
unsigned char new_sha1[20];
|
unsigned char new_sha1[20];
|
||||||
unsigned char force;
|
unsigned char force;
|
||||||
struct ref *peer_ref; /* when renaming */
|
struct ref *peer_ref; /* when renaming */
|
||||||
char name[0];
|
char name[FLEX_ARRAY]; /* more */
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int git_connect(int fd[2], char *url, const char *prog);
|
extern int git_connect(int fd[2], char *url, const char *prog);
|
||||||
@ -338,4 +339,9 @@ extern char git_default_name[MAX_GITNAME];
|
|||||||
extern char git_commit_encoding[MAX_ENCODING_LENGTH];
|
extern char git_commit_encoding[MAX_ENCODING_LENGTH];
|
||||||
|
|
||||||
extern int copy_fd(int ifd, int ofd);
|
extern int copy_fd(int ifd, int ofd);
|
||||||
|
|
||||||
|
/* Finish off pack transfer receiving end */
|
||||||
|
extern int receive_unpack_pack(int fd[2], const char *me, int quiet);
|
||||||
|
extern int receive_keep_pack(int fd[2], const char *me);
|
||||||
|
|
||||||
#endif /* CACHE_H */
|
#endif /* CACHE_H */
|
||||||
|
@ -55,10 +55,8 @@ int main(int argc, char **argv)
|
|||||||
die("git-cat-file %s: bad file", argv[2]);
|
die("git-cat-file %s: bad file", argv[2]);
|
||||||
|
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
long ret = write(1, buf, size);
|
long ret = xwrite(1, buf, size);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (errno == EAGAIN)
|
|
||||||
continue;
|
|
||||||
/* Ignore epipe */
|
/* Ignore epipe */
|
||||||
if (errno == EPIPE)
|
if (errno == EPIPE)
|
||||||
break;
|
break;
|
||||||
|
151
clone-pack.c
151
clone-pack.c
@ -1,7 +1,6 @@
|
|||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
#include "pkt-line.h"
|
#include "pkt-line.h"
|
||||||
#include <sys/wait.h>
|
|
||||||
|
|
||||||
static const char clone_pack_usage[] =
|
static const char clone_pack_usage[] =
|
||||||
"git-clone-pack [--exec=<git-upload-pack>] [<host>:]<directory> [<heads>]*";
|
"git-clone-pack [--exec=<git-upload-pack>] [<host>:]<directory> [<heads>]*";
|
||||||
@ -112,139 +111,6 @@ static void write_refs(struct ref *ref)
|
|||||||
free(head_path);
|
free(head_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int finish_pack(const char *pack_tmp_name)
|
|
||||||
{
|
|
||||||
int pipe_fd[2];
|
|
||||||
pid_t pid;
|
|
||||||
char idx[PATH_MAX];
|
|
||||||
char final[PATH_MAX];
|
|
||||||
char hash[41];
|
|
||||||
unsigned char sha1[20];
|
|
||||||
char *cp;
|
|
||||||
int err = 0;
|
|
||||||
|
|
||||||
if (pipe(pipe_fd) < 0)
|
|
||||||
die("git-clone-pack: unable to set up pipe");
|
|
||||||
|
|
||||||
strcpy(idx, pack_tmp_name); /* ".git/objects/pack-XXXXXX" */
|
|
||||||
cp = strrchr(idx, '/');
|
|
||||||
memcpy(cp, "/pidx", 5);
|
|
||||||
|
|
||||||
pid = fork();
|
|
||||||
if (pid < 0)
|
|
||||||
die("git-clone-pack: unable to fork off git-index-pack");
|
|
||||||
if (!pid) {
|
|
||||||
close(0);
|
|
||||||
dup2(pipe_fd[1], 1);
|
|
||||||
close(pipe_fd[0]);
|
|
||||||
close(pipe_fd[1]);
|
|
||||||
execlp("git-index-pack","git-index-pack",
|
|
||||||
"-o", idx, pack_tmp_name, NULL);
|
|
||||||
error("cannot exec git-index-pack <%s> <%s>",
|
|
||||||
idx, pack_tmp_name);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
close(pipe_fd[1]);
|
|
||||||
if (read(pipe_fd[0], hash, 40) != 40) {
|
|
||||||
error("git-clone-pack: unable to read from git-index-pack");
|
|
||||||
err = 1;
|
|
||||||
}
|
|
||||||
close(pipe_fd[0]);
|
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
int status, code;
|
|
||||||
int retval = waitpid(pid, &status, 0);
|
|
||||||
|
|
||||||
if (retval < 0) {
|
|
||||||
if (errno == EINTR)
|
|
||||||
continue;
|
|
||||||
error("waitpid failed (%s)", strerror(retval));
|
|
||||||
goto error_die;
|
|
||||||
}
|
|
||||||
if (WIFSIGNALED(status)) {
|
|
||||||
int sig = WTERMSIG(status);
|
|
||||||
error("git-index-pack died of signal %d", sig);
|
|
||||||
goto error_die;
|
|
||||||
}
|
|
||||||
if (!WIFEXITED(status)) {
|
|
||||||
error("git-index-pack died of unnatural causes %d",
|
|
||||||
status);
|
|
||||||
goto error_die;
|
|
||||||
}
|
|
||||||
code = WEXITSTATUS(status);
|
|
||||||
if (code) {
|
|
||||||
error("git-index-pack died with error code %d", code);
|
|
||||||
goto error_die;
|
|
||||||
}
|
|
||||||
if (err)
|
|
||||||
goto error_die;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
hash[40] = 0;
|
|
||||||
if (get_sha1_hex(hash, sha1)) {
|
|
||||||
error("git-index-pack reported nonsense '%s'", hash);
|
|
||||||
goto error_die;
|
|
||||||
}
|
|
||||||
/* Now we have pack in pack_tmp_name[], and
|
|
||||||
* idx in idx[]; rename them to their final names.
|
|
||||||
*/
|
|
||||||
snprintf(final, sizeof(final),
|
|
||||||
"%s/pack/pack-%s.pack", get_object_directory(), hash);
|
|
||||||
move_temp_to_file(pack_tmp_name, final);
|
|
||||||
chmod(final, 0444);
|
|
||||||
snprintf(final, sizeof(final),
|
|
||||||
"%s/pack/pack-%s.idx", get_object_directory(), hash);
|
|
||||||
move_temp_to_file(idx, final);
|
|
||||||
chmod(final, 0444);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
error_die:
|
|
||||||
unlink(idx);
|
|
||||||
unlink(pack_tmp_name);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int clone_without_unpack(int fd[2])
|
|
||||||
{
|
|
||||||
char tmpfile[PATH_MAX];
|
|
||||||
int ofd, ifd;
|
|
||||||
|
|
||||||
ifd = fd[0];
|
|
||||||
snprintf(tmpfile, sizeof(tmpfile),
|
|
||||||
"%s/pack/tmp-XXXXXX", get_object_directory());
|
|
||||||
ofd = mkstemp(tmpfile);
|
|
||||||
if (ofd < 0)
|
|
||||||
return error("unable to create temporary file %s", tmpfile);
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
char buf[8192];
|
|
||||||
ssize_t sz, wsz, pos;
|
|
||||||
sz = read(ifd, buf, sizeof(buf));
|
|
||||||
if (sz == 0)
|
|
||||||
break;
|
|
||||||
if (sz < 0) {
|
|
||||||
error("error reading pack (%s)", strerror(errno));
|
|
||||||
close(ofd);
|
|
||||||
unlink(tmpfile);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
pos = 0;
|
|
||||||
while (pos < sz) {
|
|
||||||
wsz = write(ofd, buf + pos, sz - pos);
|
|
||||||
if (wsz < 0) {
|
|
||||||
error("error writing pack (%s)",
|
|
||||||
strerror(errno));
|
|
||||||
close(ofd);
|
|
||||||
unlink(tmpfile);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
pos += wsz;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close(ofd);
|
|
||||||
return finish_pack(tmpfile);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int clone_pack(int fd[2], int nr_match, char **match)
|
static int clone_pack(int fd[2], int nr_match, char **match)
|
||||||
{
|
{
|
||||||
struct ref *refs;
|
struct ref *refs;
|
||||||
@ -257,10 +123,19 @@ static int clone_pack(int fd[2], int nr_match, char **match)
|
|||||||
}
|
}
|
||||||
clone_handshake(fd, refs);
|
clone_handshake(fd, refs);
|
||||||
|
|
||||||
status = clone_without_unpack(fd);
|
status = receive_keep_pack(fd, "git-clone-pack");
|
||||||
|
|
||||||
if (!status)
|
if (!status) {
|
||||||
write_refs(refs);
|
if (nr_match == 0)
|
||||||
|
write_refs(refs);
|
||||||
|
else
|
||||||
|
while (refs) {
|
||||||
|
printf("%s %s\n",
|
||||||
|
sha1_to_hex(refs->old_sha1),
|
||||||
|
refs->name);
|
||||||
|
refs = refs->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,8 +160,6 @@ int main(int argc, char **argv)
|
|||||||
exec = arg + 7;
|
exec = arg + 7;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!strcmp("--keep", arg))
|
|
||||||
continue;
|
|
||||||
usage(clone_pack_usage);
|
usage(clone_pack_usage);
|
||||||
}
|
}
|
||||||
dest = arg;
|
dest = arg;
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# If you installed git by hand previously, you may find this
|
|
||||||
# script useful to remove the symbolic links that we shipped
|
|
||||||
# for backward compatibility.
|
|
||||||
#
|
|
||||||
# Running this script with the previous installation directory
|
|
||||||
# like this:
|
|
||||||
#
|
|
||||||
# $ cmd-rename.sh /usr/local/bin/
|
|
||||||
#
|
|
||||||
# would clean them.
|
|
||||||
|
|
||||||
d="$1"
|
|
||||||
test -d "$d" || exit
|
|
||||||
while read old new
|
|
||||||
do
|
|
||||||
rm -f "$d/$old"
|
|
||||||
done <<\EOF
|
|
||||||
git-add-script git-add
|
|
||||||
git-archimport-script git-archimport
|
|
||||||
git-bisect-script git-bisect
|
|
||||||
git-branch-script git-branch
|
|
||||||
git-checkout-script git-checkout
|
|
||||||
git-cherry-pick-script git-cherry-pick
|
|
||||||
git-clone-script git-clone
|
|
||||||
git-commit-script git-commit
|
|
||||||
git-count-objects-script git-count-objects
|
|
||||||
git-cvsimport-script git-cvsimport
|
|
||||||
git-diff-script git-diff
|
|
||||||
git-send-email-script git-send-email
|
|
||||||
git-fetch-script git-fetch
|
|
||||||
git-format-patch-script git-format-patch
|
|
||||||
git-log-script git-log
|
|
||||||
git-ls-remote-script git-ls-remote
|
|
||||||
git-merge-one-file-script git-merge-one-file
|
|
||||||
git-octopus-script git-octopus
|
|
||||||
git-parse-remote-script git-parse-remote
|
|
||||||
git-prune-script git-prune
|
|
||||||
git-pull-script git-pull
|
|
||||||
git-push-script git-push
|
|
||||||
git-rebase-script git-rebase
|
|
||||||
git-relink-script git-relink
|
|
||||||
git-rename-script git-rename
|
|
||||||
git-repack-script git-repack
|
|
||||||
git-request-pull-script git-request-pull
|
|
||||||
git-reset-script git-reset
|
|
||||||
git-resolve-script git-resolve
|
|
||||||
git-revert-script git-revert
|
|
||||||
git-sh-setup-script git-sh-setup
|
|
||||||
git-status-script git-status
|
|
||||||
git-tag-script git-tag
|
|
||||||
git-verify-tag-script git-verify-tag
|
|
||||||
git-http-pull git-http-fetch
|
|
||||||
git-local-pull git-local-fetch
|
|
||||||
git-checkout-cache git-checkout-index
|
|
||||||
git-diff-cache git-diff-index
|
|
||||||
git-merge-cache git-merge-index
|
|
||||||
git-update-cache git-update-index
|
|
||||||
git-convert-cache git-convert-objects
|
|
||||||
git-fsck-cache git-fsck-objects
|
|
||||||
EOF
|
|
5
commit.c
5
commit.c
@ -1,6 +1,6 @@
|
|||||||
|
#include "cache.h"
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
#include "cache.h"
|
|
||||||
|
|
||||||
int save_commit_buffer = 1;
|
int save_commit_buffer = 1;
|
||||||
|
|
||||||
@ -560,6 +560,9 @@ void sort_in_topological_order(struct commit_list ** list)
|
|||||||
next = next->next;
|
next = next->next;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!count)
|
||||||
|
return;
|
||||||
/* allocate an array to help sort the list */
|
/* allocate an array to help sort the list */
|
||||||
nodes = xcalloc(count, sizeof(*nodes));
|
nodes = xcalloc(count, sizeof(*nodes));
|
||||||
/* link the list to the array */
|
/* link the list to the array */
|
||||||
|
19
config.c
19
config.c
@ -409,8 +409,7 @@ int git_config_set_multivar(const char* key, const char* value,
|
|||||||
const char* value_regex, int multi_replace)
|
const char* value_regex, int multi_replace)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct stat st;
|
int fd, in_fd;
|
||||||
int fd;
|
|
||||||
char* config_filename = strdup(git_path("config"));
|
char* config_filename = strdup(git_path("config"));
|
||||||
char* lock_file = strdup(git_path("config.lock"));
|
char* lock_file = strdup(git_path("config.lock"));
|
||||||
const char* last_dot = strrchr(key, '.');
|
const char* last_dot = strrchr(key, '.');
|
||||||
@ -457,9 +456,17 @@ int git_config_set_multivar(const char* key, const char* value,
|
|||||||
/*
|
/*
|
||||||
* If .git/config does not exist yet, write a minimal version.
|
* If .git/config does not exist yet, write a minimal version.
|
||||||
*/
|
*/
|
||||||
if (stat(config_filename, &st)) {
|
in_fd = open(config_filename, O_RDONLY);
|
||||||
|
if ( in_fd < 0 ) {
|
||||||
free(store.key);
|
free(store.key);
|
||||||
|
|
||||||
|
if ( ENOENT != errno ) {
|
||||||
|
error("opening %s: %s", config_filename,
|
||||||
|
strerror(errno));
|
||||||
|
close(fd);
|
||||||
|
unlink(lock_file);
|
||||||
|
return 3; /* same as "invalid config file" */
|
||||||
|
}
|
||||||
/* if nothing to unset, error out */
|
/* if nothing to unset, error out */
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
close(fd);
|
close(fd);
|
||||||
@ -471,7 +478,7 @@ int git_config_set_multivar(const char* key, const char* value,
|
|||||||
store_write_section(fd, key);
|
store_write_section(fd, key);
|
||||||
store_write_pair(fd, key, value);
|
store_write_pair(fd, key, value);
|
||||||
} else{
|
} else{
|
||||||
int in_fd;
|
struct stat st;
|
||||||
char* contents;
|
char* contents;
|
||||||
int i, copy_begin, copy_end, new_line = 0;
|
int i, copy_begin, copy_end, new_line = 0;
|
||||||
|
|
||||||
@ -487,7 +494,7 @@ int git_config_set_multivar(const char* key, const char* value,
|
|||||||
store.value_regex = (regex_t*)malloc(sizeof(regex_t));
|
store.value_regex = (regex_t*)malloc(sizeof(regex_t));
|
||||||
if (regcomp(store.value_regex, value_regex,
|
if (regcomp(store.value_regex, value_regex,
|
||||||
REG_EXTENDED)) {
|
REG_EXTENDED)) {
|
||||||
fprintf(stderr, "Invalid pattern: %s",
|
fprintf(stderr, "Invalid pattern: %s\n",
|
||||||
value_regex);
|
value_regex);
|
||||||
free(store.value_regex);
|
free(store.value_regex);
|
||||||
return 6;
|
return 6;
|
||||||
@ -528,7 +535,7 @@ int git_config_set_multivar(const char* key, const char* value,
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
in_fd = open(config_filename, O_RDONLY, 0666);
|
fstat(in_fd, &st);
|
||||||
contents = mmap(NULL, st.st_size, PROT_READ,
|
contents = mmap(NULL, st.st_size, PROT_READ,
|
||||||
MAP_PRIVATE, in_fd, 0);
|
MAP_PRIVATE, in_fd, 0);
|
||||||
close(in_fd);
|
close(in_fd);
|
||||||
|
22
copy.c
22
copy.c
@ -6,32 +6,30 @@ int copy_fd(int ifd, int ofd)
|
|||||||
int len;
|
int len;
|
||||||
char buffer[8192];
|
char buffer[8192];
|
||||||
char *buf = buffer;
|
char *buf = buffer;
|
||||||
len = read(ifd, buffer, sizeof(buffer));
|
len = xread(ifd, buffer, sizeof(buffer));
|
||||||
if (!len)
|
if (!len)
|
||||||
break;
|
break;
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
int read_error;
|
int read_error;
|
||||||
if (errno == EAGAIN)
|
|
||||||
continue;
|
|
||||||
read_error = errno;
|
read_error = errno;
|
||||||
close(ifd);
|
close(ifd);
|
||||||
return error("copy-fd: read returned %s",
|
return error("copy-fd: read returned %s",
|
||||||
strerror(read_error));
|
strerror(read_error));
|
||||||
}
|
}
|
||||||
while (1) {
|
while (len) {
|
||||||
int written = write(ofd, buf, len);
|
int written = xwrite(ofd, buf, len);
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
buf += written;
|
buf += written;
|
||||||
len -= written;
|
len -= written;
|
||||||
if (!len)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (!written)
|
else if (!written) {
|
||||||
|
close(ifd);
|
||||||
return error("copy-fd: write returned 0");
|
return error("copy-fd: write returned 0");
|
||||||
if (errno == EAGAIN || errno == EINTR)
|
} else {
|
||||||
continue;
|
close(ifd);
|
||||||
return error("copy-fd: write returned %s",
|
return error("copy-fd: write returned %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close(ifd);
|
close(ifd);
|
||||||
|
@ -15,7 +15,7 @@ static int sha1flush(struct sha1file *f, unsigned int count)
|
|||||||
void *buf = f->buffer;
|
void *buf = f->buffer;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int ret = write(f->fd, buf, count);
|
int ret = xwrite(f->fd, buf, count);
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
buf += ret;
|
buf += ret;
|
||||||
count -= ret;
|
count -= ret;
|
||||||
@ -25,8 +25,6 @@ static int sha1flush(struct sha1file *f, unsigned int count)
|
|||||||
}
|
}
|
||||||
if (!ret)
|
if (!ret)
|
||||||
die("sha1 file '%s' write error. Out of diskspace", f->name);
|
die("sha1 file '%s' write error. Out of diskspace", f->name);
|
||||||
if (errno == EAGAIN || errno == EINTR)
|
|
||||||
continue;
|
|
||||||
die("sha1 file '%s' write error (%s)", f->name, strerror(errno));
|
die("sha1 file '%s' write error (%s)", f->name, strerror(errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
date.c
4
date.c
@ -326,7 +326,7 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE! We will give precedence to day-of-month over month or
|
* NOTE! We will give precedence to day-of-month over month or
|
||||||
* year numebers in the 1-12 range. So 05 is always "mday 5",
|
* year numbers in the 1-12 range. So 05 is always "mday 5",
|
||||||
* unless we already have a mday..
|
* unless we already have a mday..
|
||||||
*
|
*
|
||||||
* IOW, 01 Apr 05 parses as "April 1st, 2005".
|
* IOW, 01 Apr 05 parses as "April 1st, 2005".
|
||||||
@ -640,7 +640,7 @@ unsigned long approxidate(const char *date)
|
|||||||
}
|
}
|
||||||
if (number > 0 && number < 32)
|
if (number > 0 && number < 32)
|
||||||
tm.tm_mday = number;
|
tm.tm_mday = number;
|
||||||
if (tm.tm_mon > now.tm_mon)
|
if (tm.tm_mon > now.tm_mon && tm.tm_year == now.tm_year)
|
||||||
tm.tm_year--;
|
tm.tm_year--;
|
||||||
return mktime(&tm);
|
return mktime(&tm);
|
||||||
}
|
}
|
||||||
|
6
debian/.gitignore
vendored
6
debian/.gitignore
vendored
@ -1,6 +0,0 @@
|
|||||||
git-core
|
|
||||||
git-tk
|
|
||||||
*.debhelper
|
|
||||||
*.substvars
|
|
||||||
build-stamp
|
|
||||||
files
|
|
195
debian/changelog
vendored
195
debian/changelog
vendored
@ -1,195 +0,0 @@
|
|||||||
git-core (0.99.9n-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9n aka 1.0rc6
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Wed, 14 Dec 2005 17:27:08 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9m-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9m aka 1.0rc5
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Sun, 11 Dec 2005 16:48:06 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9l-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9l aka 1.0rc4
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Sat, 3 Dec 2005 23:45:23 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9k-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9k but not 1.0rc yet.
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Fri, 25 Nov 2005 16:33:11 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9j-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9j aka 1.0rc3
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Wed, 16 Nov 2005 20:39:55 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9i-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9i aka 1.0rc2
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Mon, 14 Nov 2005 18:38:27 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9h-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9h
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Fri, 11 Nov 2005 22:33:18 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9g-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9g
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Wed, 9 Nov 2005 21:01:55 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9f-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9f
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Tue, 8 Nov 2005 01:21:52 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9e-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9e
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Sun, 6 Nov 2005 18:37:18 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9d-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9d
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Sat, 5 Nov 2005 11:46:37 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9c-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9c
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Thu, 3 Nov 2005 15:44:54 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9b-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9b
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Tue, 1 Nov 2005 21:39:39 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9a-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9a
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Sun, 30 Oct 2005 15:03:32 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9.GIT-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* Build Dependency did not include libexpat-dev.
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Sun, 13 Nov 2005 01:55:34 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9.GIT-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* Do not scatter txt and html documentation into feature
|
|
||||||
subpackages. Do place man pages into them.
|
|
||||||
* Capture more cvs stuff into git-cvs package.
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Tue, 8 Nov 2005 01:19:06 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9.GIT-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* Test Build.
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Sat, 5 Nov 2005 11:18:13 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* Split the git-core binary package into core, doc, and foreign SCM
|
|
||||||
interoperability modules.
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Sat, 5 Nov 2005 11:18:13 -0800
|
|
||||||
|
|
||||||
git-core (0.99.9-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.9
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Sat, 29 Oct 2005 14:34:30 -0700
|
|
||||||
|
|
||||||
git-core (0.99.8-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.8
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Sun, 2 Oct 2005 12:54:26 -0700
|
|
||||||
|
|
||||||
git-core (0.99.7-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.7
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Sat, 10 Sep 2005 18:36:39 -0700
|
|
||||||
|
|
||||||
git-core (0.99.6-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.6
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Wed, 24 Aug 2005 23:09:35 -0700
|
|
||||||
|
|
||||||
git-core (0.99.5-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* Enable git-send-email on Debian. There is no reason to shy
|
|
||||||
away from it, since we have the necessary Perl modules available.
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Thu, 25 Aug 2005 14:16:59 -0700
|
|
||||||
|
|
||||||
git-core (0.99.5-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* GIT 0.99.5
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Wed, 10 Aug 2005 22:05:00 -0700
|
|
||||||
|
|
||||||
git-core (0.99.4-4) unstable; urgency=low
|
|
||||||
|
|
||||||
* Mark git-tk as architecture neutral.
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Fri, 12 Aug 2005 13:25:00 -0700
|
|
||||||
|
|
||||||
git-core (0.99.4-3) unstable; urgency=low
|
|
||||||
|
|
||||||
* Split off gitk.
|
|
||||||
* Do not depend on diff which is an essential package.
|
|
||||||
* Use dh_movefiles, not dh_install, to stage two subpackages.
|
|
||||||
|
|
||||||
-- Matthias Urlichs <smurf@debian.org> Thu, 11 Aug 2005 01:43:24 +0200
|
|
||||||
|
|
||||||
git-core (0.99.4-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* Git 0.99.4 official release.
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Wed, 10 Aug 2005 15:00:00 -0700
|
|
||||||
|
|
||||||
git-core (0.99.4-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* Pass prefix down to the submake when building.
|
|
||||||
|
|
||||||
-- Junio C Hamano <junkio@cox.net> Sat, 6 Aug 2005 13:00:00 -0700
|
|
||||||
|
|
||||||
git-core (0.99-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* Conflict with the GNU Interactive Tools package, which also installs
|
|
||||||
/usr/bin/git.
|
|
||||||
* Use the Mozilla SHA1 code and/or the PPC assembly in preference to
|
|
||||||
OpenSSL. This is only a partial fix for the license issues with OpenSSL.
|
|
||||||
* Minor tweaks to the Depends.
|
|
||||||
|
|
||||||
-- Ryan Anderson <ryan@michonline.com> Sat, 23 Jul 2005 14:15:00 -0400
|
|
||||||
|
|
||||||
git-core (0.99-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* Update deb package support to build correctly.
|
|
||||||
|
|
||||||
-- Ryan Anderson <ryan@michonline.com> Thu, 21 Jul 2005 02:03:32 -0400
|
|
||||||
|
|
||||||
git-core (0.99-0) unstable; urgency=low
|
|
||||||
|
|
||||||
* Initial deb package support
|
|
||||||
|
|
||||||
-- Eric Biederman <ebiederm@xmission.com> Tue, 12 Jul 2005 10:57:51 -0600
|
|
1
debian/compat
vendored
1
debian/compat
vendored
@ -1 +0,0 @@
|
|||||||
4
|
|
63
debian/control
vendored
63
debian/control
vendored
@ -1,63 +0,0 @@
|
|||||||
Source: git-core
|
|
||||||
Section: devel
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: Junio C Hamano <junkio@cox.net>
|
|
||||||
Build-Depends-Indep: libz-dev, libssl-dev, libcurl3-dev|libcurl3-gnutls-dev|libcurl3-openssl-dev, asciidoc (>= 7), xmlto, debhelper (>= 4.0.0), bc, libexpat-dev
|
|
||||||
Standards-Version: 3.6.1
|
|
||||||
|
|
||||||
Package: git-core
|
|
||||||
Architecture: any
|
|
||||||
Depends: ${shlibs:Depends}, ${perl:Depends}, ${misc:Depends}, rcs
|
|
||||||
Recommends: rsync, curl, ssh, python (>= 2.4.0), less
|
|
||||||
Suggests: cogito, patch
|
|
||||||
Conflicts: git, cogito (<< 0.13)
|
|
||||||
Description: The git content addressable filesystem
|
|
||||||
GIT comes in two layers. The bottom layer is merely an extremely fast
|
|
||||||
and flexible filesystem-based database designed to store directory trees
|
|
||||||
with regard to their history. The top layer is a SCM-like tool which
|
|
||||||
enables human beings to work with the database in a manner to a degree
|
|
||||||
similar to other SCM tools.
|
|
||||||
|
|
||||||
Package: git-doc
|
|
||||||
Architecture: all
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, git-core
|
|
||||||
Description: The git content addressable filesystem, Documentation
|
|
||||||
This package contains documentation for GIT.
|
|
||||||
|
|
||||||
Package: git-tk
|
|
||||||
Architecture: all
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, git-core, tk8.4
|
|
||||||
Description: The git content addressable filesystem, GUI add-on
|
|
||||||
This package contains 'gitk', the git revision tree visualizer.
|
|
||||||
|
|
||||||
Package: git-svn
|
|
||||||
Architecture: all
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, git-core, libsvn-core-perl (>= 1.2.1)
|
|
||||||
Suggests: subversion
|
|
||||||
Description: The git content addressable filesystem, SVN interoperability
|
|
||||||
This package contains 'git-svnimport', to import development history from
|
|
||||||
SVN repositories.
|
|
||||||
|
|
||||||
Package: git-arch
|
|
||||||
Architecture: all
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, git-core
|
|
||||||
Suggests: tla, bazaar
|
|
||||||
Description: The git content addressable filesystem, GNUArch interoperability
|
|
||||||
This package contains 'git-archimport', to import development history from
|
|
||||||
GNUArch repositories.
|
|
||||||
|
|
||||||
Package: git-cvs
|
|
||||||
Architecture: all
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, git-core, cvsps (>= 2.1)
|
|
||||||
Suggests: cvs
|
|
||||||
Description: The git content addressable filesystem, CVS interoperability
|
|
||||||
This package contains 'git-cvsimport', to import development history from
|
|
||||||
CVS repositories.
|
|
||||||
|
|
||||||
Package: git-email
|
|
||||||
Architecture: all
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, git-core, libmail-sendmail-perl, libemail-valid-perl
|
|
||||||
Description: The git content addressable filesystem, e-mail add-on
|
|
||||||
This package contains 'git-send-email', to send a series of patch e-mails.
|
|
||||||
|
|
||||||
|
|
24
debian/copyright
vendored
24
debian/copyright
vendored
@ -1,24 +0,0 @@
|
|||||||
This package was downloaded from ftp.kernel.org:/pub/software/scm/git/.
|
|
||||||
|
|
||||||
Upstream Author: Linus Torvalds and many others
|
|
||||||
|
|
||||||
Copyright:
|
|
||||||
|
|
||||||
Copyright 2005, Linus Torvalds and others.
|
|
||||||
|
|
||||||
This package is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; version 2 dated June, 1991.
|
|
||||||
|
|
||||||
This package is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this package; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
02111-1307, USA.
|
|
||||||
|
|
||||||
On Debian GNU/Linux systems, the complete text of the GNU General
|
|
||||||
Public License can be found in `/usr/share/common-licenses/GPL'.
|
|
1
debian/docs
vendored
1
debian/docs
vendored
@ -1 +0,0 @@
|
|||||||
README
|
|
2
debian/git-arch.files
vendored
2
debian/git-arch.files
vendored
@ -1,2 +0,0 @@
|
|||||||
/usr/bin/git-arch*
|
|
||||||
/usr/share/man/*/git-arch*
|
|
13
debian/git-core.doc-base
vendored
13
debian/git-core.doc-base
vendored
@ -1,13 +0,0 @@
|
|||||||
Document: git-core
|
|
||||||
Title: git reference
|
|
||||||
Abstract: This manual describes git
|
|
||||||
Section: Devel
|
|
||||||
|
|
||||||
Format: HTML
|
|
||||||
Index: /usr/share/doc/git-core/git.html
|
|
||||||
Files: /usr/share/doc/git-core/*.html
|
|
||||||
/usr/share/doc/git-core/*/*.html
|
|
||||||
|
|
||||||
Format: text
|
|
||||||
Files: /usr/share/doc/git-core/*.txt
|
|
||||||
/usr/share/doc/git-core/*/*.txt
|
|
1
debian/git-core.files
vendored
1
debian/git-core.files
vendored
@ -1 +0,0 @@
|
|||||||
/usr
|
|
2
debian/git-cvs.files
vendored
2
debian/git-cvs.files
vendored
@ -1,2 +0,0 @@
|
|||||||
/usr/bin/git-cvs*
|
|
||||||
/usr/share/man/*/git-cvs*
|
|
4
debian/git-doc.files
vendored
4
debian/git-doc.files
vendored
@ -1,4 +0,0 @@
|
|||||||
/usr/share/doc/git-core/*.txt
|
|
||||||
/usr/share/doc/git-core/*.html
|
|
||||||
/usr/share/doc/git-core/*/*.html
|
|
||||||
/usr/share/doc/git-core/*/*.txt
|
|
2
debian/git-email.files
vendored
2
debian/git-email.files
vendored
@ -1,2 +0,0 @@
|
|||||||
/usr/bin/git-send-email
|
|
||||||
/usr/share/man/*/git-send-email.*
|
|
2
debian/git-svn.files
vendored
2
debian/git-svn.files
vendored
@ -1,2 +0,0 @@
|
|||||||
/usr/bin/git-svn*
|
|
||||||
/usr/share/man/*/git-svn*
|
|
2
debian/git-tk.files
vendored
2
debian/git-tk.files
vendored
@ -1,2 +0,0 @@
|
|||||||
/usr/bin/gitk
|
|
||||||
/usr/share/man/man1/gitk.*
|
|
109
debian/rules
vendored
109
debian/rules
vendored
@ -1,109 +0,0 @@
|
|||||||
#!/usr/bin/make -f
|
|
||||||
# -*- makefile -*-
|
|
||||||
|
|
||||||
# Uncomment this to turn on verbose mode.
|
|
||||||
#export DH_VERBOSE=1
|
|
||||||
|
|
||||||
CFLAGS = -g -Wall
|
|
||||||
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
|
||||||
CFLAGS += -O0
|
|
||||||
else
|
|
||||||
CFLAGS += -O2
|
|
||||||
endif
|
|
||||||
export CFLAGS
|
|
||||||
|
|
||||||
#
|
|
||||||
# On PowerPC we compile against the hand-crafted assembly, on all
|
|
||||||
# other architectures we compile against GPL'ed sha1 code lifted
|
|
||||||
# from Mozilla. OpenSSL is strangely licensed and best avoided
|
|
||||||
# in Debian.
|
|
||||||
#
|
|
||||||
HOST_ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
|
|
||||||
ifeq (${HOST_ARCH},powerpc)
|
|
||||||
export PPC_SHA1=YesPlease
|
|
||||||
else
|
|
||||||
export MOZILLA_SHA1=YesPlease
|
|
||||||
endif
|
|
||||||
|
|
||||||
# We do have the requisite perl modules in the mainline, and
|
|
||||||
# have no reason to shy away from this script.
|
|
||||||
export WITH_SEND_EMAIL=YesPlease
|
|
||||||
|
|
||||||
PREFIX := /usr
|
|
||||||
MANDIR := /usr/share/man/
|
|
||||||
|
|
||||||
SRC := ./
|
|
||||||
DOC := Documentation/
|
|
||||||
DESTDIR := $(CURDIR)/debian/tmp
|
|
||||||
DOC_DESTDIR := $(DESTDIR)/usr/share/doc/git-core/
|
|
||||||
MAN_DESTDIR := $(DESTDIR)/$(MANDIR)
|
|
||||||
|
|
||||||
build: debian/build-stamp
|
|
||||||
debian/build-stamp:
|
|
||||||
dh_testdir
|
|
||||||
$(MAKE) prefix=$(PREFIX) PYTHON_PATH=/usr/bin/python2.4 all test doc
|
|
||||||
touch debian/build-stamp
|
|
||||||
|
|
||||||
debian-clean:
|
|
||||||
dh_testdir
|
|
||||||
dh_testroot
|
|
||||||
rm -f debian/build-stamp
|
|
||||||
dh_clean
|
|
||||||
|
|
||||||
clean: debian-clean
|
|
||||||
$(MAKE) clean
|
|
||||||
|
|
||||||
install: build
|
|
||||||
dh_testdir
|
|
||||||
dh_testroot
|
|
||||||
dh_clean -k
|
|
||||||
dh_installdirs
|
|
||||||
|
|
||||||
make DESTDIR=$(DESTDIR) prefix=$(PREFIX) mandir=$(MANDIR) \
|
|
||||||
install install-doc
|
|
||||||
|
|
||||||
make -C Documentation DESTDIR=$(DESTDIR) prefix=$(PREFIX) \
|
|
||||||
WEBDOC_DEST=$(DOC_DESTDIR) install-webdoc
|
|
||||||
|
|
||||||
dh_movefiles -p git-arch
|
|
||||||
dh_movefiles -p git-cvs
|
|
||||||
dh_movefiles -p git-svn
|
|
||||||
dh_movefiles -p git-tk
|
|
||||||
dh_movefiles -p git-email
|
|
||||||
dh_movefiles -p git-doc
|
|
||||||
dh_movefiles -p git-core
|
|
||||||
find debian/tmp -type d -o -print | sed -e 's/^/? /'
|
|
||||||
|
|
||||||
binary-arch: build install
|
|
||||||
dh_testdir
|
|
||||||
dh_testroot
|
|
||||||
dh_installchangelogs -a
|
|
||||||
dh_installdocs -a
|
|
||||||
dh_strip -a
|
|
||||||
dh_compress -a
|
|
||||||
dh_fixperms -a
|
|
||||||
dh_perl -a
|
|
||||||
dh_makeshlibs -a
|
|
||||||
dh_installdeb -a
|
|
||||||
dh_shlibdeps -a
|
|
||||||
dh_gencontrol -a
|
|
||||||
dh_md5sums -a
|
|
||||||
dh_builddeb -a
|
|
||||||
|
|
||||||
binary-indep: build install
|
|
||||||
dh_testdir
|
|
||||||
dh_testroot
|
|
||||||
dh_installchangelogs -i
|
|
||||||
dh_installdocs -i
|
|
||||||
dh_compress -i
|
|
||||||
dh_fixperms -i
|
|
||||||
dh_makeshlibs -i
|
|
||||||
dh_installdeb -i
|
|
||||||
dh_shlibdeps -i
|
|
||||||
dh_gencontrol -i
|
|
||||||
dh_md5sums -i
|
|
||||||
dh_builddeb -i
|
|
||||||
|
|
||||||
binary: binary-arch binary-indep
|
|
||||||
|
|
||||||
.PHONY: build clean binary install clean debian-clean
|
|
34
diff-delta.c
34
diff-delta.c
@ -84,20 +84,15 @@ typedef struct s_chanode {
|
|||||||
} chanode_t;
|
} chanode_t;
|
||||||
|
|
||||||
typedef struct s_chastore {
|
typedef struct s_chastore {
|
||||||
chanode_t *head, *tail;
|
|
||||||
int isize, nsize;
|
int isize, nsize;
|
||||||
chanode_t *ancur;
|
chanode_t *ancur;
|
||||||
chanode_t *sncur;
|
|
||||||
int scurr;
|
|
||||||
} chastore_t;
|
} chastore_t;
|
||||||
|
|
||||||
static void cha_init(chastore_t *cha, int isize, int icount)
|
static void cha_init(chastore_t *cha, int isize, int icount)
|
||||||
{
|
{
|
||||||
cha->head = cha->tail = NULL;
|
|
||||||
cha->isize = isize;
|
cha->isize = isize;
|
||||||
cha->nsize = icount * isize;
|
cha->nsize = icount * isize;
|
||||||
cha->ancur = cha->sncur = NULL;
|
cha->ancur = NULL;
|
||||||
cha->scurr = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *cha_alloc(chastore_t *cha)
|
static void *cha_alloc(chastore_t *cha)
|
||||||
@ -111,12 +106,7 @@ static void *cha_alloc(chastore_t *cha)
|
|||||||
if (!ancur)
|
if (!ancur)
|
||||||
return NULL;
|
return NULL;
|
||||||
ancur->icurr = 0;
|
ancur->icurr = 0;
|
||||||
ancur->next = NULL;
|
ancur->next = cha->ancur;
|
||||||
if (cha->tail)
|
|
||||||
cha->tail->next = ancur;
|
|
||||||
if (!cha->head)
|
|
||||||
cha->head = ancur;
|
|
||||||
cha->tail = ancur;
|
|
||||||
cha->ancur = ancur;
|
cha->ancur = ancur;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +117,7 @@ static void *cha_alloc(chastore_t *cha)
|
|||||||
|
|
||||||
static void cha_free(chastore_t *cha)
|
static void cha_free(chastore_t *cha)
|
||||||
{
|
{
|
||||||
chanode_t *cur = cha->head;
|
chanode_t *cur = cha->ancur;
|
||||||
while (cur) {
|
while (cur) {
|
||||||
chanode_t *tmp = cur;
|
chanode_t *tmp = cur;
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
@ -142,7 +132,6 @@ typedef struct s_bdrecord {
|
|||||||
} bdrecord_t;
|
} bdrecord_t;
|
||||||
|
|
||||||
typedef struct s_bdfile {
|
typedef struct s_bdfile {
|
||||||
const unsigned char *data, *top;
|
|
||||||
chastore_t cha;
|
chastore_t cha;
|
||||||
unsigned int fphbits;
|
unsigned int fphbits;
|
||||||
bdrecord_t **fphash;
|
bdrecord_t **fphash;
|
||||||
@ -152,7 +141,7 @@ static int delta_prepare(const unsigned char *buf, int bufsize, bdfile_t *bdf)
|
|||||||
{
|
{
|
||||||
unsigned int fphbits;
|
unsigned int fphbits;
|
||||||
int i, hsize;
|
int i, hsize;
|
||||||
const unsigned char *base, *data, *top;
|
const unsigned char *data, *top;
|
||||||
bdrecord_t *brec;
|
bdrecord_t *brec;
|
||||||
bdrecord_t **fphash;
|
bdrecord_t **fphash;
|
||||||
|
|
||||||
@ -165,13 +154,12 @@ static int delta_prepare(const unsigned char *buf, int bufsize, bdfile_t *bdf)
|
|||||||
fphash[i] = NULL;
|
fphash[i] = NULL;
|
||||||
cha_init(&bdf->cha, sizeof(bdrecord_t), hsize / 4 + 1);
|
cha_init(&bdf->cha, sizeof(bdrecord_t), hsize / 4 + 1);
|
||||||
|
|
||||||
bdf->data = data = base = buf;
|
top = buf + bufsize;
|
||||||
bdf->top = top = buf + bufsize;
|
data = buf + (bufsize / BLK_SIZE) * BLK_SIZE;
|
||||||
data += (bufsize / BLK_SIZE) * BLK_SIZE;
|
|
||||||
if (data == top)
|
if (data == top)
|
||||||
data -= BLK_SIZE;
|
data -= BLK_SIZE;
|
||||||
|
|
||||||
for ( ; data >= base; data -= BLK_SIZE) {
|
for ( ; data >= buf; data -= BLK_SIZE) {
|
||||||
brec = cha_alloc(&bdf->cha);
|
brec = cha_alloc(&bdf->cha);
|
||||||
if (!brec) {
|
if (!brec) {
|
||||||
cha_free(&bdf->cha);
|
cha_free(&bdf->cha);
|
||||||
@ -208,7 +196,7 @@ void *diff_delta(void *from_buf, unsigned long from_size,
|
|||||||
{
|
{
|
||||||
int i, outpos, outsize, inscnt, csize, msize, moff;
|
int i, outpos, outsize, inscnt, csize, msize, moff;
|
||||||
unsigned int fp;
|
unsigned int fp;
|
||||||
const unsigned char *data, *top, *ptr1, *ptr2;
|
const unsigned char *ref_data, *ref_top, *data, *top, *ptr1, *ptr2;
|
||||||
unsigned char *out, *orig;
|
unsigned char *out, *orig;
|
||||||
bdrecord_t *brec;
|
bdrecord_t *brec;
|
||||||
bdfile_t bdf;
|
bdfile_t bdf;
|
||||||
@ -224,6 +212,8 @@ void *diff_delta(void *from_buf, unsigned long from_size,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ref_data = from_buf;
|
||||||
|
ref_top = from_buf + from_size;
|
||||||
data = to_buf;
|
data = to_buf;
|
||||||
top = to_buf + to_size;
|
top = to_buf + to_size;
|
||||||
|
|
||||||
@ -253,7 +243,7 @@ void *diff_delta(void *from_buf, unsigned long from_size,
|
|||||||
i = HASH(fp, bdf.fphbits);
|
i = HASH(fp, bdf.fphbits);
|
||||||
for (brec = bdf.fphash[i]; brec; brec = brec->next) {
|
for (brec = bdf.fphash[i]; brec; brec = brec->next) {
|
||||||
if (brec->fp == fp) {
|
if (brec->fp == fp) {
|
||||||
csize = bdf.top - brec->ptr;
|
csize = ref_top - brec->ptr;
|
||||||
if (csize > top - data)
|
if (csize > top - data)
|
||||||
csize = top - data;
|
csize = top - data;
|
||||||
for (ptr1 = brec->ptr, ptr2 = data;
|
for (ptr1 = brec->ptr, ptr2 = data;
|
||||||
@ -262,7 +252,7 @@ void *diff_delta(void *from_buf, unsigned long from_size,
|
|||||||
|
|
||||||
csize = ptr1 - brec->ptr;
|
csize = ptr1 - brec->ptr;
|
||||||
if (csize > msize) {
|
if (csize > msize) {
|
||||||
moff = brec->ptr - bdf.data;
|
moff = brec->ptr - ref_data;
|
||||||
msize = csize;
|
msize = csize;
|
||||||
if (msize >= 0x10000) {
|
if (msize >= 0x10000) {
|
||||||
msize = 0x10000;
|
msize = 0x10000;
|
||||||
|
@ -116,7 +116,7 @@ static int diff_cache(struct cache_entry **ac, int entries, const char **pathspe
|
|||||||
/* We come here with ce pointing at stage 1
|
/* We come here with ce pointing at stage 1
|
||||||
* (original tree) and ac[1] pointing at stage
|
* (original tree) and ac[1] pointing at stage
|
||||||
* 3 (unmerged). show-modified with
|
* 3 (unmerged). show-modified with
|
||||||
* report-mising set to false does not say the
|
* report-missing set to false does not say the
|
||||||
* file is deleted but reports true if work
|
* file is deleted but reports true if work
|
||||||
* tree does not have it, in which case we
|
* tree does not have it, in which case we
|
||||||
* fall through to report the unmerged state.
|
* fall through to report the unmerged state.
|
||||||
|
40
diff-tree.c
40
diff-tree.c
@ -14,11 +14,6 @@ static enum cmit_fmt commit_format = CMIT_FMT_RAW;
|
|||||||
|
|
||||||
static struct diff_options diff_options;
|
static struct diff_options diff_options;
|
||||||
|
|
||||||
static void call_diff_setup_done(void)
|
|
||||||
{
|
|
||||||
diff_setup_done(&diff_options);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int call_diff_flush(void)
|
static int call_diff_flush(void)
|
||||||
{
|
{
|
||||||
diffcore_std(&diff_options);
|
diffcore_std(&diff_options);
|
||||||
@ -43,7 +38,6 @@ static int diff_tree_sha1_top(const unsigned char *old,
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
call_diff_setup_done();
|
|
||||||
ret = diff_tree_sha1(old, new, base, &diff_options);
|
ret = diff_tree_sha1(old, new, base, &diff_options);
|
||||||
call_diff_flush();
|
call_diff_flush();
|
||||||
return ret;
|
return ret;
|
||||||
@ -55,7 +49,6 @@ static int diff_root_tree(const unsigned char *new, const char *base)
|
|||||||
void *tree;
|
void *tree;
|
||||||
struct tree_desc empty, real;
|
struct tree_desc empty, real;
|
||||||
|
|
||||||
call_diff_setup_done();
|
|
||||||
tree = read_object_with_reference(new, "tree", &real.size, NULL);
|
tree = read_object_with_reference(new, "tree", &real.size, NULL);
|
||||||
if (!tree)
|
if (!tree)
|
||||||
die("unable to read root tree (%s)", sha1_to_hex(new));
|
die("unable to read root tree (%s)", sha1_to_hex(new));
|
||||||
@ -69,18 +62,29 @@ static int diff_root_tree(const unsigned char *new, const char *base)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *generate_header(const char *commit, const char *parent, const char *msg)
|
static const char *generate_header(const unsigned char *commit_sha1,
|
||||||
|
const unsigned char *parent_sha1,
|
||||||
|
const char *msg)
|
||||||
{
|
{
|
||||||
static char this_header[16384];
|
static char this_header[16384];
|
||||||
int offset;
|
int offset;
|
||||||
unsigned long len;
|
unsigned long len;
|
||||||
|
int abbrev = diff_options.abbrev;
|
||||||
|
|
||||||
if (!verbose_header)
|
if (!verbose_header)
|
||||||
return commit;
|
return sha1_to_hex(commit_sha1);
|
||||||
|
|
||||||
len = strlen(msg);
|
len = strlen(msg);
|
||||||
offset = sprintf(this_header, "%s%s (from %s)\n", header_prefix, commit, parent);
|
|
||||||
offset += pretty_print_commit(commit_format, msg, len, this_header + offset, sizeof(this_header) - offset);
|
offset = sprintf(this_header, "%s%s ",
|
||||||
|
header_prefix,
|
||||||
|
diff_unique_abbrev(commit_sha1, abbrev));
|
||||||
|
offset += sprintf(this_header + offset, "(from %s)\n",
|
||||||
|
parent_sha1 ?
|
||||||
|
diff_unique_abbrev(parent_sha1, abbrev) : "root");
|
||||||
|
offset += pretty_print_commit(commit_format, msg, len,
|
||||||
|
this_header + offset,
|
||||||
|
sizeof(this_header) - offset);
|
||||||
return this_header;
|
return this_header;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,18 +103,18 @@ static int diff_tree_commit(const unsigned char *commit_sha1)
|
|||||||
|
|
||||||
/* Root commit? */
|
/* Root commit? */
|
||||||
if (show_root_diff && !commit->parents) {
|
if (show_root_diff && !commit->parents) {
|
||||||
header = generate_header(name, "root", commit->buffer);
|
header = generate_header(sha1, NULL, commit->buffer);
|
||||||
diff_root_tree(commit_sha1, "");
|
diff_root_tree(commit_sha1, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* More than one parent? */
|
/* More than one parent? */
|
||||||
if (ignore_merges && commit->parents && commit->parents->next)
|
if (ignore_merges && commit->parents && commit->parents->next)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (parents = commit->parents; parents; parents = parents->next) {
|
for (parents = commit->parents; parents; parents = parents->next) {
|
||||||
struct commit *parent = parents->item;
|
struct commit *parent = parents->item;
|
||||||
header = generate_header(name,
|
header = generate_header(sha1,
|
||||||
sha1_to_hex(parent->object.sha1),
|
parent->object.sha1,
|
||||||
commit->buffer);
|
commit->buffer);
|
||||||
diff_tree_sha1_top(parent->object.sha1, commit_sha1, "");
|
diff_tree_sha1_top(parent->object.sha1, commit_sha1, "");
|
||||||
if (!header && verbose_header) {
|
if (!header && verbose_header) {
|
||||||
@ -129,6 +133,7 @@ static int diff_tree_stdin(char *line)
|
|||||||
int len = strlen(line);
|
int len = strlen(line);
|
||||||
unsigned char commit[20], parent[20];
|
unsigned char commit[20], parent[20];
|
||||||
static char this_header[1000];
|
static char this_header[1000];
|
||||||
|
int abbrev = diff_options.abbrev;
|
||||||
|
|
||||||
if (!len || line[len-1] != '\n')
|
if (!len || line[len-1] != '\n')
|
||||||
return -1;
|
return -1;
|
||||||
@ -138,7 +143,9 @@ static int diff_tree_stdin(char *line)
|
|||||||
if (isspace(line[40]) && !get_sha1_hex(line+41, parent)) {
|
if (isspace(line[40]) && !get_sha1_hex(line+41, parent)) {
|
||||||
line[40] = 0;
|
line[40] = 0;
|
||||||
line[81] = 0;
|
line[81] = 0;
|
||||||
sprintf(this_header, "%s (from %s)\n", line, line+41);
|
sprintf(this_header, "%s (from %s)\n",
|
||||||
|
diff_unique_abbrev(commit, abbrev),
|
||||||
|
diff_unique_abbrev(parent, abbrev));
|
||||||
header = this_header;
|
header = this_header;
|
||||||
return diff_tree_sha1_top(parent, commit, "");
|
return diff_tree_sha1_top(parent, commit, "");
|
||||||
}
|
}
|
||||||
@ -239,6 +246,7 @@ int main(int argc, const char **argv)
|
|||||||
diff_options.recursive = 1;
|
diff_options.recursive = 1;
|
||||||
|
|
||||||
diff_tree_setup_paths(get_pathspec(prefix, argv));
|
diff_tree_setup_paths(get_pathspec(prefix, argv));
|
||||||
|
diff_setup_done(&diff_options);
|
||||||
|
|
||||||
switch (nr_sha1) {
|
switch (nr_sha1) {
|
||||||
case 0:
|
case 0:
|
||||||
|
67
diff.c
67
diff.c
@ -504,9 +504,9 @@ static void prepare_temp_file(const char *name,
|
|||||||
}
|
}
|
||||||
if (S_ISLNK(st.st_mode)) {
|
if (S_ISLNK(st.st_mode)) {
|
||||||
int ret;
|
int ret;
|
||||||
char *buf, buf_[1024];
|
char buf[PATH_MAX + 1]; /* ought to be SYMLINK_MAX */
|
||||||
buf = ((sizeof(buf_) < st.st_size) ?
|
if (sizeof(buf) <= st.st_size)
|
||||||
xmalloc(st.st_size) : buf_);
|
die("symlink too long: %s", name);
|
||||||
ret = readlink(name, buf, st.st_size);
|
ret = readlink(name, buf, st.st_size);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
die("readlink(%s)", name);
|
die("readlink(%s)", name);
|
||||||
@ -650,7 +650,7 @@ static void diff_fill_sha1_info(struct diff_filespec *one)
|
|||||||
if (DIFF_FILE_VALID(one)) {
|
if (DIFF_FILE_VALID(one)) {
|
||||||
if (!one->sha1_valid) {
|
if (!one->sha1_valid) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (stat(one->path, &st) < 0)
|
if (lstat(one->path, &st) < 0)
|
||||||
die("stat %s", one->path);
|
die("stat %s", one->path);
|
||||||
if (index_path(one->sha1, one->path, &st, 0))
|
if (index_path(one->sha1, one->path, &st, 0))
|
||||||
die("cannot hash %s\n", one->path);
|
die("cannot hash %s\n", one->path);
|
||||||
@ -723,11 +723,13 @@ static void run_diff(struct diff_filepair *p, struct diff_options *o)
|
|||||||
|
|
||||||
if (memcmp(one->sha1, two->sha1, 20)) {
|
if (memcmp(one->sha1, two->sha1, 20)) {
|
||||||
char one_sha1[41];
|
char one_sha1[41];
|
||||||
const char *index_fmt = o->full_index ? "index %s..%s" : "index %.7s..%.7s";
|
int abbrev = o->full_index ? 40 : DIFF_DEFAULT_INDEX_ABBREV;
|
||||||
memcpy(one_sha1, sha1_to_hex(one->sha1), 41);
|
memcpy(one_sha1, sha1_to_hex(one->sha1), 41);
|
||||||
|
|
||||||
len += snprintf(msg + len, sizeof(msg) - len,
|
len += snprintf(msg + len, sizeof(msg) - len,
|
||||||
index_fmt, one_sha1, sha1_to_hex(two->sha1));
|
"index %.*s..%.*s",
|
||||||
|
abbrev, one_sha1, abbrev,
|
||||||
|
sha1_to_hex(two->sha1));
|
||||||
if (one->mode == two->mode)
|
if (one->mode == two->mode)
|
||||||
len += snprintf(msg + len, sizeof(msg) - len,
|
len += snprintf(msg + len, sizeof(msg) - len,
|
||||||
" %06o", one->mode);
|
" %06o", one->mode);
|
||||||
@ -785,12 +787,14 @@ int diff_setup_done(struct diff_options *options)
|
|||||||
* so it is safe for us to do this here. Also
|
* so it is safe for us to do this here. Also
|
||||||
* it does not smudge active_cache or active_nr
|
* it does not smudge active_cache or active_nr
|
||||||
* when it fails, so we do not have to worry about
|
* when it fails, so we do not have to worry about
|
||||||
* cleaning it up oufselves either.
|
* cleaning it up ourselves either.
|
||||||
*/
|
*/
|
||||||
read_cache();
|
read_cache();
|
||||||
}
|
}
|
||||||
if (options->setup & DIFF_SETUP_USE_SIZE_CACHE)
|
if (options->setup & DIFF_SETUP_USE_SIZE_CACHE)
|
||||||
use_size_cache = 1;
|
use_size_cache = 1;
|
||||||
|
if (options->abbrev <= 0 || 40 < options->abbrev)
|
||||||
|
options->abbrev = 40; /* full */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -841,6 +845,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
|
|||||||
}
|
}
|
||||||
else if (!strcmp(arg, "--find-copies-harder"))
|
else if (!strcmp(arg, "--find-copies-harder"))
|
||||||
options->find_copies_harder = 1;
|
options->find_copies_harder = 1;
|
||||||
|
else if (!strcmp(arg, "--abbrev"))
|
||||||
|
options->abbrev = DIFF_DEFAULT_ABBREV;
|
||||||
|
else if (!strncmp(arg, "--abbrev=", 9))
|
||||||
|
options->abbrev = strtoul(arg + 9, NULL, 10);
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
return 1;
|
return 1;
|
||||||
@ -947,14 +955,49 @@ void diff_free_filepair(struct diff_filepair *p)
|
|||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This is different from find_unique_abbrev() in that
|
||||||
|
* it needs to deal with 0{40} SHA1.
|
||||||
|
*/
|
||||||
|
const char *diff_unique_abbrev(const unsigned char *sha1, int len)
|
||||||
|
{
|
||||||
|
int abblen;
|
||||||
|
const char *abbrev;
|
||||||
|
if (len == 40)
|
||||||
|
return sha1_to_hex(sha1);
|
||||||
|
|
||||||
|
abbrev = find_unique_abbrev(sha1, len);
|
||||||
|
if (!abbrev) {
|
||||||
|
if (!memcmp(sha1, null_sha1, 20)) {
|
||||||
|
char *buf = sha1_to_hex(null_sha1);
|
||||||
|
if (len < 37)
|
||||||
|
strcpy(buf + len, "...");
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return sha1_to_hex(sha1);
|
||||||
|
}
|
||||||
|
abblen = strlen(abbrev);
|
||||||
|
if (abblen < 37) {
|
||||||
|
static char hex[41];
|
||||||
|
if (len < abblen && abblen <= len + 2)
|
||||||
|
sprintf(hex, "%s%.*s", abbrev, len+3-abblen, "..");
|
||||||
|
else
|
||||||
|
sprintf(hex, "%s...", abbrev);
|
||||||
|
return hex;
|
||||||
|
}
|
||||||
|
return sha1_to_hex(sha1);
|
||||||
|
}
|
||||||
|
|
||||||
static void diff_flush_raw(struct diff_filepair *p,
|
static void diff_flush_raw(struct diff_filepair *p,
|
||||||
int line_termination,
|
int line_termination,
|
||||||
int inter_name_termination,
|
int inter_name_termination,
|
||||||
int output_format)
|
struct diff_options *options)
|
||||||
{
|
{
|
||||||
int two_paths;
|
int two_paths;
|
||||||
char status[10];
|
char status[10];
|
||||||
|
int abbrev = options->abbrev;
|
||||||
const char *path_one, *path_two;
|
const char *path_one, *path_two;
|
||||||
|
int output_format = options->output_format;
|
||||||
|
|
||||||
path_one = p->one->path;
|
path_one = p->one->path;
|
||||||
path_two = p->two->path;
|
path_two = p->two->path;
|
||||||
@ -985,8 +1028,10 @@ static void diff_flush_raw(struct diff_filepair *p,
|
|||||||
}
|
}
|
||||||
if (output_format != DIFF_FORMAT_NAME_STATUS) {
|
if (output_format != DIFF_FORMAT_NAME_STATUS) {
|
||||||
printf(":%06o %06o %s ",
|
printf(":%06o %06o %s ",
|
||||||
p->one->mode, p->two->mode, sha1_to_hex(p->one->sha1));
|
p->one->mode, p->two->mode,
|
||||||
printf("%s ", sha1_to_hex(p->two->sha1));
|
diff_unique_abbrev(p->one->sha1, abbrev));
|
||||||
|
printf("%s ",
|
||||||
|
diff_unique_abbrev(p->two->sha1, abbrev));
|
||||||
}
|
}
|
||||||
printf("%s%c%s", status, inter_name_termination, path_one);
|
printf("%s%c%s", status, inter_name_termination, path_one);
|
||||||
if (two_paths)
|
if (two_paths)
|
||||||
@ -1194,7 +1239,7 @@ void diff_flush(struct diff_options *options)
|
|||||||
case DIFF_FORMAT_NAME_STATUS:
|
case DIFF_FORMAT_NAME_STATUS:
|
||||||
diff_flush_raw(p, line_termination,
|
diff_flush_raw(p, line_termination,
|
||||||
inter_name_termination,
|
inter_name_termination,
|
||||||
diff_output_format);
|
options);
|
||||||
break;
|
break;
|
||||||
case DIFF_FORMAT_NAME:
|
case DIFF_FORMAT_NAME:
|
||||||
diff_flush_name(p,
|
diff_flush_name(p,
|
||||||
|
9
diff.h
9
diff.h
@ -44,6 +44,7 @@ struct diff_options {
|
|||||||
int reverse_diff;
|
int reverse_diff;
|
||||||
int rename_limit;
|
int rename_limit;
|
||||||
int setup;
|
int setup;
|
||||||
|
int abbrev;
|
||||||
|
|
||||||
change_fn_t change;
|
change_fn_t change;
|
||||||
add_remove_fn_t add_remove;
|
add_remove_fn_t add_remove;
|
||||||
@ -87,6 +88,9 @@ extern int diff_setup_done(struct diff_options *);
|
|||||||
|
|
||||||
#define DIFF_PICKAXE_ALL 1
|
#define DIFF_PICKAXE_ALL 1
|
||||||
|
|
||||||
|
#define DIFF_DEFAULT_INDEX_ABBREV 7 /* hex digits */
|
||||||
|
#define DIFF_DEFAULT_ABBREV 7 /* hex digits */
|
||||||
|
|
||||||
extern void diffcore_std(struct diff_options *);
|
extern void diffcore_std(struct diff_options *);
|
||||||
|
|
||||||
extern void diffcore_std_no_resolve(struct diff_options *);
|
extern void diffcore_std_no_resolve(struct diff_options *);
|
||||||
@ -98,7 +102,8 @@ extern void diffcore_std_no_resolve(struct diff_options *);
|
|||||||
" -u synonym for -p.\n" \
|
" -u synonym for -p.\n" \
|
||||||
" --name-only show only names of changed files.\n" \
|
" --name-only show only names of changed files.\n" \
|
||||||
" --name-status show names and status of changed files.\n" \
|
" --name-status show names and status of changed files.\n" \
|
||||||
" --full-index show full object name on index ines.\n" \
|
" --full-index show full object name on index lines.\n" \
|
||||||
|
" --abbrev=<n> abbreviate object names in diff-tree header and diff-raw.\n" \
|
||||||
" -R swap input file pairs.\n" \
|
" -R swap input file pairs.\n" \
|
||||||
" -B detect complete rewrites.\n" \
|
" -B detect complete rewrites.\n" \
|
||||||
" -M detect renames.\n" \
|
" -M detect renames.\n" \
|
||||||
@ -137,4 +142,6 @@ extern void diff_flush(struct diff_options*);
|
|||||||
#define DIFF_STATUS_FILTER_AON '*'
|
#define DIFF_STATUS_FILTER_AON '*'
|
||||||
#define DIFF_STATUS_FILTER_BROKEN 'B'
|
#define DIFF_STATUS_FILTER_BROKEN 'B'
|
||||||
|
|
||||||
|
extern const char *diff_unique_abbrev(const unsigned char *, int);
|
||||||
|
|
||||||
#endif /* DIFF_H */
|
#endif /* DIFF_H */
|
||||||
|
@ -105,9 +105,13 @@ static int compare_pair_order(const void *a_, const void *b_)
|
|||||||
void diffcore_order(const char *orderfile)
|
void diffcore_order(const char *orderfile)
|
||||||
{
|
{
|
||||||
struct diff_queue_struct *q = &diff_queued_diff;
|
struct diff_queue_struct *q = &diff_queued_diff;
|
||||||
struct pair_order *o = xmalloc(sizeof(*o) * q->nr);
|
struct pair_order *o;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (!q->nr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
o = xmalloc(sizeof(*o) * q->nr);
|
||||||
prepare_order(orderfile);
|
prepare_order(orderfile);
|
||||||
for (i = 0; i < q->nr; i++) {
|
for (i = 0; i < q->nr; i++) {
|
||||||
o[i].pair = q->queue[i];
|
o[i].pair = q->queue[i];
|
||||||
|
@ -48,6 +48,9 @@ void diffcore_pathspec(const char **pathspec)
|
|||||||
for (i = 0; pathspec[i]; i++)
|
for (i = 0; pathspec[i]; i++)
|
||||||
;
|
;
|
||||||
speccnt = i;
|
speccnt = i;
|
||||||
|
if (!speccnt)
|
||||||
|
return;
|
||||||
|
|
||||||
spec = xmalloc(sizeof(*spec) * speccnt);
|
spec = xmalloc(sizeof(*spec) * speccnt);
|
||||||
for (i = 0; pathspec[i]; i++) {
|
for (i = 0; pathspec[i]; i++) {
|
||||||
spec[i].spec = pathspec[i];
|
spec[i].spec = pathspec[i];
|
||||||
|
@ -282,7 +282,7 @@ void diffcore_rename(struct diff_options *options)
|
|||||||
else if (detect_rename == DIFF_DETECT_COPY)
|
else if (detect_rename == DIFF_DETECT_COPY)
|
||||||
register_rename_src(p->one, 1);
|
register_rename_src(p->one, 1);
|
||||||
}
|
}
|
||||||
if (rename_dst_nr == 0 ||
|
if (rename_dst_nr == 0 || rename_src_nr == 0 ||
|
||||||
(0 < rename_limit && rename_limit < rename_dst_nr))
|
(0 < rename_limit && rename_limit < rename_dst_nr))
|
||||||
goto cleanup; /* nothing to do */
|
goto cleanup; /* nothing to do */
|
||||||
|
|
||||||
|
2
entry.c
2
entry.c
@ -60,7 +60,7 @@ static void remove_subtree(const char *path)
|
|||||||
static int create_file(const char *path, unsigned int mode)
|
static int create_file(const char *path, unsigned int mode)
|
||||||
{
|
{
|
||||||
mode = (mode & 0100) ? 0777 : 0666;
|
mode = (mode & 0100) ? 0777 : 0666;
|
||||||
return open(path, O_WRONLY | O_TRUNC | O_CREAT | O_EXCL, mode);
|
return open(path, O_WRONLY | O_CREAT | O_EXCL, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int write_entry(struct cache_entry *ce, const char *path, struct checkout *state)
|
static int write_entry(struct cache_entry *ce, const char *path, struct checkout *state)
|
||||||
|
2
epoch.c
2
epoch.c
@ -190,7 +190,7 @@ static void free_mass_counter(struct mass_counter *counter)
|
|||||||
* enqueued, enqueuing the commit in a list of pending commits, in latest
|
* enqueued, enqueuing the commit in a list of pending commits, in latest
|
||||||
* commit date first order.
|
* commit date first order.
|
||||||
*
|
*
|
||||||
* The algorithm then preceeds to visit each commit in the pending queue.
|
* The algorithm then proceeds to visit each commit in the pending queue.
|
||||||
* Upon each visit, the pending mass is added to the mass already seen for that
|
* Upon each visit, the pending mass is added to the mass already seen for that
|
||||||
* commit and then divided into N equal portions, where N is the number of
|
* commit and then divided into N equal portions, where N is the number of
|
||||||
* parents of the commit being visited. The divided portions are then injected
|
* parents of the commit being visited. The divided portions are then injected
|
||||||
|
172
fetch-clone.c
Normal file
172
fetch-clone.c
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
#include "cache.h"
|
||||||
|
#include <sys/wait.h>
|
||||||
|
|
||||||
|
static int finish_pack(const char *pack_tmp_name, const char *me)
|
||||||
|
{
|
||||||
|
int pipe_fd[2];
|
||||||
|
pid_t pid;
|
||||||
|
char idx[PATH_MAX];
|
||||||
|
char final[PATH_MAX];
|
||||||
|
char hash[41];
|
||||||
|
unsigned char sha1[20];
|
||||||
|
char *cp;
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
if (pipe(pipe_fd) < 0)
|
||||||
|
die("%s: unable to set up pipe", me);
|
||||||
|
|
||||||
|
strcpy(idx, pack_tmp_name); /* ".git/objects/pack-XXXXXX" */
|
||||||
|
cp = strrchr(idx, '/');
|
||||||
|
memcpy(cp, "/pidx", 5);
|
||||||
|
|
||||||
|
pid = fork();
|
||||||
|
if (pid < 0)
|
||||||
|
die("git-clone-pack: unable to fork off git-index-pack");
|
||||||
|
if (!pid) {
|
||||||
|
close(0);
|
||||||
|
dup2(pipe_fd[1], 1);
|
||||||
|
close(pipe_fd[0]);
|
||||||
|
close(pipe_fd[1]);
|
||||||
|
execlp("git-index-pack","git-index-pack",
|
||||||
|
"-o", idx, pack_tmp_name, NULL);
|
||||||
|
error("cannot exec git-index-pack <%s> <%s>",
|
||||||
|
idx, pack_tmp_name);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
close(pipe_fd[1]);
|
||||||
|
if (read(pipe_fd[0], hash, 40) != 40) {
|
||||||
|
error("%s: unable to read from git-index-pack", me);
|
||||||
|
err = 1;
|
||||||
|
}
|
||||||
|
close(pipe_fd[0]);
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
int status, code;
|
||||||
|
int retval = waitpid(pid, &status, 0);
|
||||||
|
|
||||||
|
if (retval < 0) {
|
||||||
|
if (errno == EINTR)
|
||||||
|
continue;
|
||||||
|
error("waitpid failed (%s)", strerror(errno));
|
||||||
|
goto error_die;
|
||||||
|
}
|
||||||
|
if (WIFSIGNALED(status)) {
|
||||||
|
int sig = WTERMSIG(status);
|
||||||
|
error("git-index-pack died of signal %d", sig);
|
||||||
|
goto error_die;
|
||||||
|
}
|
||||||
|
if (!WIFEXITED(status)) {
|
||||||
|
error("git-index-pack died of unnatural causes %d",
|
||||||
|
status);
|
||||||
|
goto error_die;
|
||||||
|
}
|
||||||
|
code = WEXITSTATUS(status);
|
||||||
|
if (code) {
|
||||||
|
error("git-index-pack died with error code %d", code);
|
||||||
|
goto error_die;
|
||||||
|
}
|
||||||
|
if (err)
|
||||||
|
goto error_die;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
hash[40] = 0;
|
||||||
|
if (get_sha1_hex(hash, sha1)) {
|
||||||
|
error("git-index-pack reported nonsense '%s'", hash);
|
||||||
|
goto error_die;
|
||||||
|
}
|
||||||
|
/* Now we have pack in pack_tmp_name[], and
|
||||||
|
* idx in idx[]; rename them to their final names.
|
||||||
|
*/
|
||||||
|
snprintf(final, sizeof(final),
|
||||||
|
"%s/pack/pack-%s.pack", get_object_directory(), hash);
|
||||||
|
move_temp_to_file(pack_tmp_name, final);
|
||||||
|
chmod(final, 0444);
|
||||||
|
snprintf(final, sizeof(final),
|
||||||
|
"%s/pack/pack-%s.idx", get_object_directory(), hash);
|
||||||
|
move_temp_to_file(idx, final);
|
||||||
|
chmod(final, 0444);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
error_die:
|
||||||
|
unlink(idx);
|
||||||
|
unlink(pack_tmp_name);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int receive_unpack_pack(int fd[2], const char *me, int quiet)
|
||||||
|
{
|
||||||
|
int status;
|
||||||
|
pid_t pid;
|
||||||
|
|
||||||
|
pid = fork();
|
||||||
|
if (pid < 0)
|
||||||
|
die("%s: unable to fork off git-unpack-objects", me);
|
||||||
|
if (!pid) {
|
||||||
|
dup2(fd[0], 0);
|
||||||
|
close(fd[0]);
|
||||||
|
close(fd[1]);
|
||||||
|
execlp("git-unpack-objects", "git-unpack-objects",
|
||||||
|
quiet ? "-q" : NULL, NULL);
|
||||||
|
die("git-unpack-objects exec failed");
|
||||||
|
}
|
||||||
|
close(fd[0]);
|
||||||
|
close(fd[1]);
|
||||||
|
while (waitpid(pid, &status, 0) < 0) {
|
||||||
|
if (errno != EINTR)
|
||||||
|
die("waiting for git-unpack-objects: %s",
|
||||||
|
strerror(errno));
|
||||||
|
}
|
||||||
|
if (WIFEXITED(status)) {
|
||||||
|
int code = WEXITSTATUS(status);
|
||||||
|
if (code)
|
||||||
|
die("git-unpack-objects died with error code %d",
|
||||||
|
code);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (WIFSIGNALED(status)) {
|
||||||
|
int sig = WTERMSIG(status);
|
||||||
|
die("git-unpack-objects died of signal %d", sig);
|
||||||
|
}
|
||||||
|
die("git-unpack-objects died of unnatural causes %d", status);
|
||||||
|
}
|
||||||
|
|
||||||
|
int receive_keep_pack(int fd[2], const char *me)
|
||||||
|
{
|
||||||
|
char tmpfile[PATH_MAX];
|
||||||
|
int ofd, ifd;
|
||||||
|
|
||||||
|
ifd = fd[0];
|
||||||
|
snprintf(tmpfile, sizeof(tmpfile),
|
||||||
|
"%s/pack/tmp-XXXXXX", get_object_directory());
|
||||||
|
ofd = mkstemp(tmpfile);
|
||||||
|
if (ofd < 0)
|
||||||
|
return error("unable to create temporary file %s", tmpfile);
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
char buf[8192];
|
||||||
|
ssize_t sz, wsz, pos;
|
||||||
|
sz = read(ifd, buf, sizeof(buf));
|
||||||
|
if (sz == 0)
|
||||||
|
break;
|
||||||
|
if (sz < 0) {
|
||||||
|
error("error reading pack (%s)", strerror(errno));
|
||||||
|
close(ofd);
|
||||||
|
unlink(tmpfile);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
pos = 0;
|
||||||
|
while (pos < sz) {
|
||||||
|
wsz = write(ofd, buf + pos, sz - pos);
|
||||||
|
if (wsz < 0) {
|
||||||
|
error("error writing pack (%s)",
|
||||||
|
strerror(errno));
|
||||||
|
close(ofd);
|
||||||
|
unlink(tmpfile);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
pos += wsz;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(ofd);
|
||||||
|
return finish_pack(tmpfile, me);
|
||||||
|
}
|
60
fetch-pack.c
60
fetch-pack.c
@ -3,13 +3,12 @@
|
|||||||
#include "pkt-line.h"
|
#include "pkt-line.h"
|
||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include <time.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
|
|
||||||
|
static int keep_pack;
|
||||||
static int quiet;
|
static int quiet;
|
||||||
static int verbose;
|
static int verbose;
|
||||||
static const char fetch_pack_usage[] =
|
static const char fetch_pack_usage[] =
|
||||||
"git-fetch-pack [-q] [-v] [--exec=upload-pack] [host:]directory <refs>...";
|
"git-fetch-pack [-q] [-v] [-k] [--exec=upload-pack] [host:]directory <refs>...";
|
||||||
static const char *exec = "git-upload-pack";
|
static const char *exec = "git-upload-pack";
|
||||||
|
|
||||||
#define COMPLETE (1U << 0)
|
#define COMPLETE (1U << 0)
|
||||||
@ -363,7 +362,6 @@ static int fetch_pack(int fd[2], int nr_match, char **match)
|
|||||||
struct ref *ref;
|
struct ref *ref;
|
||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
int status;
|
int status;
|
||||||
pid_t pid;
|
|
||||||
|
|
||||||
get_remote_heads(fd[0], &ref, 0, NULL, 0);
|
get_remote_heads(fd[0], &ref, 0, NULL, 0);
|
||||||
if (server_supports("multi_ack")) {
|
if (server_supports("multi_ack")) {
|
||||||
@ -381,40 +379,22 @@ static int fetch_pack(int fd[2], int nr_match, char **match)
|
|||||||
}
|
}
|
||||||
if (find_common(fd, sha1, ref) < 0)
|
if (find_common(fd, sha1, ref) < 0)
|
||||||
fprintf(stderr, "warning: no common commits\n");
|
fprintf(stderr, "warning: no common commits\n");
|
||||||
pid = fork();
|
|
||||||
if (pid < 0)
|
if (keep_pack)
|
||||||
die("git-fetch-pack: unable to fork off git-unpack-objects");
|
status = receive_keep_pack(fd, "git-fetch-pack");
|
||||||
if (!pid) {
|
else
|
||||||
dup2(fd[0], 0);
|
status = receive_unpack_pack(fd, "git-fetch-pack", quiet);
|
||||||
close(fd[0]);
|
|
||||||
close(fd[1]);
|
if (status)
|
||||||
execlp("git-unpack-objects", "git-unpack-objects",
|
die("git-fetch-pack: fetch failed.");
|
||||||
quiet ? "-q" : NULL, NULL);
|
|
||||||
die("git-unpack-objects exec failed");
|
all_done:
|
||||||
|
while (ref) {
|
||||||
|
printf("%s %s\n",
|
||||||
|
sha1_to_hex(ref->old_sha1), ref->name);
|
||||||
|
ref = ref->next;
|
||||||
}
|
}
|
||||||
close(fd[0]);
|
return 0;
|
||||||
close(fd[1]);
|
|
||||||
while (waitpid(pid, &status, 0) < 0) {
|
|
||||||
if (errno != EINTR)
|
|
||||||
die("waiting for git-unpack-objects: %s", strerror(errno));
|
|
||||||
}
|
|
||||||
if (WIFEXITED(status)) {
|
|
||||||
int code = WEXITSTATUS(status);
|
|
||||||
if (code)
|
|
||||||
die("git-unpack-objects died with error code %d", code);
|
|
||||||
all_done:
|
|
||||||
while (ref) {
|
|
||||||
printf("%s %s\n",
|
|
||||||
sha1_to_hex(ref->old_sha1), ref->name);
|
|
||||||
ref = ref->next;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (WIFSIGNALED(status)) {
|
|
||||||
int sig = WTERMSIG(status);
|
|
||||||
die("git-unpack-objects died of signal %d", sig);
|
|
||||||
}
|
|
||||||
die("Sherlock Holmes! git-unpack-objects died of unnatural causes %d!", status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
@ -436,10 +416,14 @@ int main(int argc, char **argv)
|
|||||||
exec = arg + 7;
|
exec = arg + 7;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!strcmp("-q", arg)) {
|
if (!strcmp("--quiet", arg) || !strcmp("-q", arg)) {
|
||||||
quiet = 1;
|
quiet = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!strcmp("--keep", arg) || !strcmp("-k", arg)) {
|
||||||
|
keep_pack = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!strcmp("-v", arg)) {
|
if (!strcmp("-v", arg)) {
|
||||||
verbose = 1;
|
verbose = 1;
|
||||||
continue;
|
continue;
|
||||||
|
@ -211,6 +211,7 @@ this=`cat "$dotest/next"`
|
|||||||
if test "$skip" = t
|
if test "$skip" = t
|
||||||
then
|
then
|
||||||
this=`expr "$this" + 1`
|
this=`expr "$this" + 1`
|
||||||
|
resume=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$this" -gt "$last"
|
if test "$this" -gt "$last"
|
||||||
@ -225,6 +226,7 @@ do
|
|||||||
msgnum=`printf "%0${prec}d" $this`
|
msgnum=`printf "%0${prec}d" $this`
|
||||||
next=`expr "$this" + 1`
|
next=`expr "$this" + 1`
|
||||||
test -f "$dotest/$msgnum" || {
|
test -f "$dotest/$msgnum" || {
|
||||||
|
resume=
|
||||||
go_next
|
go_next
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
USAGE='<msg> <patch> <info> [<signoff>]'
|
USAGE='<msg> <patch> <info> [<signoff>]'
|
||||||
. git-sh-setup
|
. git-sh-setup
|
||||||
|
|
||||||
case "$#" in 3|4) usage ;; esac
|
case "$#" in 3|4) ;; *) usage ;; esac
|
||||||
|
|
||||||
final=.dotest/final-commit
|
final=.dotest/final-commit
|
||||||
##
|
##
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
|
|
||||||
=head1 Invocation
|
=head1 Invocation
|
||||||
|
|
||||||
git-archimport [ -h ] [ -v ] [ -T ] [ -t tempdir ] <archive>/<branch> [ <archive>/<branch> ]
|
git-archimport [ -h ] [ -v ] [ -o ] [ -a ] [ -f ] [ -T ]
|
||||||
|
[ -D depth] [ -t tempdir ] <archive>/<branch> [ <archive>/<branch> ]
|
||||||
|
|
||||||
Imports a project from one or more Arch repositories. It will follow branches
|
Imports a project from one or more Arch repositories. It will follow branches
|
||||||
and repositories within the namespaces defined by the <archive/branch>
|
and repositories within the namespaces defined by the <archive/branch>
|
||||||
@ -74,7 +75,7 @@ our($opt_h,$opt_f,$opt_v,$opt_T,$opt_t,$opt_D,$opt_a,$opt_o);
|
|||||||
sub usage() {
|
sub usage() {
|
||||||
print STDERR <<END;
|
print STDERR <<END;
|
||||||
Usage: ${\basename $0} # fetch/update GIT from Arch
|
Usage: ${\basename $0} # fetch/update GIT from Arch
|
||||||
[ -f ] [ -o ] [ -h ] [ -v ] [ -T ] [ -a ] [ -D depth ] [ -t tempdir ]
|
[ -h ] [ -v ] [ -o ] [ -a ] [ -f ] [ -T ] [ -D depth ] [ -t tempdir ]
|
||||||
repository/arch-branch [ repository/arch-branch] ...
|
repository/arch-branch [ repository/arch-branch] ...
|
||||||
END
|
END
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -32,11 +32,11 @@ delete_branch () {
|
|||||||
case " $mbs " in
|
case " $mbs " in
|
||||||
*' '$branch' '*)
|
*' '$branch' '*)
|
||||||
# the merge base of branch and HEAD contains branch --
|
# the merge base of branch and HEAD contains branch --
|
||||||
# which means that the HEAD contains everything in the HEAD.
|
# which means that the HEAD contains everything in both.
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo >&2 "The branch '$branch_name' is not a strict subset of your current HEAD.
|
echo >&2 "The branch '$branch_name' is not a strict subset of your current HEAD.
|
||||||
If you are sure you want to delete it, run 'git branch -D $branch_name'."
|
If you are sure you want to delete it, run 'git branch -D $branch_name'."
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -116,7 +116,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Switch the HEAD pointer to the new branch if it we
|
# Switch the HEAD pointer to the new branch if we
|
||||||
# checked out a branch head, and remove any potential
|
# checked out a branch head, and remove any potential
|
||||||
# old MERGE_HEAD's (subsequent commits will clearly not
|
# old MERGE_HEAD's (subsequent commits will clearly not
|
||||||
# be based on them, since we re-set the index)
|
# be based on them, since we re-set the index)
|
||||||
|
@ -148,7 +148,7 @@ esac
|
|||||||
|
|
||||||
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
|
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
|
||||||
echo "#"
|
echo "#"
|
||||||
echo "# It looks like your may be committing a MERGE."
|
echo "# It looks like you may be committing a MERGE."
|
||||||
echo "# If this is not correct, please remove the file"
|
echo "# If this is not correct, please remove the file"
|
||||||
echo "# $GIT_DIR/MERGE_HEAD"
|
echo "# $GIT_DIR/MERGE_HEAD"
|
||||||
echo "# and try again"
|
echo "# and try again"
|
||||||
@ -165,6 +165,7 @@ then
|
|||||||
then
|
then
|
||||||
pick_author_script='
|
pick_author_script='
|
||||||
/^author /{
|
/^author /{
|
||||||
|
s/'\''/'\''\\'\'\''/g
|
||||||
h
|
h
|
||||||
s/^author \([^<]*\) <[^>]*> .*$/\1/
|
s/^author \([^<]*\) <[^>]*> .*$/\1/
|
||||||
s/'\''/'\''\'\'\''/g
|
s/'\''/'\''\'\'\''/g
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
#ifndef GIT_COMPAT_UTIL_H
|
#ifndef GIT_COMPAT_UTIL_H
|
||||||
#define GIT_COMPAT_UTIL_H
|
#define GIT_COMPAT_UTIL_H
|
||||||
|
|
||||||
|
#ifndef FLEX_ARRAY
|
||||||
|
#if defined(__GNUC__) && (__GNUC__ < 3)
|
||||||
|
#define FLEX_ARRAY 0
|
||||||
|
#else
|
||||||
|
#define FLEX_ARRAY /* empty */
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -63,6 +71,8 @@ extern char *gitstrcasestr(const char *haystack, const char *needle);
|
|||||||
static inline void *xmalloc(size_t size)
|
static inline void *xmalloc(size_t size)
|
||||||
{
|
{
|
||||||
void *ret = malloc(size);
|
void *ret = malloc(size);
|
||||||
|
if (!ret && !size)
|
||||||
|
ret = malloc(1);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
die("Out of memory, malloc failed");
|
die("Out of memory, malloc failed");
|
||||||
return ret;
|
return ret;
|
||||||
@ -71,6 +81,8 @@ static inline void *xmalloc(size_t size)
|
|||||||
static inline void *xrealloc(void *ptr, size_t size)
|
static inline void *xrealloc(void *ptr, size_t size)
|
||||||
{
|
{
|
||||||
void *ret = realloc(ptr, size);
|
void *ret = realloc(ptr, size);
|
||||||
|
if (!ret && !size)
|
||||||
|
ret = realloc(ptr, 1);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
die("Out of memory, realloc failed");
|
die("Out of memory, realloc failed");
|
||||||
return ret;
|
return ret;
|
||||||
@ -79,11 +91,35 @@ static inline void *xrealloc(void *ptr, size_t size)
|
|||||||
static inline void *xcalloc(size_t nmemb, size_t size)
|
static inline void *xcalloc(size_t nmemb, size_t size)
|
||||||
{
|
{
|
||||||
void *ret = calloc(nmemb, size);
|
void *ret = calloc(nmemb, size);
|
||||||
|
if (!ret && (!nmemb || !size))
|
||||||
|
ret = calloc(1, 1);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
die("Out of memory, calloc failed");
|
die("Out of memory, calloc failed");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline ssize_t xread(int fd, void *buf, size_t len)
|
||||||
|
{
|
||||||
|
ssize_t nr;
|
||||||
|
while (1) {
|
||||||
|
nr = read(fd, buf, len);
|
||||||
|
if ((nr < 0) && (errno == EAGAIN || errno == EINTR))
|
||||||
|
continue;
|
||||||
|
return nr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline ssize_t xwrite(int fd, const void *buf, size_t len)
|
||||||
|
{
|
||||||
|
ssize_t nr;
|
||||||
|
while (1) {
|
||||||
|
nr = write(fd, buf, len);
|
||||||
|
if ((nr < 0) && (errno == EAGAIN || errno == EINTR))
|
||||||
|
continue;
|
||||||
|
return nr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Sane ctype - no locale, and works with signed chars */
|
/* Sane ctype - no locale, and works with signed chars */
|
||||||
#undef isspace
|
#undef isspace
|
||||||
#undef isdigit
|
#undef isdigit
|
||||||
|
@ -103,8 +103,16 @@ undef @files; # don't need it anymore
|
|||||||
|
|
||||||
# check that the files are clean and up to date according to cvs
|
# check that the files are clean and up to date according to cvs
|
||||||
my $dirty;
|
my $dirty;
|
||||||
foreach my $f (@afiles, @mfiles, @dfiles) {
|
foreach my $f (@afiles) {
|
||||||
# TODO:we need to handle removed in cvs and/or new (from git)
|
my $status = `cvs -q status "$f" | grep '^File: '`;
|
||||||
|
|
||||||
|
unless ($status =~ m/Status: Unknown$/) {
|
||||||
|
$dirty = 1;
|
||||||
|
warn "File $f is already known in your CVS checkout!\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach my $f (@mfiles, @dfiles) {
|
||||||
|
# TODO:we need to handle removed in cvs
|
||||||
my $status = `cvs -q status "$f" | grep '^File: '`;
|
my $status = `cvs -q status "$f" | grep '^File: '`;
|
||||||
|
|
||||||
unless ($status =~ m/Status: Up-to-date$/) {
|
unless ($status =~ m/Status: Up-to-date$/) {
|
||||||
|
@ -649,6 +649,7 @@ my $commit = sub {
|
|||||||
my($xtag) = $tag;
|
my($xtag) = $tag;
|
||||||
$xtag =~ s/\s+\*\*.*$//; # Remove stuff like ** INVALID ** and ** FUNKY **
|
$xtag =~ s/\s+\*\*.*$//; # Remove stuff like ** INVALID ** and ** FUNKY **
|
||||||
$xtag =~ tr/_/\./ if ( $opt_u );
|
$xtag =~ tr/_/\./ if ( $opt_u );
|
||||||
|
$xtag =~ s/[\/]/$opt_s/g;
|
||||||
|
|
||||||
my $pid = open2($in, $out, 'git-mktag');
|
my $pid = open2($in, $out, 'git-mktag');
|
||||||
print $out "object $cid\n".
|
print $out "object $cid\n".
|
||||||
|
14
git-diff.sh
14
git-diff.sh
@ -3,15 +3,14 @@
|
|||||||
# Copyright (c) 2005 Linus Torvalds
|
# Copyright (c) 2005 Linus Torvalds
|
||||||
# Copyright (c) 2005 Junio C Hamano
|
# Copyright (c) 2005 Junio C Hamano
|
||||||
|
|
||||||
|
USAGE='[ --diff-options ] <ent>{0,2} [<path>...]'
|
||||||
|
SUBDIRECTORY_OK='Yes'
|
||||||
|
. git-sh-setup
|
||||||
|
|
||||||
rev=$(git-rev-parse --revs-only --no-flags --sq "$@") || exit
|
rev=$(git-rev-parse --revs-only --no-flags --sq "$@") || exit
|
||||||
flags=$(git-rev-parse --no-revs --flags --sq "$@")
|
flags=$(git-rev-parse --no-revs --flags --sq "$@")
|
||||||
files=$(git-rev-parse --no-revs --no-flags --sq "$@")
|
files=$(git-rev-parse --no-revs --no-flags --sq "$@")
|
||||||
|
|
||||||
die () {
|
|
||||||
echo >&2 "$*"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# I often say 'git diff --cached -p' and get scolded by git-diff-files, but
|
# I often say 'git diff --cached -p' and get scolded by git-diff-files, but
|
||||||
# obviously I mean 'git diff --cached -p HEAD' in that case.
|
# obviously I mean 'git diff --cached -p HEAD' in that case.
|
||||||
case "$rev" in
|
case "$rev" in
|
||||||
@ -40,8 +39,7 @@ esac
|
|||||||
|
|
||||||
case "$rev" in
|
case "$rev" in
|
||||||
?*' '?*' '?*)
|
?*' '?*' '?*)
|
||||||
echo >&2 "I don't understand"
|
usage
|
||||||
exit 1
|
|
||||||
;;
|
;;
|
||||||
?*' '^?*)
|
?*' '^?*)
|
||||||
begin=$(expr "$rev" : '.*^.\([0-9a-f]*\).*') &&
|
begin=$(expr "$rev" : '.*^.\([0-9a-f]*\).*') &&
|
||||||
@ -58,7 +56,7 @@ case "$rev" in
|
|||||||
cmd="git-diff-files $flags -- $files"
|
cmd="git-diff-files $flags -- $files"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "I don't understand $*"
|
usage
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
19
git-fetch.sh
19
git-fetch.sh
@ -188,11 +188,20 @@ esac
|
|||||||
reflist=$(get_remote_refs_for_fetch "$@")
|
reflist=$(get_remote_refs_for_fetch "$@")
|
||||||
if test "$tags"
|
if test "$tags"
|
||||||
then
|
then
|
||||||
taglist=$(git-ls-remote --tags "$remote" |
|
taglist=$(IFS=" " &&
|
||||||
sed -e '
|
git-ls-remote --tags "$remote" |
|
||||||
/\^/d
|
while read sha1 name
|
||||||
s/^[^ ]* //
|
do
|
||||||
s/.*/&:&/')
|
case "$name" in
|
||||||
|
(*^*) continue ;;
|
||||||
|
esac
|
||||||
|
if git-check-ref-format "$name"
|
||||||
|
then
|
||||||
|
echo ".${name}:${name}"
|
||||||
|
else
|
||||||
|
echo >&2 "warning: tag ${name} ignored"
|
||||||
|
fi
|
||||||
|
done)
|
||||||
if test "$#" -gt 1
|
if test "$#" -gt 1
|
||||||
then
|
then
|
||||||
# remote URL plus explicit refspecs; we need to merge them.
|
# remote URL plus explicit refspecs; we need to merge them.
|
||||||
|
@ -9,8 +9,10 @@ one file per patch, for e-mail submission. Each output file is
|
|||||||
numbered sequentially from 1, and uses the first line of the commit
|
numbered sequentially from 1, and uses the first line of the commit
|
||||||
message (massaged for pathname safety) as the filename.
|
message (massaged for pathname safety) as the filename.
|
||||||
|
|
||||||
When -o is specified, output files are created in that directory; otherwise in
|
There are three output modes. By default, output files are created in
|
||||||
the current working directory.
|
the current working directory; when -o is specified, they are created
|
||||||
|
in that directory instead; when --stdout is specified, they are spit
|
||||||
|
on standard output, and can be piped to git-am.
|
||||||
|
|
||||||
When -n is specified, instead of "[PATCH] Subject", the first line is formatted
|
When -n is specified, instead of "[PATCH] Subject", the first line is formatted
|
||||||
as "[PATCH N/M] Subject", unless you have only one patch.
|
as "[PATCH N/M] Subject", unless you have only one patch.
|
||||||
@ -173,6 +175,7 @@ titleScript='
|
|||||||
|
|
||||||
whosepatchScript='
|
whosepatchScript='
|
||||||
/^author /{
|
/^author /{
|
||||||
|
s/'\''/'\''\\'\'\''/g
|
||||||
s/author \(.*>\) \(.*\)$/au='\''\1'\'' ad='\''\2'\''/p
|
s/author \(.*>\) \(.*\)$/au='\''\1'\'' ad='\''\2'\''/p
|
||||||
q
|
q
|
||||||
}'
|
}'
|
||||||
@ -210,6 +213,8 @@ Date: '"$ad"
|
|||||||
}
|
}
|
||||||
|
|
||||||
mailScript="$mailScript"'
|
mailScript="$mailScript"'
|
||||||
|
a\
|
||||||
|
|
||||||
: body
|
: body
|
||||||
p
|
p
|
||||||
n
|
n
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
# Copyright (c) 2005 Linus Torvalds
|
# Copyright (c) 2005 Linus Torvalds
|
||||||
#
|
#
|
||||||
|
|
||||||
# This one uses only subdirectory-aware commands, so no need to
|
USAGE='[--max-count=<n>] [<since>..<limit>] [--pretty=<format>] [git-rev-list options]'
|
||||||
# include sh-setup-script.
|
SUBDIRECTORY_OK='Yes'
|
||||||
|
. git-sh-setup
|
||||||
|
|
||||||
revs=$(git-rev-parse --revs-only --no-flags --default HEAD "$@") || exit
|
revs=$(git-rev-parse --revs-only --no-flags --default HEAD "$@") || exit
|
||||||
[ "$revs" ] || {
|
[ "$revs" ] || {
|
||||||
echo >&2 "No HEAD ref"
|
die "No HEAD ref"
|
||||||
exit 1
|
|
||||||
}
|
}
|
||||||
git-rev-list --pretty $(git-rev-parse --default HEAD "$@") |
|
git-rev-list --pretty $(git-rev-parse --default HEAD "$@") |
|
||||||
LESS=-S ${PAGER:-less}
|
LESS=-S ${PAGER:-less}
|
||||||
|
@ -82,7 +82,7 @@ case "${1:-.}${2:-.}${3:-.}" in
|
|||||||
expr "$sz0" \< "$sz1" \* 2 >/dev/null || : >$orig
|
expr "$sz0" \< "$sz1" \* 2 >/dev/null || : >$orig
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Auto-merging $4."
|
echo "Auto-merging $4"
|
||||||
orig=`git-unpack-file $1`
|
orig=`git-unpack-file $1`
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -107,7 +107,7 @@ case "${1:-.}${2:-.}${3:-.}" in
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $ret -ne 0 ]; then
|
if [ $ret -ne 0 ]; then
|
||||||
echo "ERROR: Merge conflict in $4."
|
echo "ERROR: Merge conflict in $4"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
exec git-update-index -- "$4"
|
exec git-update-index -- "$4"
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user