Compare commits

..

2 Commits

Author SHA1 Message Date
cbcab75c54 Git 1.7.0.8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-02 12:13:27 -08:00
6b3020a241 add: introduce add.ignoreerrors synonym for add.ignore-errors
The "[add] ignore-errors" tweakable introduced by v1.5.6-rc0~30^2 (Add
a config option to ignore errors for git-add, 2008-05-12) does not
follow the usual convention for naming values in the git configuration
file.

What convention?  Glad you asked.

	The section name indicates the affected subsystem.

	The subsection name, if any, indicates which of
	an unbound set of things to set the value for.

	The variable name describes the effect of tweaking
	this knob.

	The section and variable names can be broken into
	words using bumpyCaps in documentation as a hint to
	the reader.  These word breaks are not significant
	at the level of code, since the section and variable
	names are not case sensitive.

The name "add.ignore-errors" includes a dash, meaning a naive
configuration file like

	[add]
		ignoreErrors

does not have any effect.  Avoid such confusion by renaming to the
more consistent add.ignoreErrors, but keep the old version for
backwards compatibility.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-01 13:40:12 -08:00
376 changed files with 2765 additions and 12736 deletions

3
.gitignore vendored
View File

@ -155,9 +155,7 @@
/git-write-tree
/git-core-*/?*
/gitk-git/gitk-wish
/gitweb/GITWEB-BUILD-OPTIONS
/gitweb/gitweb.cgi
/gitweb/gitweb.min.*
/test-chmtime
/test-ctype
/test-date
@ -179,7 +177,6 @@
*.exe
*.[aos]
*.py[co]
.depend/
*+
/config.mak
/autom4te.cache

View File

@ -1,96 +0,0 @@
Git v1.7.1.1 Release Notes
==========================
Fixes since v1.7.1
------------------
* Authentication over http transport can now be made lazily, in that the
request can first go to a URL without username, get a 401 response and
then the client will ask for the username to use.
* We used to mistakenly think "../work" is a subdirectory of the current
directory when we are in "../work-xyz".
* The attribute mechanism now allows an entry that uses an attribute
macro that set/unset one attribute, immediately followed by an
overriding setting; this makes attribute macros much easier to use.
* We didn't recognize timezone "Z" as a synonym for "UTC" (75b37e70).
* In 1.7.0, read-tree and user commands that use the mechanism such as
checkout and merge were fixed to handle switching between branches one
of which has a file while the other has a directory at the same path
correctly even when there are some "confusing" pathnames in them. But
the algorithm used for this fix was suboptimal and had a terrible
performance degradation especially in larger trees.
* "git am -3" did not show diagnosis when the patch in the message was corrupt.
* After "git apply --whitespace=fix" removed trailing blank lines in an
patch in a patch series, it failed to apply later patches that depend
on the presence of such blank lines.
* "git bundle --stdin" segfaulted.
* "git checkout" and "git rebase" overwrote paths that are marked "assume
unchanged".
* "git commit --amend" on a commit with an invalid author-name line that
lacks the display name didn't work.
* "git describe" did not tie-break tags that point at the same commit
correctly; newer ones are preferred by paying attention to the
tagger date now.
* "git diff" used to tell underlying xdiff machinery to work very hard to
minimize the output, but this often was spending too many extra cycles
for very little gain.
* "git diff --color" did not paint extended diff headers per line
(i.e. the coloring escape sequence didn't end at the end of line),
which confused "less -R".
* "git fetch" over HTTP verifies the downloaded packfiles more robustly.
* The memory usage by "git index-pack" (run during "git fetch" and "git
push") got leaner.
* "GIT_DIR=foo.git git init --bare bar.git" created foo.git instead of bar.git.
* "git log --abbrev=$num --format='%h' ignored --abbrev=$num.
* "git ls-files ../out/side/cwd" refused to work.
* "git merge --log" used to replace the custom message given by "-m" with
the shortlog, instead of appending to it.
* "git notes copy" without any other argument segfaulted.
* "git pull" accepted "--dry-run", gave it to underlying "git fetch" but
ignored the option itself, resulting in a bogus attempt to merge
unrelated commit.
* "git rebase" did not faithfully reproduce a malformed author ident, that
is often seen in a repository converted from foreign SCMs.
* "git reset --hard" started from a wrong directory and a working tree in
a nonstandard location is in use got confused.
* "git send-email" lacked a way to specify the domainname used in the
EHLO/HELO exchange, causing rejected connection from picky servers.
It learned --smtp-domain option to solve this issue.
* "git send-email" did not declare a content-transfer-encoding and
content-type even when its payload needs to be sent in 8-bit.
* "git show -C -C" and other corner cases lost diff metainfo output
in 1.7.0.
* "git stash" incorrectly lost paths in the working tree that were
previously removed from the index.
* "git status" stopped refreshing the index by mistake in 1.7.1.
* "git status" showed excess "hints" even when advice.statusHints is set to false.
And other minor fixes and documentation updates.

View File

@ -1,28 +0,0 @@
Git v1.7.1.2 Release Notes
==========================
Fixes since v1.7.1.1
--------------------
* "git commit" did not honor GIT_REFLOG_ACTION environment variable, resulting
reflog messages for cherry-pick and revert actions to be recorded as "commit".
* "git clone/fetch/pull" issued an incorrect error message when a ref and
a symref that points to the ref were updated at the same time. This
obviously would update them to the same value, and should not result in
an error condition.
* "git diff" inside a tree with many pathnames that have certain
characters has become very slow in 1.7.0 by mistake.
* "git rev-parse --parseopt --stop-at-non-option" did not stop at non option
when --keep-dashdash was in effect.
* An overlong line after ".gitdir: " in a git file caused out of bounds
access to an array on the stack.
* "git config --path conf.var" to attempt to expand a variable conf.var
that uses "~/" short-hand segfaulted when $HOME environment variable
was not set.
And other minor fixes and documentation updates.

View File

@ -1,89 +0,0 @@
Git v1.7.1 Release Notes
========================
Updates since v1.7.0
--------------------
* Eric Raymond is the maintainer of updated CIAbot scripts, in contrib/.
* gitk updates.
* Some commands (e.g. svn and http interfaces) that interactively ask
for a password can be told to use an external program given via
GIT_ASKPASS.
* Conflict markers that lead the common ancestor in diff3-style output
now have a label, which hopefully would help third-party tools that
expect one.
* Comes with an updated bash-completion script.
* "git am" learned "--keep-cr" option to handle inputs that are
a mixture of changes to files with and without CRLF line endings.
* "git cvsimport" learned -R option to leave revision mapping between
CVS revisions and resulting git commits.
* "git diff --submodule" notices and describes dirty submodules.
* "git for-each-ref" learned %(symref), %(symref:short) and %(flag)
tokens.
* "git hash-object --stdin-paths" can take "--no-filters" option now.
* "git init" can be told to look at init.templatedir configuration
variable (obviously that has to come from either /etc/gitconfig or
$HOME/.gitconfig).
* "git grep" learned "--no-index" option, to search inside contents that
are not managed by git.
* "git grep" learned --color=auto/always/never.
* "git grep" learned to paint filename and line-number in colors.
* "git log -p --first-parent -m" shows one-parent diff for merge
commits, instead of showing combined diff.
* "git merge-file" learned to use custom conflict marker size and also
to use the "union merge" behaviour.
* "git notes" command has been rewritten in C and learned many commands
and features to help you carry notes forward across rebases and amends.
* "git request-pull" identifies the commit the request is relative to in
a more readable way.
* "git reset" learned "--keep" option that lets you discard commits
near the tip while preserving your local changes in a way similar
to how "git checkout branch" does.
* "git status" notices and describes dirty submodules.
* "git svn" should work better when interacting with repositories
with CRLF line endings.
* "git imap-send" learned to support CRAM-MD5 authentication.
* "gitweb" installation procedure can use "minified" js/css files
better.
* Various documentation updates.
Fixes since v1.7.0
------------------
All of the fixes in v1.7.0.X maintenance series are included in this
release, unless otherwise noted.
* "git add frotz/nitfol" did not complain when the entire frotz/ directory
was ignored.
* "git diff --stat" used "int" to count the size of differences,
which could result in overflowing.
* "git rev-list --pretty=oneline" didn't terminate a record with LF for
commits without any message.
* "git rev-list --abbrev-commit" defaulted to 40-byte abbreviations, unlike
newer tools in the git toolset.

View File

@ -0,0 +1,10 @@
Git v1.7.0.8 Release Notes
==========================
This is primarily to backport support for the new "add.ignoreErrors"
name given to the existing "add.ignore-errors" configuration variable.
The next version, Git 1.7.4, and future versions, will support both
old and incorrect name and the new corrected name, but without this
backport, users who want to use the new name "add.ignoreErrors" in
their repositories cannot use older versions of Git.

View File

@ -41,7 +41,6 @@ Checklist (and a short version for the impatient):
maintainer (gitster@pobox.com) if (and only if) the patch
is ready for inclusion. If you use git-send-email(1),
please test it first by sending email to yourself.
- see below for instructions specific to your mailer
Long version:
@ -54,34 +53,6 @@ But the patch submission requirements are a lot more relaxed
here on the technical/contents front, because the core GIT is
thousand times smaller ;-). So here is only the relevant bits.
(0) Decide what to base your work on.
In general, always base your work on the oldest branch that your
change is relevant to.
- A bugfix should be based on 'maint' in general. If the bug is not
present in 'maint', base it on 'master'. For a bug that's not yet
in 'master', find the topic that introduces the regression, and
base your work on the tip of the topic.
- A new feature should be based on 'master' in general. If the new
feature depends on a topic that is in 'pu', but not in 'master',
base your work on the tip of that topic.
- Corrections and enhancements to a topic not yet in 'master' should
be based on the tip of that topic. If the topic has not been merged
to 'next', it's alright to add a note to squash minor corrections
into the series.
- In the exceptional case that a new feature depends on several topics
not in 'master', start working on 'next' or 'pu' privately and send
out patches for discussion. Before the final merge, you may have to
wait until some of the dependent topics graduate to 'master', and
rebase your work.
To find the tip of a topic branch, run "git log --first-parent
master..pu" and look for the merge commit. The second parent of this
commit is the tip of the topic branch.
(1) Make separate commits for logically separate changes.
@ -199,16 +170,17 @@ patch, format it as "multipart/signed", not a text/plain message
that starts with '-----BEGIN PGP SIGNED MESSAGE-----'. That is
not a text/plain, it's something else.
Unless your patch is a very trivial and an obviously correct one,
first send it with "To:" set to the mailing list, with "cc:" listing
people who are involved in the area you are touching (the output from
"git blame $path" and "git shortlog --no-merges $path" would help to
identify them), to solicit comments and reviews. After the list
reached a consensus that it is a good idea to apply the patch, re-send
it with "To:" set to the maintainer and optionally "cc:" the list for
inclusion. Do not forget to add trailers such as "Acked-by:",
"Reviewed-by:" and "Tested-by:" after your "Signed-off-by:" line as
necessary.
Note that your maintainer does not necessarily read everything
on the git mailing list. If your patch is for discussion first,
send it "To:" the mailing list, and optionally "cc:" him. If it
is trivially correct or after the list reached a consensus, send
it "To:" the maintainer and optionally "cc:" the list for
inclusion.
Also note that your maintainer does not actively involve himself in
maintaining what are in contrib/ hierarchy. When you send fixes and
enhancements to them, do not forget to "cc: " the person who primarily
worked on that hierarchy in contrib/.
(4) Sign your work
@ -547,28 +519,12 @@ Gmail
GMail does not appear to have any way to turn off line wrapping in the web
interface, so this will mangle any emails that you send. You can however
use "git send-email" and send your patches through the GMail SMTP server, or
use any IMAP email client to connect to the google IMAP server and forward
the emails through that.
use any IMAP email client to connect to the google imap server, and forward
the emails through that. Just make sure to disable line wrapping in that
email client. Alternatively, use "git send-email" instead.
To use "git send-email" and send your patches through the GMail SMTP server,
edit ~/.gitconfig to specify your account settings:
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = user@gmail.com
smtppass = p4ssw0rd
smtpserverport = 587
Once your commits are ready to be sent to the mailing list, run the
following commands:
$ git format-patch --cover-letter -M origin/master -o outgoing/
$ edit outgoing/0000-*
$ git send-email outgoing/*
To submit using the IMAP interface, first, edit your ~/.gitconfig to specify your
Submitting properly formatted patches via Gmail is simple now that
IMAP support is available. First, edit your ~/.gitconfig to specify your
account settings:
[imap]
@ -582,12 +538,14 @@ account settings:
You might need to instead use: folder = "[Google Mail]/Drafts" if you get an error
that the "Folder doesn't exist".
Once your commits are ready to be sent to the mailing list, run the
following commands:
Next, ensure that your Gmail settings are correct. In "Settings" the
"Use Unicode (UTF-8) encoding for outgoing messages" should be checked.
$ git format-patch --cover-letter -M --stdout origin/master | git imap-send
Once your commits are ready to send to the mailing list, run the following
command to send the patch emails to your Gmail Drafts folder.
Just make sure to disable line wrapping in the email client (GMail web
interface will line wrap no matter what, so you need to use a real
IMAP client).
$ git format-patch -M --stdout origin/master | git imap-send
Go to your Gmail account, open the Drafts folder, find the patch email, fill
in the To: and CC: fields and send away!

View File

@ -90,9 +90,9 @@ of lines before or after the line given by <start>.
running extra passes of inspection.
+
<num> is optional but it is the lower bound on the number of
alphanumeric characters that git must detect as moving/copying
alphanumeric characters that git must detect as moving
within a file for it to associate those lines with the parent
commit. The default value is 20.
commit.
-C|<num>|::
In addition to `-M`, detect lines moved or copied from other
@ -105,11 +105,9 @@ commit. The default value is 20.
looks for copies from other files in any commit.
+
<num> is optional but it is the lower bound on the number of
alphanumeric characters that git must detect as moving/copying
alphanumeric characters that git must detect as moving
between files for it to associate those lines with the parent
commit. And the default value is 40. If there are more than one
`-C` options given, the <num> argument of the last `-C` will
take effect.
commit.
-h::
--help::

View File

@ -518,21 +518,29 @@ check that makes sure that existing object files will not get overwritten.
core.notesRef::
When showing commit messages, also show notes which are stored in
the given ref. The ref must be fully qualified. If the given
ref does not exist, it is not an error but means that no
notes should be printed.
the given ref. This ref is expected to contain files named
after the full SHA-1 of the commit they annotate.
+
This setting defaults to "refs/notes/commits", and it can be overridden by
the 'GIT_NOTES_REF' environment variable. See linkgit:git-notes[1].
If such a file exists in the given ref, the referenced blob is read, and
appended to the commit message, separated by a "Notes:" line. If the
given ref itself does not exist, it is not an error, but means that no
notes should be printed.
+
This setting defaults to "refs/notes/commits", and can be overridden by
the `GIT_NOTES_REF` environment variable.
core.sparseCheckout::
Enable "sparse checkout" feature. See section "Sparse checkout" in
linkgit:git-read-tree[1] for more information.
add.ignore-errors::
add.ignoreErrors::
Tells 'git add' to continue adding files when some files cannot be
added due to indexing errors. Equivalent to the '--ignore-errors'
option of linkgit:git-add[1].
option of linkgit:git-add[1]. Older versions of git accept only
`add.ignore-errors`, which does not follow the usual naming
convention for configuration variables. Newer versions of git
honor `add.ignoreErrors` as well.
alias.*::
Command aliases for the linkgit:git[1] command wrapper - e.g.
@ -551,13 +559,6 @@ it will be treated as a shell command. For example, defining
executed from the top-level directory of a repository, which may
not necessarily be the current directory.
am.keepcr::
If true, git-am will call git-mailsplit for patches in mbox format
with parameter '--keep-cr'. In this case git-mailsplit will
not remove `\r` from lines ending with `\r\n`. Can be overrriden
by giving '--no-keep-cr' from the command line.
See linkgit:git-am[1], linkgit:git-mailsplit[1].
apply.ignorewhitespace::
When set to 'change', tells 'git apply' to ignore changes in
whitespace, in the same way as the '--ignore-space-change'
@ -686,29 +687,9 @@ color.grep::
`never`), never. When set to `true` or `auto`, use color only
when the output is written to the terminal. Defaults to `false`.
color.grep.<slot>::
Use customized color for grep colorization. `<slot>` specifies which
part of the line to use the specified color, and is one of
+
--
`context`;;
non-matching text in context lines (when using `-A`, `-B`, or `-C`)
`filename`;;
filename prefix (when not using `-h`)
`function`;;
function name lines (when using `-p`)
`linenumber`;;
line number prefix (when using `-n`)
`match`;;
matching text
`selected`;;
non-matching text in selected lines
`separator`;;
separators between fields on a line (`:`, `-`, and `=`)
and between hunks (`--`)
--
+
The values of these variables may be specified as in color.branch.<slot>.
color.grep.match::
Use customized color for matches. The value of this variable
may be specified as in color.branch.<slot>.
color.interactive::
When set to `always`, always use colors for interactive prompts
@ -870,11 +851,9 @@ format.headers::
Additional email headers to include in a patch to be submitted
by mail. See linkgit:git-format-patch[1].
format.to::
format.cc::
Additional recipients to include in a patch to be submitted
by mail. See the --to and --cc options in
linkgit:git-format-patch[1].
Additional "Cc:" headers to include in a patch to be submitted
by mail. See the --cc option in linkgit:git-format-patch[1].
format.subjectprefix::
The default for format-patch is to output files with the '[PATCH]'
@ -1228,10 +1207,6 @@ imap::
The configuration variables in the 'imap' section are described
in linkgit:git-imap-send[1].
init.templatedir::
Specify the directory from which templates will be copied.
(See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
instaweb.browser::
Specify the program that will be used to browse your working
repository in gitweb. See linkgit:git-instaweb[1].
@ -1332,53 +1307,6 @@ mergetool.keepTemporaries::
mergetool.prompt::
Prompt before each invocation of the merge resolution program.
notes.displayRef::
The (fully qualified) refname from which to show notes when
showing commit messages. The value of this variable can be set
to a glob, in which case notes from all matching refs will be
shown. You may also specify this configuration variable
several times. A warning will be issued for refs that do not
exist, but a glob that does not match any refs is silently
ignored.
+
This setting can be overridden with the `GIT_NOTES_DISPLAY_REF`
environment variable, which must be a colon separated list of refs or
globs.
+
The effective value of "core.notesRef" (possibly overridden by
GIT_NOTES_REF) is also implicitly added to the list of refs to be
displayed.
notes.rewrite.<command>::
When rewriting commits with <command> (currently `amend` or
`rebase`) and this variable is set to `true`, git
automatically copies your notes from the original to the
rewritten commit. Defaults to `true`, but see
"notes.rewriteRef" below.
notes.rewriteMode::
When copying notes during a rewrite (see the
"notes.rewrite.<command>" option), determines what to do if
the target commit already has a note. Must be one of
`overwrite`, `concatenate`, or `ignore`. Defaults to
`concatenate`.
+
This setting can be overridden with the `GIT_NOTES_REWRITE_MODE`
environment variable.
notes.rewriteRef::
When copying notes during a rewrite, specifies the (fully
qualified) ref whose notes should be copied. The ref may be a
glob, in which case notes in all matching refs will be copied.
You may also specify this configuration several times.
+
Does not have a default value; you must configure this variable to
enable note rewriting.
+
This setting can be overridden with the `GIT_NOTES_REWRITE_REF`
environment variable, which must be a colon separated list of refs or
globs.
pack.window::
The size of the window used by linkgit:git-pack-objects[1] when no
window size is given on the command line. Defaults to 10.
@ -1512,7 +1440,7 @@ receive.denyDeletes::
the ref. Use this to prevent such a ref deletion via a push.
receive.denyCurrentBranch::
If set to true or "refuse", git-receive-pack will deny a ref update
If set to true or "refuse", receive-pack will deny a ref update
to the currently checked out branch of a non-bare repository.
Such a push is potentially dangerous because it brings the HEAD
out of sync with the index and working tree. If set to "warn",
@ -1638,7 +1566,6 @@ sendemail.smtppass::
sendemail.suppresscc::
sendemail.suppressfrom::
sendemail.to::
sendemail.smtpdomain::
sendemail.smtpserver::
sendemail.smtpserverport::
sendemail.smtpuser::
@ -1685,15 +1612,6 @@ status.submodulesummary::
summary of commits for modified submodules will be shown (see
--summary-limit option of linkgit:git-submodule[1]).
submodule.<name>.path::
submodule.<name>.url::
submodule.<name>.update::
The path within this project, URL, and the updating strategy
for a submodule. These variables are initially populated
by 'git submodule init'; edit them to override the
URL and other values found in the `.gitmodules` file. See
linkgit:git-submodule[1] and linkgit:gitmodules[5] for details.
tar.umask::
This variable can be used to restrict the permission bits of
tar archive entries. The default is 0002, which turns off the

View File

@ -56,8 +56,7 @@ combined diff format
"git-diff-tree", "git-diff-files" and "git-diff" can take '-c' or
'--cc' option to produce 'combined diff'. For showing a merge commit
with "git log -p", this is the default format; you can force showing
full diff with the '-m' option.
with "git log -p", this is the default format.
A 'combined diff' format looks like this:
------------

View File

@ -117,14 +117,12 @@ any of those replacements occurred.
option and lists the commits in that commit range like the 'summary'
option of linkgit:git-submodule[1] does.
--color[=<when>]::
--color::
Show colored diff.
The value must be always (the default), never, or auto.
--no-color::
Turn off colored diff, even when the configuration file
gives the default to color output.
Same as `--color=never`.
--color-words[=<regex>]::
Show colored word diff, i.e., color words which have changed.
@ -177,14 +175,7 @@ endif::git-format-patch[]
Break complete rewrite changes into pairs of delete and create.
-M::
ifndef::git-log[]
Detect renames.
endif::git-log[]
ifdef::git-log[]
If generating diffs, detect and report renames for each commit.
For following files across renames while traversing history, see
`--follow`.
endif::git-log[]
-C::
Detect copies as well as renames. See also `--find-copies-harder`.

View File

@ -1,8 +1,13 @@
Everyday GIT With 20 Commands Or So
===================================
<<Individual Developer (Standalone)>> commands are essential for
anybody who makes a commit, even for somebody who works alone.
<<Basic Repository>> commands are needed by people who have a
repository --- that is everybody, because every working tree of
git is a repository.
In addition, <<Individual Developer (Standalone)>> commands are
essential for anybody who makes a commit, even for somebody who
works alone.
If you work with other people, you will need commands listed in
the <<Individual Developer (Participant)>> section as well.
@ -15,6 +20,46 @@ administrators who are responsible for the care and feeding
of git repositories.
Basic Repository[[Basic Repository]]
------------------------------------
Everybody uses these commands to maintain git repositories.
* linkgit:git-init[1] or linkgit:git-clone[1] to create a
new repository.
* linkgit:git-fsck[1] to check the repository for errors.
* linkgit:git-gc[1] to do common housekeeping tasks such as
repack and prune.
Examples
~~~~~~~~
Check health and remove cruft.::
+
------------
$ git fsck <1>
$ git count-objects <2>
$ git gc <3>
------------
+
<1> running without `\--full` is usually cheap and assures the
repository health reasonably well.
<2> check how many loose objects there are and how much
disk space is wasted by not repacking.
<3> repacks the local repository and performs other housekeeping tasks.
Repack a small project into single pack.::
+
------------
$ git gc <1>
------------
+
<1> pack all the objects reachable from the refs into one pack,
then remove the other packs.
Individual Developer (Standalone)[[Individual Developer (Standalone)]]
----------------------------------------------------------------------
@ -22,8 +67,6 @@ A standalone individual developer does not exchange patches with
other people, and works alone in a single repository, using the
following commands.
* linkgit:git-init[1] to create a new repository.
* linkgit:git-show-branch[1] to see where you are.
* linkgit:git-log[1] to see what happened.

View File

@ -34,7 +34,6 @@ ifndef::git-pull[]
Allow several <repository> and <group> arguments to be
specified. No <refspec>s may be specified.
-p::
--prune::
After fetching, remove any remote tracking branches which
no longer exist on the remote.
@ -79,16 +78,9 @@ ifndef::git-pull[]
-q::
--quiet::
Pass --quiet to git-fetch-pack and silence any other internally
used git commands. Progress is not reported to the standard error
stream.
used git commands.
-v::
--verbose::
Be verbose.
endif::git-pull[]
--progress::
Progress status is reported on the standard error stream
by default when it is attached to a terminal, unless -q
is specified. This flag forces progress status even if the
standard error stream is not directed to a terminal.

View File

@ -266,9 +266,9 @@ patch::
y - stage this hunk
n - do not stage this hunk
q - quit; do not stage this hunk nor any of the remaining ones
a - stage this hunk and all later hunks in the file
d - do not stage this hunk nor any of the later hunks in the file
q - quit, do not stage this hunk nor any of the remaining ones
a - stage this and all the remaining hunks in the file
d - do not stage this hunk nor any of the remaining hunks in the file
g - select a hunk to go to
/ - search for a hunk matching the given regex
j - leave this hunk undecided, see next undecided hunk

View File

@ -9,7 +9,7 @@ git-am - Apply a series of patches from a mailbox
SYNOPSIS
--------
[verse]
'git am' [--signoff] [--keep] [--keep-cr | --no-keep-cr] [--utf8 | --no-utf8]
'git am' [--signoff] [--keep] [--utf8 | --no-utf8]
[--3way] [--interactive] [--committer-date-is-author-date]
[--ignore-date] [--ignore-space-change | --ignore-whitespace]
[--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
@ -39,13 +39,6 @@ OPTIONS
--keep::
Pass `-k` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).
--keep-cr::
--no-keep-cr::
With `--keep-cr`, call 'git mailsplit' (see linkgit:git-mailsplit[1])
with the same option, to prevent it from stripping CR at the end of
lines. `am.keepcr` configuration variable can be used to specify the
default behaviour. `--no-keep-cr` is useful to override `am.keepcr`.
-c::
--scissors::
Remove everything in body before a scissors line (see

View File

@ -8,7 +8,7 @@ git-branch - List, create, or delete branches
SYNOPSIS
--------
[verse]
'git branch' [--color[=<when>] | --no-color] [-r | -a]
'git branch' [--color | --no-color] [-r | -a]
[-v [--abbrev=<length> | --no-abbrev]]
[(--merged | --no-merged | --contains) [<commit>]]
'git branch' [--set-upstream | --track | --no-track] [-l] [-f] <branchname> [<start-point>]
@ -88,14 +88,12 @@ OPTIONS
-M::
Move/rename a branch even if the new branch name already exists.
--color[=<when>]::
--color::
Color branches to highlight current, local, and remote branches.
The value must be always (the default), never, or auto.
--no-color::
Turn off branch colors, even when the configuration file gives the
default to color output.
Same as `--color=never`.
-r::
List or delete (if used with -d) the remote-tracking branches.

View File

@ -15,41 +15,33 @@ SYNOPSIS
DESCRIPTION
-----------
Updates files in the working tree to match the version in the index
or the specified tree. If no paths are given, 'git checkout' will
also update `HEAD` to set the specified branch as the current
When <paths> are not given, this command switches branches by
updating the index, working tree, and HEAD to reflect the specified
branch.
'git checkout' [<branch>]::
'git checkout' -b <new branch> [<start point>]::
If `-b` is given, a new branch is created and checked out, as if
linkgit:git-branch[1] were called; in this case you can
use the --track or --no-track options, which will be passed to `git
branch`. As a convenience, --track without `-b` implies branch
creation; see the description of --track below.
This form switches branches by updating the index, working
tree, and HEAD to reflect the specified branch.
+
If `-b` is given, a new branch is created as if linkgit:git-branch[1]
were called and then checked out; in this case you can
use the `--track` or `--no-track` options, which will be passed to
'git branch'. As a convenience, `--track` without `-b` implies branch
creation; see the description of `--track` below.
When <paths> or --patch are given, this command does *not* switch
branches. It updates the named paths in the working tree from
the index file, or from a named <tree-ish> (most often a commit). In
this case, the `-b` and `--track` options are meaningless and giving
either of them results in an error. The <tree-ish> argument can be
used to specify a specific tree-ish (i.e. commit, tag or tree)
to update the index for the given paths before updating the
working tree.
'git checkout' [--patch] [<tree-ish>] [--] <pathspec>...::
When <paths> or `--patch` are given, 'git checkout' *not* switch
branches. It updates the named paths in the working tree from
the index file or from a named <tree-ish> (most often a commit). In
this case, the `-b` and `--track` options are meaningless and giving
either of them results in an error. The <tree-ish> argument can be
used to specify a specific tree-ish (i.e. commit, tag or tree)
to update the index for the given paths before updating the
working tree.
+
The index may contain unmerged entries because of a previous failed merge.
By default, if you try to check out such an entry from the index, the
The index may contain unmerged entries after a failed merge. By
default, if you try to check out such an entry from the index, the
checkout operation will fail and nothing will be checked out.
Using `-f` will ignore these unmerged entries. The contents from a
Using -f will ignore these unmerged entries. The contents from a
specific side of the merge can be checked out of the index by
using `--ours` or `--theirs`. With `-m`, changes made to the working tree
file can be discarded to re-create the original conflicted merge result.
using --ours or --theirs. With -m, changes made to the working tree
file can be discarded to recreate the original conflicted merge result.
OPTIONS
-------
@ -144,10 +136,6 @@ edits from your current working tree.
As a special case, the `"@\{-N\}"` syntax for the N-th last branch
checks out the branch (instead of detaching). You may also specify
`-` which is synonymous with `"@\{-1\}"`.
+
As a further special case, you may use `"A...B"` as a shortcut for the
merge base of `A` and `B` if there is exactly one merge base. You can
leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
<new_branch>::
Name for the new branch.
@ -238,7 +226,7 @@ the above checkout would fail like this:
+
------------
$ git checkout mytopic
error: You have local changes to 'frotz'; not switching branches.
fatal: Entry 'frotz' not uptodate. Cannot merge.
------------
+
You can give the `-m` flag to the command, which would try a

View File

@ -7,7 +7,7 @@ git-cherry-pick - Apply the change introduced by an existing commit
SYNOPSIS
--------
'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff] <commit>
'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] <commit>
DESCRIPTION
-----------
@ -70,10 +70,6 @@ effect to your index in a row.
--signoff::
Add Signed-off-by line at the end of the commit message.
--ff::
If the current HEAD is the same as the parent of the
cherry-pick'ed commit, then a fast forward to this commit will
be performed.
Author
------

View File

@ -102,8 +102,7 @@ objects from the source repository into a pack in the cloned repository.
--verbose::
-v::
Run verbosely. Does not affect the reporting of progress status
to the standard error stream.
Run verbosely.
--progress::
Progress status is reported on the standard error stream
@ -150,7 +149,8 @@ objects from the source repository into a pack in the cloned repository.
--template=<template_directory>::
Specify the directory from which templates will be used;
(See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
if unset the templates are taken from the installation
defined default, typically `/usr/share/git-core/templates`.
--depth <depth>::
Create a 'shallow' clone with a history truncated to the

View File

@ -95,11 +95,10 @@ OPTIONS
read the message from the standard input.
--author=<author>::
Override the commit author. Specify an explicit author using the
standard `A U Thor <author@example.com>` format. Otherwise <author>
is assumed to be a pattern and is used to search for an existing
commit by that author (i.e. rev-list --all -i --author=<author>);
the commit author is then copied from the first such commit found.
Override the author name used in the commit. You can use the
standard `A U Thor <author@example.com>` format. Otherwise,
an existing commit that matches the given string and its author
name is used.
--date=<date>::
Override the author date used in the commit.

View File

@ -13,7 +13,7 @@ SYNOPSIS
[-A <author-conv-file>] [-p <options-for-cvsps>] [-P <file>]
[-C <git_repository>] [-z <fuzz>] [-i] [-k] [-u] [-s <subst>]
[-a] [-m] [-M <regex>] [-S <regex>] [-L <commitlimit>]
[-r <remote>] [-R] [<CVS_module>]
[-r <remote>] [<CVS_module>]
DESCRIPTION
@ -157,22 +157,6 @@ It is not recommended to use this feature if you intend to
export changes back to CVS again later with
'git cvsexportcommit'.
-R::
Generate a `$GIT_DIR/cvs-revisions` file containing a mapping from CVS
revision numbers to newly-created Git commit IDs. The generated file
will contain one line for each (filename, revision) pair imported;
each line will look like
+
---------
src/widget.c 1.1 1d862f173cdc7325b6fa6d2ae1cfd61fd1b512b7
---------
+
The revision data is appended to the file if it already exists, for use when
doing incremental imports.
+
This option may be useful if you have CVS revision numbers stored in commit
messages, bug-tracking systems, email archives, and the like.
-h::
Print a short usage message and exit.

View File

@ -18,7 +18,7 @@ SYNOPSIS
[--in-reply-to=Message-Id] [--suffix=.<sfx>]
[--ignore-if-in-upstream]
[--subject-prefix=Subject-Prefix]
[--to=<email>] [--cc=<email>]
[--cc=<email>]
[--cover-letter]
[<common diff options>]
[ <since> | <revision range> ]
@ -162,10 +162,6 @@ will want to ensure that threading is disabled for `git send-email`.
allows for useful naming of a patch series, and can be
combined with the `--numbered` option.
--to=<email>::
Add a `To:` header to the email headers. This is in addition
to any configured headers, and may be used multiple times.
--cc=<email>::
Add a `Cc:` header to the email headers. This is in addition
to any configured headers, and may be used multiple times.
@ -206,8 +202,8 @@ CONFIGURATION
-------------
You can specify extra mail header lines to be added to each message,
defaults for the subject prefix and file suffix, number patches when
outputting more than one patch, add "To" or "Cc:" headers, configure
attachments, and sign off patches with configuration variables.
outputting more than one patch, add "Cc:" headers, configure attachments,
and sign off patches with configuration variables.
------------
[format]
@ -215,7 +211,6 @@ attachments, and sign off patches with configuration variables.
subjectprefix = CHANGE
suffix = .txt
numbered = auto
to = <email>
cc = <email>
attach [ = mime-boundary-string ]
signoff = true

View File

@ -127,13 +127,6 @@ If you are expecting some objects to be collected and they aren't, check
all of those locations and decide whether it makes sense in your case to
remove those references.
HOOKS
-----
The 'git gc --auto' command will run the 'pre-auto-gc' hook. See
linkgit:githooks[5] for more information.
SEE ALSO
--------
linkgit:git-prune[1]

View File

@ -17,7 +17,7 @@ SYNOPSIS
[-z | --null]
[-c | --count] [--all-match] [-q | --quiet]
[--max-depth <depth>]
[--color[=<when>] | --no-color]
[--color | --no-color]
[-A <post-context>] [-B <pre-context>] [-C <context>]
[-f <file>] [-e] <pattern>
[--and|--or|--not|(|)|-e <pattern>...]
@ -114,14 +114,12 @@ OPTIONS
Instead of showing every matched line, show the number of
lines that match.
--color[=<when>]::
--color::
Show colored matches.
The value must be always (the default), never, or auto.
--no-color::
Turn off match highlighting, even when the configuration file
gives the default to color output.
Same as `--color=never`.
-[ABC] <context>::
Show `context` trailing (`A` -- after), or leading (`B`
@ -183,7 +181,7 @@ OPTIONS
Examples
--------
git grep 'time_t' \-- '*.[ch]'::
git grep 'time_t' -- '*.[ch]'::
Looks for `time_t` in all tracked .c and .h files in the working
directory and its subdirectories.

View File

@ -10,7 +10,7 @@ SYNOPSIS
--------
[verse]
'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin] [--] <file>...
'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters] < <list-of-paths>
'git hash-object' [-t <type>] [-w] --stdin-paths < <list-of-paths>
DESCRIPTION
-----------

View File

@ -73,10 +73,6 @@ imap.preformattedHTML::
option causes Thunderbird to send the patch as a plain/text,
format=fixed email. Default is `false`.
imap.authMethod::
Specify authenticate method for authentication with IMAP server.
Current supported method is 'CRAM-MD5' only.
Examples
~~~~~~~~

View File

@ -28,8 +28,14 @@ current working directory.
--template=<template_directory>::
Specify the directory from which templates will be used. (See the "TEMPLATE
DIRECTORY" section below.)
Provide the directory from which templates will be used. The default template
directory is `/usr/share/git-core/templates`.
When specified, `<template_directory>` is used as the source of the template
files rather than the default. The template files include some directory
structure, some suggested "exclude patterns", and copies of non-executing
"hook" files. The suggested patterns and hook files are all modifiable and
extensible.
--shared[={false|true|umask|group|all|world|everybody|0xxx}]::
@ -100,25 +106,6 @@ of the repository, such as installing the default hooks and
setting the configuration variables. The old name is retained
for backward compatibility reasons.
TEMPLATE DIRECTORY
------------------
The template directory contains files and directories that will be copied to
the `$GIT_DIR` after it is created.
The template directory used will (in order):
- The argument given with the `--template` option.
- The contents of the `$GIT_TEMPLATE_DIR` environment variable.
- The `init.templatedir` configuration variable.
- The default template directory: `/usr/share/git-core/templates`.
The default template directory includes some directory structure, some
suggested "exclude patterns", and copies of sample "hook" files.
The suggested patterns and hook files are all modifiable and extensible.
EXAMPLES
--------

View File

@ -118,62 +118,11 @@ git log master --not --remotes=*/master::
Shows all commits that are in local master but not in any remote
repository master branches.
git log -p -m --first-parent::
Shows the history including change diffs, but only from the
"main branch" perspective, skipping commits that come from merged
branches, and showing full diffs of changes introduced by the merges.
This makes sense only when following a strict policy of merging all
topic branches when staying on a single integration branch.
Discussion
----------
include::i18n.txt[]
Configuration
-------------
See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
for settings related to diff generation.
format.pretty::
Default for the `--format` option. (See "PRETTY FORMATS" above.)
Defaults to "medium".
i18n.logOutputEncoding::
Encoding to use when displaying logs. (See "Discussion", above.)
Defaults to the value of `i18n.commitEncoding` if set, UTF-8
otherwise.
log.date::
Default format for human-readable dates. (Compare the
`--date` option.) Defaults to "default", which means to write
dates like `Sat May 8 19:35:34 2010 -0500`.
log.showroot::
If `false`, 'git log' and related commands will not treat the
initial commit as a big creation event. Any root commits in
`git log -p` output would be shown without a diff attached.
The default is `true`.
mailmap.file::
See linkgit:git-shortlog[1].
notes.displayRef::
Which refs, in addition to the default set by `core.notesRef`
or 'GIT_NOTES_REF', to read notes from when showing commit
messages with the 'log' family of commands. See
linkgit:git-notes[1].
+
May be an unabbreviated ref name or a glob and may be specified
multiple times. A warning will be issued for refs that do not exist,
but a glob that does not match any refs is silently ignored.
+
This setting can be disabled by the `--no-standard-notes` option,
overridden by the 'GIT_NOTES_DISPLAY_REF' environment variable,
and supplemented by the `--show-notes` option.
Author
------

View File

@ -40,16 +40,16 @@ OPTIONS
-u::
The commit log message, author name and author email are
taken from the e-mail, and after minimally decoding MIME
transfer encoding, re-coded in the charset specified by
i18n.commitencoding (defaulting to UTF-8) by transliterating
transfer encoding, re-coded in UTF-8 by transliterating
them. This used to be optional but now it is the default.
+
Note that the patch is always used as-is without charset
conversion, even with this flag.
--encoding=<encoding>::
Similar to -u. But when re-coding, the charset specified here is
used instead of the one specified by i18n.commitencoding or UTF-8.
Similar to -u but if the local convention is different
from what is specified by i18n.commitencoding, this flag
can be used to override it.
-n::
Disable all charset re-coding of the metadata.

View File

@ -7,7 +7,7 @@ git-mailsplit - Simple UNIX mbox splitter program
SYNOPSIS
--------
'git mailsplit' [-b] [-f<nn>] [-d<prec>] [--keep-cr] -o<directory> [--] [<mbox>|<Maildir>...]
'git mailsplit' [-b] [-f<nn>] [-d<prec>] -o<directory> [--] [<mbox>|<Maildir>...]
DESCRIPTION
-----------
@ -43,9 +43,6 @@ OPTIONS
Skip the first <nn> numbers, for example if -f3 is specified,
start the numbering with 0004.
--keep-cr::
Do not remove `\r` from lines ending with `\r\n`.
Author
------
Written by Linus Torvalds <torvalds@osdl.org>

View File

@ -10,7 +10,7 @@ SYNOPSIS
--------
[verse]
'git merge-file' [-L <current-name> [-L <base-name> [-L <other-name>]]]
[--ours|--theirs|--union] [-p|--stdout] [-q|--quiet] [--marker-size=<n>]
[--ours|--theirs] [-p|--stdout] [-q|--quiet]
<current-file> <base-file> <other-file>
@ -35,10 +35,9 @@ normally outputs a warning and brackets the conflict with lines containing
>>>>>>> B
If there are conflicts, the user should edit the result and delete one of
the alternatives. When `--ours`, `--theirs`, or `--union` option is in effect,
however, these conflicts are resolved favouring lines from `<current-file>`,
lines from `<other-file>`, or lines from both respectively. The length of the
conflict markers can be given with the `--marker-size` option.
the alternatives. When `--ours` or `--theirs` option is in effect, however,
these conflicts are resolved favouring lines from `<current-file>` or
lines from `<other-file>` respectively.
The exit value of this program is negative on error, and the number of
conflicts otherwise. If the merge was clean, the exit value is 0.
@ -68,9 +67,8 @@ OPTIONS
--ours::
--theirs::
--union::
Instead of leaving conflicts in the file, resolve conflicts
favouring our (or their or both) side of the lines.
favouring our (or their) side of the lines.
EXAMPLES

View File

@ -58,12 +58,7 @@ include::merge-options.txt[]
-m <msg>::
Set the commit message to be used for the merge commit (in
case one is created).
If `--log` is specified, a shortlog of the commits being merged
will be appended to the specified message.
The 'git fmt-merge-msg' command can be
case one is created). The 'git fmt-merge-msg' command can be
used to give a good default for automated 'git merge'
invocations.

