Compare commits
145 Commits
Author | SHA1 | Date | |
---|---|---|---|
9529a2524a | |||
d0e50cb4cb | |||
75c962c99a | |||
d3e41ebff4 | |||
fd2a75972e | |||
cd67c8e0bc | |||
4ae89b7625 | |||
346d5e1835 | |||
290b1467a3 | |||
f9308a182e | |||
979ea5856c | |||
a947ab79d4 | |||
81b6c950de | |||
cbd919221f | |||
f562e6f316 | |||
06e7ea3787 | |||
21f13ee203 | |||
0a3985dcfb | |||
6bf035f278 | |||
2be08a84ba | |||
3d4e1932f2 | |||
9debca9aac | |||
41f5d73391 | |||
ad0f8c9ea7 | |||
65d61e5f51 | |||
f022f85f6d | |||
115f0fe499 | |||
3ed02de2f4 | |||
756d846fea | |||
bb616ddd15 | |||
56a7fde16e | |||
c7bafad10d | |||
fc095242b1 | |||
be242d576c | |||
60fa08ed61 | |||
3844814755 | |||
96a5702409 | |||
8bb2b516d5 | |||
8ce9d83b78 | |||
1dc71a9155 | |||
ed4eb0d8f3 | |||
fabbd8f6ca | |||
923642fe1b | |||
c816eb1784 | |||
c4431d380c | |||
443b92b6e5 | |||
ef203f0856 | |||
58db64f73c | |||
eec102524f | |||
0b5ea163d2 | |||
c93d88a574 | |||
b8105375ab | |||
043d76050d | |||
c2d4eb7e04 | |||
56333bac66 | |||
2f6dc35d2a | |||
734c91f9e2 | |||
7193db3685 | |||
2aa54fa872 | |||
ef561ac738 | |||
365aa19919 | |||
3512193034 | |||
1c95c565c2 | |||
1c73bb0ef7 | |||
0bc25a7842 | |||
7943b3a94f | |||
fd547a972a | |||
2832114532 | |||
41b200179d | |||
ee96d11beb | |||
78cb59c8e5 | |||
7d79c860a6 | |||
64edf4b2eb | |||
81035bba0a | |||
b8ac23bcf8 | |||
eecc8367f4 | |||
0df56eabf2 | |||
3e4e8c03ca | |||
5ef1f8d488 | |||
d53ebb429a | |||
2ba91e9698 | |||
c3e8a0a4dd | |||
a1367d1219 | |||
db554bf0a7 | |||
4fa96e1557 | |||
14b4f2dbd1 | |||
a94f457e89 | |||
2c46759db7 | |||
cf70c16fc0 | |||
163d7b9b85 | |||
a91d49cd36 | |||
ae64860622 | |||
79c96c5733 | |||
0a43acbe85 | |||
aa27e46111 | |||
7ee70a7119 | |||
63e50d492c | |||
ee24ee55c2 | |||
34fc5cefa7 | |||
51bd9d7b8c | |||
fd234dfdb7 | |||
9b28a8b9c2 | |||
0d9b9ab128 | |||
4e5104c1fc | |||
c5ddca1fff | |||
4fc970c438 | |||
0b1f647557 | |||
17cd29b25c | |||
308efc10d8 | |||
d2dc6222d4 | |||
ffa84ffb77 | |||
1289172749 | |||
ab242f809a | |||
cef19c7af5 | |||
92446aba47 | |||
5089277718 | |||
b1440cc806 | |||
c06d2daa12 | |||
bdd69c2f64 | |||
8ab40a2005 | |||
75b62b489a | |||
755b99d815 | |||
4917d2a66e | |||
e4a15f40bc | |||
5bac4a6719 | |||
c750da256a | |||
981193786f | |||
7391b2e999 | |||
c0f7a6c33d | |||
019f42a4ff | |||
871f4c97ad | |||
ee40599330 | |||
3efb1f343a | |||
e326bce65c | |||
bc6b4f52fc | |||
f496454e0f | |||
372ef954a1 | |||
b90d479255 | |||
101e3ae7a6 | |||
26370f73c0 | |||
ed3adde081 | |||
5ac58f5ba1 | |||
cdf6e08880 | |||
54acdd95b8 | |||
8134722306 |
@ -16,8 +16,9 @@ ARTICLES += repository-layout
|
||||
ARTICLES += hooks
|
||||
ARTICLES += everyday
|
||||
ARTICLES += git-tools
|
||||
ARTICLES += glossary
|
||||
# with their own formatting rules.
|
||||
SP_ARTICLES = glossary howto/revert-branch-rebase user-manual
|
||||
SP_ARTICLES = howto/revert-branch-rebase user-manual
|
||||
|
||||
DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
|
||||
|
||||
@ -37,6 +38,7 @@ INSTALL?=install
|
||||
DOC_REF = origin/man
|
||||
|
||||
-include ../config.mak.autogen
|
||||
-include ../config.mak
|
||||
|
||||
#
|
||||
# Please note that there is a minor bug in asciidoc.
|
||||
@ -104,13 +106,11 @@ clean:
|
||||
user-manual.xml: user-manual.txt user-manual.conf
|
||||
$(ASCIIDOC) -b docbook -d book $<
|
||||
|
||||
user-manual.html: user-manual.xml
|
||||
xmlto html-nochunks $<
|
||||
XSLT = http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
|
||||
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
|
||||
|
||||
glossary.html : glossary.txt sort_glossary.pl
|
||||
cat $< | \
|
||||
perl sort_glossary.pl | \
|
||||
$(ASCIIDOC) -b xhtml11 - > glossary.html
|
||||
user-manual.html: user-manual.xml
|
||||
xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
|
||||
|
||||
howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
|
||||
rm -f $@+ $@
|
||||
|
65
Documentation/RelNotes-1.5.0.2.txt
Normal file
65
Documentation/RelNotes-1.5.0.2.txt
Normal file
@ -0,0 +1,65 @@
|
||||
GIT v1.5.0.2 Release Notes
|
||||
==========================
|
||||
|
||||
Fixes since v1.5.0.1
|
||||
--------------------
|
||||
|
||||
* Bugfixes
|
||||
|
||||
- Automated merge conflict handling when changes to symbolic
|
||||
links conflicted were completely broken. The merge-resolve
|
||||
strategy created a regular file with conflict markers in it
|
||||
in place of the symbolic link. The default strategy,
|
||||
merge-recursive was even more broken. It removed the path
|
||||
that was pointed at by the symbolic link. Both of these
|
||||
problems have been fixed.
|
||||
|
||||
- 'git diff maint master next' did not correctly give combined
|
||||
diff across three trees.
|
||||
|
||||
- 'git fast-import' portability fix for Solaris.
|
||||
|
||||
- 'git show-ref --verify' without arguments did not error out
|
||||
but segfaulted.
|
||||
|
||||
- 'git diff :tracked-file `pwd`/an-untracked-file' gave an extra
|
||||
slashes after a/ and b/.
|
||||
|
||||
- 'git format-patch' produced too long filenames if the commit
|
||||
message had too long line at the beginning.
|
||||
|
||||
- Running 'make all' and then without changing anything
|
||||
running 'make install' still rebuilt some files. This
|
||||
was inconvenient when building as yourself and then
|
||||
installing as root (especially problematic when the source
|
||||
directory is on NFS and root is mapped to nobody).
|
||||
|
||||
- 'git-rerere' failed to deal with two unconflicted paths that
|
||||
sorted next to each other.
|
||||
|
||||
- 'git-rerere' attempted to open(2) a symlink and failed if
|
||||
there was a conflict. Since a conflicting change to a
|
||||
symlink would not benefit from rerere anyway, the command
|
||||
now ignores conflicting changes to symlinks.
|
||||
|
||||
- 'git-repack' did not like to pass more than 64 arguments
|
||||
internally to underlying 'rev-list' logic, which made it
|
||||
impossible to repack after accumulating many (small) packs
|
||||
in the repository.
|
||||
|
||||
- 'git-diff' to review the combined diff during a conflicted
|
||||
merge were not reading the working tree version correctly
|
||||
when changes to a symbolic link conflicted. It should have
|
||||
read the data using readlink(2) but read from the regular
|
||||
file the symbolic link pointed at.
|
||||
|
||||
- 'git-remote' did not like period in a remote's name.
|
||||
|
||||
* Documentation updates
|
||||
|
||||
- added and clarified core.bare, core.legacyheaders configurations.
|
||||
|
||||
- updated "git-clone --depth" documentation.
|
||||
|
||||
|
||||
* Assorted git-gui fixes.
|
58
Documentation/RelNotes-1.5.0.3.txt
Normal file
58
Documentation/RelNotes-1.5.0.3.txt
Normal file
@ -0,0 +1,58 @@
|
||||
GIT v1.5.0.3 Release Notes
|
||||
==========================
|
||||
|
||||
Fixes since v1.5.0.2
|
||||
--------------------
|
||||
|
||||
* Bugfixes
|
||||
|
||||
- 'git.el' honors the commit coding system from the configuration.
|
||||
|
||||
- 'blameview' in contrib/ correctly digs deeper when a line is
|
||||
clicked.
|
||||
|
||||
- 'http-push' correctly makes sure the remote side has leading
|
||||
path. Earlier it started in the middle of the path, and
|
||||
incorrectly.
|
||||
|
||||
- 'git-merge' did not exit with non-zero status when the
|
||||
working tree was dirty and cannot fast forward. It does
|
||||
now.
|
||||
|
||||
- 'cvsexportcommit' does not lose yet-to-be-used message file.
|
||||
|
||||
- int-vs-size_t typefix when running combined diff on files
|
||||
over 2GB long.
|
||||
|
||||
- 'git apply --whitespace=strip' should not touch unmodified
|
||||
lines.
|
||||
|
||||
- 'git-mailinfo' choke when a logical header line was too long.
|
||||
|
||||
- 'git show A..B' did not error out. Negative ref ("not A" in
|
||||
this example) does not make sense for the purpose of the
|
||||
command, so now it errors out.
|
||||
|
||||
- 'git fmt-merge-msg --file' without file parameter did not
|
||||
correctly error out.
|
||||
|
||||
- 'git archimport' barfed upon encountering a commit without
|
||||
summary.
|
||||
|
||||
- 'git index-pack' did not protect itself from getting a short
|
||||
read out of pread(2).
|
||||
|
||||
- 'git http-push' had a few buffer overruns.
|
||||
|
||||
- Build dependency fixes to rebuild fetch.o when other headers
|
||||
change.
|
||||
|
||||
* Documentation updates
|
||||
|
||||
- user-manual updates.
|
||||
|
||||
- Options to 'git remote add' were described insufficiently.
|
||||
|
||||
- Configuration format.suffix was not documented.
|
||||
|
||||
- Other formatting and spelling fixes.
|
24
Documentation/RelNotes-1.5.0.4.txt
Normal file
24
Documentation/RelNotes-1.5.0.4.txt
Normal file
@ -0,0 +1,24 @@
|
||||
GIT v1.5.0.4 Release Notes
|
||||
==========================
|
||||
|
||||
Fixes since v1.5.0.3
|
||||
--------------------
|
||||
|
||||
* Bugfixes
|
||||
|
||||
- git.el does not add duplicate sign-off lines.
|
||||
|
||||
- git-commit shows the full stat of the resulting commit, not
|
||||
just about the files in the current directory, when run from
|
||||
a subdirectory.
|
||||
|
||||
- "git-checkout -m '@{8 hours ago}'" had a funny failure from
|
||||
eval; fixed.
|
||||
|
||||
- git-gui updates.
|
||||
|
||||
* Documentation updates
|
||||
|
||||
* User manual updates
|
||||
|
||||
|
28
Documentation/RelNotes-1.5.0.5.txt
Normal file
28
Documentation/RelNotes-1.5.0.5.txt
Normal file
@ -0,0 +1,28 @@
|
||||
GIT v1.5.0.5 Release Notes
|
||||
==========================
|
||||
|
||||
Fixes since v1.5.0.3
|
||||
--------------------
|
||||
|
||||
* Bugfixes
|
||||
|
||||
- git-merge (hence git-pull) did not refuse fast-forwarding
|
||||
when the working tree had local changes that would have
|
||||
conflicted with it.
|
||||
|
||||
- git.el does not add duplicate sign-off lines.
|
||||
|
||||
- git-commit shows the full stat of the resulting commit, not
|
||||
just about the files in the current directory, when run from
|
||||
a subdirectory.
|
||||
|
||||
- "git-checkout -m '@{8 hours ago}'" had a funny failure from
|
||||
eval; fixed.
|
||||
|
||||
- git-gui updates.
|
||||
|
||||
* Documentation updates
|
||||
|
||||
* User manual updates
|
||||
|
||||
|
22
Documentation/RelNotes-1.5.0.6.txt
Normal file
22
Documentation/RelNotes-1.5.0.6.txt
Normal file
@ -0,0 +1,22 @@
|
||||
GIT v1.5.0.6 Release Notes
|
||||
==========================
|
||||
|
||||
Fixes since v1.5.0.5
|
||||
--------------------
|
||||
|
||||
* Bugfixes
|
||||
|
||||
- a handful small fixes to gitweb.
|
||||
|
||||
- build procedure for user-manual is fixed not to require locally
|
||||
installed stylesheets.
|
||||
|
||||
- "git commit $paths" on paths whose earlier contents were
|
||||
already updated in the index were failing out.
|
||||
|
||||
* Documentation
|
||||
|
||||
- user-manual has better cross references.
|
||||
|
||||
- gitweb installation/deployment procedure is now documented.
|
||||
|
@ -448,7 +448,7 @@ Updates in v1.5.0 since v1.4.4 series
|
||||
- There is a partial support for 'shallow' repositories that
|
||||
keeps only recent history. A 'shallow clone' is created by
|
||||
specifying how deep that truncated history should be
|
||||
(e.g. "git clone --depth=5 git://some.where/repo.git").
|
||||
(e.g. "git clone --depth 5 git://some.where/repo.git").
|
||||
|
||||
Currently a shallow repository has number of limitations:
|
||||
|
||||
|
@ -1,3 +1,30 @@
|
||||
Checklist (and a short version for the impatient):
|
||||
|
||||
- make commits of logical units
|
||||
- check for unnecessary whitespace with "git diff --check"
|
||||
before committing
|
||||
- do not check in commented out code or unneeded files
|
||||
- provide a meaningful commit message
|
||||
- the first line of the commit message should be a short
|
||||
description and should skip the full stop
|
||||
- if you want your work included in git.git, add a
|
||||
"Signed-off-by: Your Name <your@email.com>" line to the
|
||||
commit message (or just use the option "-s" when
|
||||
committing) to confirm that you agree to the Developer's
|
||||
Certificate of Origin
|
||||
- do not PGP sign your patch
|
||||
- use "git format-patch -M" to create the patch
|
||||
- do not attach your patch, but read in the mail
|
||||
body, unless you cannot teach your mailer to
|
||||
leave the formatting of the patch alone.
|
||||
- be careful doing cut & paste into your mailer, not to
|
||||
corrupt whitespaces.
|
||||
- provide additional information (which is unsuitable for
|
||||
the commit message) between the "---" and the diffstat
|
||||
- send the patch to the list _and_ the maintainer
|
||||
|
||||
Long version:
|
||||
|
||||
I started reading over the SubmittingPatches document for Linux
|
||||
kernel, primarily because I wanted to have a document similar to
|
||||
it for the core GIT to make sure people understand what they are
|
||||
|
@ -41,10 +41,6 @@ while ($changed) {
|
||||
while (my ($text, $included) = each %include) {
|
||||
if (! exists $included{$text} &&
|
||||
(my $base = $text) =~ s/\.txt$//) {
|
||||
my ($suffix) = '1';
|
||||
if ($base eq 'git') {
|
||||
$suffix = '7'; # yuck...
|
||||
}
|
||||
print "$base.html $base.$suffix : ", join(" ", keys %$included), "\n";
|
||||
print "$base.html $base.xml : ", join(" ", keys %$included), "\n";
|
||||
}
|
||||
}
|
||||
|
@ -142,6 +142,18 @@ core.preferSymlinkRefs::
|
||||
This is sometimes needed to work with old scripts that
|
||||
expect HEAD to be a symbolic link.
|
||||
|
||||
core.bare::
|
||||
If true this repository is assumed to be 'bare' and has no
|
||||
working directory associated with it. If this is the case a
|
||||
number of commands that require a working directory will be
|
||||
disabled, such as gitlink:git-add[1] or gitlink:git-merge[1].
|
||||
+
|
||||
This setting is automatically guessed by gitlink:git-clone[1] or
|
||||
gitlink:git-init[1] when the repository was created. By default a
|
||||
repository that ends in "/.git" is assumed to be not bare (bare =
|
||||
false), while all other repositories are assumed to be bare (bare
|
||||
= true).
|
||||
|
||||
core.logAllRefUpdates::
|
||||
Updates to a ref <ref> is logged to the file
|
||||
"$GIT_DIR/logs/<ref>", by appending the new and old
|
||||
@ -180,10 +192,17 @@ core.compression::
|
||||
slowest.
|
||||
|
||||
core.legacyheaders::
|
||||
A boolean which enables the legacy object header format in case
|
||||
you want to interoperate with old clients accessing the object
|
||||
database directly (where the "http://" and "rsync://" protocols
|
||||
count as direct access).
|
||||
A boolean which
|
||||
changes the format of loose objects so that they are more
|
||||
efficient to pack and to send out of the repository over git
|
||||
native protocol, since v1.4.2. However, loose objects
|
||||
written in the new format cannot be read by git older than
|
||||
that version; people fetching from your repository using
|
||||
older versions of git over dumb transports (e.g. http)
|
||||
will also be affected.
|
||||
+
|
||||
To let git use the new loose object format, you have to
|
||||
set core.legacyheaders to false.
|
||||
|
||||
core.packedGitWindowSize::
|
||||
Number of bytes of a pack file to map into memory in a
|
||||
@ -321,6 +340,11 @@ format.headers::
|
||||
Additional email headers to include in a patch to be submitted
|
||||
by mail. See gitlink:git-format-patch[1].
|
||||
|
||||
format.suffix::
|
||||
The default for format-patch is to output files with the suffix
|
||||
`.patch`. Use this variable to change that suffix (make sure to
|
||||
include the dot if you want it).
|
||||
|
||||
gc.packrefs::
|
||||
`git gc` does not run `git pack-refs` in a bare repository by
|
||||
default so that older dumb-transport clients can still fetch
|
||||
|
@ -109,7 +109,7 @@ sure it is in your path. Then cd to a checked out CVS working directory
|
||||
of the project you are interested in and run gitlink:git-cvsimport[1]:
|
||||
|
||||
-------------------------------------------
|
||||
$ git cvsimport -C <destination>
|
||||
$ git cvsimport -C <destination> <module>
|
||||
-------------------------------------------
|
||||
|
||||
This puts a git archive of the named CVS module in the directory
|
||||
|
@ -52,7 +52,7 @@ OPTIONS
|
||||
-f::
|
||||
Allow adding otherwise ignored files.
|
||||
|
||||
\i, \--interactive::
|
||||
-i, \--interactive::
|
||||
Add modified contents in the working tree interactively to
|
||||
the index.
|
||||
|
||||
|
@ -70,7 +70,7 @@ default. You could use `--no-utf8` to override this.
|
||||
the patch.
|
||||
|
||||
-C<n>, -p<n>::
|
||||
These flag are passed to the `git-apply` program that applies
|
||||
These flags are passed to the `git-apply` program that applies
|
||||
the patch.
|
||||
|
||||
--interactive::
|
||||
|
@ -11,7 +11,7 @@ SYNOPSIS
|
||||
[verse]
|
||||
'git-clone' [--template=<template_directory>] [-l [-s]] [-q] [-n] [--bare]
|
||||
[-o <name>] [-u <upload-pack>] [--reference <repository>]
|
||||
[--depth=<depth>] <repository> [<directory>]
|
||||
[--depth <depth>] <repository> [<directory>]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
@ -96,7 +96,7 @@ OPTIONS
|
||||
if unset the templates are taken from the installation
|
||||
defined default, typically `/usr/share/git-core/templates`.
|
||||
|
||||
--depth=<depth>::
|
||||
--depth <depth>::
|
||||
Create a 'shallow' clone with a history truncated to the
|
||||
specified number of revs. A shallow repository has
|
||||
number of limitations (you cannot clone or fetch from
|
||||
|
@ -78,7 +78,7 @@ OPTIONS
|
||||
Remove the line matching the key from config file.
|
||||
|
||||
--unset-all::
|
||||
Remove all matching lines from config file.
|
||||
Remove all lines matching the key from config file.
|
||||
|
||||
-l, --list::
|
||||
List all variables set in config file.
|
||||
|
@ -96,11 +96,6 @@ If you need to pass multiple options, separate them with a comma.
|
||||
-s <subst>::
|
||||
Substitute the character "/" in branch names with <subst>
|
||||
|
||||
-A <author-conv-file>::
|
||||
CVS by default uses the Unix username when writing its
|
||||
commit logs. Using this option and an author-conv-file
|
||||
in this format
|
||||
|
||||
-a::
|
||||
Import all commits, including recent ones. cvsimport by default
|
||||
skips commits that have a timestamp less than 10 minutes ago.
|
||||
@ -112,6 +107,10 @@ If you need to pass multiple options, separate them with a comma.
|
||||
Limit the number of commits imported. Workaround for cases where
|
||||
cvsimport leaks memory.
|
||||
|
||||
-A <author-conv-file>::
|
||||
CVS by default uses the Unix username when writing its
|
||||
commit logs. Using this option and an author-conv-file
|
||||
in this format
|
||||
+
|
||||
---------
|
||||
exon=Andreas Ericsson <ae@op5.se>
|
||||
|
@ -121,10 +121,10 @@ so that calling 'cvs' effectively calls git-cvsserver.
|
||||
Clients known to work
|
||||
---------------------
|
||||
|
||||
CVS 1.12.9 on Debian
|
||||
CVS 1.11.17 on MacOSX (from Fink package)
|
||||
Eclipse 3.0, 3.1.2 on MacOSX (see Eclipse CVS Client Notes)
|
||||
TortoiseCVS
|
||||
- CVS 1.12.9 on Debian
|
||||
- CVS 1.11.17 on MacOSX (from Fink package)
|
||||
- Eclipse 3.0, 3.1.2 on MacOSX (see Eclipse CVS Client Notes)
|
||||
- TortoiseCVS
|
||||
|
||||
Operations supported
|
||||
--------------------
|
||||
@ -148,13 +148,16 @@ Copyright and Authors
|
||||
|
||||
This program is copyright The Open University UK - 2006.
|
||||
|
||||
Authors: Martyn Smith <martyn@catalyst.net.nz>
|
||||
Martin Langhoff <martin@catalyst.net.nz>
|
||||
with ideas and patches from participants of the git-list <git@vger.kernel.org>.
|
||||
Authors:
|
||||
|
||||
- Martyn Smith <martyn@catalyst.net.nz>
|
||||
- Martin Langhoff <martin@catalyst.net.nz>
|
||||
|
||||
with ideas and patches from participants of the git-list <git@vger.kernel.org>.
|
||||
|
||||
Documentation
|
||||
--------------
|
||||
Documentation by Martyn Smith <martyn@catalyst.net.nz> and Martin Langhoff <martin@catalyst.net.nz> Matthias Urlichs <smurf@smurf.noris.de>.
|
||||
Documentation by Martyn Smith <martyn@catalyst.net.nz>, Martin Langhoff <martin@catalyst.net.nz>, and Matthias Urlichs <smurf@smurf.noris.de>.
|
||||
|
||||
GIT
|
||||
---
|
||||
|
@ -8,7 +8,7 @@ git-diff - Show changes between commits, commit and working tree, etc
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
'git-diff' [ --diff-options ] <commit>{0,2} [--] [<path>...]
|
||||
'git-diff' [<common diff options>] <commit>{0,2} [--] [<path>...]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
@ -451,7 +451,7 @@ in octal. Git only supports the following modes:
|
||||
In both formats `<path>` is the complete path of the file to be added
|
||||
(if not already existing) or modified (if already existing).
|
||||
|
||||
A `<path>` string must use UNIX-style directory seperators (forward
|
||||
A `<path>` string must use UNIX-style directory separators (forward
|
||||
slash `/`), may contain any byte other than `LF`, and must not
|
||||
start with double quote (`"`).
|
||||
|
||||
@ -461,8 +461,8 @@ quoting should be used, e.g. `"path/with\n and \" in it"`.
|
||||
The value of `<path>` must be in canoncial form. That is it must not:
|
||||
|
||||
* contain an empty directory component (e.g. `foo//bar` is invalid),
|
||||
* end with a directory seperator (e.g. `foo/` is invalid),
|
||||
* start with a directory seperator (e.g. `/foo` is invalid),
|
||||
* end with a directory separator (e.g. `foo/` is invalid),
|
||||
* start with a directory separator (e.g. `/foo` is invalid),
|
||||
* contain the special component `.` or `..` (e.g. `foo/./bar` and
|
||||
`foo/../bar` are invalid).
|
||||
|
||||
|
@ -9,8 +9,8 @@ git-format-patch - Prepare patches for e-mail submission
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach] [--thread]
|
||||
[-s | --signoff] [--diff-options] [--start-number <n>]
|
||||
'git-format-patch' [<common diff options>] [-n | -k] [-o <dir> | --stdout]
|
||||
[--attach] [--thread] [-s | --signoff] [--start-number <n>]
|
||||
[--in-reply-to=Message-Id] [--suffix=.<sfx>]
|
||||
[--ignore-if-in-upstream]
|
||||
<since>[..<until>]
|
||||
@ -46,6 +46,8 @@ reference.
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
include::diff-options.txt[]
|
||||
|
||||
-o|--output-directory <dir>::
|
||||
Use <dir> to store the resulting files, instead of the
|
||||
current working directory.
|
||||
|
@ -42,10 +42,10 @@ OPTIONS
|
||||
--patches <dir>::
|
||||
The directory to find the quilt patches and the
|
||||
quilt series file.
|
||||
|
||||
The default for the patch directory is patches
|
||||
or the value of the $QUILT_PATCHES environment
|
||||
variable.
|
||||
+
|
||||
The default for the patch directory is patches
|
||||
or the value of the $QUILT_PATCHES environment
|
||||
variable.
|
||||
|
||||
Author
|
||||
------
|
||||
|
@ -10,7 +10,7 @@ SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git-remote'
|
||||
'git-remote' add <name> <url>
|
||||
'git-remote' add [-t <branch>] [-m <branch>] [-f] <name> <url>
|
||||
'git-remote' show <name>
|
||||
'git-remote' prune <name>
|
||||
|
||||
@ -31,6 +31,19 @@ subcommands are available to perform operations on the remotes.
|
||||
Adds a remote named <name> for the repository at
|
||||
<url>. The command `git fetch <name>` can then be used to create and
|
||||
update remote-tracking branches <name>/<branch>.
|
||||
+
|
||||
With `-f` option, `git fetch <name>` is run immediately after
|
||||
the remote information is set up.
|
||||
+
|
||||
With `-t <branch>` option, instead of the default glob
|
||||
refspec for the remote to track all branches under
|
||||
`$GIT_DIR/remotes/<name>/`, a refspec to track only `<branch>`
|
||||
is created. You can give more than one `-t <branch>` to track
|
||||
multiple branche without grabbing all branches.
|
||||
+
|
||||
With `-m <master>` option, `$GIT_DIR/remotes/<name>/HEAD` is set
|
||||
up to point at remote's `<master>` branch instead of whatever
|
||||
branch the `HEAD` at the remote repository actually points at.
|
||||
|
||||
'show'::
|
||||
|
||||
@ -53,8 +66,8 @@ gitlink:git-config[1]).
|
||||
Examples
|
||||
--------
|
||||
|
||||
Add a new remote, fetch, and check out a branch from it:
|
||||
|
||||
* Add a new remote, fetch, and check out a branch from it
|
||||
+
|
||||
------------
|
||||
$ git remote
|
||||
origin
|
||||
@ -74,6 +87,17 @@ $ git checkout -b nfs linux-nfs/master
|
||||
...
|
||||
------------
|
||||
|
||||
* Imitate 'git clone' but track only selected branches
|
||||
+
|
||||
------------
|
||||
$ mkdir project.git
|
||||
$ cd project.git
|
||||
$ git init
|
||||
$ git remote add -f -t master -m master origin git://example.com/git.git/
|
||||
$ git merge origin
|
||||
------------
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
gitlink:git-fetch[1]
|
||||
|
@ -26,13 +26,13 @@ The options available are:
|
||||
|
||||
--bcc::
|
||||
Specify a "Bcc:" value for each email.
|
||||
|
||||
The --bcc option must be repeated for each user you want on the bcc list.
|
||||
+
|
||||
The --bcc option must be repeated for each user you want on the bcc list.
|
||||
|
||||
--cc::
|
||||
Specify a starting "Cc:" value for each email.
|
||||
|
||||
The --cc option must be repeated for each user you want on the cc list.
|
||||
+
|
||||
The --cc option must be repeated for each user you want on the cc list.
|
||||
|
||||
--chain-reply-to, --no-chain-reply-to::
|
||||
If this is set, each email will be sent as a reply to the previous
|
||||
@ -87,9 +87,22 @@ The options available are:
|
||||
Specify the primary recipient of the emails generated.
|
||||
Generally, this will be the upstream maintainer of the
|
||||
project involved.
|
||||
+
|
||||
The --to option must be repeated for each user you want on the to list.
|
||||
|
||||
The --to option must be repeated for each user you want on the to list.
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
sendemail.aliasesfile::
|
||||
To avoid typing long email addresses, point this to one or more
|
||||
email aliases files. You must also supply 'sendemail.aliasfiletype'.
|
||||
|
||||
sendemail.aliasfiletype::
|
||||
Format of the file(s) specified in sendemail.aliasesfile. Must be
|
||||
one of 'mutt', 'mailrc', 'pine', or 'gnus'.
|
||||
|
||||
sendemail.smtpserver::
|
||||
Default smtp server to use.
|
||||
|
||||
Author
|
||||
------
|
||||
|
@ -48,15 +48,15 @@ git show v1.0.0::
|
||||
Shows the tag `v1.0.0`, along with the object the tags
|
||||
points at.
|
||||
|
||||
git show v1.0.0^{tree}::
|
||||
git show v1.0.0^\{tree\}::
|
||||
Shows the tree pointed to by the tag `v1.0.0`.
|
||||
|
||||
git show next~10:Documentation/README
|
||||
git show next~10:Documentation/README::
|
||||
Shows the contents of the file `Documentation/README` as
|
||||
they were current in the 10th last commit of the branch
|
||||
`next`.
|
||||
|
||||
git show master:Makefile master:t/Makefile
|
||||
git show master:Makefile master:t/Makefile::
|
||||
Concatenates the contents of said Makefiles in the head
|
||||
of the branch `master`.
|
||||
|
||||
|
@ -231,6 +231,12 @@ Identifier Terminology
|
||||
operate on a <tree> object but automatically dereferences
|
||||
<commit> and <tag> objects that point at a <tree>.
|
||||
|
||||
<commit-ish>::
|
||||
Indicates a commit or tag object name. A
|
||||
command that takes a <commit-ish> argument ultimately wants to
|
||||
operate on a <commit> object but automatically dereferences
|
||||
<tag> objects that point at a <commit>.
|
||||
|
||||
<type>::
|
||||
Indicates that an object type is required.
|
||||
Currently one of: `blob`, `tree`, `commit`, or `tag`.
|
||||
|
@ -1,356 +1,405 @@
|
||||
alternate object database::
|
||||
Via the alternates mechanism, a repository can inherit part of its
|
||||
object database from another object database, which is called
|
||||
"alternate".
|
||||
GIT Glossary
|
||||
============
|
||||
|
||||
bare repository::
|
||||
A bare repository is normally an appropriately named
|
||||
directory with a `.git` suffix that does not have a
|
||||
locally checked-out copy of any of the files under revision
|
||||
control. That is, all of the `git` administrative and
|
||||
control files that would normally be present in the
|
||||
hidden `.git` sub-directory are directly present in
|
||||
the `repository.git` directory instead, and no other files
|
||||
are present and checked out. Usually publishers of public
|
||||
repositories make bare repositories available.
|
||||
[[def_alternate_object_database]]alternate object database::
|
||||
Via the alternates mechanism, a <<def_repository,repository>> can
|
||||
inherit part of its <<def_object_database,object database>> from another
|
||||
<<def_object_database,object database>>, which is called "alternate".
|
||||
|
||||
blob object::
|
||||
Untyped object, e.g. the contents of a file.
|
||||
[[def_bare_repository]]bare repository::
|
||||
A <<def_bare_repository,bare repository>> is normally an appropriately
|
||||
named <<def_directory,directory>> with a `.git` suffix that does not
|
||||
have a locally checked-out copy of any of the files under
|
||||
<<def_revision,revision>> control. That is, all of the `git`
|
||||
administrative and control files that would normally be present in the
|
||||
hidden `.git` sub-directory are directly present in the
|
||||
`repository.git` directory instead,
|
||||
and no other files are present and checked out. Usually publishers of
|
||||
public repositories make bare repositories available.
|
||||
|
||||
branch::
|
||||
A non-cyclical graph of revisions, i.e. the complete history of
|
||||
a particular revision, which is called the branch head. The
|
||||
branch heads are stored in `$GIT_DIR/refs/heads/`.
|
||||
[[def_blob_object]]blob object::
|
||||
Untyped <<def_object,object>>, e.g. the contents of a file.
|
||||
|
||||
cache::
|
||||
Obsolete for: index.
|
||||
[[def_branch]]branch::
|
||||
A non-cyclical graph of revisions, i.e. the complete history of a
|
||||
particular <<def_revision,revision>>, which is called the
|
||||
branch <<def_head,head>>. The heads
|
||||
are stored in `$GIT_DIR/refs/heads/`.
|
||||
|
||||
chain::
|
||||
A list of objects, where each object in the list contains a
|
||||
reference to its successor (for example, the successor of a commit
|
||||
could be one of its parents).
|
||||
[[def_cache]]cache::
|
||||
Obsolete for: <<def_index,index>>.
|
||||
|
||||
changeset::
|
||||
BitKeeper/cvsps speak for "commit". Since git does not store
|
||||
changes, but states, it really does not make sense to use
|
||||
the term "changesets" with git.
|
||||
[[def_chain]]chain::
|
||||
A list of objects, where each <<def_object,object>> in the list contains
|
||||
a reference to its successor (for example, the successor of a
|
||||
<<def_commit,commit>> could be one of its parents).
|
||||
|
||||
checkout::
|
||||
The action of updating the working tree to a revision which was
|
||||
stored in the object database.
|
||||
[[def_changeset]]changeset::
|
||||
BitKeeper/cvsps speak for "<<def_commit,commit>>". Since git does not
|
||||
store changes, but states, it really does not make sense to use the term
|
||||
"changesets" with git.
|
||||
|
||||
cherry-picking::
|
||||
In SCM jargon, "cherry pick" means to choose a subset of
|
||||
changes out of a series of changes (typically commits)
|
||||
and record them as a new series of changes on top of
|
||||
different codebase. In GIT, this is performed by
|
||||
"git cherry-pick" command to extract the change
|
||||
introduced by an existing commit and to record it based
|
||||
on the tip of the current branch as a new commit.
|
||||
[[def_checkout]]checkout::
|
||||
The action of updating the <<def_working_tree,working tree>> to a
|
||||
<<def_revision,revision>> which was stored in the
|
||||
<<def_object_database,object database>>.
|
||||
|
||||
clean::
|
||||
A working tree is clean, if it corresponds to the revision
|
||||
referenced by the current head. Also see "dirty".
|
||||
[[def_cherry-picking]]cherry-picking::
|
||||
In <<def_SCM,SCM>> jargon, "cherry pick" means to choose a subset of
|
||||
changes out of a series of changes (typically commits) and record them
|
||||
as a new series of changes on top of different codebase. In GIT, this is
|
||||
performed by "git cherry-pick" command to extract the change introduced
|
||||
by an existing <<def_commit,commit>> and to record it based on the tip
|
||||
of the current <<def_branch,branch>> as a new <<def_commit,commit>>.
|
||||
|
||||
commit::
|
||||
As a verb: The action of storing the current state of the index in the
|
||||
object database. The result is a revision.
|
||||
As a noun: Short hand for commit object.
|
||||
[[def_clean]]clean::
|
||||
A <<def_working_tree,working tree>> is <<def_clean,clean>>, if it
|
||||
corresponds to the <<def_revision,revision>> referenced by the current
|
||||
<<def_head,head>>. Also see "<<def_dirty,dirty>>".
|
||||
|
||||
commit object::
|
||||
An object which contains the information about a particular
|
||||
revision, such as parents, committer, author, date and the
|
||||
tree object which corresponds to the top directory of the
|
||||
stored revision.
|
||||
[[def_commit]]commit::
|
||||
As a verb: The action of storing the current state of the
|
||||
<<def_index,index>> in the <<def_object_database,object database>>. The
|
||||
result is a <<def_revision,revision>>. As a noun: Short hand for
|
||||
<<def_commit_object,commit object>>.
|
||||
|
||||
core git::
|
||||
Fundamental data structures and utilities of git. Exposes only
|
||||
limited source code management tools.
|
||||
[[def_commit_object]]commit object::
|
||||
An <<def_object,object>> which contains the information about a
|
||||
particular <<def_revision,revision>>, such as parents, committer,
|
||||
author, date and the <<def_tree_object,tree object>> which corresponds
|
||||
to the top <<def_directory,directory>> of the stored
|
||||
<<def_revision,revision>>.
|
||||
|
||||
DAG::
|
||||
Directed acyclic graph. The commit objects form a directed acyclic
|
||||
graph, because they have parents (directed), and the graph of commit
|
||||
objects is acyclic (there is no chain which begins and ends with the
|
||||
same object).
|
||||
[[def_core_git]]core git::
|
||||
Fundamental data structures and utilities of git. Exposes only limited
|
||||
source code management tools.
|
||||
|
||||
dircache::
|
||||
[[def_DAG]]DAG::
|
||||
Directed acyclic graph. The <<def_commit,commit>> objects form a
|
||||
directed acyclic graph, because they have parents (directed), and the
|
||||
graph of <<def_commit,commit>> objects is acyclic (there is no
|
||||
<<def_chain,chain>> which begins and ends with the same
|
||||
<<def_object,object>>).
|
||||
|
||||
[[def_dangling_object]]dangling object::
|
||||
An <<def_unreachable_object,unreachable object>> which is not
|
||||
<<def_reachable,reachable>> even from other unreachable objects; a
|
||||
<<def_dangling_object,dangling object>> has no references to it from any
|
||||
reference or <<def_object,object>> in the <<def_repository,repository>>.
|
||||
|
||||
[[def_dircache]]dircache::
|
||||
You are *waaaaay* behind.
|
||||
|
||||
dirty::
|
||||
A working tree is said to be dirty if it contains modifications
|
||||
which have not been committed to the current branch.
|
||||
|
||||
directory::
|
||||
[[def_directory]]directory::
|
||||
The list you get with "ls" :-)
|
||||
|
||||
ent::
|
||||
Favorite synonym to "tree-ish" by some total geeks. See
|
||||
[[def_dirty]]dirty::
|
||||
A <<def_working_tree,working tree>> is said to be <<def_dirty,dirty>> if
|
||||
it contains modifications which have not been committed to the current
|
||||
<<def_branch,branch>>.
|
||||
|
||||
[[def_ent]]ent::
|
||||
Favorite synonym to "<<def_tree-ish,tree-ish>>" by some total geeks. See
|
||||
`http://en.wikipedia.org/wiki/Ent_(Middle-earth)` for an in-depth
|
||||
explanation. Avoid this term, not to confuse people.
|
||||
|
||||
fast forward::
|
||||
A fast-forward is a special type of merge where you have
|
||||
a revision and you are "merging" another branch's changes
|
||||
that happen to be a descendant of what you have.
|
||||
In such these cases, you do not make a new merge commit but
|
||||
instead just update to his revision. This will happen
|
||||
frequently on a tracking branch of a remote repository.
|
||||
[[def_fast_forward]]fast forward::
|
||||
A fast-forward is a special type of <<def_merge,merge>> where you have a
|
||||
<<def_revision,revision>> and you are "merging" another
|
||||
<<def_branch,branch>>'s changes that happen to be a descendant of what
|
||||
you have. In such these cases, you do not make a new <<def_merge,merge>>
|
||||
<<def_commit,commit>> but instead just update to his
|
||||
<<def_revision,revision>>. This will happen frequently on a
|
||||
<<def_tracking_branch,tracking branch>> of a remote
|
||||
<<def_repository,repository>>.
|
||||
|
||||
fetch::
|
||||
Fetching a branch means to get the branch's head ref from a
|
||||
remote repository, to find out which objects are missing from
|
||||
the local object database, and to get them, too.
|
||||
[[def_fetch]]fetch::
|
||||
Fetching a <<def_branch,branch>> means to get the
|
||||
<<def_branch,branch>>'s <<def_head_ref,head ref>> from a remote
|
||||
<<def_repository,repository>>, to find out which objects are missing
|
||||
from the local <<def_object_database,object database>>, and to get them,
|
||||
too.
|
||||
|
||||
file system::
|
||||
Linus Torvalds originally designed git to be a user space file
|
||||
system, i.e. the infrastructure to hold files and directories.
|
||||
That ensured the efficiency and speed of git.
|
||||
[[def_file_system]]file system::
|
||||
Linus Torvalds originally designed git to be a user space file system,
|
||||
i.e. the infrastructure to hold files and directories. That ensured the
|
||||
efficiency and speed of git.
|
||||
|
||||
git archive::
|
||||
Synonym for repository (for arch people).
|
||||
[[def_git_archive]]git archive::
|
||||
Synonym for <<def_repository,repository>> (for arch people).
|
||||
|
||||
grafts::
|
||||
Grafts enables two otherwise different lines of development to be
|
||||
joined together by recording fake ancestry information for commits.
|
||||
This way you can make git pretend the set of parents a commit
|
||||
has is different from what was recorded when the commit was created.
|
||||
Configured via the `.git/info/grafts` file.
|
||||
[[def_grafts]]grafts::
|
||||
Grafts enables two otherwise different lines of development to be joined
|
||||
together by recording fake ancestry information for commits. This way
|
||||
you can make git pretend the set of parents a <<def_commit,commit>> has
|
||||
is different from what was recorded when the <<def_commit,commit>> was
|
||||
created. Configured via the `.git/info/grafts` file.
|
||||
|
||||
hash::
|
||||
In git's context, synonym to object name.
|
||||
[[def_hash]]hash::
|
||||
In git's context, synonym to <<def_object_name,object name>>.
|
||||
|
||||
head::
|
||||
The top of a branch. It contains a ref to the corresponding
|
||||
commit object.
|
||||
[[def_head]]head::
|
||||
The top of a <<def_branch,branch>>. It contains a <<def_ref,ref>> to the
|
||||
corresponding <<def_commit_object,commit object>>.
|
||||
|
||||
head ref::
|
||||
A ref pointing to a head. Often, this is abbreviated to "head".
|
||||
Head refs are stored in `$GIT_DIR/refs/heads/`.
|
||||
[[def_head_ref]]head ref::
|
||||
A <<def_ref,ref>> pointing to a <<def_head,head>>. Often, this is
|
||||
abbreviated to "<<def_head,head>>". Head refs are stored in
|
||||
`$GIT_DIR/refs/heads/`.
|
||||
|
||||
hook::
|
||||
During the normal execution of several git commands,
|
||||
call-outs are made to optional scripts that allow
|
||||
a developer to add functionality or checking.
|
||||
Typically, the hooks allow for a command to be pre-verified
|
||||
and potentially aborted, and allow for a post-notification
|
||||
after the operation is done.
|
||||
The hook scripts are found in the `$GIT_DIR/hooks/` directory,
|
||||
and are enabled by simply making them executable.
|
||||
[[def_hook]]hook::
|
||||
During the normal execution of several git commands, call-outs are made
|
||||
to optional scripts that allow a developer to add functionality or
|
||||
checking. Typically, the hooks allow for a command to be pre-verified
|
||||
and potentially aborted, and allow for a post-notification after the
|
||||
operation is done. The <<def_hook,hook>> scripts are found in the
|
||||
`$GIT_DIR/hooks/` <<def_directory,directory>>, and are enabled by simply
|
||||
making them executable.
|
||||
|
||||
index::
|
||||
A collection of files with stat information, whose contents are
|
||||
stored as objects. The index is a stored version of your working
|
||||
tree. Truth be told, it can also contain a second, and even a third
|
||||
version of a working tree, which are used when merging.
|
||||
[[def_index]]index::
|
||||
A collection of files with stat information, whose contents are stored
|
||||
as objects. The <<def_index,index>> is a stored version of your working
|
||||
<<def_tree,tree>>. Truth be told, it can also contain a second, and even
|
||||
a third version of a <<def_working_tree,working tree>>, which are used
|
||||
when merging.
|
||||
|
||||
index entry::
|
||||
The information regarding a particular file, stored in the index.
|
||||
An index entry can be unmerged, if a merge was started, but not
|
||||
yet finished (i.e. if the index contains multiple versions of
|
||||
that file).
|
||||
[[def_index_entry]]index entry::
|
||||
The information regarding a particular file, stored in the
|
||||
<<def_index,index>>. An <<def_index_entry,index entry>> can be unmerged,
|
||||
if a <<def_merge,merge>> was started, but not yet finished (i.e. if the
|
||||
<<def_index,index>> contains multiple versions of that file).
|
||||
|
||||
master::
|
||||
The default development branch. Whenever you create a git
|
||||
repository, a branch named "master" is created, and becomes
|
||||
the active branch. In most cases, this contains the local
|
||||
[[def_master]]master::
|
||||
The default development <<def_branch,branch>>. Whenever you create a git
|
||||
<<def_repository,repository>>, a <<def_branch,branch>> named
|
||||
"<<def_master,master>>" is created, and becomes the active
|
||||
<<def_branch,branch>>. In most cases, this contains the local
|
||||
development, though that is purely conventional and not required.
|
||||
|
||||
merge::
|
||||
To merge branches means to try to accumulate the changes since a
|
||||
common ancestor and apply them to the first branch. An automatic
|
||||
merge uses heuristics to accomplish that. Evidently, an automatic
|
||||
merge can fail.
|
||||
[[def_merge]]merge::
|
||||
To <<def_merge,merge>> branches means to try to accumulate the changes
|
||||
since a common ancestor and apply them to the first
|
||||
<<def_branch,branch>>. An automatic <<def_merge,merge>> uses heuristics
|
||||
to accomplish that. Evidently, an automatic <<def_merge,merge>> can
|
||||
fail.
|
||||
|
||||
object::
|
||||
The unit of storage in git. It is uniquely identified by
|
||||
the SHA1 of its contents. Consequently, an object can not
|
||||
be changed.
|
||||
[[def_object]]object::
|
||||
The unit of storage in git. It is uniquely identified by the
|
||||
<<def_SHA1,SHA1>> of its contents. Consequently, an
|
||||
<<def_object,object>> can not be changed.
|
||||
|
||||
object database::
|
||||
Stores a set of "objects", and an individual object is identified
|
||||
by its object name. The objects usually live in `$GIT_DIR/objects/`.
|
||||
[[def_object_database]]object database::
|
||||
Stores a set of "objects", and an individual <<def_object,object>> is
|
||||
identified by its <<def_object_name,object name>>. The objects usually
|
||||
live in `$GIT_DIR/objects/`.
|
||||
|
||||
object identifier::
|
||||
Synonym for object name.
|
||||
[[def_object_identifier]]object identifier::
|
||||
Synonym for <<def_object_name,object name>>.
|
||||
|
||||
object name::
|
||||
The unique identifier of an object. The hash of the object's contents
|
||||
using the Secure Hash Algorithm 1 and usually represented by the 40
|
||||
character hexadecimal encoding of the hash of the object (possibly
|
||||
followed by a white space).
|
||||
[[def_object_name]]object name::
|
||||
The unique identifier of an <<def_object,object>>. The <<def_hash,hash>>
|
||||
of the <<def_object,object>>'s contents using the Secure Hash Algorithm
|
||||
1 and usually represented by the 40 character hexadecimal encoding of
|
||||
the <<def_hash,hash>> of the <<def_object,object>> (possibly followed by
|
||||
a white space).
|
||||
|
||||
object type::
|
||||
One of the identifiers "commit","tree","tag" and "blob" describing
|
||||
the type of an object.
|
||||
[[def_object_type]]object type::
|
||||
One of the identifiers
|
||||
"<<def_commit,commit>>","<<def_tree,tree>>","<<def_tag,tag>>" or "<<def_blob_object,blob>>"
|
||||
describing the type of an <<def_object,object>>.
|
||||
|
||||
octopus::
|
||||
To merge more than two branches. Also denotes an intelligent
|
||||
predator.
|
||||
[[def_octopus]]octopus::
|
||||
To <<def_merge,merge>> more than two branches. Also denotes an
|
||||
intelligent predator.
|
||||
|
||||
origin::
|
||||
The default upstream repository. Most projects have at
|
||||
least one upstream project which they track. By default
|
||||
'origin' is used for that purpose. New upstream updates
|
||||
[[def_origin]]origin::
|
||||
The default upstream <<def_repository,repository>>. Most projects have
|
||||
at least one upstream project which they track. By default
|
||||
'<<def_origin,origin>>' is used for that purpose. New upstream updates
|
||||
will be fetched into remote tracking branches named
|
||||
origin/name-of-upstream-branch, which you can see using
|
||||
"git branch -r".
|
||||
"git <<def_branch,branch>> -r".
|
||||
|
||||
pack::
|
||||
A set of objects which have been compressed into one file (to save
|
||||
space or to transmit them efficiently).
|
||||
[[def_pack]]pack::
|
||||
A set of objects which have been compressed into one file (to save space
|
||||
or to transmit them efficiently).
|
||||
|
||||
pack index::
|
||||
[[def_pack_index]]pack index::
|
||||
The list of identifiers, and other information, of the objects in a
|
||||
pack, to assist in efficiently accessing the contents of a pack.
|
||||
<<def_pack,pack>>, to assist in efficiently accessing the contents of a
|
||||
<<def_pack,pack>>.
|
||||
|
||||
parent::
|
||||
A commit object contains a (possibly empty) list of the logical
|
||||
predecessor(s) in the line of development, i.e. its parents.
|
||||
[[def_parent]]parent::
|
||||
A <<def_commit_object,commit object>> contains a (possibly empty) list
|
||||
of the logical predecessor(s) in the line of development, i.e. its
|
||||
parents.
|
||||
|
||||
pickaxe::
|
||||
The term pickaxe refers to an option to the diffcore routines
|
||||
that help select changes that add or delete a given text string.
|
||||
With the --pickaxe-all option, it can be used to view the
|
||||
full changeset that introduced or removed, say, a particular
|
||||
line of text. See gitlink:git-diff[1].
|
||||
[[def_pickaxe]]pickaxe::
|
||||
The term <<def_pickaxe,pickaxe>> refers to an option to the diffcore
|
||||
routines that help select changes that add or delete a given text
|
||||
string. With the --pickaxe-all option, it can be used to view the full
|
||||
<<def_changeset,changeset>> that introduced or removed, say, a
|
||||
particular line of text. See gitlink:git-diff[1].
|
||||
|
||||
plumbing::
|
||||
Cute name for core git.
|
||||
[[def_plumbing]]plumbing::
|
||||
Cute name for <<def_core_git,core git>>.
|
||||
|
||||
porcelain::
|
||||
Cute name for programs and program suites depending on core git,
|
||||
presenting a high level access to core git. Porcelains expose
|
||||
more of a SCM interface than the plumbing.
|
||||
[[def_porcelain]]porcelain::
|
||||
Cute name for programs and program suites depending on
|
||||
<<def_core_git,core git>>, presenting a high level access to
|
||||
<<def_core_git,core git>>. Porcelains expose more of a <<def_SCM,SCM>>
|
||||
interface than the <<def_plumbing,plumbing>>.
|
||||
|
||||
pull::
|
||||
Pulling a branch means to fetch it and merge it.
|
||||
[[def_pull]]pull::
|
||||
Pulling a <<def_branch,branch>> means to <<def_fetch,fetch>> it and
|
||||
<<def_merge,merge>> it.
|
||||
|
||||
push::
|
||||
Pushing a branch means to get the branch's head ref from a remote
|
||||
repository, find out if it is an ancestor to the branch's local
|
||||
head ref is a direct, and in that case, putting all objects, which
|
||||
are reachable from the local head ref, and which are missing from
|
||||
the remote repository, into the remote object database, and updating
|
||||
the remote head ref. If the remote head is not an ancestor to the
|
||||
local head, the push fails.
|
||||
[[def_push]]push::
|
||||
Pushing a <<def_branch,branch>> means to get the <<def_branch,branch>>'s
|
||||
<<def_head_ref,head ref>> from a remote <<def_repository,repository>>,
|
||||
find out if it is an ancestor to the <<def_branch,branch>>'s local
|
||||
<<def_head_ref,head ref>> is a direct, and in that case, putting all
|
||||
objects, which are <<def_reachable,reachable>> from the local
|
||||
<<def_head_ref,head ref>>, and which are missing from the remote
|
||||
<<def_repository,repository>>, into the remote
|
||||
<<def_object_database,object database>>, and updating the remote
|
||||
<<def_head_ref,head ref>>. If the remote <<def_head,head>> is not an
|
||||
ancestor to the local <<def_head,head>>, the <<def_push,push>> fails.
|
||||
|
||||
reachable::
|
||||
All of the ancestors of a given commit are said to be reachable from
|
||||
that commit. More generally, one object is reachable from another if
|
||||
we can reach the one from the other by a chain that follows tags to
|
||||
whatever they tag, commits to their parents or trees, and trees to the
|
||||
trees or blobs that they contain.
|
||||
[[def_reachable]]reachable::
|
||||
All of the ancestors of a given <<def_commit,commit>> are said to be
|
||||
<<def_reachable,reachable>> from that <<def_commit,commit>>. More
|
||||
generally, one <<def_object,object>> is <<def_reachable,reachable>> from
|
||||
another if we can reach the one from the other by a <<def_chain,chain>>
|
||||
that follows <<def_tag,tags>> to whatever they tag,
|
||||
<<def_commit_object,commits>> to their parents or trees, and
|
||||
<<def_tree_object,trees>> to the trees or <<def_blob_object,blobs>>
|
||||
that they contain.
|
||||
|
||||
rebase::
|
||||
To clean a branch by starting from the head of the main line of
|
||||
development ("master"), and reapply the (possibly cherry-picked)
|
||||
changes from that branch.
|
||||
[[def_rebase]]rebase::
|
||||
To reapply a series of changes from a <<def_branch,branch>> to a
|
||||
different base, and reset the <<def_head,head>> of that branch
|
||||
to the result.
|
||||
|
||||
ref::
|
||||
A 40-byte hex representation of a SHA1 or a name that denotes
|
||||
a particular object. These may be stored in `$GIT_DIR/refs/`.
|
||||
[[def_ref]]ref::
|
||||
A 40-byte hex representation of a <<def_SHA1,SHA1>> or a name that
|
||||
denotes a particular <<def_object,object>>. These may be stored in
|
||||
`$GIT_DIR/refs/`.
|
||||
|
||||
refspec::
|
||||
A refspec is used by fetch and push to describe the mapping
|
||||
between remote ref and local ref. They are combined with
|
||||
a colon in the format <src>:<dst>, preceded by an optional
|
||||
plus sign, +. For example:
|
||||
`git fetch $URL refs/heads/master:refs/heads/origin`
|
||||
means "grab the master branch head from the $URL and store
|
||||
it as my origin branch head".
|
||||
And `git push $URL refs/heads/master:refs/heads/to-upstream`
|
||||
means "publish my master branch head as to-upstream branch
|
||||
at $URL". See also gitlink:git-push[1]
|
||||
[[def_refspec]]refspec::
|
||||
A <<def_refspec,refspec>> is used by <<def_fetch,fetch>> and
|
||||
<<def_push,push>> to describe the mapping between remote <<def_ref,ref>>
|
||||
and local <<def_ref,ref>>. They are combined with a colon in the format
|
||||
<src>:<dst>, preceded by an optional plus sign, +. For example: `git
|
||||
fetch $URL refs/heads/master:refs/heads/origin` means
|
||||
"grab the master <<def_branch,branch>> <<def_head,head>>
|
||||
from the $URL and store it as my origin
|
||||
<<def_branch,branch>> <<def_head,head>>". And `git <<def_push,push>>
|
||||
$URL refs/heads/master:refs/heads/to-upstream` means
|
||||
"publish my master <<def_branch,branch>>
|
||||
<<def_head,head>> as to-upstream <<def_branch,branch>> at $URL". See
|
||||
also gitlink:git-push[1]
|
||||
|
||||
repository::
|
||||
A collection of refs together with an object database containing
|
||||
all objects, which are reachable from the refs, possibly accompanied
|
||||
by meta data from one or more porcelains. A repository can
|
||||
share an object database with other repositories.
|
||||
[[def_repository]]repository::
|
||||
A collection of refs together with an <<def_object_database,object
|
||||
database>> containing all objects which are <<def_reachable,reachable>>
|
||||
from the refs, possibly accompanied by meta data from one or more
|
||||
porcelains. A <<def_repository,repository>> can share an
|
||||
<<def_object_database,object database>> with other repositories.
|
||||
|
||||
resolve::
|
||||
The action of fixing up manually what a failed automatic merge
|
||||
left behind.
|
||||
[[def_resolve]]resolve::
|
||||
The action of fixing up manually what a failed automatic
|
||||
<<def_merge,merge>> left behind.
|
||||
|
||||
revision::
|
||||
A particular state of files and directories which was stored in
|
||||
the object database. It is referenced by a commit object.
|
||||
[[def_revision]]revision::
|
||||
A particular state of files and directories which was stored in the
|
||||
<<def_object_database,object database>>. It is referenced by a
|
||||
<<def_commit_object,commit object>>.
|
||||
|
||||
rewind::
|
||||
To throw away part of the development, i.e. to assign the head to
|
||||
an earlier revision.
|
||||
[[def_rewind]]rewind::
|
||||
To throw away part of the development, i.e. to assign the
|
||||
<<def_head,head>> to an earlier <<def_revision,revision>>.
|
||||
|
||||
SCM::
|
||||
[[def_SCM]]SCM::
|
||||
Source code management (tool).
|
||||
|
||||
SHA1::
|
||||
Synonym for object name.
|
||||
[[def_SHA1]]SHA1::
|
||||
Synonym for <<def_object_name,object name>>.
|
||||
|
||||
shallow repository::
|
||||
A shallow repository has an incomplete history some of
|
||||
whose commits have parents cauterized away (in other
|
||||
words, git is told to pretend that these commits do not
|
||||
have the parents, even though they are recorded in the
|
||||
commit object). This is sometimes useful when you are
|
||||
interested only in the recent history of a project even
|
||||
though the real history recorded in the upstream is
|
||||
much larger. A shallow repository is created by giving
|
||||
`--depth` option to gitlink:git-clone[1], and its
|
||||
history can be later deepened with gitlink:git-fetch[1].
|
||||
[[def_shallow_repository]]shallow repository::
|
||||
A <<def_shallow_repository,shallow repository>> has an incomplete
|
||||
history some of whose commits have parents cauterized away (in other
|
||||
words, git is told to pretend that these commits do not have the
|
||||
parents, even though they are recorded in the <<def_commit_object,commit
|
||||
object>>). This is sometimes useful when you are interested only in the
|
||||
recent history of a project even though the real history recorded in the
|
||||
upstream is much larger. A <<def_shallow_repository,shallow repository>>
|
||||
is created by giving the `--depth` option to gitlink:git-clone[1], and
|
||||
its history can be later deepened with gitlink:git-fetch[1].
|
||||
|
||||
symref::
|
||||
Symbolic reference: instead of containing the SHA1 id itself, it
|
||||
is of the format 'ref: refs/some/thing' and when referenced, it
|
||||
recursively dereferences to this reference. 'HEAD' is a prime
|
||||
example of a symref. Symbolic references are manipulated with
|
||||
the gitlink:git-symbolic-ref[1] command.
|
||||
[[def_symref]]symref::
|
||||
Symbolic reference: instead of containing the <<def_SHA1,SHA1>> id
|
||||
itself, it is of the format 'ref: refs/some/thing' and when
|
||||
referenced, it recursively dereferences to this reference. 'HEAD' is a
|
||||
prime example of a <<def_symref,symref>>. Symbolic references are
|
||||
manipulated with the gitlink:git-symbolic-ref[1] command.
|
||||
|
||||
topic branch::
|
||||
A regular git branch that is used by a developer to
|
||||
identify a conceptual line of development. Since branches
|
||||
are very easy and inexpensive, it is often desirable to
|
||||
have several small branches that each contain very well
|
||||
defined concepts or small incremental yet related changes.
|
||||
[[def_tag]]tag::
|
||||
A <<def_ref,ref>> pointing to a <<def_tag,tag>> or
|
||||
<<def_commit_object,commit object>>. In contrast to a <<def_head,head>>,
|
||||
a tag is not changed by a <<def_commit,commit>>. Tags (not
|
||||
<<def_tag_object,tag objects>>) are stored in `$GIT_DIR/refs/tags/`. A
|
||||
git tag has nothing to do with a Lisp tag (which would be
|
||||
called an <<def_object_type,object type>> in git's context). A
|
||||
tag is most typically used to mark a particular point in the
|
||||
<<def_commit,commit>> ancestry <<def_chain,chain>>.
|
||||
|
||||
tracking branch::
|
||||
A regular git branch that is used to follow changes from
|
||||
another repository. A tracking branch should not contain
|
||||
direct modifications or have local commits made to it.
|
||||
A tracking branch can usually be identified as the
|
||||
right-hand-side ref in a Pull: refspec.
|
||||
[[def_tag_object]]tag object::
|
||||
An <<def_object,object>> containing a <<def_ref,ref>> pointing to
|
||||
another <<def_object,object>>, which can contain a message just like a
|
||||
<<def_commit_object,commit object>>. It can also contain a (PGP)
|
||||
signature, in which case it is called a "signed <<def_tag_object,tag
|
||||
object>>".
|
||||
|
||||
tree object::
|
||||
An object containing a list of file names and modes along with refs
|
||||
to the associated blob and/or tree objects. A tree is equivalent
|
||||
to a directory.
|
||||
[[def_topic_branch]]topic branch::
|
||||
A regular git <<def_branch,branch>> that is used by a developer to
|
||||
identify a conceptual line of development. Since branches are very easy
|
||||
and inexpensive, it is often desirable to have several small branches
|
||||
that each contain very well defined concepts or small incremental yet
|
||||
related changes.
|
||||
|
||||
tree::
|
||||
Either a working tree, or a tree object together with the
|
||||
dependent blob and tree objects (i.e. a stored representation
|
||||
of a working tree).
|
||||
[[def_tracking_branch]]tracking branch::
|
||||
A regular git <<def_branch,branch>> that is used to follow changes from
|
||||
another <<def_repository,repository>>. A <<def_tracking_branch,tracking
|
||||
branch>> should not contain direct modifications or have local commits
|
||||
made to it. A <<def_tracking_branch,tracking branch>> can usually be
|
||||
identified as the right-hand-side <<def_ref,ref>> in a Pull:
|
||||
<<def_refspec,refspec>>.
|
||||
|
||||
tree-ish::
|
||||
A ref pointing to either a commit object, a tree object, or a
|
||||
tag object pointing to a tag or commit or tree object.
|
||||
[[def_tree]]tree::
|
||||
Either a <<def_working_tree,working tree>>, or a <<def_tree_object,tree
|
||||
object>> together with the dependent blob and <<def_tree,tree>> objects
|
||||
(i.e. a stored representation of a <<def_working_tree,working tree>>).
|
||||
|
||||
tag object::
|
||||
An object containing a ref pointing to another object, which can
|
||||
contain a message just like a commit object. It can also
|
||||
contain a (PGP) signature, in which case it is called a "signed
|
||||
tag object".
|
||||
[[def_tree_object]]tree object::
|
||||
An <<def_object,object>> containing a list of file names and modes along
|
||||
with refs to the associated blob and/or tree objects. A
|
||||
<<def_tree,tree>> is equivalent to a <<def_directory,directory>>.
|
||||
|
||||
tag::
|
||||
A ref pointing to a tag or commit object. In contrast to a head,
|
||||
a tag is not changed by a commit. Tags (not tag objects) are
|
||||
stored in `$GIT_DIR/refs/tags/`. A git tag has nothing to do with
|
||||
a Lisp tag (which is called object type in git's context).
|
||||
A tag is most typically used to mark a particular point in the
|
||||
commit ancestry chain.
|
||||
[[def_tree-ish]]tree-ish::
|
||||
A <<def_ref,ref>> pointing to either a <<def_commit_object,commit
|
||||
object>>, a <<def_tree_object,tree object>>, or a <<def_tag_object,tag
|
||||
object>> pointing to a <<def_tag,tag>> or <<def_commit,commit>> or
|
||||
<<def_tree_object,tree object>>.
|
||||
|
||||
unmerged index::
|
||||
An index which contains unmerged index entries.
|
||||
[[def_unmerged_index]]unmerged index::
|
||||
An <<def_index,index>> which contains unmerged
|
||||
<<def_index_entry,index entries>>.
|
||||
|
||||
working tree::
|
||||
The set of files and directories currently being worked on,
|
||||
i.e. you can work in your working tree without using git at all.
|
||||
[[def_unreachable_object]]unreachable object::
|
||||
An <<def_object,object>> which is not <<def_reachable,reachable>> from a
|
||||
<<def_branch,branch>>, <<def_tag,tag>>, or any other reference.
|
||||
|
||||
[[def_working_tree]]working tree::
|
||||
The set of files and directories currently being worked on, i.e. you can
|
||||
work in your <<def_working_tree,working tree>> without using git at all.
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
T="$1"
|
||||
|
||||
for h in *.html *.txt howto/*.txt howto/*.html RelNotes-*.txt
|
||||
for h in *.html *.txt howto/*.txt howto/*.html RelNotes-*.txt *.css
|
||||
do
|
||||
if test -f "$T/$h" &&
|
||||
diff -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h"
|
||||
|
@ -1,69 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
%terms=();
|
||||
|
||||
while(<>) {
|
||||
if(/^(\S.*)::$/) {
|
||||
my $term=$1;
|
||||
if(defined($terms{$term})) {
|
||||
die "$1 defined twice\n";
|
||||
}
|
||||
$terms{$term}="";
|
||||
LOOP: while(<>) {
|
||||
if(/^$/) {
|
||||
last LOOP;
|
||||
}
|
||||
if(/^ \S/) {
|
||||
$terms{$term}.=$_;
|
||||
} else {
|
||||
die "Error 1: $_";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub format_tab_80 ($) {
|
||||
my $text=$_[0];
|
||||
my $result="";
|
||||
$text=~s/\s+/ /g;
|
||||
$text=~s/^\s+//;
|
||||
while($text=~/^(.{1,72})(|\s+(\S.*)?)$/) {
|
||||
$result.=" ".$1."\n";
|
||||
$text=$3;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub no_spaces ($) {
|
||||
my $result=$_[0];
|
||||
$result=~tr/ /_/;
|
||||
return $result;
|
||||
}
|
||||
|
||||
print 'GIT Glossary
|
||||
============
|
||||
|
||||
This list is sorted alphabetically:
|
||||
|
||||
';
|
||||
|
||||
@keys=sort {uc($a) cmp uc($b)} keys %terms;
|
||||
$pattern='(\b(?<!link:git-)'.join('\b|\b(?<!link:git-)',reverse @keys).'\b)';
|
||||
foreach $key (@keys) {
|
||||
$terms{$key}=~s/$pattern/sprintf "<<ref_".no_spaces($1).",$1>>";/eg;
|
||||
print '[[ref_'.no_spaces($key).']]'.$key."::\n"
|
||||
.format_tab_80($terms{$key})."\n";
|
||||
}
|
||||
|
||||
print '
|
||||
|
||||
Author
|
||||
------
|
||||
Written by Johannes Schindelin <Johannes.Schindelin@gmx.de> and
|
||||
the git-list <git@vger.kernel.org>.
|
||||
|
||||
GIT
|
||||
---
|
||||
Part of the link:git.html[git] suite
|
||||
';
|
||||
|
@ -21,11 +21,11 @@ GIT pack format
|
||||
which looks like this:
|
||||
|
||||
(undeltified representation)
|
||||
n-byte type and length (4-bit type, (n-1)*7+4-bit length)
|
||||
n-byte type and length (3-bit type, (n-1)*7+4-bit length)
|
||||
compressed data
|
||||
|
||||
(deltified representation)
|
||||
n-byte type and length (4-bit type, (n-1)*7+4-bit length)
|
||||
n-byte type and length (3-bit type, (n-1)*7+4-bit length)
|
||||
20-byte base object name
|
||||
compressed delta data
|
||||
|
||||
@ -102,11 +102,13 @@ trailer | | packfile checksum |
|
||||
Pack file entry: <+
|
||||
|
||||
packed object header:
|
||||
1-byte type (upper 4-bit)
|
||||
1-byte size extension bit (MSB)
|
||||
type (next 3 bit)
|
||||
size0 (lower 4-bit)
|
||||
n-byte sizeN (as long as MSB is set, each 7-bit)
|
||||
size0..sizeN form 4+7+7+..+7 bit integer, size0
|
||||
is the most significant part.
|
||||
is the least significant part, and sizeN is the
|
||||
most significant part.
|
||||
packed object data:
|
||||
If it is not DELTA, then deflated bytes (the size above
|
||||
is the size before compression).
|
||||
|
@ -2,7 +2,7 @@ Git User's Manual
|
||||
_________________
|
||||
|
||||
This manual is designed to be readable by someone with basic unix
|
||||
commandline skills, but no previous knowledge of git.
|
||||
command-line skills, but no previous knowledge of git.
|
||||
|
||||
Chapter 1 gives a brief overview of git commands, without any
|
||||
explanation; you may prefer to skip to chapter 2 on a first reading.
|
||||
@ -288,21 +288,22 @@ collection of files. It stores the history as a compressed
|
||||
collection of interrelated snapshots (versions) of the project's
|
||||
contents.
|
||||
|
||||
A single git repository may contain multiple branches. Each branch
|
||||
is a bookmark referencing a particular point in the project history.
|
||||
The gitlink:git-branch[1] command shows you the list of branches:
|
||||
A single git repository may contain multiple branches. It keeps track
|
||||
of them by keeping a list of <<def_head,heads>> which reference the
|
||||
latest version on each branch; the gitlink:git-branch[1] command shows
|
||||
you the list of branch heads:
|
||||
|
||||
------------------------------------------------
|
||||
$ git branch
|
||||
* master
|
||||
------------------------------------------------
|
||||
|
||||
A freshly cloned repository contains a single branch, named "master",
|
||||
and the working directory contains the version of the project
|
||||
referred to by the master branch.
|
||||
A freshly cloned repository contains a single branch head, named
|
||||
"master", and working directory is initialized to the state of
|
||||
the project referred to by "master".
|
||||
|
||||
Most projects also use tags. Tags, like branches, are references
|
||||
into the project's history, and can be listed using the
|
||||
Most projects also use <<def_tag,tags>>. Tags, like heads, are
|
||||
references into the project's history, and can be listed using the
|
||||
gitlink:git-tag[1] command:
|
||||
|
||||
------------------------------------------------
|
||||
@ -320,9 +321,9 @@ v2.6.13
|
||||
------------------------------------------------
|
||||
|
||||
Tags are expected to always point at the same version of a project,
|
||||
while branches are expected to advance as development progresses.
|
||||
while heads are expected to advance as development progresses.
|
||||
|
||||
Create a new branch pointing to one of these versions and check it
|
||||
Create a new branch head pointing to one of these versions and check it
|
||||
out using gitlink:git-checkout[1]:
|
||||
|
||||
------------------------------------------------
|
||||
@ -346,10 +347,10 @@ the current branch to point at v2.6.17 instead, with
|
||||
$ git reset --hard v2.6.17
|
||||
------------------------------------------------
|
||||
|
||||
Note that if the current branch was your only reference to a
|
||||
Note that if the current branch head was your only reference to a
|
||||
particular point in history, then resetting that branch may leave you
|
||||
with no way to find the history it used to point to; so use this
|
||||
command carefully.
|
||||
with no way to find the history it used to point to; so use this command
|
||||
carefully.
|
||||
|
||||
Understanding History: Commits
|
||||
------------------------------
|
||||
@ -391,15 +392,20 @@ index 8be626f..d7aac9d 100644
|
||||
As you can see, a commit shows who made the latest change, what they
|
||||
did, and why.
|
||||
|
||||
Every commit has a 40-hexdigit id, sometimes called the "object name"
|
||||
or the "SHA1 id", shown on the first line of the "git show" output.
|
||||
You can usually refer to a commit by a shorter name, such as a tag or a
|
||||
branch name, but this longer name can also be useful. Most
|
||||
importantly, it is a globally unique name for this commit: so if you
|
||||
tell somebody else the object name (for example in email), then you are
|
||||
guaranteed that name will refer to the same commit in their repository
|
||||
that it does in yours (assuming their repository has that commit at
|
||||
all).
|
||||
Every commit has a 40-hexdigit id, sometimes called the "object name" or the
|
||||
"SHA1 id", shown on the first line of the "git show" output. You can usually
|
||||
refer to a commit by a shorter name, such as a tag or a branch name, but this
|
||||
longer name can also be useful. Most importantly, it is a globally unique
|
||||
name for this commit: so if you tell somebody else the object name (for
|
||||
example in email), then you are guaranteed that name will refer to the same
|
||||
commit in their repository that it does in yours (assuming their repository
|
||||
has that commit at all). Since the object name is computed as a hash over the
|
||||
contents of the commit, you are guaranteed that the commit can never change
|
||||
without its name also changing.
|
||||
|
||||
In fact, in <<git-internals>> we shall see that everything stored in git
|
||||
history, including file data and directory contents, is stored in an object
|
||||
with a name that is a hash of its contents.
|
||||
|
||||
Understanding history: commits, parents, and reachability
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -432,11 +438,14 @@ We will sometimes represent git history using diagrams like the one
|
||||
below. Commits are shown as "o", and the links between them with
|
||||
lines drawn with - / and \. Time goes left to right:
|
||||
|
||||
|
||||
................................................
|
||||
o--o--o <-- Branch A
|
||||
/
|
||||
o--o--o <-- master
|
||||
\
|
||||
o--o--o <-- Branch B
|
||||
................................................
|
||||
|
||||
If we need to talk about a particular commit, the character "o" may
|
||||
be replaced with another letter or number.
|
||||
@ -444,17 +453,15 @@ be replaced with another letter or number.
|
||||
Understanding history: What is a branch?
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Though we've been using the word "branch" to mean a kind of reference
|
||||
to a particular commit, the word branch is also commonly used to
|
||||
refer to the line of commits leading up to that point. In the
|
||||
example above, git may think of the branch named "A" as just a
|
||||
pointer to one particular commit, but we may refer informally to the
|
||||
line of three commits leading up to that point as all being part of
|
||||
When we need to be precise, we will use the word "branch" to mean a line
|
||||
of development, and "branch head" (or just "head") to mean a reference
|
||||
to the most recent commit on a branch. In the example above, the branch
|
||||
head named "A" is a pointer to one particular commit, but we refer to
|
||||
the line of three commits leading up to that point as all being part of
|
||||
"branch A".
|
||||
|
||||
If we need to make it clear that we're just talking about the most
|
||||
recent commit on the branch, we may refer to that commit as the
|
||||
"head" of the branch.
|
||||
However, when no confusion will result, we often just use the term
|
||||
"branch" both for branches and for branch heads.
|
||||
|
||||
Manipulating branches
|
||||
---------------------
|
||||
@ -596,8 +603,8 @@ a new stanza:
|
||||
$ cat .git/config
|
||||
...
|
||||
[remote "linux-nfs"]
|
||||
url = git://linux-nfs.org/~bfields/git.git
|
||||
fetch = +refs/heads/*:refs/remotes/linux-nfs-read/*
|
||||
url = git://linux-nfs.org/pub/nfs-2.6.git
|
||||
fetch = +refs/heads/*:refs/remotes/linux-nfs/*
|
||||
...
|
||||
-------------------------------------------------
|
||||
|
||||
@ -1128,17 +1135,9 @@ modified in two different ways in the remote branch and the local
|
||||
branch--then you are warned; the output may look something like this:
|
||||
|
||||
-------------------------------------------------
|
||||
$ git pull . next
|
||||
Trying really trivial in-index merge...
|
||||
fatal: Merge requires file-level merging
|
||||
Nope.
|
||||
Merging HEAD with 77976da35a11db4580b80ae27e8d65caf5208086
|
||||
Merging:
|
||||
15e2162 world
|
||||
77976da goodbye
|
||||
found 1 common ancestor(s):
|
||||
d122ed4 initial
|
||||
Auto-merging file.txt
|
||||
$ git merge next
|
||||
100% (4/4) done
|
||||
Auto-merged file.txt
|
||||
CONFLICT (content): Merge conflict in file.txt
|
||||
Automatic merge failed; fix conflicts and then commit the result.
|
||||
-------------------------------------------------
|
||||
@ -1163,18 +1162,46 @@ the working tree in a special state that gives you all the
|
||||
information you need to help resolve the merge.
|
||||
|
||||
Files with conflicts are marked specially in the index, so until you
|
||||
resolve the problem and update the index, git commit will fail:
|
||||
resolve the problem and update the index, gitlink:git-commit[1] will
|
||||
fail:
|
||||
|
||||
-------------------------------------------------
|
||||
$ git commit
|
||||
file.txt: needs merge
|
||||
-------------------------------------------------
|
||||
|
||||
Also, git status will list those files as "unmerged".
|
||||
Also, gitlink:git-status[1] will list those files as "unmerged", and the
|
||||
files with conflicts will have conflict markers added, like this:
|
||||
|
||||
-------------------------------------------------
|
||||
<<<<<<< HEAD:file.txt
|
||||
Hello world
|
||||
=======
|
||||
Goodbye
|
||||
>>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:file.txt
|
||||
-------------------------------------------------
|
||||
|
||||
All you need to do is edit the files to resolve the conflicts, and then
|
||||
|
||||
-------------------------------------------------
|
||||
$ git add file.txt
|
||||
$ git commit
|
||||
-------------------------------------------------
|
||||
|
||||
Note that the commit message will already be filled in for you with
|
||||
some information about the merge. Normally you can just use this
|
||||
default message unchanged, but you may add additional commentary of
|
||||
your own if desired.
|
||||
|
||||
The above is all you need to know to resolve a simple merge. But git
|
||||
also provides more information to help resolve conflicts:
|
||||
|
||||
Getting conflict-resolution help during a merge
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
All of the changes that git was able to merge automatically are
|
||||
already added to the index file, so gitlink:git-diff[1] shows only
|
||||
the conflicts. Also, it uses a somewhat unusual syntax:
|
||||
the conflicts. It uses an unusual syntax:
|
||||
|
||||
-------------------------------------------------
|
||||
$ git diff
|
||||
@ -1195,14 +1222,32 @@ conflict will have two parents instead of the usual one: one parent
|
||||
will be HEAD, the tip of the current branch; the other will be the
|
||||
tip of the other branch, which is stored temporarily in MERGE_HEAD.
|
||||
|
||||
The diff above shows the differences between the working-tree version
|
||||
of file.txt and two previous version: one version from HEAD, and one
|
||||
from MERGE_HEAD. So instead of preceding each line by a single "+"
|
||||
or "-", it now uses two columns: the first column is used for
|
||||
differences between the first parent and the working directory copy,
|
||||
and the second for differences between the second parent and the
|
||||
working directory copy. Thus after resolving the conflict in the
|
||||
obvious way, the diff will look like:
|
||||
During the merge, the index holds three versions of each file. Each of
|
||||
these three "file stages" represents a different version of the file:
|
||||
|
||||
-------------------------------------------------
|
||||
$ git show :1:file.txt # the file in a common ancestor of both branches
|
||||
$ git show :2:file.txt # the version from HEAD, but including any
|
||||
# nonconflicting changes from MERGE_HEAD
|
||||
$ git show :3:file.txt # the version from MERGE_HEAD, but including any
|
||||
# nonconflicting changes from HEAD.
|
||||
-------------------------------------------------
|
||||
|
||||
Since the stage 2 and stage 3 versions have already been updated with
|
||||
nonconflicting changes, the only remaining differences between them are
|
||||
the important ones; thus gitlink:git-diff[1] can use the information in
|
||||
the index to show only those conflicts.
|
||||
|
||||
The diff above shows the differences between the working-tree version of
|
||||
file.txt and the stage 2 and stage 3 versions. So instead of preceding
|
||||
each line by a single "+" or "-", it now uses two columns: the first
|
||||
column is used for differences between the first parent and the working
|
||||
directory copy, and the second for differences between the second parent
|
||||
and the working directory copy. (See the "COMBINED DIFF FORMAT" section
|
||||
of gitlink:git-diff-files[1] for a details of the format.)
|
||||
|
||||
After resolving the conflict in the obvious way (but before updating the
|
||||
index), the diff will look like:
|
||||
|
||||
-------------------------------------------------
|
||||
$ git diff
|
||||
@ -1220,26 +1265,37 @@ This shows that our resolved version deleted "Hello world" from the
|
||||
first parent, deleted "Goodbye" from the second parent, and added
|
||||
"Goodbye world", which was previously absent from both.
|
||||
|
||||
The gitlink:git-log[1] command also provides special help for merges:
|
||||
Some special diff options allow diffing the working directory against
|
||||
any of these stages:
|
||||
|
||||
-------------------------------------------------
|
||||
$ git diff -1 file.txt # diff against stage 1
|
||||
$ git diff --base file.txt # same as the above
|
||||
$ git diff -2 file.txt # diff against stage 2
|
||||
$ git diff --ours file.txt # same as the above
|
||||
$ git diff -3 file.txt # diff against stage 3
|
||||
$ git diff --theirs file.txt # same as the above.
|
||||
-------------------------------------------------
|
||||
|
||||
The gitlink:git-log[1] and gitk[1] commands also provide special help
|
||||
for merges:
|
||||
|
||||
-------------------------------------------------
|
||||
$ git log --merge
|
||||
$ gitk --merge
|
||||
-------------------------------------------------
|
||||
|
||||
This will list all commits which exist only on HEAD or on MERGE_HEAD,
|
||||
and which touch an unmerged file.
|
||||
These will display all commits which exist only on HEAD or on
|
||||
MERGE_HEAD, and which touch an unmerged file.
|
||||
|
||||
We can now add the resolved version to the index and commit:
|
||||
Each time you resolve the conflicts in a file and update the index:
|
||||
|
||||
-------------------------------------------------
|
||||
$ git add file.txt
|
||||
$ git commit
|
||||
-------------------------------------------------
|
||||
|
||||
Note that the commit message will already be filled in for you with
|
||||
some information about the merge. Normally you can just use this
|
||||
default message unchanged, but you may add additional commentary of
|
||||
your own if desired.
|
||||
the different stages of that file will be "collapsed", after which
|
||||
git-diff will (by default) no longer show diffs for that file.
|
||||
|
||||
[[undoing-a-merge]]
|
||||
undoing a merge
|
||||
@ -1255,7 +1311,7 @@ $ git reset --hard HEAD
|
||||
Or, if you've already commited the merge that you want to throw away,
|
||||
|
||||
-------------------------------------------------
|
||||
$ git reset --hard HEAD^
|
||||
$ git reset --hard ORIG_HEAD
|
||||
-------------------------------------------------
|
||||
|
||||
However, this last command can be dangerous in some cases--never
|
||||
@ -1328,6 +1384,7 @@ with the changes to be reverted, then you will be asked to fix
|
||||
conflicts manually, just as in the case of <<resolving-a-merge,
|
||||
resolving a merge>>.
|
||||
|
||||
[[fixing-a-mistake-by-editing-history]]
|
||||
Fixing a mistake by editing history
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -1376,7 +1433,7 @@ modifying the working directory, you can do that with
|
||||
gitlink:git-show[1]:
|
||||
|
||||
-------------------------------------------------
|
||||
$ git show HEAD^ path/to/file
|
||||
$ git show HEAD^:path/to/file
|
||||
-------------------------------------------------
|
||||
|
||||
which will display the given version of the file.
|
||||
@ -1479,7 +1536,7 @@ Examining dangling objects
|
||||
|
||||
In some situations the reflog may not be able to save you. For
|
||||
example, suppose you delete a branch, then realize you need the history
|
||||
it pointed you. The reflog is also deleted; however, if you have not
|
||||
it contained. The reflog is also deleted; however, if you have not
|
||||
yet pruned the repository, then you may still be able to find
|
||||
the lost commits; run git-fsck and watch for output that mentions
|
||||
"dangling commits":
|
||||
@ -1505,7 +1562,7 @@ history that is described by all your existing branches and tags. Thus
|
||||
you get exactly the history reachable from that commit that is lost.
|
||||
(And notice that it might not be just one commit: we only report the
|
||||
"tip of the line" as being dangling, but there might be a whole deep
|
||||
and complex commit history that was gotten dropped.)
|
||||
and complex commit history that was dropped.)
|
||||
|
||||
If you decide you want the history back, you can always create a new
|
||||
reference pointing to it, for example, a new branch:
|
||||
@ -1561,7 +1618,7 @@ repository that you pulled from.
|
||||
|
||||
(But note that no such commit will be created in the case of a
|
||||
<<fast-forwards,fast forward>>; instead, your branch will just be
|
||||
updated to point to the latest commit from the upstream branch).
|
||||
updated to point to the latest commit from the upstream branch.)
|
||||
|
||||
The git-pull command can also be given "." as the "remote" repository,
|
||||
in which case it just merges in a branch from the current repository; so
|
||||
@ -1638,9 +1695,9 @@ updates with git pull>>".
|
||||
|
||||
If you and maintainer both have accounts on the same machine, then
|
||||
then you can just pull changes from each other's repositories
|
||||
directly; note that all of the command (gitlink:git-clone[1],
|
||||
git-fetch[1], git-pull[1], etc.) which accept a URL as an argument
|
||||
will also accept a local file patch; so, for example, you can
|
||||
directly; note that all of the commands (gitlink:git-clone[1],
|
||||
git-fetch[1], git-pull[1], etc.) that accept a URL as an argument
|
||||
will also accept a local directory name; so, for example, you can
|
||||
use
|
||||
|
||||
-------------------------------------------------
|
||||
@ -1832,7 +1889,7 @@ that makes it easy for them to read your changes, verify that they are
|
||||
correct, and understand why you made each change.
|
||||
|
||||
If you present all of your changes as a single patch (or commit), they
|
||||
may find it is too much to digest all at once.
|
||||
may find that it is too much to digest all at once.
|
||||
|
||||
If you present them with the entire history of your work, complete with
|
||||
mistakes, corrections, and dead ends, they may be overwhelmed.
|
||||
@ -1858,11 +1915,8 @@ you are rewriting history.
|
||||
Keeping a patch series up to date using git-rebase
|
||||
--------------------------------------------------
|
||||
|
||||
Suppose you have a series of commits in a branch "mywork", which
|
||||
originally branched off from "origin".
|
||||
|
||||
Suppose you create a branch "mywork" on a remote-tracking branch
|
||||
"origin", and created some commits on top of it:
|
||||
Suppose that you create a branch "mywork" on a remote-tracking branch
|
||||
"origin", and create some commits on top of it:
|
||||
|
||||
-------------------------------------------------
|
||||
$ git checkout -b mywork origin
|
||||
@ -1876,25 +1930,29 @@ $ git commit
|
||||
You have performed no merges into mywork, so it is just a simple linear
|
||||
sequence of patches on top of "origin":
|
||||
|
||||
|
||||
................................................
|
||||
o--o--o <-- origin
|
||||
\
|
||||
o--o--o <-- mywork
|
||||
................................................
|
||||
|
||||
Some more interesting work has been done in the upstream project, and
|
||||
"origin" has advanced:
|
||||
|
||||
................................................
|
||||
o--o--O--o--o--o <-- origin
|
||||
\
|
||||
a--b--c <-- mywork
|
||||
................................................
|
||||
|
||||
At this point, you could use "pull" to merge your changes back in;
|
||||
the result would create a new merge commit, like this:
|
||||
|
||||
|
||||
................................................
|
||||
o--o--O--o--o--o <-- origin
|
||||
\ \
|
||||
a--b--c--m <-- mywork
|
||||
................................................
|
||||
|
||||
However, if you prefer to keep the history in mywork a simple series of
|
||||
commits without any merges, you may instead choose to use
|
||||
@ -1911,9 +1969,11 @@ point at the latest version of origin, then apply each of the saved
|
||||
patches to the new mywork. The result will look like:
|
||||
|
||||
|
||||
................................................
|
||||
o--o--O--o--o--o <-- origin
|
||||
\
|
||||
a'--b'--c' <-- mywork
|
||||
................................................
|
||||
|
||||
In the process, it may discover conflicts. In that case it will stop
|
||||
and allow you to fix the conflicts; after fixing conflicts, use "git
|
||||
@ -1933,6 +1993,51 @@ return mywork to the state it had before you started the rebase:
|
||||
$ git rebase --abort
|
||||
-------------------------------------------------
|
||||
|
||||
Modifying a single commit
|
||||
-------------------------
|
||||
|
||||
We saw in <<fixing-a-mistake-by-editing-history>> that you can replace the
|
||||
most recent commit using
|
||||
|
||||
-------------------------------------------------
|
||||
$ git commit --amend
|
||||
-------------------------------------------------
|
||||
|
||||
which will replace the old commit by a new commit incorporating your
|
||||
changes, giving you a chance to edit the old commit message first.
|
||||
|
||||
You can also use a combination of this and gitlink:git-rebase[1] to edit
|
||||
commits further back in your history. First, tag the problematic commit with
|
||||
|
||||
-------------------------------------------------
|
||||
$ git tag bad mywork~5
|
||||
-------------------------------------------------
|
||||
|
||||
(Either gitk or git-log may be useful for finding the commit.)
|
||||
|
||||
Then check out a new branch at that commit, edit it, and rebase the rest of
|
||||
the series on top of it:
|
||||
|
||||
-------------------------------------------------
|
||||
$ git checkout -b TMP bad
|
||||
$ # make changes here and update the index
|
||||
$ git commit --amend
|
||||
$ git rebase --onto TMP bad mywork
|
||||
-------------------------------------------------
|
||||
|
||||
When you're done, you'll be left with mywork checked out, with the top patches
|
||||
on mywork reapplied on top of the modified commit you created in TMP. You can
|
||||
then clean up with
|
||||
|
||||
-------------------------------------------------
|
||||
$ git branch -d TMP
|
||||
$ git tag -d bad
|
||||
-------------------------------------------------
|
||||
|
||||
Note that the immutable nature of git history means that you haven't really
|
||||
"modified" existing commits; instead, you have replaced the old commits with
|
||||
new commits having new object names.
|
||||
|
||||
Reordering or selecting from a patch series
|
||||
-------------------------------------------
|
||||
|
||||
@ -1966,7 +2071,7 @@ Other tools
|
||||
-----------
|
||||
|
||||
There are numerous other tools, such as stgit, which exist for the
|
||||
purpose of maintaining a patch series. These are out of the scope of
|
||||
purpose of maintaining a patch series. These are outside of the scope of
|
||||
this manual.
|
||||
|
||||
Problems with rewriting history
|
||||
@ -1976,24 +2081,30 @@ The primary problem with rewriting the history of a branch has to do
|
||||
with merging. Suppose somebody fetches your branch and merges it into
|
||||
their branch, with a result something like this:
|
||||
|
||||
................................................
|
||||
o--o--O--o--o--o <-- origin
|
||||
\ \
|
||||
t--t--t--m <-- their branch:
|
||||
................................................
|
||||
|
||||
Then suppose you modify the last three commits:
|
||||
|
||||
................................................
|
||||
o--o--o <-- new head of origin
|
||||
/
|
||||
o--o--O--o--o--o <-- old head of origin
|
||||
................................................
|
||||
|
||||
If we examined all this history together in one repository, it will
|
||||
look like:
|
||||
|
||||
................................................
|
||||
o--o--o <-- new head of origin
|
||||
/
|
||||
o--o--O--o--o--o <-- old head of origin
|
||||
\ \
|
||||
t--t--t--m <-- their branch:
|
||||
................................................
|
||||
|
||||
Git has no way of knowing that the new head is an updated version of
|
||||
the old head; it treats this situation exactly the same as it would if
|
||||
@ -2054,9 +2165,11 @@ commit. Git calls this process a "fast forward".
|
||||
|
||||
A fast forward looks something like this:
|
||||
|
||||
................................................
|
||||
o--o--o--o <-- old head of the branch
|
||||
\
|
||||
o--o--o <-- new head of the branch
|
||||
................................................
|
||||
|
||||
|
||||
In some cases it is possible that the new head will *not* actually be
|
||||
@ -2064,11 +2177,11 @@ a descendant of the old head. For example, the developer may have
|
||||
realized she made a serious mistake, and decided to backtrack,
|
||||
resulting in a situation like:
|
||||
|
||||
................................................
|
||||
o--o--o--o--a--b <-- old head of the branch
|
||||
\
|
||||
o--o--o <-- new head of the branch
|
||||
|
||||
|
||||
................................................
|
||||
|
||||
In this case, "git fetch" will fail, and print out a warning.
|
||||
|
||||
@ -2088,7 +2201,7 @@ descendant of the old head, you may force the update with:
|
||||
$ git fetch git://example.com/proj.git +master:refs/remotes/example/master
|
||||
-------------------------------------------------
|
||||
|
||||
Note the addition of the "+" sign. Be aware that commits which the
|
||||
Note the addition of the "+" sign. Be aware that commits that the
|
||||
old version of example/master pointed at may be lost, as we saw in
|
||||
the previous section.
|
||||
|
||||
@ -2096,7 +2209,7 @@ Configuring remote branches
|
||||
---------------------------
|
||||
|
||||
We saw above that "origin" is just a shortcut to refer to the
|
||||
repository which you originally cloned from. This information is
|
||||
repository that you originally cloned from. This information is
|
||||
stored in git configuration variables, which you can see using
|
||||
gitlink:git-config[1]:
|
||||
|
||||
@ -2158,6 +2271,7 @@ See gitlink:git-config[1] for more details on the configuration
|
||||
options mentioned above.
|
||||
|
||||
|
||||
[[git-internals]]
|
||||
Git internals
|
||||
=============
|
||||
|
||||
@ -2407,7 +2521,7 @@ conflicts between different tree objects, allowing each pathname to be
|
||||
associated with sufficient information about the trees involved that
|
||||
you can create a three-way merge between them.'
|
||||
|
||||
Those are the three ONLY things that the directory cache does. It's a
|
||||
Those are the ONLY three things that the directory cache does. It's a
|
||||
cache, and the normal operation is to re-generate it completely from a
|
||||
known tree object, or update/compare it with a live tree that is being
|
||||
developed. If you blow the directory cache away entirely, you generally
|
||||
@ -2898,9 +3012,6 @@ confusing and scary messages, but it won't actually do anything bad. In
|
||||
contrast, running "git prune" while somebody is actively changing the
|
||||
repository is a *BAD* idea).
|
||||
|
||||
Glossary of git terms
|
||||
=====================
|
||||
|
||||
include::glossary.txt[]
|
||||
|
||||
Notes and todo list for this manual
|
||||
@ -2939,11 +3050,6 @@ provides.
|
||||
Simplify beginning by suggesting disconnected head instead of
|
||||
temporary branch creation?
|
||||
|
||||
Explain how to refer to file stages in the "how to resolve a merge"
|
||||
section: diff -1, -2, -3, --ours, --theirs :1:/path notation. The
|
||||
"git ls-files --unmerged --stage" thing is sorta useful too,
|
||||
actually. And note gitk --merge.
|
||||
|
||||
Add more good examples. Entire sections of just cookbook examples
|
||||
might be a good idea; maybe make an "advanced examples" section a
|
||||
standard end-of-chapter section?
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
GVF=GIT-VERSION-FILE
|
||||
DEF_VER=v1.5.0.1.GIT
|
||||
DEF_VER=v1.5.0.6.GIT
|
||||
|
||||
LF='
|
||||
'
|
||||
|
23
Makefile
23
Makefile
@ -28,6 +28,10 @@ all::
|
||||
#
|
||||
# Define NO_STRLCPY if you don't have strlcpy.
|
||||
#
|
||||
# Define NO_STRTOUMAX if you don't have strtoumax in the C library.
|
||||
# If your compiler also does not support long long or does not have
|
||||
# strtoull, define NO_STRTOULL.
|
||||
#
|
||||
# Define NO_SETENV if you don't have setenv in the C library.
|
||||
#
|
||||
# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
|
||||
@ -85,6 +89,9 @@ all::
|
||||
#
|
||||
# Define NO_ICONV if your libc does not properly support iconv.
|
||||
#
|
||||
# Define OLD_ICONV if your library has an old iconv(), where the second
|
||||
# (input buffer pointer) parameter is declared with type (const char **).
|
||||
#
|
||||
# Define NO_R_TO_GCC if your gcc does not like "-R/path/lib" that
|
||||
# tells runtime paths to dynamic libraries; "-Wl,-rpath=/path/lib"
|
||||
# is used instead.
|
||||
@ -353,11 +360,13 @@ ifeq ($(uname_S),SunOS)
|
||||
NO_UNSETENV = YesPlease
|
||||
NO_SETENV = YesPlease
|
||||
NO_C99_FORMAT = YesPlease
|
||||
NO_STRTOUMAX = YesPlease
|
||||
endif
|
||||
ifeq ($(uname_R),5.9)
|
||||
NO_UNSETENV = YesPlease
|
||||
NO_SETENV = YesPlease
|
||||
NO_C99_FORMAT = YesPlease
|
||||
NO_STRTOUMAX = YesPlease
|
||||
endif
|
||||
INSTALL = ginstall
|
||||
TAR = gtar
|
||||
@ -369,7 +378,6 @@ ifeq ($(uname_O),Cygwin)
|
||||
NO_STRCASESTR = YesPlease
|
||||
NO_SYMLINK_HEAD = YesPlease
|
||||
NEEDS_LIBICONV = YesPlease
|
||||
NO_C99_FORMAT = YesPlease
|
||||
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
|
||||
NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
|
||||
# There are conflicting reports about this.
|
||||
@ -517,6 +525,13 @@ ifdef NO_STRLCPY
|
||||
COMPAT_CFLAGS += -DNO_STRLCPY
|
||||
COMPAT_OBJS += compat/strlcpy.o
|
||||
endif
|
||||
ifdef NO_STRTOUMAX
|
||||
COMPAT_CFLAGS += -DNO_STRTOUMAX
|
||||
COMPAT_OBJS += compat/strtoumax.o
|
||||
endif
|
||||
ifdef NO_STRTOULL
|
||||
COMPAT_CFLAGS += -DNO_STRTOULL
|
||||
endif
|
||||
ifdef NO_SETENV
|
||||
COMPAT_CFLAGS += -DNO_SETENV
|
||||
COMPAT_OBJS += compat/setenv.o
|
||||
@ -560,6 +575,10 @@ ifdef NO_ICONV
|
||||
BASIC_CFLAGS += -DNO_ICONV
|
||||
endif
|
||||
|
||||
ifdef OLD_ICONV
|
||||
BASIC_CFLAGS += -DOLD_ICONV
|
||||
endif
|
||||
|
||||
ifdef PPC_SHA1
|
||||
SHA1_HEADER = "ppc/sha1.h"
|
||||
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
|
||||
@ -762,7 +781,7 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
|
||||
$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
|
||||
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
|
||||
|
||||
$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
|
||||
$(LIB_OBJS) $(BUILTIN_OBJS) fetch.o: $(LIB_H)
|
||||
$(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
|
||||
$(DIFF_OBJS): diffcore.h
|
||||
|
||||
|
2
RelNotes
2
RelNotes
@ -1 +1 @@
|
||||
Documentation/RelNotes-1.5.0.1.txt
|
||||
Documentation/RelNotes-1.5.0.6.txt
|
@ -1539,7 +1539,8 @@ static int apply_line(char *output, const char *patch, int plen)
|
||||
int need_fix_leading_space = 0;
|
||||
char *buf;
|
||||
|
||||
if ((new_whitespace != strip_whitespace) || !whitespace_error) {
|
||||
if ((new_whitespace != strip_whitespace) || !whitespace_error ||
|
||||
*patch != '+') {
|
||||
memcpy(output, patch + 1, plen);
|
||||
return plen;
|
||||
}
|
||||
|
@ -252,8 +252,6 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
|
||||
|
||||
memset(&ar, 0, sizeof(ar));
|
||||
tree_idx = parse_archive_args(argc, argv, &ar);
|
||||
if (prefix == NULL)
|
||||
prefix = setup_git_directory();
|
||||
|
||||
argv += tree_idx;
|
||||
parse_treeish_arg(argv, &ar.args, prefix);
|
||||
|
@ -192,7 +192,8 @@ static int builtin_diff_combined(struct rev_info *revs,
|
||||
parent = xmalloc(ents * sizeof(*parent));
|
||||
/* Again, the revs are all reverse */
|
||||
for (i = 0; i < ents; i++)
|
||||
hashcpy((unsigned char*)parent + i, ent[ents - 1 - i].item->sha1);
|
||||
hashcpy((unsigned char *)(parent + i),
|
||||
ent[ents - 1 - i].item->sha1);
|
||||
diff_tree_combined(parent[0], parent + 1, ents - 1,
|
||||
revs->dense_combined_merges, revs);
|
||||
return 0;
|
||||
|
@ -259,13 +259,15 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
|
||||
else if (!strcmp(argv[1], "--no-summary"))
|
||||
merge_summary = 0;
|
||||
else if (!strcmp(argv[1], "-F") || !strcmp(argv[1], "--file")) {
|
||||
if (argc < 2)
|
||||
if (argc < 3)
|
||||
die ("Which file?");
|
||||
if (!strcmp(argv[2], "-"))
|
||||
in = stdin;
|
||||
else {
|
||||
fclose(in);
|
||||
in = fopen(argv[2], "r");
|
||||
if (!in)
|
||||
die("cannot open %s", argv[2]);
|
||||
}
|
||||
argc--; argv++;
|
||||
} else
|
||||
|
@ -224,6 +224,9 @@ int cmd_log(int argc, const char **argv, const char *prefix)
|
||||
return cmd_log_walk(&rev);
|
||||
}
|
||||
|
||||
/* format-patch */
|
||||
#define FORMAT_PATCH_NAME_MAX 64
|
||||
|
||||
static int istitlechar(char c)
|
||||
{
|
||||
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
|
||||
@ -264,15 +267,18 @@ static int git_format_config(const char *var, const char *value)
|
||||
static FILE *realstdout = NULL;
|
||||
static const char *output_directory = NULL;
|
||||
|
||||
static void reopen_stdout(struct commit *commit, int nr, int keep_subject)
|
||||
static int reopen_stdout(struct commit *commit, int nr, int keep_subject)
|
||||
{
|
||||
char filename[1024];
|
||||
char filename[PATH_MAX];
|
||||
char *sol;
|
||||
int len = 0;
|
||||
int suffix_len = strlen(fmt_patch_suffix) + 10; /* ., NUL and slop */
|
||||
int suffix_len = strlen(fmt_patch_suffix) + 1;
|
||||
|
||||
if (output_directory) {
|
||||
strlcpy(filename, output_directory, 1000);
|
||||
if (strlen(output_directory) >=
|
||||
sizeof(filename) - FORMAT_PATCH_NAME_MAX - suffix_len)
|
||||
return error("name of output directory is too long");
|
||||
strlcpy(filename, output_directory, sizeof(filename) - suffix_len);
|
||||
len = strlen(filename);
|
||||
if (filename[len - 1] != '/')
|
||||
filename[len++] = '/';
|
||||
@ -297,6 +303,7 @@ static void reopen_stdout(struct commit *commit, int nr, int keep_subject)
|
||||
}
|
||||
|
||||
for (j = 0;
|
||||
j < FORMAT_PATCH_NAME_MAX - suffix_len - 5 &&
|
||||
len < sizeof(filename) - suffix_len &&
|
||||
sol[j] && sol[j] != '\n';
|
||||
j++) {
|
||||
@ -314,10 +321,16 @@ static void reopen_stdout(struct commit *commit, int nr, int keep_subject)
|
||||
}
|
||||
while (filename[len - 1] == '.' || filename[len - 1] == '-')
|
||||
len--;
|
||||
filename[len] = 0;
|
||||
}
|
||||
if (len + suffix_len >= sizeof(filename))
|
||||
return error("Patch pathname too long");
|
||||
strcpy(filename + len, fmt_patch_suffix);
|
||||
fprintf(realstdout, "%s\n", filename);
|
||||
freopen(filename, "w", stdout);
|
||||
if (freopen(filename, "w", stdout) == NULL)
|
||||
return error("Cannot open patch file %s",filename);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
static int get_patch_id(struct commit *commit, struct diff_options *options,
|
||||
@ -573,7 +586,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
|
||||
rev.message_id = message_id;
|
||||
}
|
||||
if (!use_stdout)
|
||||
reopen_stdout(commit, rev.nr, keep_subject);
|
||||
if (reopen_stdout(commit, rev.nr, keep_subject))
|
||||
die("Failed to create output files");
|
||||
shown = log_tree_commit(&rev, commit);
|
||||
free(commit->buffer);
|
||||
commit->buffer = NULL;
|
||||
|
@ -406,6 +406,11 @@ static int is_rfc2822_header(char *line)
|
||||
*/
|
||||
int ch;
|
||||
char *cp = line;
|
||||
|
||||
/* Count mbox From headers as headers */
|
||||
if (!memcmp(line, "From ", 5) || !memcmp(line, ">From ", 6))
|
||||
return 1;
|
||||
|
||||
while ((ch = *cp++)) {
|
||||
if (ch == ':')
|
||||
return cp != line;
|
||||
@ -417,30 +422,61 @@ static int is_rfc2822_header(char *line)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* sz is size of 'line' buffer in bytes. Must be reasonably
|
||||
* long enough to hold one physical real-world e-mail line.
|
||||
*/
|
||||
static int read_one_header_line(char *line, int sz, FILE *in)
|
||||
{
|
||||
int ofs = 0;
|
||||
while (ofs < sz) {
|
||||
int peek, len;
|
||||
if (fgets(line + ofs, sz - ofs, in) == NULL)
|
||||
break;
|
||||
len = eatspace(line + ofs);
|
||||
if ((len == 0) || !is_rfc2822_header(line)) {
|
||||
int len;
|
||||
|
||||
/*
|
||||
* We will read at most (sz-1) bytes and then potentially
|
||||
* re-add NUL after it. Accessing line[sz] after this is safe
|
||||
* and we can allow len to grow up to and including sz.
|
||||
*/
|
||||
sz--;
|
||||
|
||||
/* Get the first part of the line. */
|
||||
if (!fgets(line, sz, in))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Is it an empty line or not a valid rfc2822 header?
|
||||
* If so, stop here, and return false ("not a header")
|
||||
*/
|
||||
len = eatspace(line);
|
||||
if (!len || !is_rfc2822_header(line)) {
|
||||
/* Re-add the newline */
|
||||
line[ofs + len] = '\n';
|
||||
line[ofs + len + 1] = '\0';
|
||||
break;
|
||||
line[len] = '\n';
|
||||
line[len + 1] = '\0';
|
||||
return 0;
|
||||
}
|
||||
ofs += len;
|
||||
/* Yuck, 2822 header "folding" */
|
||||
|
||||
/*
|
||||
* Now we need to eat all the continuation lines..
|
||||
* Yuck, 2822 header "folding"
|
||||
*/
|
||||
for (;;) {
|
||||
int peek, addlen;
|
||||
static char continuation[1000];
|
||||
|
||||
peek = fgetc(in); ungetc(peek, in);
|
||||
if (peek != ' ' && peek != '\t')
|
||||
break;
|
||||
if (!fgets(continuation, sizeof(continuation), in))
|
||||
break;
|
||||
addlen = eatspace(continuation);
|
||||
if (len < sz - 1) {
|
||||
if (addlen >= sz - len)
|
||||
addlen = sz - len - 1;
|
||||
memcpy(line + len, continuation, addlen);
|
||||
len += addlen;
|
||||
}
|
||||
/* Count mbox From headers as headers */
|
||||
if (!ofs && (!memcmp(line, "From ", 5) || !memcmp(line, ">From ", 6)))
|
||||
ofs = 1;
|
||||
return ofs;
|
||||
}
|
||||
line[len] = 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int decode_q_segment(char *in, char *ot, char *ep, int rfc2047)
|
||||
|
@ -1551,9 +1551,12 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
|
||||
int use_internal_rev_list = 0;
|
||||
int thin = 0;
|
||||
int i;
|
||||
const char *rp_av[64];
|
||||
const char **rp_av;
|
||||
int rp_ac_alloc = 64;
|
||||
int rp_ac;
|
||||
|
||||
rp_av = xcalloc(rp_ac_alloc, sizeof(*rp_av));
|
||||
|
||||
rp_av[0] = "pack-objects";
|
||||
rp_av[1] = "--objects"; /* --thin will make it --objects-edge */
|
||||
rp_ac = 2;
|
||||
@ -1626,8 +1629,11 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
|
||||
!strcmp("--reflog", arg) ||
|
||||
!strcmp("--all", arg)) {
|
||||
use_internal_rev_list = 1;
|
||||
if (ARRAY_SIZE(rp_av) - 1 <= rp_ac)
|
||||
die("too many internal rev-list options");
|
||||
if (rp_ac >= rp_ac_alloc - 1) {
|
||||
rp_ac_alloc = alloc_nr(rp_ac_alloc);
|
||||
rp_av = xrealloc(rp_av,
|
||||
rp_ac_alloc * sizeof(*rp_av));
|
||||
}
|
||||
rp_av[rp_ac++] = arg;
|
||||
continue;
|
||||
}
|
||||
|
@ -154,13 +154,17 @@ static int find_conflict(struct path_list *conflict)
|
||||
return error("Could not read index");
|
||||
for (i = 0; i + 2 < active_nr; i++) {
|
||||
struct cache_entry *e1 = active_cache[i];
|
||||
struct cache_entry *e2 = active_cache[i + 1];
|
||||
struct cache_entry *e3 = active_cache[i + 2];
|
||||
if (ce_stage(e1) == 1 && ce_stage(e2) == 2 &&
|
||||
ce_stage(e3) == 3 && ce_same_name(e1, e2) &&
|
||||
ce_same_name(e1, e3)) {
|
||||
struct cache_entry *e2 = active_cache[i+1];
|
||||
struct cache_entry *e3 = active_cache[i+2];
|
||||
if (ce_stage(e1) == 1 &&
|
||||
ce_stage(e2) == 2 &&
|
||||
ce_stage(e3) == 3 &&
|
||||
ce_same_name(e1, e2) && ce_same_name(e1, e3) &&
|
||||
S_ISREG(ntohl(e1->ce_mode)) &&
|
||||
S_ISREG(ntohl(e2->ce_mode)) &&
|
||||
S_ISREG(ntohl(e3->ce_mode))) {
|
||||
path_list_insert((const char *)e1->name, conflict);
|
||||
i += 3;
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -221,9 +221,11 @@ int cmd_show_ref(int argc, const char **argv, const char *prefix)
|
||||
}
|
||||
|
||||
if (verify) {
|
||||
if (!pattern)
|
||||
die("--verify requires a reference");
|
||||
while (*pattern) {
|
||||
unsigned char sha1[20];
|
||||
|
||||
while (*pattern) {
|
||||
if (!strncmp(*pattern, "refs/", 5) &&
|
||||
resolve_ref(*pattern, sha1, 1, NULL)) {
|
||||
if (!quiet)
|
||||
|
@ -678,11 +678,27 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
|
||||
else {
|
||||
/* Used by diff-tree to read from the working tree */
|
||||
struct stat st;
|
||||
int fd;
|
||||
if (0 <= (fd = open(elem->path, O_RDONLY)) &&
|
||||
int fd = -1;
|
||||
|
||||
if (lstat(elem->path, &st) < 0)
|
||||
goto deleted_file;
|
||||
|
||||
if (S_ISLNK(st.st_mode)) {
|
||||
size_t len = st.st_size;
|
||||
result_size = len;
|
||||
result = xmalloc(len + 1);
|
||||
if (result_size != readlink(elem->path, result, len)) {
|
||||
error("readlink(%s): %s", elem->path,
|
||||
strerror(errno));
|
||||
return;
|
||||
}
|
||||
result[len] = 0;
|
||||
elem->mode = canon_mode(st.st_mode);
|
||||
}
|
||||
else if (0 <= (fd = open(elem->path, O_RDONLY)) &&
|
||||
!fstat(fd, &st)) {
|
||||
int len = st.st_size;
|
||||
int sz = 0;
|
||||
size_t len = st.st_size;
|
||||
size_t sz = 0;
|
||||
|
||||
elem->mode = canon_mode(st.st_mode);
|
||||
result_size = len;
|
||||
@ -698,11 +714,12 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
|
||||
result[len] = 0;
|
||||
}
|
||||
else {
|
||||
/* deleted file */
|
||||
deleted_file:
|
||||
result_size = 0;
|
||||
elem->mode = 0;
|
||||
result = xcalloc(1, 1);
|
||||
}
|
||||
|
||||
if (0 <= fd)
|
||||
close(fd);
|
||||
}
|
||||
|
7
commit.c
7
commit.c
@ -644,6 +644,7 @@ static char *get_header(const struct commit *commit, const char *key)
|
||||
static char *replace_encoding_header(char *buf, char *encoding)
|
||||
{
|
||||
char *encoding_header = strstr(buf, "\nencoding ");
|
||||
char *header_end = strstr(buf, "\n\n");
|
||||
char *end_of_encoding_header;
|
||||
int encoding_header_pos;
|
||||
int encoding_header_len;
|
||||
@ -651,8 +652,10 @@ static char *replace_encoding_header(char *buf, char *encoding)
|
||||
int need_len;
|
||||
int buflen = strlen(buf) + 1;
|
||||
|
||||
if (!encoding_header)
|
||||
return buf; /* should not happen but be defensive */
|
||||
if (!header_end)
|
||||
header_end = buf + buflen;
|
||||
if (!encoding_header || encoding_header >= header_end)
|
||||
return buf;
|
||||
encoding_header++;
|
||||
end_of_encoding_header = strchr(encoding_header, '\n');
|
||||
if (!end_of_encoding_header)
|
||||
|
10
compat/strtoumax.c
Normal file
10
compat/strtoumax.c
Normal file
@ -0,0 +1,10 @@
|
||||
#include "../git-compat-util.h"
|
||||
|
||||
uintmax_t gitstrtoumax (const char *nptr, char **endptr, int base)
|
||||
{
|
||||
#if defined(NO_STRTOULL)
|
||||
return strtoul(nptr, endptr, base);
|
||||
#else
|
||||
return strtoull(nptr, endptr, base);
|
||||
#endif
|
||||
}
|
@ -41,7 +41,7 @@ $fileview->set_rules_hint(1);
|
||||
$fileview->signal_connect (row_activated => sub {
|
||||
my ($sl, $path, $column) = @_;
|
||||
my $row_ref = $sl->get_row_data_from_path ($path);
|
||||
system("blameview @$row_ref[0] $fn &");
|
||||
system("blameview @$row_ref[0]~1 $fn &");
|
||||
});
|
||||
|
||||
my $commitwindow = Gtk2::ScrolledWindow->new();
|
||||
|
@ -75,10 +75,11 @@ then to `add-log-mailing-address' and then to `user-mail-address'."
|
||||
:type '(choice (const :tag "Default" nil)
|
||||
(string :tag "Email")))
|
||||
|
||||
(defcustom git-commits-coding-system 'utf-8
|
||||
(defcustom git-commits-coding-system nil
|
||||
"Default coding system for the log message of git commits."
|
||||
:group 'git
|
||||
:type 'coding-system)
|
||||
:type '(choice (const :tag "From repository config" nil)
|
||||
(coding-system)))
|
||||
|
||||
(defcustom git-append-signed-off-by nil
|
||||
"Whether to append a Signed-off-by line to the commit message before editing."
|
||||
@ -236,6 +237,15 @@ and returns the process output as a string."
|
||||
(and (fboundp 'user-mail-address) (user-mail-address))
|
||||
(and (boundp 'user-mail-address) user-mail-address)))
|
||||
|
||||
(defun git-get-commits-coding-system ()
|
||||
"Return the coding system to use for commits."
|
||||
(let ((repo-config (git-config "i18n.commitencoding")))
|
||||
(or git-commits-coding-system
|
||||
(and repo-config
|
||||
(fboundp 'locale-charset-to-coding-system)
|
||||
(locale-charset-to-coding-system repo-config))
|
||||
'utf-8)))
|
||||
|
||||
(defun git-escape-file-name (name)
|
||||
"Escape a file name if necessary."
|
||||
(if (string-match "[\n\t\"\\]" name)
|
||||
@ -327,7 +337,7 @@ and returns the process output as a string."
|
||||
"Call git-commit-tree with buffer as input and return the resulting commit SHA1."
|
||||
(let ((author-name (git-get-committer-name))
|
||||
(author-email (git-get-committer-email))
|
||||
author-date log-start log-end args)
|
||||
author-date log-start log-end args coding-system-for-write)
|
||||
(when head
|
||||
(push "-p" args)
|
||||
(push head args))
|
||||
@ -350,12 +360,12 @@ and returns the process output as a string."
|
||||
(push "-p" args)
|
||||
(push (match-string 1) args))))
|
||||
(setq log-start (point-min)))
|
||||
(setq log-end (point-max)))
|
||||
(setq log-end (point-max))
|
||||
(setq coding-system-for-write buffer-file-coding-system))
|
||||
(git-get-string-sha1
|
||||
(with-output-to-string
|
||||
(with-current-buffer standard-output
|
||||
(let ((coding-system-for-write git-commits-coding-system)
|
||||
(env `(("GIT_AUTHOR_NAME" . ,author-name)
|
||||
(let ((env `(("GIT_AUTHOR_NAME" . ,author-name)
|
||||
("GIT_AUTHOR_EMAIL" . ,author-email)
|
||||
("GIT_COMMITTER_NAME" . ,(git-get-committer-name))
|
||||
("GIT_COMMITTER_EMAIL" . ,(git-get-committer-email)))))
|
||||
@ -881,22 +891,35 @@ and returns the process output as a string."
|
||||
(with-current-buffer log-edit-parent-buffer
|
||||
(git-get-filenames (git-marked-files-state 'added 'deleted 'modified))))
|
||||
|
||||
(defun git-commit-file ()
|
||||
"Commit the marked file(s), asking for a commit message."
|
||||
(interactive)
|
||||
(defun git-append-sign-off (name email)
|
||||
"Append a Signed-off-by entry to the current buffer, avoiding duplicates."
|
||||
(let ((sign-off (format "Signed-off-by: %s <%s>" name email))
|
||||
(case-fold-search t))
|
||||
(goto-char (point-min))
|
||||
(unless (re-search-forward (concat "^" (regexp-quote sign-off)) nil t)
|
||||
(goto-char (point-min))
|
||||
(unless (re-search-forward "^Signed-off-by: " nil t)
|
||||
(setq sign-off (concat "\n" sign-off)))
|
||||
(goto-char (point-max))
|
||||
(insert sign-off "\n"))))
|
||||
|
||||
(defun git-setup-log-buffer (buffer &optional author-name author-email subject date msg)
|
||||
"Setup the log buffer for a commit."
|
||||
(unless git-status (error "Not in git-status buffer."))
|
||||
(let ((buffer (get-buffer-create "*git-commit*"))
|
||||
(merge-heads (git-get-merge-heads))
|
||||
(let ((merge-heads (git-get-merge-heads))
|
||||
(dir default-directory)
|
||||
(committer-name (git-get-committer-name))
|
||||
(committer-email (git-get-committer-email))
|
||||
(sign-off git-append-signed-off-by))
|
||||
(with-current-buffer buffer
|
||||
(when (eq 0 (buffer-size))
|
||||
(cd dir)
|
||||
(erase-buffer)
|
||||
(insert
|
||||
(propertize
|
||||
(format "Author: %s <%s>\n%s"
|
||||
(git-get-committer-name) (git-get-committer-email)
|
||||
(format "Author: %s <%s>\n%s%s"
|
||||
(or author-name committer-name)
|
||||
(or author-email committer-email)
|
||||
(if date (format "Date: %s\n" date) "")
|
||||
(if merge-heads
|
||||
(format "Parent: %s\n%s\n"
|
||||
(git-rev-parse "HEAD")
|
||||
@ -905,13 +928,43 @@ and returns the process output as a string."
|
||||
'face 'git-header-face)
|
||||
(propertize git-log-msg-separator 'face 'git-separator-face)
|
||||
"\n")
|
||||
(cond ((file-readable-p ".git/MERGE_MSG")
|
||||
(insert-file-contents ".git/MERGE_MSG"))
|
||||
(sign-off
|
||||
(insert (format "\n\nSigned-off-by: %s <%s>\n"
|
||||
(git-get-committer-name) (git-get-committer-email)))))))
|
||||
(when subject (insert subject "\n\n"))
|
||||
(cond (msg (insert msg "\n"))
|
||||
((file-readable-p ".dotest/msg")
|
||||
(insert-file-contents ".dotest/msg"))
|
||||
((file-readable-p ".git/MERGE_MSG")
|
||||
(insert-file-contents ".git/MERGE_MSG")))
|
||||
; delete empty lines at end
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward "\n+\\'" nil t)
|
||||
(replace-match "\n" t t))
|
||||
(when sign-off (git-append-sign-off committer-name committer-email)))))
|
||||
|
||||
(defun git-commit-file ()
|
||||
"Commit the marked file(s), asking for a commit message."
|
||||
(interactive)
|
||||
(unless git-status (error "Not in git-status buffer."))
|
||||
(let ((buffer (get-buffer-create "*git-commit*"))
|
||||
(coding-system (git-get-commits-coding-system))
|
||||
author-name author-email subject date)
|
||||
(when (eq 0 (buffer-size buffer))
|
||||
(when (file-readable-p ".dotest/info")
|
||||
(with-temp-buffer
|
||||
(insert-file-contents ".dotest/info")
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward "^Author: \\(.*\\)\nEmail: \\(.*\\)$" nil t)
|
||||
(setq author-name (match-string 1))
|
||||
(setq author-email (match-string 2)))
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward "^Subject: \\(.*\\)$" nil t)
|
||||
(setq subject (match-string 1)))
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward "^Date: \\(.*\\)$" nil t)
|
||||
(setq date (match-string 1)))))
|
||||
(git-setup-log-buffer buffer author-name author-email subject date))
|
||||
(log-edit #'git-do-commit nil #'git-log-edit-files buffer)
|
||||
(setq font-lock-keywords (font-lock-compile-keywords git-log-edit-font-lock-keywords))
|
||||
(setq buffer-file-coding-system coding-system)
|
||||
(re-search-forward (regexp-quote (concat git-log-msg-separator "\n")) nil t)))
|
||||
|
||||
(defun git-find-file ()
|
||||
|
@ -25,11 +25,14 @@ foreach my $tar_file (@ARGV)
|
||||
my $tar_name = $1;
|
||||
|
||||
if ($tar_name =~ s/\.(tar\.gz|tgz)$//) {
|
||||
open(I, '-|', 'gzcat', $tar_file) or die "Unable to gzcat $tar_file: $!\n";
|
||||
open(I, '-|', 'gunzip', '-c', $tar_file)
|
||||
or die "Unable to gunzip -c $tar_file: $!\n";
|
||||
} elsif ($tar_name =~ s/\.(tar\.bz2|tbz2)$//) {
|
||||
open(I, '-|', 'bzcat', $tar_file) or die "Unable to bzcat $tar_file: $!\n";
|
||||
open(I, '-|', 'bunzip2', '-c', $tar_file)
|
||||
or die "Unable to bunzip2 -c $tar_file: $!\n";
|
||||
} elsif ($tar_name =~ s/\.tar\.Z$//) {
|
||||
open(I, '-|', 'zcat', $tar_file) or die "Unable to zcat $tar_file: $!\n";
|
||||
open(I, '-|', 'uncompress', '-c', $tar_file)
|
||||
or die "Unable to uncompress -c $tar_file: $!\n";
|
||||
} elsif ($tar_name =~ s/\.tar$//) {
|
||||
open(I, $tar_file) or die "Unable to open $tar_file: $!\n";
|
||||
} else {
|
||||
|
14
diff-lib.c
14
diff-lib.c
@ -41,18 +41,28 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed)
|
||||
|
||||
path_len = ce_namelen(ce);
|
||||
|
||||
dpath = xmalloc (combine_diff_path_size (5, path_len));
|
||||
dpath = xmalloc(combine_diff_path_size(5, path_len));
|
||||
dpath->path = (char *) &(dpath->parent[5]);
|
||||
|
||||
dpath->next = NULL;
|
||||
dpath->len = path_len;
|
||||
memcpy(dpath->path, ce->name, path_len);
|
||||
dpath->path[path_len] = '\0';
|
||||
dpath->mode = 0;
|
||||
hashclr(dpath->sha1);
|
||||
memset(&(dpath->parent[0]), 0,
|
||||
sizeof(struct combine_diff_parent)*5);
|
||||
|
||||
if (lstat(ce->name, &st) < 0) {
|
||||
if (errno != ENOENT && errno != ENOTDIR) {
|
||||
perror(ce->name);
|
||||
continue;
|
||||
}
|
||||
if (silent_on_removed)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
dpath->mode = canon_mode(st.st_mode);
|
||||
|
||||
while (i < entries) {
|
||||
struct cache_entry *nce = active_cache[i];
|
||||
int stage;
|
||||
|
6
diff.c
6
diff.c
@ -211,6 +211,8 @@ static void emit_rewrite_diff(const char *name_a,
|
||||
diff_populate_filespec(two, 0);
|
||||
lc_a = count_lines(one->data, one->size);
|
||||
lc_b = count_lines(two->data, two->size);
|
||||
name_a += (*name_a == '/');
|
||||
name_b += (*name_b == '/');
|
||||
printf("--- a/%s\n+++ b/%s\n@@ -", name_a, name_b);
|
||||
print_line_count(lc_a);
|
||||
printf(" +");
|
||||
@ -1020,8 +1022,8 @@ static void builtin_diff(const char *name_a,
|
||||
const char *set = diff_get_color(o->color_diff, DIFF_METAINFO);
|
||||
const char *reset = diff_get_color(o->color_diff, DIFF_RESET);
|
||||
|
||||
a_one = quote_two("a/", name_a);
|
||||
b_two = quote_two("b/", name_b);
|
||||
a_one = quote_two("a/", name_a + (*name_a == '/'));
|
||||
b_two = quote_two("b/", name_b + (*name_b == '/'));
|
||||
lbl[0] = DIFF_FILE_VALID(one) ? a_one : "/dev/null";
|
||||
lbl[1] = DIFF_FILE_VALID(two) ? b_two : "/dev/null";
|
||||
printf("%sdiff --git %s %s%s\n", set, a_one, b_two, reset);
|
||||
|
@ -133,6 +133,10 @@ Format of STDIN stream:
|
||||
#define PACK_ID_BITS 16
|
||||
#define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
|
||||
|
||||
#ifndef PRIuMAX
|
||||
#define PRIuMAX "llu"
|
||||
#endif
|
||||
|
||||
struct object_entry
|
||||
{
|
||||
struct object_entry *next;
|
||||
@ -216,7 +220,8 @@ struct branch
|
||||
const char *name;
|
||||
struct tree_entry branch_tree;
|
||||
uintmax_t last_commit;
|
||||
unsigned int pack_id;
|
||||
unsigned active : 1;
|
||||
unsigned pack_id : PACK_ID_BITS;
|
||||
unsigned char sha1[20];
|
||||
};
|
||||
|
||||
@ -475,7 +480,7 @@ static struct object_entry *find_mark(uintmax_t idnum)
|
||||
oe = s->data.marked[idnum];
|
||||
}
|
||||
if (!oe)
|
||||
die("mark :%ju not declared", orig_idnum);
|
||||
die("mark :%" PRIuMAX " not declared", orig_idnum);
|
||||
return oe;
|
||||
}
|
||||
|
||||
@ -524,6 +529,7 @@ static struct branch *new_branch(const char *name)
|
||||
b->table_next_branch = branch_table[hc];
|
||||
b->branch_tree.versions[0].mode = S_IFDIR;
|
||||
b->branch_tree.versions[1].mode = S_IFDIR;
|
||||
b->active = 0;
|
||||
b->pack_id = MAX_PACK_ID;
|
||||
branch_table[hc] = b;
|
||||
branch_count++;
|
||||
@ -1056,7 +1062,7 @@ static void load_tree(struct tree_entry *root)
|
||||
struct tree_entry *e = new_tree_entry();
|
||||
|
||||
if (t->entry_count == t->entry_capacity)
|
||||
root->tree = t = grow_tree_content(t, 8);
|
||||
root->tree = t = grow_tree_content(t, t->entry_count);
|
||||
t->entries[t->entry_count++] = e;
|
||||
|
||||
e->tree = NULL;
|
||||
@ -1223,7 +1229,7 @@ static int tree_content_set(
|
||||
}
|
||||
|
||||
if (t->entry_count == t->entry_capacity)
|
||||
root->tree = t = grow_tree_content(t, 8);
|
||||
root->tree = t = grow_tree_content(t, t->entry_count);
|
||||
e = new_tree_entry();
|
||||
e->name = to_atom(p, (unsigned short)n);
|
||||
e->versions[0].mode = 0;
|
||||
@ -1361,7 +1367,7 @@ static void dump_marks_helper(FILE *f,
|
||||
} else {
|
||||
for (k = 0; k < 1024; k++) {
|
||||
if (m->data.marked[k])
|
||||
fprintf(f, ":%ju %s\n", base + k,
|
||||
fprintf(f, ":%" PRIuMAX " %s\n", base + k,
|
||||
sha1_to_hex(m->data.marked[k]->sha1));
|
||||
}
|
||||
}
|
||||
@ -1543,6 +1549,7 @@ static void unload_one_branch(void)
|
||||
e = active_branches;
|
||||
active_branches = e->active_next_branch;
|
||||
}
|
||||
e->active = 0;
|
||||
e->active_next_branch = NULL;
|
||||
if (e->branch_tree.tree) {
|
||||
release_tree_content_recursive(e->branch_tree.tree);
|
||||
@ -1555,10 +1562,13 @@ static void unload_one_branch(void)
|
||||
static void load_branch(struct branch *b)
|
||||
{
|
||||
load_tree(&b->branch_tree);
|
||||
if (!b->active) {
|
||||
b->active = 1;
|
||||
b->active_next_branch = active_branches;
|
||||
active_branches = b;
|
||||
cur_active_branches++;
|
||||
branch_load_count++;
|
||||
}
|
||||
}
|
||||
|
||||
static void file_change_m(struct branch *b)
|
||||
@ -1687,7 +1697,7 @@ static void cmd_from(struct branch *b)
|
||||
unsigned long size;
|
||||
char *buf;
|
||||
if (oe->type != OBJ_COMMIT)
|
||||
die("Mark :%ju not a commit", idnum);
|
||||
die("Mark :%" PRIuMAX " not a commit", idnum);
|
||||
hashcpy(b->sha1, oe->sha1);
|
||||
buf = gfi_unpack_entry(oe, &size);
|
||||
if (!buf || size < 46)
|
||||
@ -1740,9 +1750,16 @@ static struct hash_list *cmd_merge(unsigned int *count)
|
||||
uintmax_t idnum = strtoumax(from + 1, NULL, 10);
|
||||
struct object_entry *oe = find_mark(idnum);
|
||||
if (oe->type != OBJ_COMMIT)
|
||||
die("Mark :%ju not a commit", idnum);
|
||||
die("Mark :%" PRIuMAX " not a commit", idnum);
|
||||
hashcpy(n->sha1, oe->sha1);
|
||||
} else if (get_sha1(from, n->sha1))
|
||||
} else if (!get_sha1(from, n->sha1)) {
|
||||
unsigned long size;
|
||||
char *buf = read_object_with_reference(n->sha1,
|
||||
type_names[OBJ_COMMIT], &size, n->sha1);
|
||||
if (!buf || size < 46)
|
||||
die("Not a valid commit: %s", from);
|
||||
free(buf);
|
||||
} else
|
||||
die("Invalid ref name or SHA1 expression: %s", from);
|
||||
|
||||
n->next = NULL;
|
||||
@ -1884,7 +1901,7 @@ static void cmd_new_tag(void)
|
||||
from_mark = strtoumax(from + 1, NULL, 10);
|
||||
oe = find_mark(from_mark);
|
||||
if (oe->type != OBJ_COMMIT)
|
||||
die("Mark :%ju not a commit", from_mark);
|
||||
die("Mark :%" PRIuMAX " not a commit", from_mark);
|
||||
hashcpy(sha1, oe->sha1);
|
||||
} else if (!get_sha1(from, sha1)) {
|
||||
unsigned long size;
|
||||
@ -2059,18 +2076,18 @@ int main(int argc, const char **argv)
|
||||
|
||||
fprintf(stderr, "%s statistics:\n", argv[0]);
|
||||
fprintf(stderr, "---------------------------------------------------------------------\n");
|
||||
fprintf(stderr, "Alloc'd objects: %10ju\n", alloc_count);
|
||||
fprintf(stderr, "Total objects: %10ju (%10ju duplicates )\n", total_count, duplicate_count);
|
||||
fprintf(stderr, " blobs : %10ju (%10ju duplicates %10ju deltas)\n", object_count_by_type[OBJ_BLOB], duplicate_count_by_type[OBJ_BLOB], delta_count_by_type[OBJ_BLOB]);
|
||||
fprintf(stderr, " trees : %10ju (%10ju duplicates %10ju deltas)\n", object_count_by_type[OBJ_TREE], duplicate_count_by_type[OBJ_TREE], delta_count_by_type[OBJ_TREE]);
|
||||
fprintf(stderr, " commits: %10ju (%10ju duplicates %10ju deltas)\n", object_count_by_type[OBJ_COMMIT], duplicate_count_by_type[OBJ_COMMIT], delta_count_by_type[OBJ_COMMIT]);
|
||||
fprintf(stderr, " tags : %10ju (%10ju duplicates %10ju deltas)\n", object_count_by_type[OBJ_TAG], duplicate_count_by_type[OBJ_TAG], delta_count_by_type[OBJ_TAG]);
|
||||
fprintf(stderr, "Alloc'd objects: %10" PRIuMAX "\n", alloc_count);
|
||||
fprintf(stderr, "Total objects: %10" PRIuMAX " (%10" PRIuMAX " duplicates )\n", total_count, duplicate_count);
|
||||
fprintf(stderr, " blobs : %10" PRIuMAX " (%10" PRIuMAX " duplicates %10" PRIuMAX " deltas)\n", object_count_by_type[OBJ_BLOB], duplicate_count_by_type[OBJ_BLOB], delta_count_by_type[OBJ_BLOB]);
|
||||
fprintf(stderr, " trees : %10" PRIuMAX " (%10" PRIuMAX " duplicates %10" PRIuMAX " deltas)\n", object_count_by_type[OBJ_TREE], duplicate_count_by_type[OBJ_TREE], delta_count_by_type[OBJ_TREE]);
|
||||
fprintf(stderr, " commits: %10" PRIuMAX " (%10" PRIuMAX " duplicates %10" PRIuMAX " deltas)\n", object_count_by_type[OBJ_COMMIT], duplicate_count_by_type[OBJ_COMMIT], delta_count_by_type[OBJ_COMMIT]);
|
||||
fprintf(stderr, " tags : %10" PRIuMAX " (%10" PRIuMAX " duplicates %10" PRIuMAX " deltas)\n", object_count_by_type[OBJ_TAG], duplicate_count_by_type[OBJ_TAG], delta_count_by_type[OBJ_TAG]);
|
||||
fprintf(stderr, "Total branches: %10lu (%10lu loads )\n", branch_count, branch_load_count);
|
||||
fprintf(stderr, " marks: %10ju (%10ju unique )\n", (((uintmax_t)1) << marks->shift) * 1024, marks_set_count);
|
||||
fprintf(stderr, " marks: %10" PRIuMAX " (%10" PRIuMAX " unique )\n", (((uintmax_t)1) << marks->shift) * 1024, marks_set_count);
|
||||
fprintf(stderr, " atoms: %10u\n", atom_cnt);
|
||||
fprintf(stderr, "Memory total: %10ju KiB\n", (total_allocd + alloc_count*sizeof(struct object_entry))/1024);
|
||||
fprintf(stderr, "Memory total: %10" PRIuMAX " KiB\n", (total_allocd + alloc_count*sizeof(struct object_entry))/1024);
|
||||
fprintf(stderr, " pools: %10lu KiB\n", (unsigned long)(total_allocd/1024));
|
||||
fprintf(stderr, " objects: %10ju KiB\n", (alloc_count*sizeof(struct object_entry))/1024);
|
||||
fprintf(stderr, " objects: %10" PRIuMAX " KiB\n", (alloc_count*sizeof(struct object_entry))/1024);
|
||||
fprintf(stderr, "---------------------------------------------------------------------\n");
|
||||
pack_report();
|
||||
fprintf(stderr, "---------------------------------------------------------------------\n");
|
||||
|
@ -66,7 +66,7 @@ fall_back_3way () {
|
||||
git-update-index -z --index-info <"$dotest/patch-merge-index-info" &&
|
||||
GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
|
||||
git-write-tree >"$dotest/patch-merge-base+" ||
|
||||
cannot_fallback "Patch does not record usable index information."
|
||||
cannot_fallback "Repository lacks necessary blobs to fall back on 3-way merge."
|
||||
|
||||
echo Using index info to reconstruct a base tree...
|
||||
if GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
|
||||
|
@ -553,7 +553,7 @@ foreach my $ps (@psets) {
|
||||
|
||||
my $pid = open2(*READER, *WRITER,'git-commit-tree',$tree,@par)
|
||||
or die $!;
|
||||
print WRITER $ps->{summary},"\n";
|
||||
print WRITER $ps->{summary},"\n\n";
|
||||
print WRITER $ps->{message},"\n";
|
||||
|
||||
# make it easy to backtrack and figure out which Arch revision this was:
|
||||
@ -755,7 +755,8 @@ sub parselog {
|
||||
$ps->{tag} = $1;
|
||||
$key = undef;
|
||||
} elsif (/^Summary:\s*(.*)$/ ) {
|
||||
# summary can be multiline as long as it has a leading space
|
||||
# summary can be multiline as long as it has a leading space.
|
||||
# we squeeze it onto a single line, though.
|
||||
$ps->{summary} = [ $1 ];
|
||||
$key = 'summary';
|
||||
} elsif (/^Creator: (.*)\s*<([^\>]+)>/) {
|
||||
@ -787,8 +788,18 @@ sub parselog {
|
||||
}
|
||||
}
|
||||
|
||||
# post-processing:
|
||||
$ps->{summary} = join("\n",@{$ps->{summary}})."\n";
|
||||
# drop leading empty lines from the log message
|
||||
while (@$log && $log->[0] eq '') {
|
||||
shift @$log;
|
||||
}
|
||||
if (exists $ps->{summary} && @{$ps->{summary}}) {
|
||||
$ps->{summary} = join(' ', @{$ps->{summary}});
|
||||
}
|
||||
elsif (@$log == 0) {
|
||||
$ps->{summary} = 'empty commit message';
|
||||
} else {
|
||||
$ps->{summary} = $log->[0] . '...';
|
||||
}
|
||||
$ps->{message} = join("\n",@$log);
|
||||
|
||||
# skip Arch control files, unescape pika-escaped files
|
||||
|
@ -196,7 +196,7 @@ else
|
||||
work=`git write-tree` &&
|
||||
git read-tree --reset -u $new || exit
|
||||
|
||||
eval GITHEAD_$new=${new_name:-${branch:-$new}} &&
|
||||
eval GITHEAD_$new='${new_name:-${branch:-$new}}' &&
|
||||
eval GITHEAD_$work=local &&
|
||||
export GITHEAD_$new GITHEAD_$work &&
|
||||
git merge-recursive $old -- $new $work
|
||||
|
@ -318,6 +318,10 @@ esac
|
||||
|
||||
case "$all,$also" in
|
||||
t,)
|
||||
if test ! -f "$THIS_INDEX"
|
||||
then
|
||||
die 'nothing to commit (use "git add file1 file2" to include for commit)'
|
||||
fi
|
||||
save_index &&
|
||||
(
|
||||
cd_to_toplevel &&
|
||||
@ -356,7 +360,7 @@ t,)
|
||||
if test -z "$initial_commit"
|
||||
then
|
||||
cp "$THIS_INDEX" "$TMP_INDEX"
|
||||
GIT_INDEX_FILE="$TMP_INDEX" git-read-tree -m HEAD
|
||||
GIT_INDEX_FILE="$TMP_INDEX" git-read-tree -i -m HEAD
|
||||
else
|
||||
rm -f "$TMP_INDEX"
|
||||
fi || exit
|
||||
@ -617,6 +621,9 @@ else
|
||||
fi
|
||||
ret="$?"
|
||||
rm -f "$GIT_DIR/COMMIT_MSG" "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG"
|
||||
|
||||
cd_to_toplevel
|
||||
|
||||
if test -d "$GIT_DIR/rr-cache"
|
||||
then
|
||||
git-rerere
|
||||
|
@ -47,9 +47,15 @@
|
||||
#include <netdb.h>
|
||||
#include <pwd.h>
|
||||
#include <inttypes.h>
|
||||
#if defined(__CYGWIN__)
|
||||
#undef _XOPEN_SOURCE
|
||||
#include <grp.h>
|
||||
#define _XOPEN_SOURCE 600
|
||||
#else
|
||||
#undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */
|
||||
#include <grp.h>
|
||||
#define _ALL_SOURCE 1
|
||||
#endif
|
||||
|
||||
#ifndef NO_ICONV
|
||||
#include <iconv.h>
|
||||
@ -139,6 +145,11 @@ extern char *gitstrcasestr(const char *haystack, const char *needle);
|
||||
extern size_t gitstrlcpy(char *, const char *, size_t);
|
||||
#endif
|
||||
|
||||
#ifdef NO_STRTOUMAX
|
||||
#define strtoumax gitstrtoumax
|
||||
extern uintmax_t gitstrtoumax(const char *, char **, int);
|
||||
#endif
|
||||
|
||||
extern void release_pack_memory(size_t);
|
||||
|
||||
static inline char* xstrdup(const char *str)
|
||||
|
@ -241,13 +241,14 @@ if ($opt_c) {
|
||||
die "Exiting: The commit did not succeed";
|
||||
}
|
||||
print "Committed successfully to CVS\n";
|
||||
# clean up
|
||||
unlink(".msg");
|
||||
} else {
|
||||
print "Ready for you to commit, just run:\n\n $cmd\n";
|
||||
}
|
||||
|
||||
# clean up
|
||||
unlink(".cvsexportcommit.diff");
|
||||
unlink(".msg");
|
||||
|
||||
sub usage {
|
||||
print STDERR <<END;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
# Cleanup unreachable files and optimize the repository.
|
||||
|
||||
USAGE='git-gc [--prune]'
|
||||
USAGE='[--prune]'
|
||||
SUBDIRECTORY_OK=Yes
|
||||
. git-sh-setup
|
||||
|
||||
|
@ -20,6 +20,11 @@ tree_search ()
|
||||
done
|
||||
}
|
||||
|
||||
# Always use the tarball version file if found, just
|
||||
# in case we are somehow contained in a larger git
|
||||
# repository that doesn't actually track our state.
|
||||
# (At least one package manager is doing this.)
|
||||
#
|
||||
# We may be a subproject, so try looking for the merge
|
||||
# commit that supplied this directory content if we are
|
||||
# not at the toplevel. We probably will always be the
|
||||
@ -27,10 +32,13 @@ tree_search ()
|
||||
# that fact.
|
||||
#
|
||||
# If we are at the toplevel or the merge assumption fails
|
||||
# try looking for a gitgui-* tag, or fallback onto the
|
||||
# distributed version file.
|
||||
# try looking for a gitgui-* tag.
|
||||
|
||||
if prefix="$(git rev-parse --show-prefix 2>/dev/null)"
|
||||
if test -f version &&
|
||||
VN=$(cat version)
|
||||
then
|
||||
: happy
|
||||
elif prefix="$(git rev-parse --show-prefix 2>/dev/null)"
|
||||
test -n "$prefix" &&
|
||||
head=$(git rev-list --max-count=1 HEAD -- . 2>/dev/null) &&
|
||||
tree=$(git rev-parse --verify "HEAD:$prefix" 2>/dev/null) &&
|
||||
@ -48,9 +56,6 @@ elif VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
|
||||
esac
|
||||
then
|
||||
VN=$(echo "$VN" | sed -e 's/^gitgui-//;s/-/./g');
|
||||
elif test -f version
|
||||
then
|
||||
VN=$(cat version) || VN="$DEF_VER"
|
||||
else
|
||||
VN="$DEF_VER"
|
||||
fi
|
||||
|
@ -1,5 +1,8 @@
|
||||
all::
|
||||
|
||||
# Define V=1 to have a more verbose compile.
|
||||
#
|
||||
|
||||
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
|
||||
@$(SHELL_PATH) ./GIT-VERSION-GEN
|
||||
-include GIT-VERSION-FILE
|
||||
@ -20,20 +23,25 @@ ifndef INSTALL
|
||||
INSTALL = install
|
||||
endif
|
||||
|
||||
ifndef V
|
||||
QUIET_GEN = @echo ' ' GEN $@;
|
||||
QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
|
||||
endif
|
||||
|
||||
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
|
||||
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
|
||||
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
|
||||
|
||||
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
|
||||
rm -f $@ $@+
|
||||
$(QUIET_GEN)rm -f $@ $@+ && \
|
||||
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
||||
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
|
||||
$@.sh >$@+
|
||||
chmod +x $@+
|
||||
$@.sh >$@+ && \
|
||||
chmod +x $@+ && \
|
||||
mv $@+ $@
|
||||
|
||||
$(GITGUI_BUILT_INS): git-gui
|
||||
rm -f $@ && ln git-gui $@
|
||||
$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
|
||||
|
||||
# These can record GITGUI_VERSION
|
||||
$(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE
|
||||
|
44
git-gui/TODO
44
git-gui/TODO
@ -1,44 +0,0 @@
|
||||
Items outstanding:
|
||||
|
||||
* Add file to .gitignore or info/excludes.
|
||||
|
||||
* Populate the pull menu with local branches.
|
||||
|
||||
* Make use of the new default merge data stored in repo-config.
|
||||
|
||||
* Checkout a different local branch.
|
||||
|
||||
* Push any local branch to a remote branch.
|
||||
|
||||
* Merge any local branches through a real merge UI.
|
||||
|
||||
* Allow user to define keyboard shortcuts for frequently used fetch
|
||||
or merge operations. Or maybe just define a keyboard shortcut
|
||||
for default fetch/default merge of current branch is enough;
|
||||
but I do know a few users who merge a couple of common branches
|
||||
also into the same branch so one default isn't quite enough.
|
||||
|
||||
* Better organize fetch/push/pull console windows.
|
||||
|
||||
* Clone UI (to download a new repository).
|
||||
|
||||
* Remotes editor (for .git/config format only).
|
||||
|
||||
* Show a shortlog of the last couple of commits in the main window,
|
||||
to give the user warm fuzzy feelings that we have their data
|
||||
saved. Actually this may be the set of commits not yet in
|
||||
the upstream (aka default merge branch remote repository).
|
||||
|
||||
* GUI configuration editor for options listed in
|
||||
git.git/Documentation/config.txt. Ideally this would
|
||||
parse that file and generate the options dialog from
|
||||
the documentation itself, and include the help text
|
||||
from the documentation as part of the UI somehow.
|
||||
|
||||
Known bugs:
|
||||
|
||||
* git-gui sometimes just closes on Windows with no error message.
|
||||
I'm not sure what the problem is here. I suspect the wish
|
||||
process is just terminating due to a segfault or something,
|
||||
as the do_quit proc in git-gui doesn't run. It often seems to
|
||||
occur while writing a commit message in the buffer. Odd.
|
@ -4,7 +4,7 @@ exec wish "$0" -- "$@"
|
||||
|
||||
set appvers {@@GITGUI_VERSION@@}
|
||||
set copyright {
|
||||
Copyright <20> 2006, 2007 Shawn Pearce, Paul Mackerras.
|
||||
Copyright <20> 2006, 2007 Shawn Pearce, et. al.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -46,7 +46,7 @@ proc gitdir {args} {
|
||||
proc gitexec {args} {
|
||||
global _gitexec
|
||||
if {$_gitexec eq {}} {
|
||||
if {[catch {set _gitexec [exec git --exec-path]} err]} {
|
||||
if {[catch {set _gitexec [git --exec-path]} err]} {
|
||||
error "Git not installed?\n\n$err"
|
||||
}
|
||||
}
|
||||
@ -202,14 +202,14 @@ proc save_config {} {
|
||||
set value $global_config_new($name)
|
||||
if {$value ne $global_config($name)} {
|
||||
if {$value eq $default_config($name)} {
|
||||
catch {exec git config --global --unset $name}
|
||||
catch {git config --global --unset $name}
|
||||
} else {
|
||||
regsub -all "\[{}\]" $value {"} value
|
||||
exec git config --global $name $value
|
||||
git config --global $name $value
|
||||
}
|
||||
set global_config($name) $value
|
||||
if {$value eq $repo_config($name)} {
|
||||
catch {exec git config --unset $name}
|
||||
catch {git config --unset $name}
|
||||
set repo_config($name) $value
|
||||
}
|
||||
}
|
||||
@ -219,16 +219,24 @@ proc save_config {} {
|
||||
set value $repo_config_new($name)
|
||||
if {$value ne $repo_config($name)} {
|
||||
if {$value eq $global_config($name)} {
|
||||
catch {exec git config --unset $name}
|
||||
catch {git config --unset $name}
|
||||
} else {
|
||||
regsub -all "\[{}\]" $value {"} value
|
||||
exec git config $name $value
|
||||
git config $name $value
|
||||
}
|
||||
set repo_config($name) $value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
######################################################################
|
||||
##
|
||||
## handy utils
|
||||
|
||||
proc git {args} {
|
||||
return [eval exec git $args]
|
||||
}
|
||||
|
||||
proc error_popup {msg} {
|
||||
set title [appname]
|
||||
if {[reponame] ne {}} {
|
||||
@ -287,12 +295,49 @@ proc ask_popup {msg} {
|
||||
-message $msg]
|
||||
}
|
||||
|
||||
######################################################################
|
||||
##
|
||||
## version check
|
||||
|
||||
if {{--version} eq $argv || {version} eq $argv} {
|
||||
puts "git-gui version $appvers"
|
||||
exit
|
||||
}
|
||||
|
||||
set req_maj 1
|
||||
set req_min 5
|
||||
|
||||
if {[catch {set v [git --version]} err]} {
|
||||
catch {wm withdraw .}
|
||||
error_popup "Cannot determine Git version:
|
||||
|
||||
$err
|
||||
|
||||
[appname] requires Git $req_maj.$req_min or later."
|
||||
exit 1
|
||||
}
|
||||
if {[regexp {^git version (\d+)\.(\d+)} $v _junk act_maj act_min]} {
|
||||
if {$act_maj < $req_maj
|
||||
|| ($act_maj == $req_maj && $act_min < $req_min)} {
|
||||
catch {wm withdraw .}
|
||||
error_popup "[appname] requires Git $req_maj.$req_min or later.
|
||||
|
||||
You are using $v."
|
||||
exit 1
|
||||
}
|
||||
} else {
|
||||
catch {wm withdraw .}
|
||||
error_popup "Cannot parse Git version string:\n\n$v"
|
||||
exit 1
|
||||
}
|
||||
unset -nocomplain v _junk act_maj act_min req_maj req_min
|
||||
|
||||
######################################################################
|
||||
##
|
||||
## repository setup
|
||||
|
||||
if { [catch {set _gitdir $env(GIT_DIR)}]
|
||||
&& [catch {set _gitdir [exec git rev-parse --git-dir]} err]} {
|
||||
&& [catch {set _gitdir [git rev-parse --git-dir]} err]} {
|
||||
catch {wm withdraw .}
|
||||
error_popup "Cannot find the git directory:\n\n$err"
|
||||
exit 1
|
||||
@ -319,6 +364,24 @@ set _reponame [lindex [file split \
|
||||
[file normalize [file dirname $_gitdir]]] \
|
||||
end]
|
||||
|
||||
######################################################################
|
||||
##
|
||||
## global init
|
||||
|
||||
set current_diff_path {}
|
||||
set current_diff_side {}
|
||||
set diff_actions [list]
|
||||
set ui_status_value {Initializing...}
|
||||
|
||||
set HEAD {}
|
||||
set PARENT {}
|
||||
set MERGE_HEAD [list]
|
||||
set commit_type {}
|
||||
set empty_tree {}
|
||||
set current_branch {}
|
||||
set current_diff_path {}
|
||||
set selected_commit_type new
|
||||
|
||||
######################################################################
|
||||
##
|
||||
## task management
|
||||
@ -365,7 +428,7 @@ proc repository_state {ctvar hdvar mhvar} {
|
||||
|
||||
set mh [list]
|
||||
|
||||
if {[catch {set current_branch [exec git symbolic-ref HEAD]}]} {
|
||||
if {[catch {set current_branch [git symbolic-ref HEAD]}]} {
|
||||
set current_branch {}
|
||||
} else {
|
||||
regsub ^refs/((heads|tags|remotes)/)? \
|
||||
@ -374,7 +437,7 @@ proc repository_state {ctvar hdvar mhvar} {
|
||||
current_branch
|
||||
}
|
||||
|
||||
if {[catch {set hd [exec git rev-parse --verify HEAD]}]} {
|
||||
if {[catch {set hd [git rev-parse --verify HEAD]}]} {
|
||||
set hd {}
|
||||
set ct initial
|
||||
return
|
||||
@ -402,7 +465,7 @@ proc PARENT {} {
|
||||
return $p
|
||||
}
|
||||
if {$empty_tree eq {}} {
|
||||
set empty_tree [exec git mktree << {}]
|
||||
set empty_tree [git mktree << {}]
|
||||
}
|
||||
return $empty_tree
|
||||
}
|
||||
@ -642,8 +705,9 @@ proc reshow_diff {} {
|
||||
global current_diff_path current_diff_side
|
||||
|
||||
set p $current_diff_path
|
||||
if {$p eq {}
|
||||
|| $current_diff_side eq {}
|
||||
if {$p eq {}} {
|
||||
# No diff is being shown.
|
||||
} elseif {$current_diff_side eq {}
|
||||
|| [catch {set s $file_states($p)}]
|
||||
|| [lsearch -sorted -exact $file_lists($current_diff_side) $p] == -1} {
|
||||
clear_diff
|
||||
@ -1042,7 +1106,7 @@ proc committer_ident {} {
|
||||
global GIT_COMMITTER_IDENT
|
||||
|
||||
if {$GIT_COMMITTER_IDENT eq {}} {
|
||||
if {[catch {set me [exec git var GIT_COMMITTER_IDENT]} err]} {
|
||||
if {[catch {set me [git var GIT_COMMITTER_IDENT]} err]} {
|
||||
error_popup "Unable to obtain your identity:\n\n$err"
|
||||
return {}
|
||||
}
|
||||
@ -1109,7 +1173,7 @@ File [short_path $path] cannot be committed by this program.
|
||||
}
|
||||
}
|
||||
}
|
||||
if {!$files_ready} {
|
||||
if {!$files_ready && ![string match *merge $curType]} {
|
||||
info_popup {No changes to commit.
|
||||
|
||||
You must add at least 1 file before you can commit.
|
||||
@ -1205,6 +1269,24 @@ proc commit_committree {fd_wt curHEAD msg} {
|
||||
return
|
||||
}
|
||||
|
||||
# -- Verify this wasn't an empty change.
|
||||
#
|
||||
if {$commit_type eq {normal}} {
|
||||
set old_tree [git rev-parse "$PARENT^{tree}"]
|
||||
if {$tree_id eq $old_tree} {
|
||||
info_popup {No changes to commit.
|
||||
|
||||
No files were modified by this commit and it
|
||||
was not a merge commit.
|
||||
|
||||
A rescan will be automatically started now.
|
||||
}
|
||||
unlock_index
|
||||
rescan {set ui_status_value {No changes to commit.}}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
# -- Build the message.
|
||||
#
|
||||
set msg_p [gitdir COMMIT_EDITMSG]
|
||||
@ -1219,15 +1301,9 @@ proc commit_committree {fd_wt curHEAD msg} {
|
||||
# -- Create the commit.
|
||||
#
|
||||
set cmd [list git commit-tree $tree_id]
|
||||
set parents [concat $PARENT $MERGE_HEAD]
|
||||
if {[llength $parents] > 0} {
|
||||
foreach p $parents {
|
||||
foreach p [concat $PARENT $MERGE_HEAD] {
|
||||
lappend cmd -p $p
|
||||
}
|
||||
} else {
|
||||
# git commit-tree writes to stderr during initial commit.
|
||||
lappend cmd 2>/dev/null
|
||||
}
|
||||
lappend cmd <$msg_p
|
||||
if {[catch {set cmt_id [eval exec $cmd]} err]} {
|
||||
error_popup "commit-tree failed:\n\n$err"
|
||||
@ -1256,14 +1332,6 @@ proc commit_committree {fd_wt curHEAD msg} {
|
||||
return
|
||||
}
|
||||
|
||||
# -- Make sure our current branch exists.
|
||||
#
|
||||
if {$commit_type eq {initial}} {
|
||||
lappend all_heads $current_branch
|
||||
set all_heads [lsort -unique $all_heads]
|
||||
populate_branch_menu
|
||||
}
|
||||
|
||||
# -- Cleanup after ourselves.
|
||||
#
|
||||
catch {file delete $msg_p}
|
||||
@ -1275,7 +1343,7 @@ proc commit_committree {fd_wt curHEAD msg} {
|
||||
# -- Let rerere do its thing.
|
||||
#
|
||||
if {[file isdirectory [gitdir rr-cache]]} {
|
||||
catch {exec git rerere}
|
||||
catch {git rerere}
|
||||
}
|
||||
|
||||
# -- Run the post-commit hook.
|
||||
@ -1299,6 +1367,14 @@ proc commit_committree {fd_wt curHEAD msg} {
|
||||
|
||||
if {[is_enabled singlecommit]} do_quit
|
||||
|
||||
# -- Make sure our current branch exists.
|
||||
#
|
||||
if {$commit_type eq {initial}} {
|
||||
lappend all_heads $current_branch
|
||||
set all_heads [lsort -unique $all_heads]
|
||||
populate_branch_menu
|
||||
}
|
||||
|
||||
# -- Update in memory status
|
||||
#
|
||||
set selected_commit_type new
|
||||
@ -1876,11 +1952,24 @@ proc all_tracking_branches {} {
|
||||
return [lsort -unique $all_trackings]
|
||||
}
|
||||
|
||||
proc load_all_tags {} {
|
||||
set all_tags [list]
|
||||
set fd [open "| git for-each-ref --format=%(refname) refs/tags" r]
|
||||
while {[gets $fd line] > 0} {
|
||||
if {![regsub ^refs/tags/ $line {} name]} continue
|
||||
lappend all_tags $name
|
||||
}
|
||||
close $fd
|
||||
|
||||
return [lsort $all_tags]
|
||||
}
|
||||
|
||||
proc do_create_branch_action {w} {
|
||||
global all_heads null_sha1 repo_config
|
||||
global create_branch_checkout create_branch_revtype
|
||||
global create_branch_head create_branch_trackinghead
|
||||
global create_branch_name create_branch_revexp
|
||||
global create_branch_tag
|
||||
|
||||
set newbranch $create_branch_name
|
||||
if {$newbranch eq {}
|
||||
@ -1894,7 +1983,7 @@ proc do_create_branch_action {w} {
|
||||
focus $w.desc.name_t
|
||||
return
|
||||
}
|
||||
if {![catch {exec git show-ref --verify -- "refs/heads/$newbranch"}]} {
|
||||
if {![catch {git show-ref --verify -- "refs/heads/$newbranch"}]} {
|
||||
tk_messageBox \
|
||||
-icon error \
|
||||
-type ok \
|
||||
@ -1904,7 +1993,7 @@ proc do_create_branch_action {w} {
|
||||
focus $w.desc.name_t
|
||||
return
|
||||
}
|
||||
if {[catch {exec git check-ref-format "heads/$newbranch"}]} {
|
||||
if {[catch {git check-ref-format "heads/$newbranch"}]} {
|
||||
tk_messageBox \
|
||||
-icon error \
|
||||
-type ok \
|
||||
@ -1919,9 +2008,10 @@ proc do_create_branch_action {w} {
|
||||
switch -- $create_branch_revtype {
|
||||
head {set rev $create_branch_head}
|
||||
tracking {set rev $create_branch_trackinghead}
|
||||
tag {set rev $create_branch_tag}
|
||||
expression {set rev $create_branch_revexp}
|
||||
}
|
||||
if {[catch {set cmt [exec git rev-parse --verify "${rev}^0"]}]} {
|
||||
if {[catch {set cmt [git rev-parse --verify "${rev}^0"]}]} {
|
||||
tk_messageBox \
|
||||
-icon error \
|
||||
-type ok \
|
||||
@ -1964,6 +2054,8 @@ trace add variable create_branch_head write \
|
||||
[list radio_selector create_branch_revtype head]
|
||||
trace add variable create_branch_trackinghead write \
|
||||
[list radio_selector create_branch_revtype tracking]
|
||||
trace add variable create_branch_tag write \
|
||||
[list radio_selector create_branch_revtype tag]
|
||||
|
||||
trace add variable delete_branch_head write \
|
||||
[list radio_selector delete_branch_checktype head]
|
||||
@ -1975,6 +2067,7 @@ proc do_create_branch {} {
|
||||
global create_branch_checkout create_branch_revtype
|
||||
global create_branch_head create_branch_trackinghead
|
||||
global create_branch_name create_branch_revexp
|
||||
global create_branch_tag
|
||||
|
||||
set w .branch_editor
|
||||
toplevel $w
|
||||
@ -2038,6 +2131,19 @@ proc do_create_branch {} {
|
||||
$all_trackings
|
||||
grid $w.from.tracking_r $w.from.tracking_m -sticky w
|
||||
}
|
||||
set all_tags [load_all_tags]
|
||||
if {$all_tags ne {}} {
|
||||
set create_branch_tag [lindex $all_tags 0]
|
||||
radiobutton $w.from.tag_r \
|
||||
-text {Tag:} \
|
||||
-value tag \
|
||||
-variable create_branch_revtype \
|
||||
-font font_ui
|
||||
eval tk_optionMenu $w.from.tag_m \
|
||||
create_branch_tag \
|
||||
$all_tags
|
||||
grid $w.from.tag_r $w.from.tag_m -sticky w
|
||||
}
|
||||
radiobutton $w.from.exp_r \
|
||||
-text {Revision Expression:} \
|
||||
-value expression \
|
||||
@ -2100,7 +2206,7 @@ proc do_delete_branch_action {w} {
|
||||
}
|
||||
if {$check_rev eq {:none}} {
|
||||
set check_cmt {}
|
||||
} elseif {[catch {set check_cmt [exec git rev-parse --verify "${check_rev}^0"]}]} {
|
||||
} elseif {[catch {set check_cmt [git rev-parse --verify "${check_rev}^0"]}]} {
|
||||
tk_messageBox \
|
||||
-icon error \
|
||||
-type ok \
|
||||
@ -2114,10 +2220,10 @@ proc do_delete_branch_action {w} {
|
||||
set not_merged [list]
|
||||
foreach i [$w.list.l curselection] {
|
||||
set b [$w.list.l get $i]
|
||||
if {[catch {set o [exec git rev-parse --verify $b]}]} continue
|
||||
if {[catch {set o [git rev-parse --verify $b]}]} continue
|
||||
if {$check_cmt ne {}} {
|
||||
if {$b eq $check_rev} continue
|
||||
if {[catch {set m [exec git merge-base $o $check_cmt]}]} continue
|
||||
if {[catch {set m [git merge-base $o $check_cmt]}]} continue
|
||||
if {$o ne $m} {
|
||||
lappend not_merged $b
|
||||
continue
|
||||
@ -2155,7 +2261,7 @@ Delete the selected branches?}
|
||||
foreach i $to_delete {
|
||||
set b [lindex $i 0]
|
||||
set o [lindex $i 1]
|
||||
if {[catch {exec git update-ref -d "refs/heads/$b" $o} err]} {
|
||||
if {[catch {git update-ref -d "refs/heads/$b" $o} err]} {
|
||||
append failed " - $b: $err\n"
|
||||
} else {
|
||||
set x [lsearch -sorted -exact $all_heads $b]
|
||||
@ -2366,7 +2472,7 @@ Staying on branch '$current_branch'."
|
||||
# here, it Just Works(tm). If it doesn't we are in some really ugly
|
||||
# state that is difficult to recover from within git-gui.
|
||||
#
|
||||
if {[catch {exec git symbolic-ref HEAD "refs/heads/$new_branch"} err]} {
|
||||
if {[catch {git symbolic-ref HEAD "refs/heads/$new_branch"} err]} {
|
||||
error_popup "Failed to set current branch.
|
||||
|
||||
This working directory is only partially switched.
|
||||
@ -2876,14 +2982,16 @@ proc do_local_merge {} {
|
||||
pack $w.source -fill both -expand 1 -pady 5 -padx 5
|
||||
|
||||
set cmd [list git for-each-ref]
|
||||
lappend cmd {--format=%(objectname) %(refname)}
|
||||
lappend cmd {--format=%(objectname) %(*objectname) %(refname)}
|
||||
lappend cmd refs/heads
|
||||
lappend cmd refs/remotes
|
||||
lappend cmd refs/tags
|
||||
set fr_fd [open "| $cmd" r]
|
||||
fconfigure $fr_fd -translation binary
|
||||
while {[gets $fr_fd line] > 0} {
|
||||
set line [split $line { }]
|
||||
set sha1([lindex $line 0]) [lindex $line 1]
|
||||
set sha1([lindex $line 0]) [lindex $line 2]
|
||||
set sha1([lindex $line 1]) [lindex $line 2]
|
||||
}
|
||||
close $fr_fd
|
||||
|
||||
@ -2891,7 +2999,7 @@ proc do_local_merge {} {
|
||||
set fr_fd [open "| git rev-list --all --not HEAD"]
|
||||
while {[gets $fr_fd line] > 0} {
|
||||
if {[catch {set ref $sha1($line)}]} continue
|
||||
regsub ^refs/(heads|remotes)/ $ref {} ref
|
||||
regsub ^refs/(heads|remotes|tags)/ $ref {} ref
|
||||
lappend to_show $ref
|
||||
}
|
||||
close $fr_fd
|
||||
@ -2972,7 +3080,14 @@ proc new_browser {commit} {
|
||||
global next_browser_id cursor_ptr M1B
|
||||
global browser_commit browser_status browser_stack browser_path browser_busy
|
||||
|
||||
if {[winfo ismapped .]} {
|
||||
set w .browser[incr next_browser_id]
|
||||
set tl $w
|
||||
toplevel $w
|
||||
} else {
|
||||
set w {}
|
||||
set tl .
|
||||
}
|
||||
set w_list $w.list.l
|
||||
set browser_commit($w_list) $commit
|
||||
set browser_status($w_list) {Starting...}
|
||||
@ -2980,7 +3095,6 @@ proc new_browser {commit} {
|
||||
set browser_path($w_list) $browser_commit($w_list):
|
||||
set browser_busy($w_list) 1
|
||||
|
||||
toplevel $w
|
||||
label $w.path -textvariable browser_path($w_list) \
|
||||
-anchor w \
|
||||
-justify left \
|
||||
@ -3030,8 +3144,8 @@ proc new_browser {commit} {
|
||||
bind $w_list <Left> break
|
||||
bind $w_list <Right> break
|
||||
|
||||
bind $w <Visibility> "focus $w"
|
||||
bind $w <Destroy> "
|
||||
bind $tl <Visibility> "focus $w"
|
||||
bind $tl <Destroy> "
|
||||
array unset browser_buffer $w_list
|
||||
array unset browser_files $w_list
|
||||
array unset browser_status $w_list
|
||||
@ -3040,7 +3154,7 @@ proc new_browser {commit} {
|
||||
array unset browser_commit $w_list
|
||||
array unset browser_busy $w_list
|
||||
"
|
||||
wm title $w "[appname] ([reponame]): File Browser"
|
||||
wm title $tl "[appname] ([reponame]): File Browser"
|
||||
ls_tree $w_list $browser_commit($w_list) {}
|
||||
}
|
||||
|
||||
@ -4161,7 +4275,7 @@ proc do_quit {} {
|
||||
set rc_geometry {}
|
||||
}
|
||||
if {$cfg_geometry ne $rc_geometry} {
|
||||
catch {exec git config gui.geometry $cfg_geometry}
|
||||
catch {git config gui.geometry $cfg_geometry}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4400,7 +4514,7 @@ proc do_about {} {
|
||||
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
|
||||
|
||||
label $w.desc \
|
||||
-text "[appname] - a commit creation tool for Git.
|
||||
-text "git-gui - a graphical user interface for Git.
|
||||
$copyright" \
|
||||
-padx 5 -pady 5 \
|
||||
-justify left \
|
||||
@ -4411,8 +4525,8 @@ $copyright" \
|
||||
pack $w.desc -side top -fill x -padx 5 -pady 5
|
||||
|
||||
set v {}
|
||||
append v "[appname] version $appvers\n"
|
||||
append v "[exec git version]\n"
|
||||
append v "git-gui version $appvers\n"
|
||||
append v "[git version]\n"
|
||||
append v "\n"
|
||||
if {$tcl_patchLevel eq $tk_patchLevel} {
|
||||
append v "Tcl/Tk version $tcl_patchLevel"
|
||||
@ -4471,7 +4585,7 @@ proc do_options {} {
|
||||
toplevel $w
|
||||
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
|
||||
|
||||
label $w.header -text "[appname] Options" \
|
||||
label $w.header -text "Options" \
|
||||
-font font_uibold
|
||||
pack $w.header -side top -fill x
|
||||
|
||||
@ -4945,6 +5059,7 @@ enable_option branch
|
||||
enable_option transport
|
||||
|
||||
switch -- $subcommand {
|
||||
browser -
|
||||
blame {
|
||||
disable_option multicommit
|
||||
disable_option branch
|
||||
@ -5094,6 +5209,12 @@ if {[is_enabled branch]} {
|
||||
-font font_ui
|
||||
lappend disable_on_lock [list .mbar.branch entryconf \
|
||||
[.mbar.branch index last] -state]
|
||||
|
||||
.mbar.branch add command -label {Reset...} \
|
||||
-command do_reset_hard \
|
||||
-font font_ui
|
||||
lappend disable_on_lock [list .mbar.branch entryconf \
|
||||
[.mbar.branch index last] -state]
|
||||
}
|
||||
|
||||
# -- Commit Menu
|
||||
@ -5168,6 +5289,34 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
|
||||
[list .mbar.commit entryconf [.mbar.commit index last] -state]
|
||||
}
|
||||
|
||||
# -- Merge Menu
|
||||
#
|
||||
if {[is_enabled branch]} {
|
||||
menu .mbar.merge
|
||||
.mbar.merge add command -label {Local Merge...} \
|
||||
-command do_local_merge \
|
||||
-font font_ui
|
||||
lappend disable_on_lock \
|
||||
[list .mbar.merge entryconf [.mbar.merge index last] -state]
|
||||
.mbar.merge add command -label {Abort Merge...} \
|
||||
-command do_reset_hard \
|
||||
-font font_ui
|
||||
lappend disable_on_lock \
|
||||
[list .mbar.merge entryconf [.mbar.merge index last] -state]
|
||||
|
||||
}
|
||||
|
||||
# -- Transport Menu
|
||||
#
|
||||
if {[is_enabled transport]} {
|
||||
menu .mbar.fetch
|
||||
|
||||
menu .mbar.push
|
||||
.mbar.push add command -label {Push...} \
|
||||
-command do_push_anywhere \
|
||||
-font font_ui
|
||||
}
|
||||
|
||||
if {[is_MacOSX]} {
|
||||
# -- Apple Menu (Mac OS X only)
|
||||
#
|
||||
@ -5177,7 +5326,7 @@ if {[is_MacOSX]} {
|
||||
.mbar.apple add command -label "About [appname]" \
|
||||
-command do_about \
|
||||
-font font_ui
|
||||
.mbar.apple add command -label "[appname] Options..." \
|
||||
.mbar.apple add command -label "Options..." \
|
||||
-command do_options \
|
||||
-font font_ui
|
||||
} else {
|
||||
@ -5236,7 +5385,7 @@ set doc_path [file dirname [gitexec]]
|
||||
set doc_path [file join $doc_path Documentation index.html]
|
||||
|
||||
if {[is_Cygwin]} {
|
||||
set doc_path [exec cygpath --windows $doc_path]
|
||||
set doc_path [exec cygpath --mixed $doc_path]
|
||||
}
|
||||
|
||||
if {$browser eq {}} {
|
||||
@ -5280,6 +5429,15 @@ bind all <$M1B-Key-W> {destroy [winfo toplevel %W]}
|
||||
# -- Not a normal commit type invocation? Do that instead!
|
||||
#
|
||||
switch -- $subcommand {
|
||||
browser {
|
||||
if {[llength $argv] != 1} {
|
||||
puts stderr "usage: $argv0 browser commit"
|
||||
exit 1
|
||||
}
|
||||
set current_branch [lindex $argv 0]
|
||||
new_browser $current_branch
|
||||
return
|
||||
}
|
||||
blame {
|
||||
if {[llength $argv] != 2} {
|
||||
puts stderr "usage: $argv0 blame commit path"
|
||||
@ -5302,7 +5460,7 @@ gui {
|
||||
# fall through to setup UI for commits
|
||||
}
|
||||
default {
|
||||
puts stderr "usage: $argv0 \[{blame|citool}\]"
|
||||
puts stderr "usage: $argv0 \[{blame|browser|citool}\]"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
@ -5326,28 +5484,6 @@ pack .branch.l1 -side left
|
||||
pack .branch.cb -side left -fill x
|
||||
pack .branch -side top -fill x
|
||||
|
||||
if {[is_enabled branch]} {
|
||||
menu .mbar.merge
|
||||
.mbar.merge add command -label {Local Merge...} \
|
||||
-command do_local_merge \
|
||||
-font font_ui
|
||||
lappend disable_on_lock \
|
||||
[list .mbar.merge entryconf [.mbar.merge index last] -state]
|
||||
.mbar.merge add command -label {Abort Merge...} \
|
||||
-command do_reset_hard \
|
||||
-font font_ui
|
||||
lappend disable_on_lock \
|
||||
[list .mbar.merge entryconf [.mbar.merge index last] -state]
|
||||
|
||||
|
||||
menu .mbar.fetch
|
||||
|
||||
menu .mbar.push
|
||||
.mbar.push add command -label {Push...} \
|
||||
-command do_push_anywhere \
|
||||
-font font_ui
|
||||
}
|
||||
|
||||
# -- Main Window Layout
|
||||
#
|
||||
panedwindow .vpane -orient vertical
|
||||
@ -5552,9 +5688,6 @@ bind_button3 $ui_comm "tk_popup $ctxm %X %Y"
|
||||
|
||||
# -- Diff Header
|
||||
#
|
||||
set current_diff_path {}
|
||||
set current_diff_side {}
|
||||
set diff_actions [list]
|
||||
proc trace_current_diff_path {varname args} {
|
||||
global current_diff_path diff_actions file_states
|
||||
if {$current_diff_path eq {}} {
|
||||
@ -5747,7 +5880,6 @@ unset ui_diff_applyhunk
|
||||
|
||||
# -- Status Bar
|
||||
#
|
||||
set ui_status_value {Initializing...}
|
||||
label .status -textvariable ui_status_value \
|
||||
-anchor w \
|
||||
-justify left \
|
||||
@ -5821,15 +5953,6 @@ unset i
|
||||
set file_lists($ui_index) [list]
|
||||
set file_lists($ui_workdir) [list]
|
||||
|
||||
set HEAD {}
|
||||
set PARENT {}
|
||||
set MERGE_HEAD [list]
|
||||
set commit_type {}
|
||||
set empty_tree {}
|
||||
set current_branch {}
|
||||
set current_diff_path {}
|
||||
set selected_commit_type new
|
||||
|
||||
wm title . "[appname] ([file normalize [file dirname [gitdir]]])"
|
||||
focus -force $ui_comm
|
||||
|
||||
@ -5904,7 +6027,7 @@ if {[is_enabled transport]} {
|
||||
if {[is_enabled multicommit]} {
|
||||
set object_limit 2000
|
||||
if {[is_Windows]} {set object_limit 200}
|
||||
regexp {^([0-9]+) objects,} [exec git count-objects] _junk objects_current
|
||||
regexp {^([0-9]+) objects,} [git count-objects] _junk objects_current
|
||||
if {$objects_current >= $object_limit} {
|
||||
if {[ask_popup \
|
||||
"This repository currently has $objects_current loose objects.
|
||||
|
@ -292,9 +292,14 @@ f,*)
|
||||
# Again the most common case of merging one remote.
|
||||
echo "Updating $(git-rev-parse --short $head)..$(git-rev-parse --short $1)"
|
||||
git-update-index --refresh 2>/dev/null
|
||||
msg="Fast forward"
|
||||
if test -n "$have_message"
|
||||
then
|
||||
msg="$msg (no commit created; -m option ignored)"
|
||||
fi
|
||||
new_head=$(git-rev-parse --verify "$1^0") &&
|
||||
git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" &&
|
||||
finish "$new_head" "Fast forward"
|
||||
finish "$new_head" "$msg" || exit
|
||||
dropsave
|
||||
exit 0
|
||||
;;
|
||||
|
@ -67,7 +67,7 @@ sub list_remote {
|
||||
$git->command(qw(config --get-regexp), '^remote\.');
|
||||
};
|
||||
for (@remotes) {
|
||||
if (/^remote\.([^.]*)\.(\S*)\s+(.*)$/) {
|
||||
if (/^remote\.(\S+?)\.([^.\s]+)\s+(.*)$/) {
|
||||
add_remote_config(\%seen, $1, $2, $3);
|
||||
}
|
||||
}
|
||||
|
2
git.c
2
git.c
@ -226,7 +226,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
|
||||
{ "add", cmd_add, RUN_SETUP | NOT_BARE },
|
||||
{ "annotate", cmd_annotate, USE_PAGER },
|
||||
{ "apply", cmd_apply },
|
||||
{ "archive", cmd_archive },
|
||||
{ "archive", cmd_archive, RUN_SETUP },
|
||||
{ "blame", cmd_blame, RUN_SETUP },
|
||||
{ "branch", cmd_branch, RUN_SETUP },
|
||||
{ "cat-file", cmd_cat_file, RUN_SETUP },
|
||||
|
184
gitweb/INSTALL
Normal file
184
gitweb/INSTALL
Normal file
@ -0,0 +1,184 @@
|
||||
GIT web Interface (gitweb) Installation
|
||||
=======================================
|
||||
|
||||
First you have to generate gitweb.cgi from gitweb.perl using
|
||||
"make gitweb/gitweb.cgi", then copy appropriate files (gitweb.cgi,
|
||||
gitweb.css, git-logo.png and git-favicon.png) to their destination.
|
||||
For example if git was (or is) installed with /usr prefix, you can do
|
||||
|
||||
$ make prefix=/usr gitweb/gitweb.cgi ;# as yourself
|
||||
# cp gitweb/git* /var/www/cgi-bin/ ;# as root
|
||||
|
||||
Alternatively you can use autoconf generated ./configure script to
|
||||
set up path to git binaries (via config.mak.autogen), so you can write
|
||||
instead
|
||||
|
||||
$ make configure ;# as yourself
|
||||
$ ./configure --prefix=/usr ;# as yourself
|
||||
$ make gitweb/gitweb.cgi ;# as yourself
|
||||
# cp gitweb/git* /var/www/cgi-bin/ ;# as root
|
||||
|
||||
The above example assumes that your web server is configured to run
|
||||
[executable] files in /var/www/cgi-bin/ as server scripts (as CGI
|
||||
scripts).
|
||||
|
||||
|
||||
Build time configuration
|
||||
------------------------
|
||||
|
||||
See also "How to configure gitweb for your local system" in README
|
||||
file for gitweb (in gitweb/README).
|
||||
|
||||
- There are many configuration variables which affects building of
|
||||
gitweb.cgi; see "default configuration for gitweb" section in main
|
||||
(top dir) Makefile, and instructions for building gitweb/gitweb.cgi
|
||||
target.
|
||||
|
||||
One of most important is where to find git wrapper binary. Gitweb
|
||||
tries to find git wrapper at $(bindir)/git, so you have to set $bindir
|
||||
when building gitweb.cgi, or $prefix from which $bindir is derived. If
|
||||
you build and install gitweb together with the rest of git suite,
|
||||
there should be no problems. Otherwise, if git was for example
|
||||
installed from a binary package, you have to set $prefix (or $bindir)
|
||||
accordingly.
|
||||
|
||||
- Another important issue is where are git repositories you want to make
|
||||
available to gitweb. By default gitweb search for repositories under
|
||||
/pub/git; if you want to have projects somewhere else, like /home/git,
|
||||
use GITWEB_PROJECTROOT build configuration variable.
|
||||
|
||||
By default all git repositories under projectroot are visible and
|
||||
available to gitweb. List of projects is generated by default by
|
||||
scanning the projectroot directory for git repositories. This can be
|
||||
changed (configured) as described in "Gitweb repositories" section
|
||||
below.
|
||||
|
||||
Note that gitweb deals directly with object database, and does not
|
||||
need working directory; the name of the project is the name of its
|
||||
repository object database, usually projectname.git for bare
|
||||
repositories. If you want to provide gitweb access to non-bare (live)
|
||||
repository, you can make projectname.git symbolic link under
|
||||
projectroot linking to projectname/.git (but it is just
|
||||
a suggestion).
|
||||
|
||||
- You can control where gitweb tries to find its main CSS style file,
|
||||
its favicon and logo with GITWEB_CSS, GITWEB_FAVICON and GITWEB_LOGO
|
||||
build configuration variables. By default gitweb tries to find them
|
||||
in the same directory as gitweb.cgi script.
|
||||
|
||||
Build example
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
- To install gitweb to /var/www/cgi-bin/gitweb/ when git wrapper
|
||||
is installed at /usr/local/bin/git and the repositories (projects)
|
||||
we want to display are under /home/local/scm, you can do
|
||||
|
||||
make GITWEB_PROJECTROOT="/home/local/scm" \
|
||||
GITWEB_CSS="/gitweb/gitweb.css" \
|
||||
GITWEB_LOGO="/gitweb/git-logo.png" \
|
||||
GITWEB_FAVICON="/gitweb/git-favicon.png" \
|
||||
bindir=/usr/local/bin \
|
||||
gitweb/gitweb.cgi
|
||||
|
||||
cp -fv ~/git/gitweb/gitweb.{cgi,css} \
|
||||
~/git/gitweb/git-{favicon,logo}.png \
|
||||
/var/www/cgi-bin/gitweb/
|
||||
|
||||
|
||||
Gitweb config file
|
||||
------------------
|
||||
|
||||
See also "Runtime gitweb configuration" section in README file
|
||||
for gitweb (in gitweb/README).
|
||||
|
||||
- You can configure gitweb further using gitweb configuration file;
|
||||
by default it is file named gitweb_config.perl in the same place as
|
||||
gitweb.cgi script. You can control default place for config file
|
||||
using GITWEB_CONFIG build configuration variable, and you can set it
|
||||
using GITWEB_CONFIG environmental variable.
|
||||
|
||||
- Gitweb config file is [fragment] of perl code. You can set variables
|
||||
using "our $variable = value"; text from "#" character until the end
|
||||
of a line is ignored. See perlsyn(1) for details.
|
||||
|
||||
See the top of gitweb.perl file for examples of customizable options.
|
||||
|
||||
|
||||
Gitweb repositories:
|
||||
--------------------
|
||||
|
||||
- By default all git repositories under projectroot are visible and
|
||||
available to gitweb. List of projects is generated by default by
|
||||
scanning the projectroot directory for git repositories (for object
|
||||
databases to be more exact).
|
||||
|
||||
You can provide pre-generated list of [visible] repositories,
|
||||
together with information about their owners (the project ownership
|
||||
is taken from owner of repository directory otherwise), by setting
|
||||
GITWEB_LIST build configuration variable (or $projects_list variable
|
||||
in gitweb config file) to point to a plain file.
|
||||
|
||||
Each line of projects list file should consist of url-encoded path
|
||||
to project repository database (relative to projectroot) separated
|
||||
by space from url-encoded project owner; spaces in both project path
|
||||
and project owner have to be encoded as either '%20' or '+'.
|
||||
|
||||
You can generate projects list index file using project_index action
|
||||
(the 'TXT' link on projects list page) directly from gitweb.
|
||||
|
||||
- By default even if project is not visible on projects list page, you
|
||||
can view it nevertheless by hand-crafting gitweb URL. You can set
|
||||
GITWEB_STRICT_EXPORT build configuration variable (or $strict_export
|
||||
variable in gitweb config file) to only allow viewing of
|
||||
repositories also shown on the overview page.
|
||||
|
||||
- Alternatively, you can configure gitweb to only list and allow
|
||||
viewing of the explicitly exported repositories, via
|
||||
GITWEB_EXPORT_OK build configuration variable (or $export_ok
|
||||
variable in gitweb config file). If it evaluates to true, gitweb
|
||||
show repository only if this file exists in its object database
|
||||
(if directory has the magic file $export_ok).
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
- Core git tools
|
||||
- Perl
|
||||
- Perl modules: CGI, Encode, Fcntl, File::Find, File::Basename.
|
||||
- web server
|
||||
|
||||
|
||||
Example web server configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
See also "Webserver configuration" section in README file for gitweb
|
||||
(in gitweb/README).
|
||||
|
||||
|
||||
- Apache2, gitweb installed as CGI script,
|
||||
under /var/www/cgi-bin/
|
||||
|
||||
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
|
||||
|
||||
<Directory "/var/www/cgi-bin">
|
||||
Options Indexes FollowSymlinks ExecCGI
|
||||
AllowOverride None
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
|
||||
- Apache2, gitweb installed as mod_perl legacy script,
|
||||
under /var/www/perl/
|
||||
|
||||
Alias /perl "/var/www/perl"
|
||||
|
||||
<Directory "/var/www/perl">
|
||||
SetHandler perl-script
|
||||
PerlResponseHandler ModPerl::Registry
|
||||
PerlOptions +ParseHeaders
|
||||
Options Indexes FollowSymlinks +ExecCGI
|
||||
AllowOverride None
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
@ -107,7 +107,7 @@ span.age {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
div.page_body span.signoff {
|
||||
span.signoff {
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
|
@ -591,7 +591,7 @@ sub esc_html ($;%) {
|
||||
my %opts = @_;
|
||||
|
||||
$str = to_utf8($str);
|
||||
$str = escapeHTML($str);
|
||||
$str = $cgi->escapeHTML($str);
|
||||
if ($opts{'-nbsp'}) {
|
||||
$str =~ s/ / /g;
|
||||
}
|
||||
@ -605,7 +605,7 @@ sub esc_path {
|
||||
my %opts = @_;
|
||||
|
||||
$str = to_utf8($str);
|
||||
$str = escapeHTML($str);
|
||||
$str = $cgi->escapeHTML($str);
|
||||
if ($opts{'-nbsp'}) {
|
||||
$str =~ s/ / /g;
|
||||
}
|
||||
@ -1974,17 +1974,17 @@ sub git_print_page_path {
|
||||
$fullname .= ($fullname ? '/' : '') . $dir;
|
||||
print $cgi->a({-href => href(action=>"tree", file_name=>$fullname,
|
||||
hash_base=>$hb),
|
||||
-title => esc_html($fullname)}, esc_path($dir));
|
||||
-title => $fullname}, esc_path($dir));
|
||||
print " / ";
|
||||
}
|
||||
if (defined $type && $type eq 'blob') {
|
||||
print $cgi->a({-href => href(action=>"blob_plain", file_name=>$file_name,
|
||||
hash_base=>$hb),
|
||||
-title => esc_html($name)}, esc_path($basename));
|
||||
-title => $name}, esc_path($basename));
|
||||
} elsif (defined $type && $type eq 'tree') {
|
||||
print $cgi->a({-href => href(action=>"tree", file_name=>$file_name,
|
||||
hash_base=>$hb),
|
||||
-title => esc_html($name)}, esc_path($basename));
|
||||
-title => $name}, esc_path($basename));
|
||||
print " / ";
|
||||
} else {
|
||||
print esc_path($basename);
|
||||
@ -3719,7 +3719,7 @@ sub git_commit {
|
||||
$formats_nav .=
|
||||
'(merge: ' .
|
||||
join(' ', map {
|
||||
$cgi->a({-href => href(action=>"commitdiff",
|
||||
$cgi->a({-href => href(action=>"commit",
|
||||
hash=>$_)},
|
||||
esc_html(substr($_, 0, 7)));
|
||||
} @$parents ) .
|
||||
|
12
http-push.c
12
http-push.c
@ -1271,7 +1271,9 @@ xml_cdata(void *userData, const XML_Char *s, int len)
|
||||
struct xml_ctx *ctx = (struct xml_ctx *)userData;
|
||||
free(ctx->cdata);
|
||||
ctx->cdata = xmalloc(len + 1);
|
||||
strlcpy(ctx->cdata, s, len + 1);
|
||||
/* NB: 's' is not null-terminated, can not use strlcpy here */
|
||||
memcpy(ctx->cdata, s, len);
|
||||
ctx->cdata[len] = '\0';
|
||||
}
|
||||
|
||||
static struct remote_lock *lock_remote(const char *path, long timeout)
|
||||
@ -1295,7 +1297,7 @@ static struct remote_lock *lock_remote(const char *path, long timeout)
|
||||
sprintf(url, "%s%s", remote->url, path);
|
||||
|
||||
/* Make sure leading directories exist for the remote ref */
|
||||
ep = strchr(url + strlen(remote->url) + 11, '/');
|
||||
ep = strchr(url + strlen(remote->url) + 1, '/');
|
||||
while (ep) {
|
||||
*ep = 0;
|
||||
slot = get_active_slot();
|
||||
@ -1473,7 +1475,8 @@ static void process_ls_object(struct remote_ls_ctx *ls)
|
||||
return;
|
||||
path += 8;
|
||||
obj_hex = xmalloc(strlen(path));
|
||||
strlcpy(obj_hex, path, 3);
|
||||
/* NB: path is not null-terminated, can not use strlcpy here */
|
||||
memcpy(obj_hex, path, 2);
|
||||
strcpy(obj_hex + 2, path + 3);
|
||||
one_remote_object(obj_hex);
|
||||
free(obj_hex);
|
||||
@ -2170,7 +2173,8 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)
|
||||
/* If it's a symref, set the refname; otherwise try for a sha1 */
|
||||
if (!strncmp((char *)buffer.buffer, "ref: ", 5)) {
|
||||
*symref = xmalloc(buffer.posn - 5);
|
||||
strlcpy(*symref, (char *)buffer.buffer + 5, buffer.posn - 5);
|
||||
memcpy(*symref, (char *)buffer.buffer + 5, buffer.posn - 6);
|
||||
(*symref)[buffer.posn - 6] = '\0';
|
||||
} else {
|
||||
get_sha1_hex(buffer.buffer, sha1);
|
||||
}
|
||||
|
@ -277,13 +277,19 @@ static void *get_data_from_pack(struct object_entry *obj)
|
||||
{
|
||||
unsigned long from = obj[0].offset + obj[0].hdr_size;
|
||||
unsigned long len = obj[1].offset - from;
|
||||
unsigned long rdy = 0;
|
||||
unsigned char *src, *data;
|
||||
z_stream stream;
|
||||
int st;
|
||||
|
||||
src = xmalloc(len);
|
||||
if (pread(pack_fd, src, len, from) != len)
|
||||
data = src;
|
||||
do {
|
||||
ssize_t n = pread(pack_fd, data + rdy, len - rdy, from + rdy);
|
||||
if (n <= 0)
|
||||
die("cannot pread pack file: %s", strerror(errno));
|
||||
rdy += n;
|
||||
} while (rdy < len);
|
||||
data = xmalloc(obj->size);
|
||||
memset(&stream, 0, sizeof(stream));
|
||||
stream.next_out = data;
|
||||
|
@ -60,7 +60,7 @@ static int merge_entry(int pos, const char *path)
|
||||
break;
|
||||
found++;
|
||||
strcpy(hexbuf[stage], sha1_to_hex(ce->sha1));
|
||||
sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode) & (~S_IFMT));
|
||||
sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode));
|
||||
arguments[stage] = hexbuf[stage];
|
||||
arguments[stage + 4] = ownbuf[stage];
|
||||
} while (++pos < active_nr);
|
||||
|
@ -589,7 +589,7 @@ static void update_file_flags(const unsigned char *sha,
|
||||
memcpy(lnk, buf, size);
|
||||
lnk[size] = '\0';
|
||||
mkdir_p(path, 0777);
|
||||
unlink(lnk);
|
||||
unlink(path);
|
||||
symlink(lnk, path);
|
||||
} else
|
||||
die("do not know what to do with %06o %s '%s'",
|
||||
|
@ -158,7 +158,10 @@ static int update(struct command *cmd)
|
||||
cmd->error_string = "failed to lock";
|
||||
return error("failed to lock %s", name);
|
||||
}
|
||||
write_ref_sha1(lock, new_sha1, "push");
|
||||
if (write_ref_sha1(lock, new_sha1, "push")) {
|
||||
cmd->error_string = "failed to write";
|
||||
return -1; /* error() already called */
|
||||
}
|
||||
fprintf(stderr, "%s: %s -> %s\n", name, old_hex, new_hex);
|
||||
}
|
||||
return 0;
|
||||
|
4
refs.c
4
refs.c
@ -921,6 +921,8 @@ static int log_ref_write(const char *ref_name, const unsigned char *old_sha1,
|
||||
log_file, strerror(errno));
|
||||
}
|
||||
|
||||
adjust_shared_perm(log_file);
|
||||
|
||||
msglen = 0;
|
||||
if (msg) {
|
||||
/* clean up the message and make sure it is a single line */
|
||||
@ -1042,7 +1044,9 @@ int create_symref(const char *ref_target, const char *refs_heads_master,
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifndef NO_SYMLINK_HEAD
|
||||
done:
|
||||
#endif
|
||||
if (logmsg && !read_ref(refs_heads_master, new_sha1))
|
||||
log_ref_write(ref_target, old_sha1, new_sha1, logmsg);
|
||||
|
||||
|
@ -116,6 +116,8 @@ void mark_parents_uninteresting(struct commit *commit)
|
||||
|
||||
void add_pending_object(struct rev_info *revs, struct object *obj, const char *name)
|
||||
{
|
||||
if (revs->no_walk && (obj->flags & UNINTERESTING))
|
||||
die("object ranges do not make sense when not walking revisions");
|
||||
add_object_array(obj, name, &revs->pending);
|
||||
if (revs->reflog_info && obj->type == OBJ_COMMIT)
|
||||
add_reflog_for_walk(revs->reflog_info,
|
||||
|
2
setup.c
2
setup.c
@ -216,7 +216,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
|
||||
die("Not a git repository: '%s'", gitdirenv);
|
||||
}
|
||||
|
||||
if (!getcwd(cwd, sizeof(cwd)) || cwd[0] != '/')
|
||||
if (!getcwd(cwd, sizeof(cwd)-1) || cwd[0] != '/')
|
||||
die("Unable to read current working directory");
|
||||
|
||||
offset = len = strlen(cwd);
|
||||
|
@ -114,7 +114,8 @@ test_expect_success \
|
||||
test_expect_success \
|
||||
'some edit' \
|
||||
'mv file file.orig &&
|
||||
sed -e "s/^3A/99/" -e "/^1A/d" < file.orig > file &&
|
||||
sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" < file.orig > file &&
|
||||
echo "incomplete" | tr -d "\\012" >>file &&
|
||||
GIT_AUTHOR_NAME="D" git commit -a -m "edit"'
|
||||
|
||||
test_expect_success \
|
||||
|
@ -23,7 +23,8 @@ test_expect_success setup '
|
||||
cat file2 >file2.orig
|
||||
git add file1 file2 &&
|
||||
sed -e "/^B/d" <file1.orig >file1 &&
|
||||
sed -e "/^B/d" <file2.orig >file2 &&
|
||||
sed -e "/^[BQ]/d" <file2.orig >file2 &&
|
||||
echo Q | tr -d "\\012" >>file2 &&
|
||||
cat file1 >file1.mods &&
|
||||
cat file2 >file2.mods &&
|
||||
git diff |
|
||||
|
@ -11,7 +11,7 @@ test_expect_success 'split sample box' \
|
||||
'git-mailsplit -o. ../t5100/sample.mbox >last &&
|
||||
last=`cat last` &&
|
||||
echo total is $last &&
|
||||
test `cat last` = 5'
|
||||
test `cat last` = 6'
|
||||
|
||||
for mail in `echo 00*`
|
||||
do
|
||||
|
5
t/t5100/info0006
Normal file
5
t/t5100/info0006
Normal file
@ -0,0 +1,5 @@
|
||||
Author: A U Thor
|
||||
Email: a.u.thor@example.com
|
||||
Subject: a commit.
|
||||
Date: Fri, 9 Jun 2006 00:44:16 -0700
|
||||
|
2
t/t5100/msg0006
Normal file
2
t/t5100/msg0006
Normal file
@ -0,0 +1,2 @@
|
||||
Here is a patch from A U Thor.
|
||||
|
14
t/t5100/patch0006
Normal file
14
t/t5100/patch0006
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
foo | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/foo b/foo
|
||||
index 9123cdc..918dcf8 100644
|
||||
--- a/foo
|
||||
+++ b/foo
|
||||
@@ -1 +1 @@
|
||||
-Fri Jun 9 00:44:04 PDT 2006
|
||||
+Fri Jun 9 00:44:13 PDT 2006
|
||||
--
|
||||
1.4.0.g6f2b
|
||||
|
@ -315,3 +315,74 @@ To unsubscribe from this list: send the line "unsubscribe git" in
|
||||
the body of a message to majordomo@vger.kernel.org
|
||||
More majordomo info at http://vger.kernel.org/majordomo-info.html
|
||||
|
||||
From nobody Mon Sep 17 00:00:00 2001
|
||||
From: A U Thor <a.u.thor@example.com>
|
||||
References: <Pine.LNX.4.640.0001@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0002@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0003@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0004@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0005@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0006@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0007@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0008@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0009@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0010@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0011@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0012@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0013@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0014@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0015@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0016@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0017@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0018@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0019@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0020@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0021@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0022@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0023@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0024@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0025@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0026@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0027@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0028@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0029@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0030@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0031@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0032@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0033@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0034@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0035@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0036@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0037@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0038@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0039@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0040@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0041@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0042@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0043@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0044@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0045@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0046@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0047@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0048@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0049@woody.linux-foundation.org>
|
||||
<Pine.LNX.4.640.0050@woody.linux-foundation.org>
|
||||
Date: Fri, 9 Jun 2006 00:44:16 -0700
|
||||
Subject: [PATCH] a commit.
|
||||
|
||||
Here is a patch from A U Thor.
|
||||
|
||||
---
|
||||
foo | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/foo b/foo
|
||||
index 9123cdc..918dcf8 100644
|
||||
--- a/foo
|
||||
+++ b/foo
|
||||
@@ -1 +1 @@
|
||||
-Fri Jun 9 00:44:04 PDT 2006
|
||||
+Fri Jun 9 00:44:13 PDT 2006
|
||||
--
|
||||
1.4.0.g6f2b
|
||||
|
||||
|
@ -64,7 +64,7 @@ case "$refname","$newrev_type" in
|
||||
# un-annotated tag
|
||||
refname_type="tag"
|
||||
short_refname=${refname##refs/tags/}
|
||||
if [ $allowunannotated != "true" ]; then
|
||||
if [ "$allowunannotated" != "true" ]; then
|
||||
echo "*** The un-annotated tag, $short_refname is not allowed in this repository" >&2
|
||||
echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
|
||||
exit 1
|
||||
|
20
utf8.c
20
utf8.c
@ -3,13 +3,15 @@
|
||||
|
||||
/* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */
|
||||
|
||||
typedef unsigned int ucs_char_t; /* assuming 32bit int */
|
||||
|
||||
struct interval {
|
||||
int first;
|
||||
int last;
|
||||
};
|
||||
|
||||
/* auxiliary function for binary search in interval table */
|
||||
static int bisearch(wchar_t ucs, const struct interval *table, int max) {
|
||||
static int bisearch(ucs_char_t ucs, const struct interval *table, int max) {
|
||||
int min = 0;
|
||||
int mid;
|
||||
|
||||
@ -56,11 +58,11 @@ static int bisearch(wchar_t ucs, const struct interval *table, int max) {
|
||||
* ISO 8859-1 and WGL4 characters, Unicode control characters,
|
||||
* etc.) have a column width of 1.
|
||||
*
|
||||
* This implementation assumes that wchar_t characters are encoded
|
||||
* This implementation assumes that ucs_char_t characters are encoded
|
||||
* in ISO 10646.
|
||||
*/
|
||||
|
||||
static int wcwidth(wchar_t ch)
|
||||
static int wcwidth(ucs_char_t ch)
|
||||
{
|
||||
/*
|
||||
* Sorted list of non-overlapping intervals of non-spacing characters,
|
||||
@ -157,7 +159,7 @@ static int wcwidth(wchar_t ch)
|
||||
int utf8_width(const char **start)
|
||||
{
|
||||
unsigned char *s = (unsigned char *)*start;
|
||||
wchar_t ch;
|
||||
ucs_char_t ch;
|
||||
|
||||
if (*s < 0x80) {
|
||||
/* 0xxxxxxx */
|
||||
@ -291,11 +293,17 @@ int is_encoding_utf8(const char *name)
|
||||
* with iconv. If the conversion fails, returns NULL.
|
||||
*/
|
||||
#ifndef NO_ICONV
|
||||
#ifdef OLD_ICONV
|
||||
typedef const char * iconv_ibp;
|
||||
#else
|
||||
typedef char * iconv_ibp;
|
||||
#endif
|
||||
char *reencode_string(const char *in, const char *out_encoding, const char *in_encoding)
|
||||
{
|
||||
iconv_t conv;
|
||||
size_t insz, outsz, outalloc;
|
||||
char *out, *outpos, *cp;
|
||||
char *out, *outpos;
|
||||
iconv_ibp cp;
|
||||
|
||||
if (!in_encoding)
|
||||
return NULL;
|
||||
@ -307,7 +315,7 @@ char *reencode_string(const char *in, const char *out_encoding, const char *in_e
|
||||
outalloc = outsz + 1; /* for terminating NUL */
|
||||
out = xmalloc(outalloc);
|
||||
outpos = out;
|
||||
cp = (char *)in;
|
||||
cp = (iconv_ibp)in;
|
||||
|
||||
while (1) {
|
||||
size_t cnt = iconv(conv, &cp, &insz, &outpos, &outsz);
|
||||
|
Reference in New Issue
Block a user