View File

@ -72,16 +72,6 @@ success of the resolution after the custom tool has exited.
This is the default behaviour; the option is provided to
override any configuration settings.
TEMPORARY FILES
---------------
`git mergetool` creates `*.orig` backup files while resolving merges.
These are safe to remove once a file has been merged and its
`git mergetool` session has completed.
Setting the `mergetool.keepBackup` configuration variable to `false`
causes `git mergetool` to automatically remove the backup as files
are successfully merged.
Author
------
Written by Theodore Y Ts'o <tytso@mit.edu>

View File

@ -3,275 +3,57 @@ git-notes(1)
NAME
----
git-notes - Add or inspect object notes
git-notes - Add/inspect commit notes
SYNOPSIS
--------
[verse]
'git notes' [list [<object>]]
'git notes' add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
'git notes' copy [-f] ( --stdin | <from-object> <to-object> )
'git notes' append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
'git notes' edit [<object>]
'git notes' show [<object>]
'git notes' remove [<object>]
'git notes' prune
'git notes' (edit [-F <file> | -m <msg>] | show) [commit]
DESCRIPTION
-----------
Adds, removes, or reads notes attached to objects, without touching
the objects themselves.
This command allows you to add notes to commit messages, without
changing the commit. To discern these notes from the message stored
in the commit object, the notes are indented like the message, after
an unindented line saying "Notes:".
By default, notes are saved to and read from `refs/notes/commits`, but
this default can be overridden. See the OPTIONS, CONFIGURATION, and
ENVIRONMENT sections below. If this ref does not exist, it will be
quietly created when it is first needed to store a note.
A typical use of notes is to supplement a commit message without
changing the commit itself. Notes can be shown by 'git log' along with
the original commit message. To distinguish these notes from the
message stored in the commit object, the notes are indented like the
message, after an unindented line saying "Notes (<refname>):" (or
"Notes:" for `refs/notes/commits`).
To change which notes are shown by 'git log', see the
"notes.displayRef" configuration in linkgit:git-log[1].
See the "notes.rewrite.<command>" configuration for a way to carry
notes across commands that rewrite commits.
To disable commit notes, you have to set the config variable
core.notesRef to the empty string. Alternatively, you can set it
to a different ref, something like "refs/notes/bugzilla". This setting
can be overridden by the environment variable "GIT_NOTES_REF".
SUBCOMMANDS
-----------
list::
List the notes object for a given object. If no object is
given, show a list of all note objects and the objects they
annotate (in the format "<note object> <annotated object>").
This is the default subcommand if no subcommand is given.
add::
Add notes for a given object (defaults to HEAD). Abort if the
object already has notes (use `-f` to overwrite an
existing note).
copy::
Copy the notes for the first object onto the second object.
Abort if the second object already has notes, or if the first
object has none (use -f to overwrite existing notes to the
second object). This subcommand is equivalent to:
`git notes add [-f] -C $(git notes list <from-object>) <to-object>`
+
In `\--stdin` mode, take lines in the format
+
----------
<from-object> SP <to-object> [ SP <rest> ] LF
----------
+
on standard input, and copy the notes from each <from-object> to its
corresponding <to-object>. (The optional `<rest>` is ignored so that
the command can read the input given to the `post-rewrite` hook.)
append::
Append to the notes of an existing object (defaults to HEAD).
Creates a new notes object if needed.
edit::
Edit the notes for a given object (defaults to HEAD).
Edit the notes for a given commit (defaults to HEAD).
show::
Show the notes for a given object (defaults to HEAD).
Show the notes for a given commit (defaults to HEAD).
remove::
Remove the notes for a given object (defaults to HEAD).
This is equivalent to specifying an empty note message to
the `edit` subcommand.
prune::
Remove all notes for non-existing/unreachable objects.
OPTIONS
-------
-f::
--force::
When adding notes to an object that already has notes,
overwrite the existing notes (instead of aborting).
-m <msg>::
--message=<msg>::
Use the given note message (instead of prompting).
If multiple `-m` options are given, their values
are concatenated as separate paragraphs.
Lines starting with `#` and empty lines other than a
single line between paragraphs will be stripped out.
If multiple `-m` (or `-F`) options are given, their
values are concatenated as separate paragraphs.
-F <file>::
--file=<file>::
Take the note message from the given file. Use '-' to
read the note message from the standard input.
Lines starting with `#` and empty lines other than a
single line between paragraphs will be stripped out.
-C <object>::
--reuse-message=<object>::
Take the note message from the given blob object (for
example, another note).
-c <object>::
--reedit-message=<object>::
Like '-C', but with '-c' the editor is invoked, so that
the user can further edit the note message.
--ref <ref>::
Manipulate the notes tree in <ref>. This overrides
'GIT_NOTES_REF' and the "core.notesRef" configuration. The ref
is taken to be in `refs/notes/` if it is not qualified.
DISCUSSION
----------
Commit notes are blobs containing extra information about an object
(usually information to supplement a commit's message). These blobs
are taken from notes refs. A notes ref is usually a branch which
contains "files" whose paths are the object names for the objects
they describe, with some directory separators included for performance
reasons footnote:[Permitted pathnames have the form
'ab'`/`'cd'`/`'ef'`/`'...'`/`'abcdef...': a sequence of directory
names of two hexadecimal digits each followed by a filename with the
rest of the object ID.].
Every notes change creates a new commit at the specified notes ref.
You can therefore inspect the history of the notes by invoking, e.g.,
`git log -p notes/commits`. Currently the commit message only records
which operation triggered the update, and the commit authorship is
determined according to the usual rules (see linkgit:git-commit[1]).
These details may change in the future.
It is also permitted for a notes ref to point directly to a tree
object, in which case the history of the notes can be read with
`git log -p -g <refname>`.
EXAMPLES
--------
You can use notes to add annotations with information that was not
available at the time a commit was written.
------------
$ git notes add -m 'Tested-by: Johannes Sixt <j6t@kdbg.org>' 72a144e2
$ git show -s 72a144e
[...]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Notes:
Tested-by: Johannes Sixt <j6t@kdbg.org>
------------
In principle, a note is a regular Git blob, and any kind of
(non-)format is accepted. You can binary-safely create notes from
arbitrary files using 'git hash-object':
------------
$ cc *.c
$ blob=$(git hash-object -w a.out)
$ git notes --ref=built add -C "$blob" HEAD
------------
Of course, it doesn't make much sense to display non-text-format notes
with 'git log', so if you use such notes, you'll probably need to write
some special-purpose tools to do something useful with them.
CONFIGURATION
-------------
core.notesRef::
Notes ref to read and manipulate instead of
`refs/notes/commits`. Must be an unabbreviated ref name.
This setting can be overridden through the environment and
command line.
notes.displayRef::
Which ref (or refs, if a glob or specified more than once), in
addition to the default set by `core.notesRef` or
'GIT_NOTES_REF', to read notes from when showing commit
messages with the 'git log' family of commands.
This setting can be overridden on the command line or by the
'GIT_NOTES_DISPLAY_REF' environment variable.
See linkgit:git-log[1].
notes.rewrite.<command>::
When rewriting commits with <command> (currently `amend` or
`rebase`), if this variable is `false`, git will not copy
notes from the original to the rewritten commit. Defaults to
`true`. See also "`notes.rewriteRef`" below.
+
This setting can be overridden by the 'GIT_NOTES_REWRITE_REF'
environment variable.
notes.rewriteMode::
When copying notes during a rewrite, what to do if the target
commit already has a note. Must be one of `overwrite`,
`concatenate`, and `ignore`. Defaults to `concatenate`.
+
This setting can be overridden with the `GIT_NOTES_REWRITE_MODE`
environment variable.
notes.rewriteRef::
When copying notes during a rewrite, specifies the (fully
qualified) ref whose notes should be copied. May be a glob,
in which case notes in all matching refs will be copied. You
may also specify this configuration several times.
+
Does not have a default value; you must configure this variable to
enable note rewriting.
+
Can be overridden with the 'GIT_NOTES_REWRITE_REF' environment variable.
ENVIRONMENT
-----------
'GIT_NOTES_REF'::
Which ref to manipulate notes from, instead of `refs/notes/commits`.
This overrides the `core.notesRef` setting.
'GIT_NOTES_DISPLAY_REF'::
Colon-delimited list of refs or globs indicating which refs,
in addition to the default from `core.notesRef` or
'GIT_NOTES_REF', to read notes from when showing commit
messages.
This overrides the `notes.displayRef` setting.
+
A warning will be issued for refs that do not exist, but a glob that
does not match any refs is silently ignored.
'GIT_NOTES_REWRITE_MODE'::
When copying notes during a rewrite, what to do if the target
commit already has a note.
Must be one of `overwrite`, `concatenate`, and `ignore`.
This overrides the `core.rewriteMode` setting.
'GIT_NOTES_REWRITE_REF'::
When rewriting commits, which notes to copy from the original
to the rewritten commit. Must be a colon-delimited list of
refs or globs.
+
If not set in the environment, the list of notes to copy depends
on the `notes.rewrite.<command>` and `notes.rewriteRef` settings.
If multiple `-F` (or `-m`) options are given, their
values are concatenated as separate paragraphs.
Author
------
Written by Johannes Schindelin <johannes.schindelin@gmx.de> and
Johan Herland <johan@herland.net>
Written by Johannes Schindelin <johannes.schindelin@gmx.de>
Documentation
-------------
Documentation by Johannes Schindelin and Johan Herland
Documentation by Johannes Schindelin
GIT
---

View File

@ -31,16 +31,6 @@ in a state that is hard to back out of in the case of a conflict.
OPTIONS
-------
-q::
--quiet::
This is passed to both underlying git-fetch to squelch reporting of
during transfer, and underlying git-merge to squelch output during
merging.
-v::
--verbose::
Pass --verbose to git-fetch and git-merge.
Options related to merging
~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -146,21 +146,14 @@ useful if you write an alias or script around 'git push'.
receiver share many of the same objects in common. The default is
\--thin.
-q::
--quiet::
Suppress all output, including the listing of updated refs,
unless an error occurs. Progress is not reported to the standard
error stream.
-v::
--verbose::
Run verbosely.
--progress::
Progress status is reported on the standard error stream
by default when it is attached to a terminal, unless -q
is specified. This flag forces progress status even if the
standard error stream is not directed to a terminal.
-q::
--quiet::
Suppress all output, including the listing of updated refs,
unless an error occurs.
include::urls-remotes.txt[]

View File

@ -206,10 +206,6 @@ OPTIONS
--onto option is not specified, the starting point is
<upstream>. May be any valid commit, and not just an
existing branch name.
+
As a special case, you may use "A...B" as a shortcut for the
merge base of A and B if there is exactly one merge base. You can
leave out at most one of A and B, in which case it defaults to HEAD.
<upstream>::
Upstream branch to compare against. May be any valid commit,
@ -278,16 +274,9 @@ which makes little sense.
-f::
--force-rebase::
Force the rebase even if the current branch is a descendant
of the commit you are rebasing onto. Normally non-interactive rebase will
of the commit you are rebasing onto. Normally the command will
exit with the message "Current branch is up to date" in such a
situation.
Incompatible with the --interactive option.
+
You may find this (or --no-ff with an interactive rebase) helpful after
reverting a topic branch merge, as this option recreates the topic branch with
fresh commits so it can be remerged successfully without needing to "revert
the reversion" (see the
link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To] for details).
--ignore-whitespace::
--whitespace=<option>::
@ -299,7 +288,6 @@ link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To] for details).
--ignore-date::
These flags are passed to 'git am' to easily change the dates
of the rebased commits (see linkgit:git-am[1]).
Incompatible with the --interactive option.
-i::
--interactive::
@ -310,11 +298,6 @@ link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To] for details).
-p::
--preserve-merges::
Instead of ignoring merges, try to recreate them.
+
This uses the `--interactive` machinery internally, but combining it
with the `--interactive` option explicitly is generally not a good
idea unless you know what you are doing (see BUGS below).
--root::
Rebase all commits reachable from <branch>, instead of
@ -333,19 +316,7 @@ idea unless you know what you are doing (see BUGS below).
commit to be modified, and change the action of the moved
commit from `pick` to `squash` (or `fixup`).
+
This option is only valid when the '--interactive' option is used.
--no-ff::
With --interactive, cherry-pick all rebased commits instead of
fast-forwarding over the unchanged ones. This ensures that the
entire history of the rebased branch is composed of new commits.
+
Without --interactive, this is a synonym for --force-rebase.
+
You may find this helpful after reverting a topic branch merge, as this option
recreates the topic branch with fresh commits so it can be remerged
successfully without needing to "revert the reversion" (see the
link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To] for details).
This option is only valid when '--interactive' option is used.
include::merge-strategies.txt[]
@ -616,28 +587,6 @@ The ripple effect of a "hard case" recovery is especially bad:
case" recovery too!
BUGS
----
The todo list presented by `--preserve-merges --interactive` does not
represent the topology of the revision graph. Editing commits and
rewording their commit messages should work fine, but attempts to
reorder commits tend to produce counterintuitive results.
For example, an attempt to rearrange
------------
1 --- 2 --- 3 --- 4 --- 5
------------
to
------------
1 --- 2 --- 4 --- 3 --- 5
------------
by moving the "pick 4" line will result in the following history:
------------
3
/
1 --- 2 --- 4 --- 5
------------
Authors
------
Written by Junio C Hamano <gitster@pobox.com> and

View File

@ -3,69 +3,20 @@ git-remote-helpers(1)
NAME
----
git-remote-helpers - Helper programs to interact with remote repositories
git-remote-helpers - Helper programs for interoperation with remote git
SYNOPSIS
--------
'git remote-<transport>' <repository> [<URL>]
'git remote-<transport>' <remote>
DESCRIPTION
-----------
Remote helper programs are normally not used directly by end users,
but they are invoked by git when it needs to interact with remote
repositories git does not support natively. A given helper will
implement a subset of the capabilities documented here. When git
needs to interact with a repository using a remote helper, it spawns
the helper as an independent process, sends commands to the helper's
standard input, and expects results from the helper's standard
output. Because a remote helper runs as an independent process from
git, there is no need to re-link git to add a new helper, nor any
need to link the helper with the implementation of git.
Every helper must support the "capabilities" command, which git will
use to determine what other commands the helper will accept. Other
commands generally concern facilities like discovering and updating
remote refs, transporting objects between the object database and
the remote repository, and updating the local object store.
Helpers supporting the 'fetch' capability can discover refs from the
remote repository and transfer objects reachable from those refs to
the local object store. Helpers supporting the 'push' capability can
transfer local objects to the remote repository and update remote refs.
Git comes with a "curl" family of remote helpers, that handle various
transport protocols, such as 'git-remote-http', 'git-remote-https',
'git-remote-ftp' and 'git-remote-ftps'. They implement the capabilities
'fetch', 'option', and 'push'.
INVOCATION
----------
Remote helper programs are invoked with one or (optionally) two
arguments. The first argument specifies a remote repository as in git;
it is either the name of a configured remote or a URL. The second
argument specifies a URL; it is usually of the form
'<transport>://<address>', but any arbitrary string is possible.
When git encounters a URL of the form '<transport>://<address>', where
'<transport>' is a protocol that it cannot handle natively, it
automatically invokes 'git remote-<transport>' with the full URL as
the second argument. If such a URL is encountered directly on the
command line, the first argument is the same as the second, and if it
is encountered in a configured remote, the first argument is the name
of that remote.
A URL of the form '<transport>::<address>' explicitly instructs git to
invoke 'git remote-<transport>' with '<address>' as the second
argument. If such a URL is encountered directly on the command line,
the first argument is '<address>', and if it is encountered in a
configured remote, the first argument is the name of that remote.
Additionally, when a configured remote has 'remote.<name>.vcs' set to
'<transport>', git explicitly invokes 'git remote-<transport>' with
'<name>' as the first argument. If set, the second argument is
'remote.<name>.url'; otherwise, the second argument is omitted.
These programs are normally not used directly by end users, but are
invoked by various git programs that interact with remote repositories
when the repository they would operate on will be accessed using
transport code not linked into the main git binary. Various particular
helper programs will behave as documented here.
COMMANDS
--------
@ -74,8 +25,8 @@ Commands are given by the caller on the helper's standard input, one per line.
'capabilities'::
Lists the capabilities of the helper, one per line, ending
with a blank line. Each capability may be preceded with '*',
which marks them mandatory for git version using the remote
with a blank line. Each capability may be preceded with '*'.
This marks them mandatory for git version using the remote
helper to understand (unknown mandatory capability is fatal
error).
@ -84,27 +35,27 @@ Commands are given by the caller on the helper's standard input, one per line.
[<attr> ...]". The value may be a hex sha1 hash, "@<dest>" for
a symref, or "?" to indicate that the helper could not get the
value of the ref. A space-separated list of attributes follows
the name; unrecognized attributes are ignored. The list ends
with a blank line.
the name; unrecognized attributes are ignored. After the
complete list, outputs a blank line.
+
If 'push' is supported this may be called as 'list for-push'
to obtain the current refs prior to sending one or more 'push'
commands to the helper.
'option' <name> <value>::
Sets the transport helper option <name> to <value>. Outputs a
Set the transport helper option <name> to <value>. Outputs a
single line containing one of 'ok' (option successfully set),
'unsupported' (option not recognized) or 'error <msg>'
(option <name> is supported but <value> is not valid
(option <name> is supported but <value> is not correct
for it). Options should be set before other commands,
and may influence the behavior of those commands.
and may how those commands behave.
+
Supported if the helper has the "option" capability.
'fetch' <sha1> <name>::
Fetches the given object, writing the necessary objects
to the database. Fetch commands are sent in a batch, one
per line, terminated with a blank line.
per line, and the batch is terminated with a blank line.
Outputs a single blank line when all fetch commands in the
same batch are complete. Only objects which were reported
in the ref list with a sha1 may be fetched this way.
@ -116,7 +67,7 @@ suitably updated.
Supported if the helper has the "fetch" capability.
'push' +<src>:<dst>::
Pushes the given local <src> commit or branch to the
Pushes the given <src> commit or branch locally to the
remote branch described by <dst>. A batch sequence of
one or more push commands is terminated with a blank line.
+
@ -140,9 +91,6 @@ Supported if the helper has the "push" capability.
by applying the refspecs from the "refspec" capability to the
name of the ref.
+
Especially useful for interoperability with a foreign versioning
system.
+
Supported if the helper has the "import" capability.
'connect' <service>::
@ -171,11 +119,16 @@ CAPABILITIES
------------
'fetch'::
This helper supports the 'fetch' command.
'option'::
This helper supports the option command.
'push'::
This helper supports the 'push' command.
'import'::
'connect'::
This helper supports the corresponding command with the same name.
This helper supports the 'import' command.
'refspec' 'spec'::
When using the import command, expect the source ref to have
@ -187,6 +140,9 @@ CAPABILITIES
all, it must cover all refs reported by the list command; if
it is not used, it is effectively "*:*"
'connect'::
This helper supports the 'connect' command.
REF LIST ATTRIBUTES
-------------------
@ -202,19 +158,19 @@ REF LIST ATTRIBUTES
OPTIONS
-------
'option verbosity' <N>::
Changes the verbosity of messages displayed by the helper.
A value of 0 for N means that processes operate
quietly, and the helper produces only error output.
1 is the default level of verbosity, and higher values
Change the level of messages displayed by the helper.
When N is 0 the end-user has asked the process to be
quiet, and the helper should produce only error output.
N of 1 is the default level of verbosity, higher values
of N correspond to the number of -v flags passed on the
command line.
'option progress' \{'true'|'false'\}::
Enables (or disables) progress messages displayed by the
Enable (or disable) progress messages displayed by the
transport helper during a command.
'option depth' <depth>::
Deepens the history of a shallow repository.
Deepen the history of a shallow repository.
'option followtags' \{'true'|'false'\}::
If enabled the helper should automatically fetch annotated
@ -230,15 +186,11 @@ OPTIONS
helpers this only applies to the 'push', if supported.
'option servpath <c-style-quoted-path>'::
Sets service path (--upload-pack, --receive-pack etc.) for
next connect. Remote helper may support this option, but
must not rely on this option being set before
Set service path (--upload-pack, --receive-pack etc.) for
next connect. Remote helper MAY support this option. Remote
helper MUST NOT rely on this option being set before
connect request occurs.
SEE ALSO
--------
linkgit:git-remote[1]
Documentation
-------------
Documentation by Daniel Barkalow and Ilari Liusvaara

View File

@ -7,7 +7,7 @@ git-rerere - Reuse recorded resolution of conflicted merges
SYNOPSIS
--------
'git rerere' ['clear'|'forget' [<pathspec>]|'diff'|'status'|'gc']
'git rerere' ['clear'|'diff'|'status'|'gc']
DESCRIPTION
-----------
@ -40,11 +40,6 @@ This resets the metadata used by rerere if a merge resolution is to be
aborted. Calling 'git am [--skip|--abort]' or 'git rebase [--skip|--abort]'
will automatically invoke this command.
'forget' <pathspec>::
This resets the conflict resolutions which rerere has recorded for the current
conflict in <pathspec>. The <pathspec> is optional.
'diff'::
This displays diffs for the current state of the resolution. It is

View File

@ -8,7 +8,7 @@ git-reset - Reset current HEAD to the specified state
SYNOPSIS
--------
[verse]
'git reset' [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]
'git reset' [--mixed | --soft | --hard | --merge] [-q] [<commit>]
'git reset' [-q] [<commit>] [--] <paths>...
'git reset' --patch [<commit>] [--] [<paths>...]
@ -52,14 +52,6 @@ OPTIONS
and updates the files that are different between the named commit
and the current commit in the working tree.
--keep::
Reset the index to the given commit, keeping local changes in
the working tree since the current commit, while updating
working tree files without local changes to what appears in
the given commit. If a file that is different between the
current commit and the given commit has local changes, reset
is aborted.
-p::
--patch::
Interactively select hunks in the difference between the index
@ -101,7 +93,6 @@ in the index and in state D in HEAD.
--mixed A D D
--hard D D D
--merge (disallowed)
--keep (disallowed)
working index HEAD target working index HEAD
----------------------------------------------------
@ -109,7 +100,6 @@ in the index and in state D in HEAD.
--mixed A C C
--hard C C C
--merge (disallowed)
--keep A C C
working index HEAD target working index HEAD
----------------------------------------------------
@ -117,7 +107,6 @@ in the index and in state D in HEAD.
--mixed B D D
--hard D D D
--merge D D D
--keep (disallowed)
working index HEAD target working index HEAD
----------------------------------------------------
@ -125,7 +114,6 @@ in the index and in state D in HEAD.
--mixed B C C
--hard C C C
--merge C C C
--keep B C C
working index HEAD target working index HEAD
----------------------------------------------------
@ -133,7 +121,6 @@ in the index and in state D in HEAD.
--mixed B D D
--hard D D D
--merge (disallowed)
--keep (disallowed)
working index HEAD target working index HEAD
----------------------------------------------------
@ -141,7 +128,6 @@ in the index and in state D in HEAD.
--mixed B C C
--hard C C C
--merge B C C
--keep B C C
"reset --merge" is meant to be used when resetting out of a conflicted
merge. Any mergy operation guarantees that the work tree file that is
@ -152,15 +138,6 @@ between the index and the work tree, then it means that we are not
resetting out from a state that a mergy operation left after failing
with a conflict. That is why we disallow --merge option in this case.
"reset --keep" is meant to be used when removing some of the last
commits in the current branch while keeping changes in the working
tree. If there could be conflicts between the changes in the commit we
want to remove and the changes in the working tree we want to keep,
the reset is disallowed. That's why it is disallowed if there are both
changes between the working tree and HEAD, and between HEAD and the
target. To be safe, it is also disallowed when there are unmerged
entries.
The following tables show what happens when there are unmerged
entries:
@ -170,7 +147,6 @@ entries:
--mixed X B B
--hard B B B
--merge B B B
--keep (disallowed)
working index HEAD target working index HEAD
----------------------------------------------------
@ -178,7 +154,6 @@ entries:
--mixed X A A
--hard A A A
--merge A A A
--keep (disallowed)
X means any state and U means an unmerged index.
@ -350,32 +325,6 @@ $ git add frotz.c <3>
<2> This commits all other changes in the index.
<3> Adds the file to the index again.
Keep changes in working tree while discarding some previous commits::
+
Suppose you are working on something and you commit it, and then you
continue working a bit more, but now you think that what you have in
your working tree should be in another branch that has nothing to do
with what you commited previously. You can start a new branch and
reset it while keeping the changes in your work tree.
+
------------
$ git tag start
$ git checkout -b branch1
$ edit
$ git commit ... <1>
$ edit
$ git checkout -b branch2 <2>
$ git reset --keep start <3>
------------
+
<1> This commits your first edits in branch1.
<2> In the ideal world, you could have realized that the earlier
commit did not belong to the new topic when you created and switched
to branch2 (i.e. "git checkout -b branch2 start"), but nobody is
perfect.
<3> But you can use "reset --keep" to remove the unwanted commit after
you switched to "branch2".
Author
------
Written by Junio C Hamano <gitster@pobox.com> and Linus Torvalds <torvalds@osdl.org>

View File

@ -256,7 +256,7 @@ the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
the branch the ref is set to build on top of. Missing ref defaults
to the current branch.
* A suffix '{caret}' to a revision parameter (e.g. 'HEAD{caret}') means the first parent of
* A suffix '{caret}' to a revision parameter means the first parent of
that commit object. '{caret}<n>' means the <n>th parent (i.e.
'rev{caret}'
is equivalent to 'rev{caret}1'). As a special rule,
@ -282,24 +282,21 @@ the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
and dereference the tag recursively until a non-tag object is
found.
* A colon, followed by a slash, followed by a text (e.g. `:/fix nasty bug`): this names
* A colon, followed by a slash, followed by a text: this names
a commit whose commit message starts with the specified text.
This name returns the youngest matching commit which is
reachable from any ref. If the commit message starts with a
'!', you have to repeat that; the special sequence ':/!',
followed by something else than '!' is reserved for now.
* A suffix ':' followed by a path (e.g. `HEAD:README`); this names the blob or tree
* A suffix ':' followed by a path; this names the blob or tree
at the given path in the tree-ish object named by the part
before the colon.
':path' (with an empty part before the colon, e.g. `:README`)
is a special case of the syntax described next: content
recorded in the index at the given path.
* A colon, optionally followed by a stage number (0 to 3) and a
colon, followed by a path (e.g. `:0:README`); this names a blob object in the
index at the given path. Missing stage number (and the colon
that follows it, e.g. `:README`) names a stage 0 entry. During a merge, stage
colon, followed by a path; this names a blob object in the
index at the given path. Missing stage number (and the colon
that follows it) names a stage 0 entry. During a merge, stage
1 is the common ancestor, stage 2 is the target branch's version
(typically the current branch), and stage 3 is the version from
the branch being merged.

View File

@ -101,15 +101,6 @@ See the CONFIGURATION section for 'sendemail.multiedit'.
+
The --to option must be repeated for each user you want on the to list.
--8bit-encoding=<encoding>::
When encountering a non-ASCII message or subject that does not
declare its encoding, add headers/quoting to indicate it is
encoded in <encoding>. Default is the value of the
'sendemail.assume8bitEncoding'; if that is unspecified, this
will be prompted for if any non-ASCII files are encountered.
+
Note that no attempts whatsoever are made to validate the encoding.
Sending
~~~~~~~
@ -128,13 +119,6 @@ Sending
value reverts to plain SMTP. Default is the value of
'sendemail.smtpencryption'.
--smtp-domain=<FQDN>::
Specifies the Fully Qualified Domain Name (FQDN) used in the
HELO/EHLO command to the SMTP server. Some servers require the
FQDN to match your IP address. If not set, git send-email attempts
to determine your FQDN automatically. Default is the value of
'sendemail.smtpdomain'.
--smtp-pass[=<password>]::
Password for SMTP-AUTH. The argument is optional: If no
argument is specified, then the empty string is used as
@ -316,21 +300,6 @@ sendemail.confirm::
in the previous section for the meaning of these values.
Use gmail as the smtp server
----------------------------
Add the following section to the config file:
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = yourname@gmail.com
smtpserverport = 587
Note: the following perl modules are required
Net::SMTP::SSL, MIME::Base64 and Authen::SASL
Author
------
Written by Ryan Anderson <ryan@michonline.com>

View File

@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
git log --pretty=short | 'git shortlog' [-h] [-n] [-s] [-e] [-w]
'git shortlog' [-n|--numbered] [-s|--summary] [-e|--email] [-w[<width>[,<indent1>[,<indent2>]]]] <commit>...
'git shortlog' [-n|--numbered] [-s|--summary] [-e|--email] [-w[<width>[,<indent1>[,<indent2>]]]] [<committish>...]
DESCRIPTION
-----------
@ -19,11 +19,6 @@ the first line of the commit message will be shown.
Additionally, "[PATCH]" will be stripped from the commit description.
If no revisions are passed on the command line and either standard input
is not a terminal or there is no current branch, 'git shortlog' will
output a summary of the log read from standard input, without
reference to the current repository.
OPTIONS
-------
@ -44,14 +39,6 @@ OPTIONS
--email::
Show the email address of each author.
--format[='<format>']::
Instead of the commit subject, use some other information to
describe each commit. '<format>' can be any string accepted
by the `--format` option of 'git log', such as '{asterisk} [%h] %s'.
(See the "PRETTY FORMATS" section of linkgit:git-log[1].)
Each pretty-printed commit will be rewrapped before it is shown.
-w[<width>[,<indent1>[,<indent2>]]]::
Linewrap the output by wrapping each line at `width`. The first
line of each entry is indented by `indent1` spaces, and the second

View File

@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git show-branch' [-a|--all] [-r|--remotes] [--topo-order | --date-order]
[--current] [--color[=<when>] | --no-color] [--sparse]
[--current] [--color | --no-color] [--sparse]
[--more=<n> | --list | --independent | --merge-base]
[--no-name | --sha1-name] [--topics]
[<rev> | <glob>]...
@ -117,15 +117,13 @@ OPTIONS
When no explicit <ref> parameter is given, it defaults to the
current branch (or `HEAD` if it is detached).
--color[=<when>]::
--color::
Color the status sign (one of these: `*` `!` `+` `-`) of each commit
corresponding to the branch it's in.
The value must be always (the default), never, or auto.
--no-color::
Turn off colored output, even when the configuration file gives the
default to color output.
Same as `--color=never`.
Note that --more, --list, --independent and --merge-base options
are mutually exclusive.

View File

@ -93,6 +93,8 @@ OPTIONS
This option can be also used as a coarse file-level mechanism
to ignore uncommitted changes in tracked files (akin to what
`.gitignore` does for untracked files).
You should remember that an explicit 'git add' operation will
still cause the file to be refreshed from the working tree.
Git will fail (gracefully) in case it needs to modify this file
in the index e.g. when merging in a commit;
thus, in case the assumed-untracked file is changed upstream,

View File

@ -43,14 +43,6 @@ unreleased) version of git, that is available from 'master'
branch of the `git.git` repository.
Documentation for older releases are available here:
* link:v1.7.1.2/git.html[documentation for release 1.7.1.2]
* release notes for
link:RelNotes-1.7.1.2.txt[1.7.1.2],
link:RelNotes-1.7.1.1.txt[1.7.1.1],
link:RelNotes-1.7.1.txt[1.7.1].
* link:v1.7.0.7/git.html[documentation for release 1.7.0.7]
* release notes for

View File

@ -227,8 +227,8 @@ changes that touch a specified string, and is controlled by the
commands.
When diffcore-pickaxe is in use, it checks if there are
filepairs whose "result" side has the specified string and
whose "origin" side does not. Such a filepair represents "the
filepairs whose "original" side has the specified string and
whose "result" side does not. Such a filepair represents "the
string appeared in this changeset". It also checks for the
opposite case that loses the specified string.

View File

@ -317,44 +317,6 @@ This hook is invoked by 'git gc --auto'. It takes no parameter, and
exiting with non-zero status from this script causes the 'git gc --auto'
to abort.
post-rewrite
~~~~~~~~~~~~
This hook is invoked by commands that rewrite commits (`git commit
--amend`, 'git-rebase'; currently 'git-filter-branch' does 'not' call
it!). Its first argument denotes the command it was invoked by:
currently one of `amend` or `rebase`. Further command-dependent
arguments may be passed in the future.
The hook receives a list of the rewritten commits on stdin, in the
format
<old-sha1> SP <new-sha1> [ SP <extra-info> ] LF
The 'extra-info' is again command-dependent. If it is empty, the
preceding SP is also omitted. Currently, no commands pass any
'extra-info'.
The hook always runs after the automatic note copying (see
"notes.rewrite.<command>" in linkgit:git-config.txt) has happened, and
thus has access to these notes.
The following command-specific comments apply:
rebase::
For the 'squash' and 'fixup' operation, all commits that were
squashed are listed as being rewritten to the squashed commit.
This means that there will be several lines sharing the same
'new-sha1'.
+
The commits are guaranteed to be listed in the order that they were
processed by rebase.
There is no default 'post-rewrite' hook, but see the
`post-receive-copy-notes` script in `contrib/hooks` for an example
that copies your git-notes to the rewritten commits.
GIT
---
Part of the linkgit:git[1] suite

View File

@ -83,20 +83,16 @@ Patterns have the following format:
- If the pattern does not contain a slash '/', git treats it as
a shell glob pattern and checks for a match against the
pathname relative to the location of the `.gitignore` file
(relative to the toplevel of the work tree if not from a
`.gitignore` file).
pathname without leading directories.
- Otherwise, git treats the pattern as a shell glob suitable
for consumption by fnmatch(3) with the FNM_PATHNAME flag:
wildcards in the pattern will not match a / in the pathname.
For example, "Documentation/\*.html" matches
"Documentation/git.html" but not "Documentation/ppc/ppc.html"
or "tools/perf/Documentation/perf.html".
- A leading slash matches the beginning of the pathname.
For example, "/*.c" matches "cat-file.c" but not
"mozilla-sha1/sha1.c".
"Documentation/git.html" but not
"Documentation/ppc/ppc.html". A leading slash matches the
beginning of the pathname; for example, "/*.c" matches
"cat-file.c" but not "mozilla-sha1/sha1.c".
An example:

View File

@ -29,9 +29,6 @@ submodule.<name>.path::
submodule.<name>.url::
Defines an url from where the submodule repository can be cloned.
This may be either an absolute URL ready to be passed to
linkgit:git-clone[1] or (if it begins with ./ or ../) a location
relative to the superproject's origin repository.
submodule.<name>.update::
Defines what to do when the submodule is updated by the superproject.

View File

@ -142,8 +142,6 @@ different resolution strategies:
revert of a merge was rebuilt from scratch (i.e. rebasing and fixing,
as you seem to have interpreted), then re-merging the result without
doing anything else fancy would be the right thing to do.
(See the ADDENDUM below for how to rebuild a branch from scratch
without changing its original branching-off point.)
However, there are things to keep in mind when reverting a merge (and
reverting such a revert).
@ -179,91 +177,3 @@ the answer is: "oops, I really shouldn't have merged it, because it wasn't
ready yet, and I really need to undo _all_ of the merge"). So then you
really should revert the merge, but when you want to re-do the merge, you
now need to do it by reverting the revert.
ADDENDUM
Sometimes you have to rewrite one of a topic branch's commits *and* you can't
change the topic's branching-off point. Consider the following situation:
P---o---o---M---x---x---W---x
\ /
A---B---C
where commit W reverted commit M because it turned out that commit B was wrong
and needs to be rewritten, but you need the rewritten topic to still branch
from commit P (perhaps P is a branching-off point for yet another branch, and
you want be able to merge the topic into both branches).
The natural thing to do in this case is to checkout the A-B-C branch and use
"rebase -i P" to change commit B. However this does not rewrite commit A,
because "rebase -i" by default fast-forwards over any initial commits selected
with the "pick" command. So you end up with this:
P---o---o---M---x---x---W---x
\ /
A---B---C <-- old branch
\
B'---C' <-- naively rewritten branch
To merge A-B'-C' into the mainline branch you would still have to first revert
commit W in order to pick up the changes in A, but then it's likely that the
changes in B' will conflict with the original B changes re-introduced by the
reversion of W.
However, you can avoid these problems if you recreate the entire branch,
including commit A:
A'---B'---C' <-- completely rewritten branch
/
P---o---o---M---x---x---W---x
\ /
A---B---C
You can merge A'-B'-C' into the mainline branch without worrying about first
reverting W. Mainline's history would look like this:
A'---B'---C'------------------
/ \
P---o---o---M---x---x---W---x---M2
\ /
A---B---C
But if you don't actually need to change commit A, then you need some way to
recreate it as a new commit with the same changes in it. The rebase commmand's
--no-ff option provides a way to do this:
$ git rebase [-i] --no-ff P
The --no-ff option creates a new branch A'-B'-C' with all-new commits (all the
SHA IDs will be different) even if in the interactive case you only actually
modify commit B. You can then merge this new branch directly into the mainline
branch and be sure you'll get all of the branch's changes.
You can also use --no-ff in cases where you just add extra commits to the topic
to fix it up. Let's revisit the situation discussed at the start of this howto:
P---o---o---M---x---x---W---x
\ /
A---B---C----------------D---E <-- fixed-up topic branch
At this point, you can use --no-ff to recreate the topic branch:
$ git checkout E
$ git rebase --no-ff P
yielding
A'---B'---C'------------D'---E' <-- recreated topic branch
/
P---o---o---M---x---x---W---x
\ /
A---B---C----------------D---E
You can merge the recreated branch into the mainline without reverting commit W,
and mainline's history will look like this:
A'---B'---C'------------D'---E'
/ \
P---o---o---M---x---x---W---x---M2
\ /
A---B---C

View File

@ -72,7 +72,6 @@ option can be used to override --squash.
Synonyms to --stat and --no-stat; these are deprecated and will be
removed in the future.
ifndef::git-pull[]
-q::
--quiet::
Operate quietly.
@ -80,4 +79,3 @@ ifndef::git-pull[]
-v::
--verbose::
Be verbose.
endif::git-pull[]

View File

@ -76,9 +76,9 @@ displayed in full, regardless of whether --abbrev or
true parent commits, without taking grafts nor history
simplification into account.
* 'format:<string>'
* 'format:'
+
The 'format:<string>' format allows you to specify which information
The 'format:' format allows you to specify which information
you want to show. It works a little bit like printf format,
with the notable exception that you get a newline with '%n'
instead of '\n'.

View File

@ -3,9 +3,8 @@
Pretty-print the contents of the commit logs in a given format,
where '<format>' can be one of 'oneline', 'short', 'medium',
'full', 'fuller', 'email', 'raw' and 'format:<string>'. See
the "PRETTY FORMATS" section for some additional details for each
format. When omitted, the format defaults to 'medium'.
'full', 'fuller', 'email', 'raw' and 'format:<string>'.
When omitted, the format defaults to 'medium'.
+
Note: you can specify the default pretty format in the repository
configuration (see linkgit:git-config[1]).
@ -31,18 +30,9 @@ people using 80-column terminals.
defaults to UTF-8.
--no-notes::
--show-notes[=<ref>]::
--show-notes::
Show the notes (see linkgit:git-notes[1]) that annotate the
commit, when showing the commit log message. This is the default
for `git log`, `git show` and `git whatchanged` commands when
there is no `--pretty`, `--format` nor `--oneline` option is
given on the command line.
+
With an optional argument, add this ref to the list of notes. The ref
is taken to be in `refs/notes/` if it is not qualified.
--[no-]standard-notes::
Enable or disable populating the notes ref list from the
'core.notesRef' and 'notes.displayRef' variables (or
corresponding environment overrides). Enabled by default.
See linkgit:git-config[1].

View File

@ -108,8 +108,8 @@ options may be given. See linkgit:git-diff-files[1] for more options.
-c::
With this option, diff output for a merge commit
shows the differences from each of the parents to the merge result
This flag changes the way a merge commit is displayed. It shows
the differences from each of the parents to the merge result
simultaneously instead of showing pairwise diff between a parent
and the result one at a time. Furthermore, it lists only files
which were modified from all parents.
@ -121,15 +121,6 @@ options may be given. See linkgit:git-diff-files[1] for more options.
the parents have only two variants and the merge result picks
one of them without modification.
-m::
This flag makes the merge commits show the full diff like
regular commits; for each merge parent, a separate log entry
and diff is generated. An exception is that only diff against
the first parent is shown when '--first-parent' option is given;
in that case, the output represents the changes the merge
brought _into_ the then-current branch.
-r::
Show recursive diffs.

View File

@ -115,9 +115,6 @@ There are some macros to easily define options:
`OPT__ABBREV(&int_var)`::
Add `\--abbrev[=<n>]`.
`OPT__COLOR(&int_var, description)`::
Add `\--color[=<when>]` and `--no-color`.
`OPT__DRY_RUN(&int_var)`::
Add `-n, \--dry-run`.
@ -186,15 +183,6 @@ There are some macros to easily define options:
arguments. Short options that happen to be digits take
precedence over it.
`OPT_COLOR_FLAG(short, long, &int_var, description)`::
Introduce an option that takes an optional argument that can
have one of three values: "always", "never", or "auto". If the
argument is not given, it defaults to "always". The `--no-` form
works like `--long=never`; it cannot take an argument. If
"always", set `int_var` to 1; if "never", set `int_var` to 0; if
"auto", set `int_var` to 1 if stdout is a tty or a pager,
0 otherwise.
The last element of the array must be `OPT_END()`.

View File

@ -104,12 +104,8 @@ write `string_list_insert(...)->util = ...;`.
`unsorted_string_list_has_string`::
It's like `string_list_has_string()` but for unsorted lists.
`unsorted_string_list_lookup`::
It's like `string_list_lookup()` but for unsorted lists.
+
The above two functions need to look through all items, as opposed to their
This function needs to look through all items, as opposed to its
counterpart for sorted lists, which performs a binary search.
Data structures

View File

@ -119,7 +119,7 @@ both.
ofs-delta
---------
Server can send, and client understand PACKv2 with delta referring to
Server can send, and client understand PACKv2 with delta refering to
its base by position in pack rather than by an obj-id. That is, they can
send/read OBJ_OFS_DELTA (aka type 6) in a packfile.

View File

@ -1,57 +1,44 @@
GIT URLS[[URLS]]
----------------
In general, URLs contain information about the transport protocol, the
address of the remote server, and the path to the repository.
Depending on the transport protocol, some of this information may be
absent.
One of the following notations can be used
to name the remote repository:
Git natively supports ssh, git, http, https, ftp, ftps, and rsync
protocols. The following syntaxes may be used with them:
- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/
- git://host.xz{startsb}:port{endsb}/path/to/repo.git/
- http{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/
- ftp{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/
- rsync://host.xz/path/to/repo.git/
- http://host.xz{startsb}:port{endsb}/path/to/repo.git/
- https://host.xz{startsb}:port{endsb}/path/to/repo.git/
- git://host.xz{startsb}:port{endsb}/path/to/repo.git/
- git://host.xz{startsb}:port{endsb}/~user/path/to/repo.git/
- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/
- ssh://{startsb}user@{endsb}host.xz/path/to/repo.git/
- ssh://{startsb}user@{endsb}host.xz/~user/path/to/repo.git/
- ssh://{startsb}user@{endsb}host.xz/~/path/to/repo.git
An alternative scp-like syntax may also be used with the ssh protocol:
SSH is the default transport protocol over the network. You can
optionally specify which user to log-in as, and an alternate,
scp-like syntax is also supported. Both syntaxes support
username expansion, as does the native git protocol, but
only the former supports port specification. The following
three are identical to the last three above, respectively:
- {startsb}user@{endsb}host.xz:path/to/repo.git/
- {startsb}user@{endsb}host.xz:/path/to/repo.git/
- {startsb}user@{endsb}host.xz:~user/path/to/repo.git/
- {startsb}user@{endsb}host.xz:path/to/repo.git
The ssh and git protocols additionally support ~username expansion:
- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/
- git://host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/
- {startsb}user@{endsb}host.xz:/~{startsb}user{endsb}/path/to/repo.git/
For local respositories, also supported by git natively, the following
syntaxes may be used:
To sync with a local directory, you can use:
- /path/to/repo.git/
- file:///path/to/repo.git/
ifndef::git-clone[]
These two syntaxes are mostly equivalent, except when cloning, when
the former implies --local option. See linkgit:git-clone[1] for
details.
They are mostly equivalent, except when cloning. See
linkgit:git-clone[1] for details.
endif::git-clone[]
ifdef::git-clone[]
These two syntaxes are mostly equivalent, except the former implies
--local option.
They are equivalent, except the former implies --local option.
endif::git-clone[]
When git doesn't know how to handle a certain transport protocol, it
attempts to use the 'remote-<transport>' remote helper, if one
exists. To explicitly request a remote helper, the following syntax
may be used:
- <transport>::<address>
where <address> may be a path, a server and path, or an arbitrary
URL-like string recognized by the specific remote helper being
invoked. See linkgit:git-remote-helpers[1] for details.
If there are a large number of similarly-named remote repositories and
you want to use a different format for them (such that the URLs you

View File

@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
DEF_VER=v1.7.1.2
DEF_VER=v1.7.0.8
LF='
'
@ -12,7 +12,7 @@ if test -f version
then
VN=$(cat version) || VN="$DEF_VER"
elif test -d .git -o -f .git &&
VN=$(git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null) &&
VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
case "$VN" in
*$LF*) (exit 1) ;;
v[0-9]*)

554
Makefile
View File

@ -31,13 +31,10 @@ all::
# Define EXPATDIR=/foo/bar if your expat header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
#
# Define HAVE_PATHS_H if you have paths.h and want to use the default PATH
# it specifies.
#
# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
#
# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
# d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7).
# d_type in struct dirent (latest Cygwin -- will be fixed soonish).
#
# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
# do not support the 'size specifiers' introduced by C99, namely ll, hh,
@ -112,7 +109,7 @@ all::
# Define NO_PTHREADS if you do not have or do not want to use Pthreads.
#
# Define NO_PREAD if you have a problem with pread() system call (e.g.
# cygwin1.dll before v1.5.22).
# cygwin.dll before v1.5.22).
#
# Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
# generally faster on your platform than accessing the working directory.
@ -206,9 +203,6 @@ all::
# Define JSMIN to point to JavaScript minifier that functions as
# a filter to have gitweb.js minified.
#
# Define CSSMIN to point to a CSS minifier in order to generate a minified
# version of gitweb.css
#
# Define DEFAULT_PAGER to a sensible pager command (defaults to "less") if
# you want to use something different. The value will be interpreted by the
# shell at runtime when it is used.
@ -220,13 +214,6 @@ all::
# DEFAULT_EDITOR='~/bin/vi',
# DEFAULT_EDITOR='$GIT_FALLBACK_EDITOR',
# DEFAULT_EDITOR='"C:\Program Files\Vim\gvim.exe" --nofork'
#
# Define COMPUTE_HEADER_DEPENDENCIES if your compiler supports the -MMD option
# and you want to avoid rebuilding objects when an unrelated header file
# changes.
#
# Define CHECK_HEADER_DEPENDENCIES to check for problems in the hard-coded
# dependency rules.
GIT-VERSION-FILE: FORCE
@$(SHELL_PATH) ./GIT-VERSION-GEN
@ -285,6 +272,9 @@ lib = lib
# DESTDIR=
pathsep = :
# JavaScript minifier invocation that can function as filter
JSMIN =
export prefix bindir sharedir sysconfdir
CC = gcc
@ -311,7 +301,7 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
# Those must not be GNU-specific; they are shared with perl/ which may
# be built by a different compiler. (Note that this is an artifact now
# but it still might be nice to keep that distinction.)
BASIC_CFLAGS = -I.
BASIC_CFLAGS =
BASIC_LDFLAGS =
# Guard against environment variables
@ -319,16 +309,13 @@ BUILTIN_OBJS =
BUILT_INS =
COMPAT_CFLAGS =
COMPAT_OBJS =
EXTRA_CPPFLAGS =
LIB_H =
LIB_OBJS =
PROGRAM_OBJS =
PROGRAMS =
SCRIPT_PERL =
SCRIPT_PYTHON =
SCRIPT_SH =
SCRIPT_LIB =
TEST_PROGRAMS_NEED_X =
TEST_PROGRAMS =
# Having this variable in your environment would break pipelines because
# you cause "cd" to echo its destination to stdout. It can also take
@ -345,20 +332,20 @@ SCRIPT_SH += git-merge-octopus.sh
SCRIPT_SH += git-merge-one-file.sh
SCRIPT_SH += git-merge-resolve.sh
SCRIPT_SH += git-mergetool.sh
SCRIPT_SH += git-mergetool--lib.sh
SCRIPT_SH += git-notes.sh
SCRIPT_SH += git-parse-remote.sh
SCRIPT_SH += git-pull.sh
SCRIPT_SH += git-quiltimport.sh
SCRIPT_SH += git-rebase--interactive.sh
SCRIPT_SH += git-rebase.sh
SCRIPT_SH += git-repack.sh
SCRIPT_SH += git-request-pull.sh
SCRIPT_SH += git-sh-setup.sh
SCRIPT_SH += git-stash.sh
SCRIPT_SH += git-submodule.sh
SCRIPT_SH += git-web--browse.sh
SCRIPT_LIB += git-mergetool--lib
SCRIPT_LIB += git-parse-remote
SCRIPT_LIB += git-sh-setup
SCRIPT_PERL += git-add--interactive.perl
SCRIPT_PERL += git-difftool.perl
SCRIPT_PERL += git-archimport.perl
@ -379,35 +366,16 @@ EXTRA_PROGRAMS =
# ... and all the rest that could be moved out of bindir to gitexecdir
PROGRAMS += $(EXTRA_PROGRAMS)
PROGRAM_OBJS += fast-import.o
PROGRAM_OBJS += imap-send.o
PROGRAM_OBJS += shell.o
PROGRAM_OBJS += show-index.o
PROGRAM_OBJS += upload-pack.o
PROGRAM_OBJS += http-backend.o
PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
TEST_PROGRAMS_NEED_X += test-chmtime
TEST_PROGRAMS_NEED_X += test-ctype
TEST_PROGRAMS_NEED_X += test-date
TEST_PROGRAMS_NEED_X += test-delta
TEST_PROGRAMS_NEED_X += test-dump-cache-tree
TEST_PROGRAMS_NEED_X += test-genrandom
TEST_PROGRAMS_NEED_X += test-match-trees
TEST_PROGRAMS_NEED_X += test-parse-options
TEST_PROGRAMS_NEED_X += test-path-utils
TEST_PROGRAMS_NEED_X += test-run-command
TEST_PROGRAMS_NEED_X += test-sha1
TEST_PROGRAMS_NEED_X += test-sigchain
TEST_PROGRAMS_NEED_X += test-index-version
TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
PROGRAMS += git-fast-import$X
PROGRAMS += git-imap-send$X
PROGRAMS += git-shell$X
PROGRAMS += git-show-index$X
PROGRAMS += git-upload-pack$X
PROGRAMS += git-http-backend$X
# List built-in command $C whose implementation cmd_$C() is not in
# builtin/$C.o but is linked in as part of some other command.
BUILT_INS += $(patsubst builtin/%.o,git-%$X,$(BUILTIN_OBJS))
# builtin-$C.o but is linked in as part of some other command.
BUILT_INS += $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS))
BUILT_INS += git-cherry$X
BUILT_INS += git-cherry-pick$X
@ -463,7 +431,6 @@ LIB_H += blob.h
LIB_H += builtin.h
LIB_H += cache.h
LIB_H += cache-tree.h
LIB_H += color.h
LIB_H += commit.h
LIB_H += compat/bswap.h
LIB_H += compat/cygwin.h
@ -475,7 +442,6 @@ LIB_H += delta.h
LIB_H += diffcore.h
LIB_H += diff.h
LIB_H += dir.h
LIB_H += exec_cmd.h
LIB_H += fsck.h
LIB_H += git-compat-util.h
LIB_H += graph.h
@ -518,8 +484,7 @@ LIB_H += tree-walk.h
LIB_H += unpack-trees.h
LIB_H += userdiff.h
LIB_H += utf8.h
LIB_H += xdiff-interface.h
LIB_H += xdiff/xdiff.h
LIB_H += wt-status.h
LIB_OBJS += abspath.o
LIB_OBJS += advice.o
@ -633,96 +598,95 @@ LIB_OBJS += ws.o
LIB_OBJS += wt-status.o
LIB_OBJS += xdiff-interface.o
BUILTIN_OBJS += builtin/add.o
BUILTIN_OBJS += builtin/annotate.o
BUILTIN_OBJS += builtin/apply.o
BUILTIN_OBJS += builtin/archive.o
BUILTIN_OBJS += builtin/bisect--helper.o
BUILTIN_OBJS += builtin/blame.o
BUILTIN_OBJS += builtin/branch.o
BUILTIN_OBJS += builtin/bundle.o
BUILTIN_OBJS += builtin/cat-file.o
BUILTIN_OBJS += builtin/check-attr.o
BUILTIN_OBJS += builtin/check-ref-format.o
BUILTIN_OBJS += builtin/checkout-index.o
BUILTIN_OBJS += builtin/checkout.o
BUILTIN_OBJS += builtin/clean.o
BUILTIN_OBJS += builtin/clone.o
BUILTIN_OBJS += builtin/commit-tree.o
BUILTIN_OBJS += builtin/commit.o
BUILTIN_OBJS += builtin/config.o
BUILTIN_OBJS += builtin/count-objects.o
BUILTIN_OBJS += builtin/describe.o
BUILTIN_OBJS += builtin/diff-files.o
BUILTIN_OBJS += builtin/diff-index.o
BUILTIN_OBJS += builtin/diff-tree.o
BUILTIN_OBJS += builtin/diff.o
BUILTIN_OBJS += builtin/fast-export.o
BUILTIN_OBJS += builtin/fetch-pack.o
BUILTIN_OBJS += builtin/fetch.o
BUILTIN_OBJS += builtin/fmt-merge-msg.o
BUILTIN_OBJS += builtin/for-each-ref.o
BUILTIN_OBJS += builtin/fsck.o
BUILTIN_OBJS += builtin/gc.o
BUILTIN_OBJS += builtin/grep.o
BUILTIN_OBJS += builtin/hash-object.o
BUILTIN_OBJS += builtin/help.o
BUILTIN_OBJS += builtin/index-pack.o
BUILTIN_OBJS += builtin/init-db.o
BUILTIN_OBJS += builtin/log.o
BUILTIN_OBJS += builtin/ls-files.o
BUILTIN_OBJS += builtin/ls-remote.o
BUILTIN_OBJS += builtin/ls-tree.o
BUILTIN_OBJS += builtin/mailinfo.o
BUILTIN_OBJS += builtin/mailsplit.o
BUILTIN_OBJS += builtin/merge.o
BUILTIN_OBJS += builtin/merge-base.o
BUILTIN_OBJS += builtin/merge-file.o
BUILTIN_OBJS += builtin/merge-index.o
BUILTIN_OBJS += builtin/merge-ours.o
BUILTIN_OBJS += builtin/merge-recursive.o
BUILTIN_OBJS += builtin/merge-tree.o
BUILTIN_OBJS += builtin/mktag.o
BUILTIN_OBJS += builtin/mktree.o
BUILTIN_OBJS += builtin/mv.o
BUILTIN_OBJS += builtin/name-rev.o
BUILTIN_OBJS += builtin/notes.o
BUILTIN_OBJS += builtin/pack-objects.o
BUILTIN_OBJS += builtin/pack-redundant.o
BUILTIN_OBJS += builtin/pack-refs.o
BUILTIN_OBJS += builtin/patch-id.o
BUILTIN_OBJS += builtin/prune-packed.o
BUILTIN_OBJS += builtin/prune.o
BUILTIN_OBJS += builtin/push.o
BUILTIN_OBJS += builtin/read-tree.o
BUILTIN_OBJS += builtin/receive-pack.o
BUILTIN_OBJS += builtin/reflog.o
BUILTIN_OBJS += builtin/remote.o
BUILTIN_OBJS += builtin/replace.o
BUILTIN_OBJS += builtin/rerere.o
BUILTIN_OBJS += builtin/reset.o
BUILTIN_OBJS += builtin/rev-list.o
BUILTIN_OBJS += builtin/rev-parse.o
BUILTIN_OBJS += builtin/revert.o
BUILTIN_OBJS += builtin/rm.o
BUILTIN_OBJS += builtin/send-pack.o
BUILTIN_OBJS += builtin/shortlog.o
BUILTIN_OBJS += builtin/show-branch.o
BUILTIN_OBJS += builtin/show-ref.o
BUILTIN_OBJS += builtin/stripspace.o
BUILTIN_OBJS += builtin/symbolic-ref.o
BUILTIN_OBJS += builtin/tag.o
BUILTIN_OBJS += builtin/tar-tree.o
BUILTIN_OBJS += builtin/unpack-file.o
BUILTIN_OBJS += builtin/unpack-objects.o
BUILTIN_OBJS += builtin/update-index.o
BUILTIN_OBJS += builtin/update-ref.o
BUILTIN_OBJS += builtin/update-server-info.o
BUILTIN_OBJS += builtin/upload-archive.o
BUILTIN_OBJS += builtin/var.o
BUILTIN_OBJS += builtin/verify-pack.o
BUILTIN_OBJS += builtin/verify-tag.o
BUILTIN_OBJS += builtin/write-tree.o
BUILTIN_OBJS += builtin-add.o
BUILTIN_OBJS += builtin-annotate.o
BUILTIN_OBJS += builtin-apply.o
BUILTIN_OBJS += builtin-archive.o
BUILTIN_OBJS += builtin-bisect--helper.o
BUILTIN_OBJS += builtin-blame.o
BUILTIN_OBJS += builtin-branch.o
BUILTIN_OBJS += builtin-bundle.o
BUILTIN_OBJS += builtin-cat-file.o
BUILTIN_OBJS += builtin-check-attr.o
BUILTIN_OBJS += builtin-check-ref-format.o
BUILTIN_OBJS += builtin-checkout-index.o
BUILTIN_OBJS += builtin-checkout.o
BUILTIN_OBJS += builtin-clean.o
BUILTIN_OBJS += builtin-clone.o
BUILTIN_OBJS += builtin-commit-tree.o
BUILTIN_OBJS += builtin-commit.o
BUILTIN_OBJS += builtin-config.o
BUILTIN_OBJS += builtin-count-objects.o
BUILTIN_OBJS += builtin-describe.o
BUILTIN_OBJS += builtin-diff-files.o
BUILTIN_OBJS += builtin-diff-index.o
BUILTIN_OBJS += builtin-diff-tree.o
BUILTIN_OBJS += builtin-diff.o
BUILTIN_OBJS += builtin-fast-export.o
BUILTIN_OBJS += builtin-fetch-pack.o
BUILTIN_OBJS += builtin-fetch.o
BUILTIN_OBJS += builtin-fmt-merge-msg.o
BUILTIN_OBJS += builtin-for-each-ref.o
BUILTIN_OBJS += builtin-fsck.o
BUILTIN_OBJS += builtin-gc.o
BUILTIN_OBJS += builtin-grep.o
BUILTIN_OBJS += builtin-hash-object.o
BUILTIN_OBJS += builtin-help.o
BUILTIN_OBJS += builtin-index-pack.o
BUILTIN_OBJS += builtin-init-db.o
BUILTIN_OBJS += builtin-log.o
BUILTIN_OBJS += builtin-ls-files.o
BUILTIN_OBJS += builtin-ls-remote.o
BUILTIN_OBJS += builtin-ls-tree.o
BUILTIN_OBJS += builtin-mailinfo.o
BUILTIN_OBJS += builtin-mailsplit.o
BUILTIN_OBJS += builtin-merge.o
BUILTIN_OBJS += builtin-merge-base.o
BUILTIN_OBJS += builtin-merge-file.o
BUILTIN_OBJS += builtin-merge-index.o
BUILTIN_OBJS += builtin-merge-ours.o
BUILTIN_OBJS += builtin-merge-recursive.o
BUILTIN_OBJS += builtin-merge-tree.o
BUILTIN_OBJS += builtin-mktag.o
BUILTIN_OBJS += builtin-mktree.o
BUILTIN_OBJS += builtin-mv.o
BUILTIN_OBJS += builtin-name-rev.o
BUILTIN_OBJS += builtin-pack-objects.o
BUILTIN_OBJS += builtin-pack-redundant.o
BUILTIN_OBJS += builtin-pack-refs.o
BUILTIN_OBJS += builtin-patch-id.o
BUILTIN_OBJS += builtin-prune-packed.o
BUILTIN_OBJS += builtin-prune.o
BUILTIN_OBJS += builtin-push.o
BUILTIN_OBJS += builtin-read-tree.o
BUILTIN_OBJS += builtin-receive-pack.o
BUILTIN_OBJS += builtin-reflog.o
BUILTIN_OBJS += builtin-remote.o
BUILTIN_OBJS += builtin-replace.o
BUILTIN_OBJS += builtin-rerere.o
BUILTIN_OBJS += builtin-reset.o
BUILTIN_OBJS += builtin-rev-list.o
BUILTIN_OBJS += builtin-rev-parse.o
BUILTIN_OBJS += builtin-revert.o
BUILTIN_OBJS += builtin-rm.o
BUILTIN_OBJS += builtin-send-pack.o
BUILTIN_OBJS += builtin-shortlog.o
BUILTIN_OBJS += builtin-show-branch.o
BUILTIN_OBJS += builtin-show-ref.o
BUILTIN_OBJS += builtin-stripspace.o
BUILTIN_OBJS += builtin-symbolic-ref.o
BUILTIN_OBJS += builtin-tag.o
BUILTIN_OBJS += builtin-tar-tree.o
BUILTIN_OBJS += builtin-unpack-file.o
BUILTIN_OBJS += builtin-unpack-objects.o
BUILTIN_OBJS += builtin-update-index.o
BUILTIN_OBJS += builtin-update-ref.o
BUILTIN_OBJS += builtin-update-server-info.o
BUILTIN_OBJS += builtin-upload-archive.o
BUILTIN_OBJS += builtin-var.o
BUILTIN_OBJS += builtin-verify-pack.o
BUILTIN_OBJS += builtin-verify-tag.o
BUILTIN_OBJS += builtin-write-tree.o
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
EXTLIBS =
@ -738,12 +702,10 @@ EXTLIBS =
ifeq ($(uname_S),Linux)
NO_STRLCPY = YesPlease
NO_MKSTEMPS = YesPlease
HAVE_PATHS_H = YesPlease
endif
ifeq ($(uname_S),GNU/kFreeBSD)
NO_STRLCPY = YesPlease
NO_MKSTEMPS = YesPlease
HAVE_PATHS_H = YesPlease
endif
ifeq ($(uname_S),UnixWare)
CC = cc
@ -836,24 +798,22 @@ ifeq ($(uname_S),SunOS)
BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H
endif
ifeq ($(uname_O),Cygwin)
ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
NO_D_TYPE_IN_DIRENT = YesPlease
NO_D_INO_IN_DIRENT = YesPlease
NO_STRCASESTR = YesPlease
NO_MEMMEM = YesPlease
NO_MKSTEMPS = YesPlease
NO_SYMLINK_HEAD = YesPlease
NO_IPV6 = YesPlease
OLD_ICONV = UnfortunatelyYes
endif
NO_D_TYPE_IN_DIRENT = YesPlease
NO_D_INO_IN_DIRENT = YesPlease
NO_STRCASESTR = YesPlease
NO_MEMMEM = YesPlease
NO_MKSTEMPS = YesPlease
NO_SYMLINK_HEAD = YesPlease
NEEDS_LIBICONV = YesPlease
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
OLD_ICONV = UnfortunatelyYes
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
# There are conflicting reports about this.
# On some boxes NO_MMAP is needed, and not so elsewhere.
# Try commenting this out if you suspect MMAP is more efficient
NO_MMAP = YesPlease
NO_IPV6 = YesPlease
X = .exe
COMPAT_OBJS += compat/cygwin.o
UNRELIABLE_FSTAT = UnfortunatelyYes
@ -872,7 +832,6 @@ ifeq ($(uname_S),FreeBSD)
NO_STRTOUMAX = YesPlease
endif
PYTHON_PATH = /usr/local/bin/python
HAVE_PATHS_H = YesPlease
endif
ifeq ($(uname_S),OpenBSD)
NO_STRCASESTR = YesPlease
@ -881,7 +840,6 @@ ifeq ($(uname_S),OpenBSD)
NEEDS_LIBICONV = YesPlease
BASIC_CFLAGS += -I/usr/local/include
BASIC_LDFLAGS += -L/usr/local/lib
HAVE_PATHS_H = YesPlease
endif
ifeq ($(uname_S),NetBSD)
ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
@ -891,10 +849,8 @@ ifeq ($(uname_S),NetBSD)
BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib
USE_ST_TIMESPEC = YesPlease
NO_MKSTEMPS = YesPlease
HAVE_PATHS_H = YesPlease
endif
ifeq ($(uname_S),AIX)
DEFAULT_PAGER = more
NO_STRCASESTR=YesPlease
NO_MEMMEM = YesPlease
NO_MKDTEMP = YesPlease
@ -913,7 +869,6 @@ ifeq ($(uname_S),GNU)
# GNU/Hurd
NO_STRLCPY=YesPlease
NO_MKSTEMPS = YesPlease
HAVE_PATHS_H = YesPlease
endif
ifeq ($(uname_S),IRIX)
NO_SETENV = YesPlease
@ -932,6 +887,7 @@ ifeq ($(uname_S),IRIX)
SNPRINTF_RETURNS_BOGUS = YesPlease
SHELL_PATH = /usr/gnu/bin/bash
NEEDS_LIBGEN = YesPlease
NEEDS_LIBICONV = YesPlease
endif
ifeq ($(uname_S),IRIX64)
NO_SETENV=YesPlease
@ -950,6 +906,7 @@ ifeq ($(uname_S),IRIX64)
SNPRINTF_RETURNS_BOGUS = YesPlease
SHELL_PATH=/usr/gnu/bin/bash
NEEDS_LIBGEN = YesPlease
NEEDS_LIBICONV = YesPlease
endif
ifeq ($(uname_S),HP-UX)
NO_IPV6=YesPlease
@ -1072,14 +1029,6 @@ endif
-include config.mak.autogen
-include config.mak
ifdef CHECK_HEADER_DEPENDENCIES
USE_COMPUTED_HEADER_DEPENDENCIES =
endif
ifdef COMPUTE_HEADER_DEPENDENCIES
USE_COMPUTED_HEADER_DEPENDENCIES = YesPlease
endif
ifdef SANE_TOOL_PATH
SANE_TOOL_PATH_SQ = $(subst ','\'',$(SANE_TOOL_PATH))
BROKEN_PATH_FIX = 's|^\# @@BROKEN_PATH_FIX@@$$|git_broken_path_fix $(SANE_TOOL_PATH_SQ)|'
@ -1135,12 +1084,11 @@ else
REMOTE_CURL_PRIMARY = git-remote-http$X
REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
PROGRAM_OBJS += http-fetch.o
PROGRAMS += $(REMOTE_CURL_NAMES)
PROGRAMS += $(REMOTE_CURL_NAMES) git-http-fetch$X
curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
ifeq "$(curl_check)" "070908"
ifndef NO_EXPAT
PROGRAM_OBJS += http-push.o
PROGRAMS += git-http-push$X
endif
endif
ifndef NO_EXPAT
@ -1160,7 +1108,7 @@ endif
EXTLIBS += -lz
ifndef NO_POSIX_ONLY_PROGRAMS
PROGRAM_OBJS += daemon.o
PROGRAMS += git-daemon$X
endif
ifndef NO_OPENSSL
OPENSSL_LIBSSL = -lssl
@ -1326,12 +1274,10 @@ endif
ifdef BLK_SHA1
SHA1_HEADER = "block-sha1/sha1.h"
LIB_OBJS += block-sha1/sha1.o
LIB_H += block-sha1/sha1.h
else
ifdef PPC_SHA1
SHA1_HEADER = "ppc/sha1.h"
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
LIB_H += ppc/sha1.h
else
SHA1_HEADER = <openssl/sha.h>
EXTLIBS += $(LIB_4_CRYPTO)
@ -1363,10 +1309,6 @@ else
LIB_OBJS += thread-utils.o
endif
ifdef HAVE_PATHS_H
BASIC_CFLAGS += -DHAVE_PATHS_H
endif
ifdef DIR_HAS_BSD_GROUP_SEMANTICS
COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS
endif
@ -1477,7 +1419,7 @@ export TAR INSTALL DESTDIR SHELL_PATH
SHELL = $(SHELL_PATH)
all:: shell_compatibility_test $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
ifneq (,$X)
$(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
endif
@ -1493,7 +1435,7 @@ endif
ifndef NO_PYTHON
$(QUIET_SUBDIR0)git_remote_helpers $(QUIET_SUBDIR1) PYTHON_PATH='$(PYTHON_PATH_SQ)' prefix='$(prefix_SQ)' all
endif
$(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) SHELL_PATH='$(SHELL_PATH_SQ)' PERL_PATH='$(PERL_PATH_SQ)'
$(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1)
please_set_SHELL_PATH_to_a_more_modern_shell:
@$$(:)
@ -1504,15 +1446,15 @@ strip: $(PROGRAMS) git$X
$(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
git.o: common-cmds.h
git.s git.o: EXTRA_CPPFLAGS = -DGIT_VERSION='"$(GIT_VERSION)"' \
git.s git.o: ALL_CFLAGS += -DGIT_VERSION='"$(GIT_VERSION)"' \
'-DGIT_HTML_PATH="$(htmldir_SQ)"'
git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
$(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
builtin/help.o: common-cmds.h
builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
builtin-help.o: common-cmds.h
builtin-help.s builtin-help.o: ALL_CFLAGS += \
'-DGIT_HTML_PATH="$(htmldir_SQ)"' \
'-DGIT_MAN_PATH="$(mandir_SQ)"' \
'-DGIT_INFO_PATH="$(infodir_SQ)"'
@ -1528,25 +1470,17 @@ common-cmds.h: ./generate-cmdlist.sh command-list.txt
common-cmds.h: $(wildcard Documentation/git-*.txt)
$(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@
define cmd_munge_script
$(RM) $@ $@+ && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
-e $(BROKEN_PATH_FIX) \
$@.sh >$@+
endef
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
$(QUIET_GEN)$(cmd_munge_script) && \
$(QUIET_GEN)$(RM) $@ $@+ && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
-e $(BROKEN_PATH_FIX) \
$@.sh >$@+ && \
chmod +x $@+ && \
mv $@+ $@
$(SCRIPT_LIB) : % : %.sh
$(QUIET_GEN)$(cmd_munge_script) && \
mv $@+ $@
ifndef NO_PERL
$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
@ -1575,29 +1509,18 @@ gitweb:
$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
ifdef JSMIN
GITWEB_PROGRAMS += gitweb/gitweb.min.js
GITWEB_JS = gitweb/gitweb.min.js
OTHER_PROGRAMS += gitweb/gitweb.cgi gitweb/gitweb.min.js
gitweb/gitweb.cgi: gitweb/gitweb.perl gitweb/gitweb.min.js
else
GITWEB_JS = gitweb/gitweb.js
OTHER_PROGRAMS += gitweb/gitweb.cgi
gitweb/gitweb.cgi: gitweb/gitweb.perl
endif
ifdef CSSMIN
GITWEB_PROGRAMS += gitweb/gitweb.min.css
GITWEB_CSS = gitweb/gitweb.min.css
else
GITWEB_CSS = gitweb/gitweb.css
endif
OTHER_PROGRAMS += gitweb/gitweb.cgi $(GITWEB_PROGRAMS)
gitweb/gitweb.cgi: gitweb/gitweb.perl $(GITWEB_PROGRAMS)
$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@)
ifdef JSMIN
gitweb/gitweb.min.js: gitweb/gitweb.js
$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@)
endif # JSMIN
ifdef CSSMIN
gitweb/gitweb.min.css: gitweb/gitweb.css
$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@)
endif # CSSMIN
git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.js
@ -1607,13 +1530,11 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
-e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \
-e '/@@GITWEB_CGI@@/d' \
-e '/@@GITWEB_CSS@@/r $(GITWEB_CSS)' \
-e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
-e '/@@GITWEB_CSS@@/d' \
-e '/@@GITWEB_JS@@/r $(GITWEB_JS)' \
-e '/@@GITWEB_JS@@/r gitweb/gitweb.js' \
-e '/@@GITWEB_JS@@/d' \
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
-e 's|@@GITWEB_CSS_NAME@@|$(GITWEB_CSS)|' \
-e 's|@@GITWEB_JS_NAME@@|$(GITWEB_JS)|' \
$@.sh > $@+ && \
chmod +x $@+ && \
mv $@+ $@
@ -1668,148 +1589,28 @@ git.o git.spec \
$(patsubst %.perl,%,$(SCRIPT_PERL)) \
: GIT-VERSION-FILE
TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
GIT_OBJS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
git.o http.o http-walker.o remote-curl.o
XDIFF_OBJS = xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
xdiff/xmerge.o xdiff/xpatience.o
OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS)
dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))
ifdef COMPUTE_HEADER_DEPENDENCIES
$(dep_dirs):
mkdir -p $@
missing_dep_dirs := $(filter-out $(wildcard $(dep_dirs)),$(dep_dirs))
dep_file = $(dir $@).depend/$(notdir $@).d
dep_args = -MF $(dep_file) -MMD -MP
ifdef CHECK_HEADER_DEPENDENCIES
$(error cannot compute header dependencies outside a normal build. \
Please unset CHECK_HEADER_DEPENDENCIES and try again)
endif
endif
ifndef COMPUTE_HEADER_DEPENDENCIES
ifndef CHECK_HEADER_DEPENDENCIES
dep_dirs =
missing_dep_dirs =
dep_args =
endif
endif
ifdef CHECK_HEADER_DEPENDENCIES
ifndef PRINT_HEADER_DEPENDENCIES
missing_deps = $(filter-out $(notdir $^), \
$(notdir $(shell $(MAKE) -s $@ \
CHECK_HEADER_DEPENDENCIES=YesPlease \
USE_COMPUTED_HEADER_DEPENDENCIES=YesPlease \
PRINT_HEADER_DEPENDENCIES=YesPlease)))
endif
endif
ASM_SRC := $(wildcard $(OBJECTS:o=S))
ASM_OBJ := $(ASM_SRC:S=o)
C_OBJ := $(filter-out $(ASM_OBJ),$(OBJECTS))
.SUFFIXES:
ifdef PRINT_HEADER_DEPENDENCIES
$(C_OBJ): %.o: %.c FORCE
echo $^
$(ASM_OBJ): %.o: %.S FORCE
echo $^
ifndef CHECK_HEADER_DEPENDENCIES
$(error cannot print header dependencies during a normal build. \
Please set CHECK_HEADER_DEPENDENCIES and try again)
endif
endif
ifndef PRINT_HEADER_DEPENDENCIES
ifdef CHECK_HEADER_DEPENDENCIES
$(C_OBJ): %.o: %.c $(dep_files) FORCE
@set -e; echo CHECK $@; \
missing_deps="$(missing_deps)"; \
if test "$$missing_deps"; \
then \
echo missing dependencies: $$missing_deps; \
false; \
fi
$(ASM_OBJ): %.o: %.S $(dep_files) FORCE
@set -e; echo CHECK $@; \
missing_deps="$(missing_deps)"; \
if test "$$missing_deps"; \
then \
echo missing dependencies: $$missing_deps; \
false; \
fi
endif
endif
ifndef CHECK_HEADER_DEPENDENCIES
$(C_OBJ): %.o: %.c GIT-CFLAGS $(missing_dep_dirs)
$(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
$(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs)
$(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
endif
%.o: %.c GIT-CFLAGS
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
%.s: %.c GIT-CFLAGS FORCE
$(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
$(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
%.o: %.S GIT-CFLAGS
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
ifdef USE_COMPUTED_HEADER_DEPENDENCIES
# Take advantage of gcc's on-the-fly dependency generation
# See <http://gcc.gnu.org/gcc-3.0/features.html>.
dep_files_present := $(wildcard $(dep_files))
ifneq ($(dep_files_present),)
include $(dep_files_present)
endif
else
# Dependencies on header files, for platforms that do not support
# the gcc -MMD option.
#
# Dependencies on automatically generated headers such as common-cmds.h
# should _not_ be included here, since they are necessary even when
# building an object for the first time.
#
# XXX. Please check occasionally that these include all dependencies
# gcc detects!
$(GIT_OBJS): $(LIB_H)
builtin/branch.o builtin/checkout.o builtin/clone.o builtin/reset.o branch.o transport.o: branch.h
builtin/bundle.o bundle.o transport.o: bundle.h
builtin/bisect--helper.o builtin/rev-list.o bisect.o: bisect.h
builtin/clone.o builtin/fetch-pack.o transport.o: fetch-pack.h
builtin/grep.o: thread-utils.h
builtin/send-pack.o transport.o: send-pack.h
builtin/log.o builtin/shortlog.o: shortlog.h
builtin/prune.o builtin/reflog.o reachable.o: reachable.h
builtin/commit.o builtin/revert.o wt-status.o: wt-status.h
builtin/tar-tree.o archive-tar.o: tar.h
builtin/pack-objects.o: thread-utils.h
http-fetch.o http-walker.o remote-curl.o transport.o walker.o: walker.h
http.o http-walker.o http-push.o remote-curl.o: http.h
xdiff-interface.o $(XDIFF_OBJS): \
xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
endif
exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
exec_cmd.s exec_cmd.o: ALL_CFLAGS += \
'-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
'-DBINDIR="$(bindir_relative_SQ)"' \
'-DPREFIX="$(prefix_SQ)"'
builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \
builtin-init-db.s builtin-init-db.o: ALL_CFLAGS += \
-DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
config.s config.o: EXTRA_CPPFLAGS = -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
config.s config.o: ALL_CFLAGS += -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
http.s http.o: EXTRA_CPPFLAGS = -DGIT_USER_AGENT='"git/$(GIT_VERSION)"'
http.s http.o: ALL_CFLAGS += -DGIT_USER_AGENT='"git/$(GIT_VERSION)"'
ifdef NO_EXPAT
http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
http-walker.o: http.h
http-walker.s http-walker.o: ALL_CFLAGS += -DNO_EXPAT
endif
git-%$X: %.o $(GITLIBS)
@ -1819,6 +1620,10 @@ git-imap-send$X: imap-send.o $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
http.o http-walker.o http-push.o: http.h
http.o http-walker.o: $(LIB_H)
git-http-fetch$X: revision.o http.o http-walker.o http-fetch.o $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(CURL_LIBCURL)
@ -1836,9 +1641,18 @@ $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
$(patsubst git-%$X,%.o,$(PROGRAMS)) git.o: $(LIB_H) $(wildcard */*.h)
builtin-revert.o wt-status.o: wt-status.h
$(LIB_FILE): $(LIB_OBJS)
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
xdiff/xmerge.o xdiff/xpatience.o
$(XDIFF_OBJS): xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
$(XDIFF_LIB): $(XDIFF_OBJS)
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS)
@ -1904,6 +1718,24 @@ GIT-GUI-VARS: FORCE
fi
endif
### Testing rules
TEST_PROGRAMS_NEED_X += test-chmtime
TEST_PROGRAMS_NEED_X += test-ctype
TEST_PROGRAMS_NEED_X += test-date
TEST_PROGRAMS_NEED_X += test-delta
TEST_PROGRAMS_NEED_X += test-dump-cache-tree
TEST_PROGRAMS_NEED_X += test-genrandom
TEST_PROGRAMS_NEED_X += test-match-trees
TEST_PROGRAMS_NEED_X += test-parse-options
TEST_PROGRAMS_NEED_X += test-path-utils
TEST_PROGRAMS_NEED_X += test-run-command
TEST_PROGRAMS_NEED_X += test-sha1
TEST_PROGRAMS_NEED_X += test-sigchain
TEST_PROGRAMS_NEED_X += test-index-version
TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))
all:: $(TEST_PROGRAMS) $(test_bindir_programs)
@ -1921,8 +1753,6 @@ bin-wrappers/%: wrap-for-bin.sh
export NO_SVN_TESTS
### Testing rules
test: all
$(MAKE) -C t/ all
@ -1934,7 +1764,9 @@ test-delta$X: diff-delta.o patch-delta.o
test-parse-options$X: parse-options.o
.PRECIOUS: $(TEST_OBJS)
test-parse-options.o: parse-options.h
.PRECIOUS: $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
test-%$X: test-%.o $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
@ -1980,7 +1812,6 @@ install: all
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)'
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
ifndef NO_PERL
@ -2100,11 +1931,10 @@ distclean: clean
clean:
$(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o \
builtin/*.o $(LIB_FILE) $(XDIFF_LIB)
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
$(LIB_FILE) $(XDIFF_LIB)
$(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
$(RM) $(TEST_PROGRAMS)
$(RM) -r bin-wrappers
$(RM) -r $(dep_dirs)
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
$(RM) -r autom4te.cache
$(RM) config.log config.mak.autogen config.mak.append config.status config.cache
@ -2113,7 +1943,7 @@ clean:
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
$(MAKE) -C Documentation/ clean
ifndef NO_PERL
$(MAKE) -C gitweb clean
$(RM) gitweb/gitweb.cgi
$(MAKE) -C perl clean
endif
ifndef NO_PYTHON
@ -2134,13 +1964,12 @@ endif
### Check documentation
#
check-docs::
@(for v in $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git gitk; \
@(for v in $(ALL_PROGRAMS) $(BUILT_INS) git gitk; \
do \
case "$$v" in \
git-merge-octopus | git-merge-ours | git-merge-recursive | \
git-merge-resolve | git-merge-subtree | \
git-fsck-objects | git-init-db | \
git-remote-* | git-stage | \
git-?*--?* ) continue ;; \
esac ; \
test -f "Documentation/$$v.txt" || \
@ -2178,12 +2007,9 @@ check-docs::
documented,gitrepository-layout | \
documented,gittutorial | \
documented,gittutorial-2 | \
documented,git-bisect-lk2009 | \
documented,git-remote-helpers | \
documented,gitworkflows | \
sentinel,not,matching,is,ok ) continue ;; \
esac; \
case " $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git gitk " in \
case " $(ALL_PROGRAMS) $(BUILT_INS) git gitk " in \
*" $$cmd "*) ;; \
*) echo "removed but $$how: $$cmd" ;; \
esac; \

View File

@ -1 +1 @@
Documentation/RelNotes-1.7.1.2.txt
Documentation/RelNotes/1.7.0.8.txt

View File

@ -54,9 +54,8 @@ const char *make_absolute_path(const char *path)
if (len + strlen(last_elem) + 2 > PATH_MAX)
die ("Too long path name: '%s/%s'",
buf, last_elem);
if (len && buf[len-1] != '/')
buf[len++] = '/';
strcpy(buf + len, last_elem);
buf[len] = '/';
strcpy(buf + len + 1, last_elem);
free(last_elem);
last_elem = NULL;
}

38
attr.c
View File

@ -594,25 +594,20 @@ static int path_matches(const char *pathname, int pathlen,
return fnmatch(pattern, pathname + baselen, FNM_PATHNAME) == 0;
}
static int macroexpand_one(int attr_nr, int rem);
static int fill_one(const char *what, struct match_attr *a, int rem)
{
struct git_attr_check *check = check_all_attr;
int i;
for (i = a->num_attr - 1; 0 < rem && 0 <= i; i--) {
for (i = 0; 0 < rem && i < a->num_attr; i++) {
struct git_attr *attr = a->state[i].attr;
const char **n = &(check[attr->attr_nr].value);
const char *v = a->state[i].setto;
if (*n == ATTR__UNKNOWN) {
debug_set(what,
a->is_macro ? a->u.attr->name : a->u.pattern,
attr, v);
debug_set(what, a->u.pattern, attr, v);
*n = v;
rem--;
rem = macroexpand_one(attr->attr_nr, rem);
}
}
return rem;
@ -634,27 +629,19 @@ static int fill(const char *path, int pathlen, struct attr_stack *stk, int rem)
return rem;
}
static int macroexpand_one(int attr_nr, int rem)
static int macroexpand(struct attr_stack *stk, int rem)
{
struct attr_stack *stk;
struct match_attr *a = NULL;
int i;
struct git_attr_check *check = check_all_attr;
if (check_all_attr[attr_nr].value != ATTR__TRUE)
return rem;
for (stk = attr_stack; !a && stk; stk = stk->prev)
for (i = stk->num_matches - 1; !a && 0 <= i; i--) {
struct match_attr *ma = stk->attrs[i];
if (!ma->is_macro)
continue;
if (ma->u.attr->attr_nr == attr_nr)
a = ma;
}
if (a)
for (i = stk->num_matches - 1; 0 < rem && 0 <= i; i--) {
struct match_attr *a = stk->attrs[i];
if (!a->is_macro)
continue;
if (check[a->u.attr->attr_nr].value != ATTR__TRUE)
continue;
rem = fill_one("expand", a, rem);
}
return rem;
}
@ -679,6 +666,9 @@ int git_checkattr(const char *path, int num, struct git_attr_check *check)
for (stk = attr_stack; 0 < rem && stk; stk = stk->prev)
rem = fill(path, pathlen, stk, rem);
for (stk = attr_stack; 0 < rem && stk; stk = stk->prev)
rem = macroexpand(stk, rem);
for (i = 0; i < num; i++) {
const char *value = check_all_attr[check[i].attr->attr_nr].value;
if (value == ATTR__UNKNOWN)

View File

@ -236,13 +236,13 @@ void blk_SHA1_Init(blk_SHA_CTX *ctx)
void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len)
{
unsigned int lenW = ctx->size & 63;
int lenW = ctx->size & 63;
ctx->size += len;
/* Read the data into W and process blocks as they get full */
if (lenW) {
unsigned int left = 64 - lenW;
int left = 64 - lenW;
if (len < left)
left = len;
memcpy(lenW + (char *)ctx->W, data, left);
@ -269,8 +269,8 @@ void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx)
int i;
/* Pad with a binary 1 (ie 0x80), then zeroes, then length */
padlen[0] = htonl((uint32_t)(ctx->size >> 29));
padlen[1] = htonl((uint32_t)(ctx->size << 3));
padlen[0] = htonl(ctx->size >> 29);
padlen[1] = htonl(ctx->size << 3);
i = ctx->size & 63;
blk_SHA1_Update(ctx, pad, 1+ (63 & (55 - i)));

View File

@ -328,7 +328,8 @@ static struct option builtin_add_options[] = {
static int add_config(const char *var, const char *value, void *cb)
{
if (!strcasecmp(var, "add.ignore-errors")) {
if (!strcasecmp(var, "add.ignoreerrors") ||
!strcasecmp(var, "add.ignore-errors")) {
ignore_add_errors = git_config_bool(var, value);
return 0;
}

View File

@ -1864,13 +1864,13 @@ static int match_fragment(struct image *img,
if (match_end && (preimage->nr + try_lno != img->nr))
return 0;
} else if (ws_error_action == correct_ws_error &&
(ws_rule & WS_BLANK_AT_EOF)) {
(ws_rule & WS_BLANK_AT_EOF) && match_end) {
/*
* This hunk extends beyond the end of img, and we are
* removing blank lines at the end of the file. This
* many lines from the beginning of the preimage must
* match with img, and the remainder of the preimage
* must be blank.
* This hunk that matches at the end extends beyond
* the end of img, and we are removing blank lines
* at the end of the file. This many lines from the
* beginning of the preimage must match with img, and
* the remainder of the preimage must be blank.
*/
preimage_limit = img->nr - try_lno;
} else {
@ -3141,7 +3141,11 @@ static void remove_file(struct patch *patch, int rmdir_empty)
die("unable to remove %s from index", patch->old_name);
}
if (!cached) {
if (!remove_or_warn(patch->old_mode, patch->old_name) && rmdir_empty) {
if (S_ISGITLINK(patch->old_mode)) {
if (rmdir(patch->old_name))
warning("unable to remove submodule %s",
patch->old_name);
} else if (!unlink_or_warn(patch->old_name) && rmdir_empty) {
remove_path(patch->old_name);
}
}

View File

@ -39,7 +39,7 @@ static int show_root;
static int reverse;
static int blank_boundary;
static int incremental;
static int xdl_opts;
static int xdl_opts = XDF_NEED_MINIMAL;
static enum date_mode blame_date_mode = DATE_ISO8601;
static size_t blame_date_width;
@ -1589,7 +1589,7 @@ static void emit_porcelain(struct scoreboard *sb, struct blame_entry *ent)
strcpy(hex, sha1_to_hex(suspect->commit->object.sha1));
printf("%s%c%d %d %d\n",
hex,
ent->guilty ? ' ' : '*', /* purely for debugging */
ent->guilty ? ' ' : '*', // purely for debugging
ent->s_lno + 1,
ent->lno + 1,
ent->num_lines);

View File

@ -610,7 +610,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
BRANCH_TRACK_EXPLICIT),
OPT_SET_INT( 0, "set-upstream", &track, "change upstream info",
BRANCH_TRACK_OVERRIDE),
OPT__COLOR(&branch_use_color, "use colored output"),
OPT_BOOLEAN( 0 , "color", &branch_use_color, "use colored output"),
OPT_SET_INT('r', NULL, &kinds, "act on remote-tracking branches",
REF_REMOTE_BRANCH),
{

View File

@ -128,6 +128,24 @@ static int checkout_stage(int stage, struct cache_entry *ce, int pos,
(stage == 2) ? "our" : "their");
}
/* NEEDSWORK: share with merge-recursive */
static void fill_mm(const unsigned char *sha1, mmfile_t *mm)
{
unsigned long size;
enum object_type type;
if (!hashcmp(sha1, null_sha1)) {
mm->ptr = xstrdup("");
mm->size = 0;
return;
}
mm->ptr = read_sha1_file(sha1, &type, &size);
if (!mm->ptr || type != OBJ_BLOB)
die("unable to read blob object %s", sha1_to_hex(sha1));
mm->size = size;
}
static int checkout_merged(int pos, struct checkout *state)
{
struct cache_entry *ce = active_cache[pos];
@ -145,11 +163,11 @@ static int checkout_merged(int pos, struct checkout *state)
ce_stage(active_cache[pos+2]) != 3)
return error("path '%s' does not have all 3 versions", path);
read_mmblob(&ancestor, active_cache[pos]->sha1);
read_mmblob(&ours, active_cache[pos+1]->sha1);
read_mmblob(&theirs, active_cache[pos+2]->sha1);
fill_mm(active_cache[pos]->sha1, &ancestor);
fill_mm(active_cache[pos+1]->sha1, &ours);
fill_mm(active_cache[pos+2]->sha1, &theirs);
status = ll_merge(&result_buf, path, &ancestor, "base",
status = ll_merge(&result_buf, path, &ancestor,
&ours, "ours", &theirs, "theirs", 0);
free(ancestor.ptr);
free(ours.ptr);
@ -439,7 +457,6 @@ static int merge_working_tree(struct checkout_opts *opts,
ret = reset_tree(new->commit->tree, opts, 1);
if (ret)
return ret;
o.ancestor = old->name;
o.branch1 = new->name;
o.branch2 = "local";
merge_trees(&o, new->commit->tree, work,

View File

@ -37,17 +37,18 @@ static const char * const builtin_clone_usage[] = {
NULL
};
static int option_no_checkout, option_bare, option_mirror;
static int option_quiet, option_no_checkout, option_bare, option_mirror;
static int option_local, option_no_hardlinks, option_shared, option_recursive;
static char *option_template, *option_reference, *option_depth;
static char *option_origin = NULL;
static char *option_branch = NULL;
static char *option_upload_pack = "git-upload-pack";
static int option_verbosity;
static int option_verbose;
static int option_progress;
static struct option builtin_clone_options[] = {
OPT__VERBOSITY(&option_verbosity),
OPT__QUIET(&option_quiet),
OPT__VERBOSE(&option_verbose),
OPT_BOOLEAN(0, "progress", &option_progress,
"force progress reporting"),
OPT_BOOLEAN('n', "no-checkout", &option_no_checkout,
@ -302,8 +303,6 @@ static const struct ref *clone_local(const char *src_repo,
transport = transport_get(remote, src_repo);
ret = transport_get_remote_refs(transport);
transport_disconnect(transport);
if (0 <= option_verbosity)
printf("done.\n");
return ret;
}
@ -463,10 +462,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
die("could not create leading directories of '%s'", git_dir);
set_git_dir(make_absolute_path(git_dir));
if (0 <= option_verbosity)
printf("Cloning into %s%s...\n",
option_bare ? "bare repository " : "", dir);
init_db(option_template, INIT_DB_QUIET);
init_db(option_template, option_quiet ? INIT_DB_QUIET : 0);
/*
* At this point, the config exists, so we do not need the
@ -530,7 +526,13 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
transport_set_option(transport, TRANS_OPT_DEPTH,
option_depth);
transport_set_verbosity(transport, option_verbosity, option_progress);
if (option_quiet)
transport->verbose = -1;
else if (option_verbose)
transport->verbose = 1;
if (option_progress)
transport->progress = 1;
if (option_upload_pack)
transport_set_option(transport, TRANS_OPT_UPLOADPACK,
@ -639,7 +641,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
opts.update = 1;
opts.merge = 1;
opts.fn = oneway_merge;
opts.verbose_update = (option_verbosity > 0);
opts.verbose_update = !option_quiet;
opts.src_index = &the_index;
opts.dst_index = &the_index;

View File

@ -48,11 +48,6 @@ static const char implicit_ident_advice[] =
"\n"
" git commit --amend --author='Your Name <you@example.com>'\n";
static const char empty_amend_advice[] =
"You asked to amend the most recent commit, but doing so would make\n"
"it empty. You can repeat your command with --allow-empty, or you can\n"
"remove the commit entirely with \"git reset HEAD^\".\n";
static unsigned char head_sha1[20];
static char *use_message_buffer;
@ -71,7 +66,6 @@ static char *edit_message, *use_message;
static char *author_name, *author_email, *author_date;
static int all, edit_flag, also, interactive, only, amend, signoff;
static int quiet, verbose, no_verify, allow_empty, dry_run, renew_authorship;
static int no_post_rewrite;
static char *untracked_files_arg, *force_date;
/*
* The default commit message cleanup mode will remove the lines
@ -143,7 +137,6 @@ static struct option builtin_commit_options[] = {
OPT_BOOLEAN('z', "null", &null_termination,
"terminate entries with NUL"),
OPT_BOOLEAN(0, "amend", &amend, "amend previous commit"),
OPT_BOOLEAN(0, "no-post-rewrite", &no_post_rewrite, "bypass post-rewrite hook"),
{ OPTION_STRING, 'u', "untracked-files", &untracked_files_arg, "mode", "show untracked files, optional modes: all, normal, no. (Default: all)", PARSE_OPT_OPTARG, NULL, (intptr_t)"all" },
OPT_BOOLEAN(0, "allow-empty", &allow_empty, "ok to record an empty change"),
/* end commit contents options */
@ -312,7 +305,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
* (B) on failure, rollback the real index.
*/
if (all || (also && pathspec && *pathspec)) {
fd = hold_locked_index(&index_lock, 1);
int fd = hold_locked_index(&index_lock, 1);
add_files_to_cache(also ? prefix : NULL, pathspec, 0);
refresh_cache_or_die(refresh_flags);
if (write_cache(fd, active_cache, active_nr) ||
@ -327,8 +320,8 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
*
* (1) return the name of the real index file.
*
* The caller should run hooks on the real index,
* and create commit from the_index.
* The caller should run hooks on the real index, and run
* hooks on the real index, and create commit from the_index.
* We still need to refresh the index here.
*/
if (!pathspec || !*pathspec) {
@ -460,21 +453,15 @@ static void determine_author_info(void)
if (!a)
die("invalid commit: %s", use_message);
lb = strchrnul(a + strlen("\nauthor "), '<');
rb = strchrnul(lb, '>');
eol = strchrnul(rb, '\n');
if (!*lb || !*rb || !*eol)
lb = strstr(a + 8, " <");
rb = strstr(a + 8, "> ");
eol = strchr(a + 8, '\n');
if (!lb || !rb || !eol)
die("invalid commit: %s", use_message);
if (lb == a + strlen("\nauthor "))
/* \nauthor <foo@example.com> */
name = xcalloc(1, 1);
else
name = xmemdupz(a + strlen("\nauthor "),
(lb - strlen(" ") -
(a + strlen("\nauthor "))));
email = xmemdupz(lb + strlen("<"), rb - (lb + strlen("<")));
date = xmemdupz(rb + strlen("> "), eol - (rb + strlen("> ")));
name = xstrndup(a + 8, lb - (a + 8));
email = xstrndup(lb + 2, rb - (lb + 2));
date = xstrndup(rb + 2, eol - (rb + 2));
}
if (force_author) {
@ -704,8 +691,6 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
if (!commitable && !in_merge && !allow_empty &&
!(amend && is_a_merge(head_sha1))) {
run_status(stdout, index_file, prefix, 0, s);
if (amend)
fputs(empty_amend_advice, stderr);
return 0;
}
@ -1030,7 +1015,6 @@ static int git_status_config(const char *k, const char *v, void *cb)
int cmd_status(int argc, const char **argv, const char *prefix)
{
struct wt_status s;
int fd;
unsigned char sha1[20];
static struct option builtin_status_options[] = {
OPT__VERBOSE(&verbose),
@ -1064,14 +1048,6 @@ int cmd_status(int argc, const char **argv, const char *prefix)
read_cache_preload(s.pathspec);
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, s.pathspec, NULL, NULL);
fd = hold_locked_index(&index_lock, 0);
if (0 <= fd) {
if (!write_cache(fd, active_cache, active_nr))
commit_locked_index(&index_lock);
rollback_lock_file(&index_lock);
}
s.is_initial = get_sha1(s.reference, sha1) ? 1 : 0;
s.in_merge = in_merge;
wt_status_collect(&s);
@ -1160,11 +1136,13 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
initial_commit ? " (root-commit)" : "");
if (!log_tree_commit(&rev, commit)) {
rev.always_show_header = 1;
rev.use_terminator = 1;
log_tree_commit(&rev, commit);
struct pretty_print_context ctx = {0};
struct strbuf buf = STRBUF_INIT;
ctx.date_mode = DATE_NORMAL;
format_commit_message(commit, format.buf + 7, &buf, &ctx);
printf("%s\n", buf.buf);
strbuf_release(&buf);
}
strbuf_release(&format);
}
@ -1182,40 +1160,6 @@ static int git_commit_config(const char *k, const char *v, void *cb)
return git_status_config(k, v, s);
}
static const char post_rewrite_hook[] = "hooks/post-rewrite";
static int run_rewrite_hook(const unsigned char *oldsha1,
const unsigned char *newsha1)
{
/* oldsha1 SP newsha1 LF NUL */
static char buf[2*40 + 3];
struct child_process proc;
const char *argv[3];
int code;
size_t n;
if (access(git_path(post_rewrite_hook), X_OK) < 0)
return 0;
argv[0] = git_path(post_rewrite_hook);
argv[1] = "amend";
argv[2] = NULL;
memset(&proc, 0, sizeof(proc));
proc.argv = argv;
proc.in = -1;
proc.stdout_to_stderr = 1;
code = start_command(&proc);
if (code)
return code;
n = snprintf(buf, sizeof(buf), "%s %s\n",
sha1_to_hex(oldsha1), sha1_to_hex(newsha1));
write_in_full(proc.in, buf, n);
close(proc.in);
return finish_command(&proc);
}
int cmd_commit(int argc, const char **argv, const char *prefix)
{
struct strbuf sb = STRBUF_INIT;
@ -1252,16 +1196,13 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
}
/* Determine parents */
reflog_msg = getenv("GIT_REFLOG_ACTION");
if (initial_commit) {
if (!reflog_msg)
reflog_msg = "commit (initial)";
reflog_msg = "commit (initial)";
} else if (amend) {
struct commit_list *c;
struct commit *commit;
if (!reflog_msg)
reflog_msg = "commit (amend)";
reflog_msg = "commit (amend)";
commit = lookup_commit(head_sha1);
if (!commit || parse_commit(commit))
die("could not parse HEAD commit");
@ -1272,8 +1213,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
struct strbuf m = STRBUF_INIT;
FILE *fp;
if (!reflog_msg)
reflog_msg = "commit (merge)";
reflog_msg = "commit (merge)";
pptr = &commit_list_insert(lookup_commit(head_sha1), pptr)->next;
fp = fopen(git_path("MERGE_HEAD"), "r");
if (fp == NULL)
@ -1296,8 +1236,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
if (allow_fast_forward)
parents = reduce_heads(parents);
} else {
if (!reflog_msg)
reflog_msg = "commit";
reflog_msg = "commit";
pptr = &commit_list_insert(lookup_commit(head_sha1), pptr)->next;
}
@ -1364,15 +1303,6 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
rerere(0);
run_hook(get_index_file(), "post-commit", NULL);
if (amend && !no_post_rewrite) {
struct notes_rewrite_cfg *cfg;
cfg = init_copy_notes_for_rewrite("amend");
if (cfg) {
copy_note_for_rewrite(cfg, head_sha1, commit_sha1);
finish_copy_notes_for_rewrite(cfg);
}
run_rewrite_hook(head_sha1, commit_sha1);
}
if (!quiet)
print_summary(prefix, commit_sha1);

View File

@ -35,8 +35,7 @@ static const char *diff_index_args[] = {
struct commit_name {
struct tag *tag;
unsigned prio:2; /* annotated tag = 2, tag = 1, head = 0 */
unsigned name_checked:1;
int prio; /* annotated tag = 2, tag = 1, head = 0 */
unsigned char sha1[20];
char path[FLEX_ARRAY]; /* more */
};
@ -44,53 +43,18 @@ static const char *prio_names[] = {
"head", "lightweight", "annotated",
};
static int replace_name(struct commit_name *e,
int prio,
const unsigned char *sha1,
struct tag **tag)
{
if (!e || e->prio < prio)
return 1;
if (e->prio == 2 && prio == 2) {
/* Multiple annotated tags point to the same commit.
* Select one to keep based upon their tagger date.
*/
struct tag *t;
if (!e->tag) {
t = lookup_tag(e->sha1);
if (!t || parse_tag(t))
return 1;
e->tag = t;
}
t = lookup_tag(sha1);
if (!t || parse_tag(t))
return 0;
*tag = t;
if (e->tag->date < t->date)
return 1;
}
return 0;
}
static void add_to_known_names(const char *path,
struct commit *commit,
int prio,
const unsigned char *sha1)
{
struct commit_name *e = commit->util;
struct tag *tag = NULL;
if (replace_name(e, prio, sha1, &tag)) {
if (!e || e->prio < prio) {
size_t len = strlen(path)+1;
free(e);
e = xmalloc(sizeof(struct commit_name) + len);
e->tag = tag;
e->tag = NULL;
e->prio = prio;
e->name_checked = 0;
hashcpy(e->sha1, sha1);
memcpy(e->path, path, len);
commit->util = e;
@ -201,15 +165,10 @@ static void display_name(struct commit_name *n)
{
if (n->prio == 2 && !n->tag) {
n->tag = lookup_tag(n->sha1);
if (!n->tag || parse_tag(n->tag))
if (!n->tag || parse_tag(n->tag) || !n->tag->tag)
die("annotated tag %s not available", n->path);
}
if (n->tag && !n->name_checked) {
if (!n->tag->tag)
die("annotated tag %s has no embedded name", n->path);
if (strcmp(n->tag->tag, all ? n->path + 5 : n->path))
warning("tag '%s' is really '%s' here", n->tag->tag, n->path);
n->name_checked = 1;
}
if (n->tag)

View File

@ -92,23 +92,12 @@ static const char diff_tree_usage[] =
" --root include the initial commit as diff against /dev/null\n"
COMMON_DIFF_OPTIONS_HELP;
static void diff_tree_tweak_rev(struct rev_info *rev, struct setup_revision_opt *opt)
{
if (!rev->diffopt.output_format) {
if (rev->dense_combined_merges)
rev->diffopt.output_format = DIFF_FORMAT_PATCH;
else
rev->diffopt.output_format = DIFF_FORMAT_RAW;
}
}
int cmd_diff_tree(int argc, const char **argv, const char *prefix)
{
int nr_sha1;
char line[1000];
struct object *tree1, *tree2;
static struct rev_info *opt = &log_tree_opt;
struct setup_revision_opt s_r_opt;
int read_stdin = 0;
init_revisions(opt, prefix);
@ -116,9 +105,7 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
opt->abbrev = 0;
opt->diff = 1;
opt->disable_stdin = 1;
memset(&s_r_opt, 0, sizeof(s_r_opt));
s_r_opt.tweak = diff_tree_tweak_rev;
argc = setup_revisions(argc, argv, opt, &s_r_opt);
argc = setup_revisions(argc, argv, opt, NULL);
while (--argc > 0) {
const char *arg = *++argv;
@ -130,6 +117,9 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
usage(diff_tree_usage);
}
if (!opt->diffopt.output_format)
opt->diffopt.output_format = DIFF_FORMAT_RAW;
/*
* NOTE! We expect "a ^b" to be equal to "a..b", so we
* reverse the order of the objects if the second one

View File

@ -11,7 +11,6 @@
#include "run-command.h"
#include "parse-options.h"
#include "sigchain.h"
#include "transport.h"
static const char * const builtin_fetch_usage[] = {
"git fetch [<options>] [<repository> [<refspec>...]]",
@ -28,7 +27,6 @@ enum {
};
static int all, append, dry_run, force, keep, multiple, prune, update_head_ok, verbosity;
static int progress;
static int tags = TAGS_DEFAULT;
static const char *depth;
static const char *upload_pack;
@ -58,7 +56,6 @@ static struct option builtin_fetch_options[] = {
OPT_BOOLEAN('k', "keep", &keep, "keep downloaded pack"),
OPT_BOOLEAN('u', "update-head-ok", &update_head_ok,
"allow updating of HEAD ref"),
OPT_BOOLEAN(0, "progress", &progress, "force progress reporting"),
OPT_STRING(0, "depth", &depth, "DEPTH",
"deepen history of shallow clone"),
OPT_END()
@ -206,6 +203,7 @@ static int s_update_ref(const char *action,
return 0;
}
#define SUMMARY_WIDTH (2 * DEFAULT_ABBREV + 3)
#define REFCOL_WIDTH 10
static int update_local_ref(struct ref *ref,
@ -224,7 +222,7 @@ static int update_local_ref(struct ref *ref,
if (!hashcmp(ref->old_sha1, ref->new_sha1)) {
if (verbosity > 0)
sprintf(display, "= %-*s %-*s -> %s", TRANSPORT_SUMMARY_WIDTH,
sprintf(display, "= %-*s %-*s -> %s", SUMMARY_WIDTH,
"[up to date]", REFCOL_WIDTH, remote,
pretty_ref);
return 0;
@ -239,7 +237,7 @@ static int update_local_ref(struct ref *ref,
* the head, and the old value of the head isn't empty...
*/
sprintf(display, "! %-*s %-*s -> %s (can't fetch in current branch)",
TRANSPORT_SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
pretty_ref);
return 1;
}
@ -249,7 +247,7 @@ static int update_local_ref(struct ref *ref,
int r;
r = s_update_ref("updating tag", ref, 0);
sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : '-',
TRANSPORT_SUMMARY_WIDTH, "[tag update]", REFCOL_WIDTH, remote,
SUMMARY_WIDTH, "[tag update]", REFCOL_WIDTH, remote,
pretty_ref, r ? " (unable to update local ref)" : "");
return r;
}
@ -271,7 +269,7 @@ static int update_local_ref(struct ref *ref,
r = s_update_ref(msg, ref, 0);
sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : '*',
TRANSPORT_SUMMARY_WIDTH, what, REFCOL_WIDTH, remote, pretty_ref,
SUMMARY_WIDTH, what, REFCOL_WIDTH, remote, pretty_ref,
r ? " (unable to update local ref)" : "");
return r;
}
@ -284,7 +282,7 @@ static int update_local_ref(struct ref *ref,
strcat(quickref, find_unique_abbrev(ref->new_sha1, DEFAULT_ABBREV));
r = s_update_ref("fast-forward", ref, 1);
sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : ' ',
TRANSPORT_SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,
SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,
pretty_ref, r ? " (unable to update local ref)" : "");
return r;
} else if (force || ref->force) {
@ -295,13 +293,13 @@ static int update_local_ref(struct ref *ref,
strcat(quickref, find_unique_abbrev(ref->new_sha1, DEFAULT_ABBREV));
r = s_update_ref("forced-update", ref, 1);
sprintf(display, "%c %-*s %-*s -> %s (%s)", r ? '!' : '+',
TRANSPORT_SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,
SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,
pretty_ref,
r ? "unable to update local ref" : "forced update");
return r;
} else {
sprintf(display, "! %-*s %-*s -> %s (non-fast-forward)",
TRANSPORT_SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
pretty_ref);
return 1;
}
@ -394,7 +392,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
free(ref);
} else
sprintf(note, "* %-*s %-*s -> FETCH_HEAD",
TRANSPORT_SUMMARY_WIDTH, *kind ? kind : "branch",
SUMMARY_WIDTH, *kind ? kind : "branch",
REFCOL_WIDTH, *what ? what : "HEAD");
if (*note) {
if (verbosity >= 0 && !shown_url) {
@ -515,7 +513,7 @@ static int prune_refs(struct transport *transport, struct ref *ref_map)
result |= delete_ref(ref->name, NULL, 0);
if (verbosity >= 0) {
fprintf(stderr, " x %-*s %-*s -> %s\n",
TRANSPORT_SUMMARY_WIDTH, "[deleted]",
SUMMARY_WIDTH, "[deleted]",
REFCOL_WIDTH, "(none)", prettify_refname(ref->name));
warn_dangling_symref(stderr, dangling_msg, ref->name);
}
@ -846,7 +844,10 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
die("Where do you want to fetch from today?");
transport = transport_get(remote, NULL);
transport_set_verbosity(transport, verbosity, progress);
if (verbosity >= 2)
transport->verbose = verbosity <= 3 ? verbosity : 3;
if (verbosity < 0)
transport->verbose = -1;
if (upload_pack)
set_option(TRANS_OPT_UPLOADPACK, upload_pack);
if (keep)

View File

@ -4,7 +4,6 @@
#include "diff.h"
#include "revision.h"
#include "tag.h"
#include "string-list.h"
static const char * const fmt_merge_msg_usage[] = {
"git fmt-merge-msg [--log|--no-log] [--file <file>]",
@ -25,21 +24,58 @@ static int fmt_merge_msg_config(const char *key, const char *value, void *cb)
return 0;
}
struct list {
char **list;
void **payload;
unsigned nr, alloc;
};
static void append_to_list(struct list *list, char *value, void *payload)
{
if (list->nr == list->alloc) {
list->alloc += 32;
list->list = xrealloc(list->list, sizeof(char *) * list->alloc);
list->payload = xrealloc(list->payload,
sizeof(char *) * list->alloc);
}
list->payload[list->nr] = payload;
list->list[list->nr++] = value;
}
static int find_in_list(struct list *list, char *value)
{
int i;
for (i = 0; i < list->nr; i++)
if (!strcmp(list->list[i], value))
return i;
return -1;
}
static void free_list(struct list *list)
{
int i;
if (list->alloc == 0)
return;
for (i = 0; i < list->nr; i++) {
free(list->list[i]);
free(list->payload[i]);
}
free(list->list);
free(list->payload);
list->nr = list->alloc = 0;
}
struct src_data {
struct string_list branch, tag, r_branch, generic;
struct list branch, tag, r_branch, generic;
int head_status;
};
void init_src_data(struct src_data *data)
{
data->branch.strdup_strings = 1;
data->tag.strdup_strings = 1;
data->r_branch.strdup_strings = 1;
data->generic.strdup_strings = 1;
}
static struct string_list srcs = { NULL, 0, 0, 1 };
static struct string_list origins = { NULL, 0, 0, 1 };
static struct list srcs = { NULL, NULL, 0, 0};
static struct list origins = { NULL, NULL, 0, 0};
static int handle_line(char *line)
{
@ -47,7 +83,6 @@ static int handle_line(char *line)
unsigned char *sha1;
char *src, *origin;
struct src_data *src_data;
struct string_list_item *item;
int pulling_head = 0;
if (len < 43 || line[40] != '\t')
@ -80,62 +115,64 @@ static int handle_line(char *line)
pulling_head = 1;
}
item = unsorted_string_list_lookup(&srcs, src);
if (!item) {
item = string_list_append(src, &srcs);
item->util = xcalloc(1, sizeof(struct src_data));
init_src_data(item->util);
i = find_in_list(&srcs, src);
if (i < 0) {
i = srcs.nr;
append_to_list(&srcs, xstrdup(src),
xcalloc(1, sizeof(struct src_data)));
}
src_data = item->util;
src_data = srcs.payload[i];
if (pulling_head) {
origin = src;
origin = xstrdup(src);
src_data->head_status |= 1;
} else if (!prefixcmp(line, "branch ")) {
origin = line + 7;
string_list_append(origin, &src_data->branch);
origin = xstrdup(line + 7);
append_to_list(&src_data->branch, origin, NULL);
src_data->head_status |= 2;
} else if (!prefixcmp(line, "tag ")) {
origin = line;
string_list_append(origin + 4, &src_data->tag);
append_to_list(&src_data->tag, xstrdup(origin + 4), NULL);
src_data->head_status |= 2;
} else if (!prefixcmp(line, "remote branch ")) {
origin = line + 14;
string_list_append(origin, &src_data->r_branch);
origin = xstrdup(line + 14);
append_to_list(&src_data->r_branch, origin, NULL);
src_data->head_status |= 2;
} else {
origin = src;
string_list_append(line, &src_data->generic);
origin = xstrdup(src);
append_to_list(&src_data->generic, xstrdup(line), NULL);
src_data->head_status |= 2;
}
if (!strcmp(".", src) || !strcmp(src, origin)) {
int len = strlen(origin);
if (origin[0] == '\'' && origin[len - 1] == '\'')
if (origin[0] == '\'' && origin[len - 1] == '\'') {
origin = xmemdupz(origin + 1, len - 2);
} else {
origin = xstrdup(origin);
}
} else {
char *new_origin = xmalloc(strlen(origin) + strlen(src) + 5);
sprintf(new_origin, "%s of %s", origin, src);
origin = new_origin;
}
string_list_append(origin, &origins)->util = sha1;
append_to_list(&origins, origin, sha1);
return 0;
}
static void print_joined(const char *singular, const char *plural,
struct string_list *list, struct strbuf *out)
struct list *list, struct strbuf *out)
{
if (list->nr == 0)
return;
if (list->nr == 1) {
strbuf_addf(out, "%s%s", singular, list->items[0].string);
strbuf_addf(out, "%s%s", singular, list->list[0]);
} else {
int i;
strbuf_addstr(out, plural);
for (i = 0; i < list->nr - 1; i++)
strbuf_addf(out, "%s%s", i > 0 ? ", " : "",
list->items[i].string);
strbuf_addf(out, " and %s", list->items[list->nr - 1].string);
strbuf_addf(out, "%s%s", i > 0 ? ", " : "", list->list[i]);
strbuf_addf(out, " and %s", list->list[list->nr - 1]);
}
}
@ -146,9 +183,8 @@ static void shortlog(const char *name, unsigned char *sha1,
int i, count = 0;
struct commit *commit;
struct object *branch;
struct string_list subjects = { NULL, 0, 0, 1 };
struct list subjects = { NULL, NULL, 0, 0 };
int flags = UNINTERESTING | TREESAME | SEEN | SHOWN | ADDED;
struct strbuf sb = STRBUF_INIT;
branch = deref_tag(parse_object(sha1), sha1_to_hex(sha1), 40);
if (!branch || branch->type != OBJ_COMMIT)
@ -162,7 +198,7 @@ static void shortlog(const char *name, unsigned char *sha1,
if (prepare_revision_walk(rev))
die("revision walk setup failed");
while ((commit = get_revision(rev)) != NULL) {
struct pretty_print_context ctx = {0};
char *oneline, *bol, *eol;
/* ignore merges */
if (commit->parents && commit->parents->next)
@ -172,14 +208,30 @@ static void shortlog(const char *name, unsigned char *sha1,
if (subjects.nr > limit)
continue;
format_commit_message(commit, "%s", &sb, &ctx);
strbuf_ltrim(&sb);
bol = strstr(commit->buffer, "\n\n");
if (bol) {
unsigned char c;
do {
c = *++bol;
} while (isspace(c));
if (!c)
bol = NULL;
}
if (!sb.len)
string_list_append(sha1_to_hex(commit->object.sha1),
&subjects);
else
string_list_append(strbuf_detach(&sb, NULL), &subjects);
if (!bol) {
append_to_list(&subjects, xstrdup(sha1_to_hex(
commit->object.sha1)),
NULL);
continue;
}
eol = strchr(bol, '\n');
if (eol) {
oneline = xmemdupz(bol, eol - bol);
} else {
oneline = xstrdup(bol);
}
append_to_list(&subjects, oneline, NULL);
}
if (count > limit)
@ -191,7 +243,7 @@ static void shortlog(const char *name, unsigned char *sha1,
if (i >= limit)
strbuf_addf(out, " ...\n");
else
strbuf_addf(out, " %s\n", subjects.items[i].string);
strbuf_addf(out, " %s\n", subjects.list[i]);
clear_commit_marks((struct commit *)branch, flags);
clear_commit_marks(head, flags);
@ -199,24 +251,46 @@ static void shortlog(const char *name, unsigned char *sha1,
rev->commits = NULL;
rev->pending.nr = 0;
string_list_clear(&subjects, 0);
free_list(&subjects);
}
static void do_fmt_merge_msg_title(struct strbuf *out,
const char *current_branch) {
int i = 0;
int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) {
int limit = 20, i = 0, pos = 0;
char *sep = "";
unsigned char head_sha1[20];
const char *current_branch;
/* get current branch */
current_branch = resolve_ref("HEAD", head_sha1, 1, NULL);
if (!current_branch)
die("No current branch");
if (!prefixcmp(current_branch, "refs/heads/"))
current_branch += 11;
/* get a line */
while (pos < in->len) {
int len;
char *newline, *p = in->buf + pos;
newline = strchr(p, '\n');
len = newline ? newline - p : strlen(p);
pos += len + !!newline;
i++;
p[len] = 0;
if (handle_line(p))
die ("Error in line %d: %.*s", i, len, p);
}
strbuf_addstr(out, "Merge ");
for (i = 0; i < srcs.nr; i++) {
struct src_data *src_data = srcs.items[i].util;
struct src_data *src_data = srcs.payload[i];
const char *subsep = "";
strbuf_addstr(out, sep);
sep = "; ";
if (src_data->head_status == 1) {
strbuf_addstr(out, srcs.items[i].string);
strbuf_addstr(out, srcs.list[i]);
continue;
}
if (src_data->head_status == 3) {
@ -245,48 +319,14 @@ static void do_fmt_merge_msg_title(struct strbuf *out,
print_joined("commit ", "commits ", &src_data->generic,
out);
}
if (strcmp(".", srcs.items[i].string))
strbuf_addf(out, " of %s", srcs.items[i].string);
if (strcmp(".", srcs.list[i]))
strbuf_addf(out, " of %s", srcs.list[i]);
}
if (!strcmp("master", current_branch))
strbuf_addch(out, '\n');
else
strbuf_addf(out, " into %s\n", current_branch);
}
static int do_fmt_merge_msg(int merge_title, int merge_summary,
struct strbuf *in, struct strbuf *out) {
int limit = 20, i = 0, pos = 0;
unsigned char head_sha1[20];
const char *current_branch;
/* get current branch */
current_branch = resolve_ref("HEAD", head_sha1, 1, NULL);
if (!current_branch)
die("No current branch");
if (!prefixcmp(current_branch, "refs/heads/"))
current_branch += 11;
/* get a line */
while (pos < in->len) {
int len;
char *newline, *p = in->buf + pos;
newline = strchr(p, '\n');
len = newline ? newline - p : strlen(p);
pos += len + !!newline;
i++;
p[len] = 0;
if (handle_line(p))
die ("Error in line %d: %.*s", i, len, p);
}
if (!srcs.nr)
return 0;
if (merge_title)
do_fmt_merge_msg_title(out, current_branch);
if (merge_summary) {
struct commit *head;
@ -298,32 +338,19 @@ static int do_fmt_merge_msg(int merge_title, int merge_summary,
rev.ignore_merges = 1;
rev.limited = 1;
if (suffixcmp(out->buf, "\n"))
strbuf_addch(out, '\n');
for (i = 0; i < origins.nr; i++)
shortlog(origins.items[i].string, origins.items[i].util,
shortlog(origins.list[i], origins.payload[i],
head, &rev, limit, out);
}
return 0;
}
int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) {
return do_fmt_merge_msg(1, merge_summary, in, out);
}
int fmt_merge_msg_shortlog(struct strbuf *in, struct strbuf *out) {
return do_fmt_merge_msg(0, 1, in, out);
}
int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
{
const char *inpath = NULL;
struct option options[] = {
OPT_BOOLEAN(0, "log", &merge_summary, "populate log with the shortlog"),
{ OPTION_BOOLEAN, 0, "summary", &merge_summary, NULL,
"alias for --log (deprecated)",
PARSE_OPT_NOARG | PARSE_OPT_HIDDEN },
OPT_BOOLEAN(0, "summary", &merge_summary, "alias for --log"),
OPT_FILENAME('F', "file", &inpath, "file to read from"),
OPT_END()
};

View File

@ -33,8 +33,6 @@ struct ref_sort {
struct refinfo {
char *refname;
unsigned char objectname[20];
int flag;
const char *symref;
struct atom_value *value;
};
@ -70,8 +68,6 @@ static struct {
{ "body" },
{ "contents" },
{ "upstream" },
{ "symref" },
{ "flag" },
};
/*
@ -86,7 +82,7 @@ static struct {
*/
static const char **used_atom;
static cmp_type *used_atom_type;
static int used_atom_cnt, sort_atom_limit, need_tagged, need_symref;
static int used_atom_cnt, sort_atom_limit, need_tagged;
/*
* Used to parse format string and sort specifiers
@ -137,10 +133,6 @@ static int parse_atom(const char *atom, const char *ep)
(sizeof(*used_atom_type) * used_atom_cnt));
used_atom[at] = xmemdupz(atom, ep - atom);
used_atom_type[at] = valid_atom[i].cmp_type;
if (*atom == '*')
need_tagged = 1;
if (!strcmp(used_atom[at], "symref"))
need_symref = 1;
return at;
}
@ -151,8 +143,7 @@ static const char *find_next(const char *cp)
{
while (*cp) {
if (*cp == '%') {
/*
* %( is the start of an atom;
/* %( is the start of an atom;
* %% is a quoted per-cent.
*/
if (cp[1] == '(')
@ -429,8 +420,7 @@ static void grab_person(const char *who, struct atom_value *val, int deref, stru
grab_date(wholine, v, name);
}
/*
* For a tag or a commit object, if "creator" or "creatordate" is
/* For a tag or a commit object, if "creator" or "creatordate" is
* requested, do something special.
*/
if (strcmp(who, "tagger") && strcmp(who, "committer"))
@ -512,8 +502,7 @@ static void grab_sub_body_contents(struct atom_value *val, int deref, struct obj
}
}
/*
* We want to have empty print-string for field requests
/* We want to have empty print-string for field requests
* that do not apply (e.g. "authordate" for a tag object)
*/
static void fill_missing_values(struct atom_value *val)
@ -549,23 +538,16 @@ static void grab_values(struct atom_value *val, int deref, struct object *obj, v
grab_person("committer", val, deref, obj, buf, sz);
break;
case OBJ_TREE:
/* grab_tree_values(val, deref, obj, buf, sz); */
// grab_tree_values(val, deref, obj, buf, sz);
break;
case OBJ_BLOB:
/* grab_blob_values(val, deref, obj, buf, sz); */
// grab_blob_values(val, deref, obj, buf, sz);
break;
default:
die("Eh? Object of type %d?", obj->type);
}
}
static inline char *copy_advance(char *dst, const char *src)
{
while (*src)
*dst++ = *src++;
return dst;
}
/*
* Parse the object referred by ref, and grab needed value.
*/
@ -579,16 +561,6 @@ static void populate_value(struct refinfo *ref)
ref->value = xcalloc(sizeof(struct atom_value), used_atom_cnt);
if (need_symref && (ref->flag & REF_ISSYMREF) && !ref->symref) {
unsigned char unused1[20];
const char *symref;
symref = resolve_ref(ref->refname, unused1, 1, NULL);
if (symref)
ref->symref = xstrdup(symref);
else
ref->symref = "";
}
/* Fill in specials first */
for (i = 0; i < used_atom_cnt; i++) {
const char *name = used_atom[i];
@ -604,8 +576,6 @@ static void populate_value(struct refinfo *ref)
if (!prefixcmp(name, "refname"))
refname = ref->refname;
else if (!prefixcmp(name, "symref"))
refname = ref->symref ? ref->symref : "";
else if (!prefixcmp(name, "upstream")) {
struct branch *branch;
/* only local branches may have an upstream */
@ -618,20 +588,6 @@ static void populate_value(struct refinfo *ref)
continue;
refname = branch->merge[0]->dst;
}
else if (!strcmp(name, "flag")) {
char buf[256], *cp = buf;
if (ref->flag & REF_ISSYMREF)
cp = copy_advance(cp, ",symref");
if (ref->flag & REF_ISPACKED)
cp = copy_advance(cp, ",packed");
if (cp == buf)
v->s = "";
else {
*cp = '\0';
v->s = xstrdup(buf + 1);
}
continue;
}
else
continue;
@ -677,21 +633,18 @@ static void populate_value(struct refinfo *ref)
if (!eaten)
free(buf);
/*
* If there is no atom that wants to know about tagged
/* If there is no atom that wants to know about tagged
* object, we are done.
*/
if (!need_tagged || (obj->type != OBJ_TAG))
return;
/*
* If it is a tag object, see if we use a value that derefs
/* If it is a tag object, see if we use a value that derefs
* the object, and if we do grab the object it refers to.
*/
tagged = ((struct tag *)obj)->tagged->sha1;
/*
* NEEDSWORK: This derefs tag only once, which
/* NEEDSWORK: This derefs tag only once, which
* is good to deal with chains of trust, but
* is not consistent with what deref_tag() does
* which peels the onion to the core.
@ -728,8 +681,9 @@ struct grab_ref_cbdata {
};
/*
* A call-back given to for_each_ref(). Filter refs and keep them for
* later object processing.
* A call-back given to for_each_ref(). It is unfortunate that we
* need to use global variables to pass extra information to this
* function.
*/
static int grab_single_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
{
@ -757,15 +711,13 @@ static int grab_single_ref(const char *refname, const unsigned char *sha1, int f
return 0;
}
/*
* We do not open the object yet; sort may only need refname
/* We do not open the object yet; sort may only need refname
* to do its job and the resulting list may yet to be pruned
* by maxcount logic.
*/
ref = xcalloc(1, sizeof(*ref));
ref->refname = xstrdup(refname);
hashcpy(ref->objectname, sha1);
ref->flag = flag;
cnt = cb->grab_cnt;
cb->grab_array = xrealloc(cb->grab_array,
@ -986,6 +938,13 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
refs = cbdata.grab_array;
num_refs = cbdata.grab_cnt;
for (i = 0; i < used_atom_cnt; i++) {
if (used_atom[i][0] == '*') {
need_tagged = 1;
break;
}
}
sort_refs(sort, refs, num_refs);
if (!maxcount || num_refs < maxcount)

View File

@ -14,11 +14,10 @@
#include "userdiff.h"
#include "grep.h"
#include "quote.h"
#include "dir.h"
#ifndef NO_PTHREADS
#include <pthread.h>
#include "thread-utils.h"
#include <pthread.h>
#endif
static char const * const grep_usage[] = {
@ -96,9 +95,6 @@ static pthread_cond_t cond_write;
/* Signalled when we are finished with everything. */
static pthread_cond_t cond_result;
static int print_hunk_marks_between_files;
static int printed_something;
static void add_work(enum work_type type, char *name, void *id)
{
grep_lock();
@ -162,12 +158,7 @@ static void work_done(struct work_item *w)
for(; todo[todo_done].done && todo_done != todo_start;
todo_done = (todo_done+1) % ARRAY_SIZE(todo)) {
w = &todo[todo_done];
if (w->out.len) {
if (print_hunk_marks_between_files && printed_something)
write_or_die(1, "--\n", 3);
write_or_die(1, w->out.buf, w->out.len);
printed_something = 1;
}
write_or_die(1, w->out.buf, w->out.len);
free(w->name);
free(w->identifier);
}
@ -297,7 +288,6 @@ static int wait_all(void)
static int grep_config(const char *var, const char *value, void *cb)
{
struct grep_opt *opt = cb;
char *color = NULL;
switch (userdiff_config(var, value)) {
case 0: break;
@ -305,30 +295,17 @@ static int grep_config(const char *var, const char *value, void *cb)
default: return 0;
}
if (!strcmp(var, "color.grep"))
if (!strcmp(var, "color.grep")) {
opt->color = git_config_colorbool(var, value, -1);
else if (!strcmp(var, "color.grep.context"))
color = opt->color_context;
else if (!strcmp(var, "color.grep.filename"))
color = opt->color_filename;
else if (!strcmp(var, "color.grep.function"))
color = opt->color_function;
else if (!strcmp(var, "color.grep.linenumber"))
color = opt->color_lineno;
else if (!strcmp(var, "color.grep.match"))
color = opt->color_match;
else if (!strcmp(var, "color.grep.selected"))
color = opt->color_selected;
else if (!strcmp(var, "color.grep.separator"))
color = opt->color_sep;
else
return git_color_default_config(var, value, cb);
if (color) {
return 0;
}
if (!strcmp(var, "color.grep.match")) {
if (!value)
return config_error_nonbool(var);
color_parse(value, var, color);
color_parse(value, var, opt->color_match);
return 0;
}
return 0;
return git_color_default_config(var, value, cb);
}
/*
@ -675,24 +652,6 @@ static int grep_object(struct grep_opt *opt, const char **paths,
die("unable to grep from object of type %s", typename(obj->type));
}
static int grep_directory(struct grep_opt *opt, const char **paths)
{
struct dir_struct dir;
int i, hit = 0;
memset(&dir, 0, sizeof(dir));
setup_standard_excludes(&dir);
fill_directory(&dir, paths);
for (i = 0; i < dir.nr; i++) {
hit |= grep_file(opt, dir.entries[i]->name);
if (hit && opt->status_only)
break;
}
free_grep_patterns(opt);
return hit;
}
static int context_callback(const struct option *opt, const char *arg,
int unset)
{
@ -787,12 +746,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
const char **paths = NULL;
int i;
int dummy;
int nongit = 0, use_index = 1;
struct option options[] = {
OPT_BOOLEAN(0, "cached", &cached,
"search in index instead of in the work tree"),
OPT_BOOLEAN(0, "index", &use_index,
"--no-index finds in contents not managed by git"),
OPT_GROUP(""),
OPT_BOOLEAN('v', "invert-match", &opt.invert,
"show non-matching lines"),
@ -833,7 +789,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
"print NUL after filenames"),
OPT_BOOLEAN('c', "count", &opt.count,
"show the number of matches instead of matching lines"),
OPT__COLOR(&opt.color, "highlight matches"),
OPT_SET_INT(0, "color", &opt.color, "highlight matches", 1),
OPT_GROUP(""),
OPT_CALLBACK('C', NULL, &opt, "n",
"show <n> context lines before and after matches",
@ -875,8 +831,6 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
OPT_END()
};
prefix = setup_git_directory_gently(&nongit);
/*
* 'git grep -h', unlike 'git grep -h <pattern>', is a request
* to show usage information and exit.
@ -894,13 +848,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
opt.regflags = REG_NEWLINE;
opt.max_depth = -1;
strcpy(opt.color_context, "");
strcpy(opt.color_filename, "");
strcpy(opt.color_function, "");
strcpy(opt.color_lineno, "");
strcpy(opt.color_match, GIT_COLOR_BOLD_RED);
strcpy(opt.color_selected, "");
strcpy(opt.color_sep, GIT_COLOR_CYAN);
strcpy(opt.color_match, GIT_COLOR_RED GIT_COLOR_BOLD);
opt.color = -1;
git_config(grep_config, &opt);
if (opt.color == -1)
@ -921,10 +869,6 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
PARSE_OPT_STOP_AT_NON_OPTION |
PARSE_OPT_NO_INTERNAL_HELP);
if (use_index && nongit)
/* die the same way as if we did it at the beginning */
setup_git_directory();
/*
* skip a -- separator; we know it cannot be
* separating revisions from pathnames if
@ -954,11 +898,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
if (online_cpus() == 1 || !grep_threads_ok(&opt))
use_threads = 0;
if (use_threads) {
if (opt.pre_context || opt.post_context)
print_hunk_marks_between_files = 1;
if (use_threads)
start_threads(&opt);
}
#else
use_threads = 0;
#endif
@ -999,18 +940,6 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
paths[1] = NULL;
}
if (!use_index) {
int hit;
if (cached)
die("--cached cannot be used with --no-index.");
if (list.nr)
die("--no-index cannot be used with revs.");
hit = grep_directory(&opt, paths);
if (use_threads)
hit |= wait_all();
return !hit;
}
if (!list.nr) {
int hit;
if (!cached)

View File

@ -33,8 +33,6 @@ static void hash_object(const char *path, const char *type, int write_object,
hash_fd(fd, type, write_object, vpath);
}
static int no_filters;
static void hash_stdin_paths(const char *type, int write_objects)
{
struct strbuf buf = STRBUF_INIT, nbuf = STRBUF_INIT;
@ -46,8 +44,7 @@ static void hash_stdin_paths(const char *type, int write_objects)
die("line is badly quoted");
strbuf_swap(&buf, &nbuf);
}
hash_object(buf.buf, type, write_objects,
no_filters ? NULL : buf.buf);
hash_object(buf.buf, type, write_objects, buf.buf);
}
strbuf_release(&buf);
strbuf_release(&nbuf);
@ -63,6 +60,7 @@ static const char *type;
static int write_object;
static int hashstdin;
static int stdin_paths;
static int no_filters;
static const char *vpath;
static const struct option hash_object_options[] = {
@ -102,6 +100,8 @@ int cmd_hash_object(int argc, const char **argv, const char *prefix)
errstr = "Can't specify files with --stdin-paths";
else if (vpath)
errstr = "Can't use --stdin-paths with --path";
else if (no_filters)
errstr = "Can't use --stdin-paths with --no-filters";
}
else {
if (hashstdin > 1)

View File

@ -266,23 +266,26 @@ static void unlink_base_data(struct base_data *c)
static void *unpack_entry_data(unsigned long offset, unsigned long size)
{
int status;
z_stream stream;
void *buf = xmalloc(size);
memset(&stream, 0, sizeof(stream));
git_inflate_init(&stream);
stream.next_out = buf;
stream.avail_out = size;
stream.next_in = fill(1);
stream.avail_in = input_len;
git_inflate_init(&stream);
do {
for (;;) {
int ret = git_inflate(&stream, 0);
use(input_len - stream.avail_in);
if (stream.total_out == size && ret == Z_STREAM_END)
break;
if (ret != Z_OK)
bad_object(offset, "inflate returned %d", ret);
stream.next_in = fill(1);
stream.avail_in = input_len;
status = git_inflate(&stream, 0);
use(input_len - stream.avail_in);
} while (status == Z_OK);
if (stream.total_out != size || status != Z_STREAM_END)
bad_object(offset, "inflate returned %d", status);
}
git_inflate_end(&stream);
return buf;
}
@ -356,38 +359,34 @@ static void *get_data_from_pack(struct object_entry *obj)
{
off_t from = obj[0].idx.offset + obj[0].hdr_size;
unsigned long len = obj[1].idx.offset - from;
unsigned char *data, *inbuf;
unsigned long rdy = 0;
unsigned char *src, *data;
z_stream stream;
int status;
data = xmalloc(obj->size);
inbuf = xmalloc((len < 64*1024) ? len : 64*1024);
memset(&stream, 0, sizeof(stream));
git_inflate_init(&stream);
stream.next_out = data;
stream.avail_out = obj->size;
int st;
src = xmalloc(len);
data = src;
do {
ssize_t n = (len < 64*1024) ? len : 64*1024;
n = pread(pack_fd, inbuf, n, from);
ssize_t n = pread(pack_fd, data + rdy, len - rdy, from + rdy);
if (n < 0)
die_errno("cannot pread pack file");
if (!n)
die("premature end of pack file, %lu bytes missing", len);
from += n;
len -= n;
stream.next_in = inbuf;
stream.avail_in = n;
status = git_inflate(&stream, 0);
} while (len && status == Z_OK && !stream.avail_in);
/* This has been inflated OK when first encountered, so... */
if (status != Z_STREAM_END || stream.total_out != obj->size)
die("serious inflate inconsistency");
die("premature end of pack file, %lu bytes missing",
len - rdy);
rdy += n;
} while (rdy < len);
data = xmalloc(obj->size);
memset(&stream, 0, sizeof(stream));
stream.next_out = data;
stream.avail_out = obj->size;
stream.next_in = src;
stream.avail_in = len;
git_inflate_init(&stream);
while ((st = git_inflate(&stream, Z_FINISH)) == Z_OK);
git_inflate_end(&stream);
free(inbuf);
if (st != Z_STREAM_END || stream.total_out != obj->size)
die("serious inflate inconsistency");
free(src);
return data;
}
@ -669,25 +668,25 @@ static void parse_pack_objects(unsigned char *sha1)
static int write_compressed(struct sha1file *f, void *in, unsigned int size)
{
z_stream stream;
int status;
unsigned char outbuf[4096];
unsigned long maxsize;
void *out;
memset(&stream, 0, sizeof(stream));
deflateInit(&stream, zlib_compression_level);
maxsize = deflateBound(&stream, size);
out = xmalloc(maxsize);
/* Compress it */
stream.next_in = in;
stream.avail_in = size;
do {
stream.next_out = outbuf;
stream.avail_out = sizeof(outbuf);
status = deflate(&stream, Z_FINISH);
sha1write(f, outbuf, sizeof(outbuf) - stream.avail_out);
} while (status == Z_OK);
if (status != Z_STREAM_END)
die("unable to deflate appended object (%d)", status);
size = stream.total_out;
stream.next_out = out;
stream.avail_out = maxsize;
while (deflate(&stream, Z_FINISH) == Z_OK);
deflateEnd(&stream);
size = stream.total_out;
sha1write(f, out, size);
free(out);
return size;
}

View File

@ -20,7 +20,6 @@
static int init_is_bare_repository = 0;
static int init_shared_repository = -1;
static const char *init_db_template_dir;
static void safe_create_dir(const char *dir, int share)
{
@ -121,8 +120,6 @@ static void copy_templates(const char *template_dir)
if (!template_dir)
template_dir = getenv(TEMPLATE_DIR_ENVIRONMENT);
if (!template_dir)
template_dir = init_db_template_dir;
if (!template_dir)
template_dir = system_path(DEFAULT_GIT_TEMPLATE_DIR);
if (!template_dir[0])
@ -168,14 +165,6 @@ static void copy_templates(const char *template_dir)
closedir(dir);
}
static int git_init_db_config(const char *k, const char *v, void *cb)
{
if (!strcmp(k, "init.templatedir"))
return git_config_pathname(&init_db_template_dir, k, v);
return 0;
}
static int create_default_files(const char *template_path)
{
const char *git_dir = get_git_dir();
@ -201,9 +190,6 @@ static int create_default_files(const char *template_path)
safe_create_dir(git_path("refs/heads"), 1);
safe_create_dir(git_path("refs/tags"), 1);
/* Just look for `init.templatedir` */
git_config(git_init_db_config, NULL);
/* First copy the templates -- we might have the default
* config file there, in which case we would want to read
* from it after installing.
@ -345,14 +331,11 @@ int init_db(const char *template_dir, unsigned int flags)
git_config_set("receive.denyNonFastforwards", "true");
}
if (!(flags & INIT_DB_QUIET)) {
const char *git_dir = get_git_dir();
int len = strlen(git_dir);
printf("%s%s Git repository in %s%s\n",
if (!(flags & INIT_DB_QUIET))
printf("%s%s Git repository in %s/\n",
reinit ? "Reinitialized existing" : "Initialized empty",
shared_repository ? " shared" : "",
git_dir, len && git_dir[len-1] != '/' ? "/" : "");
}
get_git_dir());
return 0;
}
@ -463,7 +446,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
static char git_dir[PATH_MAX+1];
setenv(GIT_DIR_ENVIRONMENT,
getcwd(git_dir, sizeof(git_dir)), argc > 0);
getcwd(git_dir, sizeof(git_dir)), 0);
}
if (init_shared_repository != -1)

Some files were not shown because too many files have changed in this diff Show More