Commit graph

7771 commits

Author SHA1 Message Date
Shawn O. Pearce ee53aff486 Document the master@{n} reflog query syntax.
In ab2a1a32 Junio improved the reflog query logic to support
obtaining the n-th prior value of a ref, but this was never
documented in git-rev-parse.  Now it is.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 20:45:15 -08:00
Junio C Hamano de3820f5e4 Documentation/git-parse-remote.txt: we deal with config vars as well
... but we never documented it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 13:06:32 -08:00
Junio C Hamano 42f62db905 Documentation: m can be relative in "git-blame -Ln,m"
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 13:04:15 -08:00
Junio C Hamano 5cb545fa22 Documentation: suggest corresponding Porcelain-level in plumbing docs.
Instead of keeping the confused end user reading low-level
documentation, suggest the higher level commands that implement
what the user may want to do using them upfront.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 13:03:29 -08:00
Junio C Hamano 475abf1b63 Documentation/git-resolve: deprecated.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 13:00:23 -08:00
Nicolas Pitre 556b6600b2 sanitize content of README file
Current README content is way too esoteric for someone looking at GIT
for the first time. Instead it should provide a quick summary of what
GIT is with a few pointers to other resources.

The bulk of the previous README content is moved to
Documentation/core-intro.txt.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 12:03:50 -08:00
Junio C Hamano d7fb91c69d git-format-patch: do not crash with format.headers without value.
An incorrect config file can say:

	[format]
		headers

and crash the parsing.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 12:03:50 -08:00
Junio C Hamano 03eeaeaea5 Introduce 'git-format-patch --suffix=.patch'
The default can also be changed with "format.suffix" configuration.
Leaving it empty would not add any suffix.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 12:03:26 -08:00
Junio C Hamano 2aa73a8fa2 Documentation/glossary.txt: describe remotes/ tracking and packed-refs
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 10:54:58 -08:00
Junio C Hamano 24a0fd02c9 Documentation/glossary.txt: unpacked objects are loose.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 10:54:18 -08:00
Junio C Hamano 428ddc5de6 Documentation: describe shallow repository
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 10:53:31 -08:00
Junio C Hamano df59afe3eb Make a short-and-sweet "git-add -i" synonym for "git-add --interactive"
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 10:52:36 -08:00
Junio C Hamano 5e1a2e8c61 Documentation: detached HEAD
Add discussion section to git-checkout documentation and mention
detached HEAD in repository-layout document.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 10:43:50 -08:00
René Scharfe 23bfbb815d Documentation: a few spelling fixes
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 08:44:32 -08:00
Junio C Hamano 850844e28f Documentation/git-sh-setup.txt: programmer's docs
Clarify that this is not meant for end users, and list what
shell functions are defined.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 01:13:05 -08:00
Junio C Hamano 7055172667 Documentation/git-whatchanged.txt: show -<n> instead of --max-count.
... to match the change we did earlier to git-log documentation.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 01:11:56 -08:00
Junio C Hamano 31fcd63c4a Documentation/git-status.txt: mention color configuration
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 01:11:01 -08:00
Junio C Hamano 0f2ba25d54 Documentation/git-tar-tree.txt: default umask is now 002
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 01:10:26 -08:00
Junio C Hamano e541557508 Documentation/git-tools.txt: mention tig and refer to wiki
In general list at Wiki seems to be maintained a lot better than
this list.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 01:09:41 -08:00
Junio C Hamano 79d5b81fee Documentation/git-tag: the command can be used to also verify a tag.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 01:08:30 -08:00
Junio C Hamano e30b217ba4 Documentation/SubmittingPatches: Gnus tips
Also warn about format=flowed (aka 'flawed').

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-17 01:07:27 -08:00
Junio C Hamano 936f32d3de git-commit: document log message formatting convention
Take it from the tutorial, since not everybody necessarily reads it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-16 22:53:28 -08:00
Chris Wedgwood 276bc2caab cache.h; fix a couple of prototypes
Trivial patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-16 22:46:57 -08:00
Junio C Hamano 5ea5621f89 Document where configuration files are in config.txt
Talking about what the files contain without talking about where
they are does not help new users.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-16 22:45:35 -08:00
Junio C Hamano c1a4278ee3 Use merge-recursive in git-checkout -m (branch switching)
This allows "git checkout -m <other-branch>" to notice renames and
carry local changes in the working tree forward.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-16 21:32:06 -08:00
Junio C Hamano 7905ba626e git-commit documentation: remove comment on unfixed git-rm
... which was fixed since then.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-16 16:36:54 -08:00
Junio C Hamano c1ff284a70 tutorial: shorthand for remotes but show distributed nature of git
* Promiscous pull shows the distributed nature of git better.
* Add a new step after that to teach "remote add".
* Highlight that with the shorthand defined you will get
  remote tracking branches for free.
* Fix Alice's workflow.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-16 16:23:58 -08:00
Santi Béjar 8b616f24ea tutorial: Use only separate layout
Then the newbies only have to understand one layout.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-16 16:23:31 -08:00
Johannes Schindelin 8bef62049b Fix spurious compile error
From time to time, I would get this error:

[...]
sed: -e expression #8, char 41: Unterminated `s' command
make: *** [git-add--interactive] Error 1

Turns out that the function WriteMakefile() called in Makefile.PL
outputs the message "Writing perl.mak for Git" to stdout! Thus,
the output of "make -C perl -s --no-print-directory instlibdir"
would be prefixed by that message whenever Makefile.PL was newer
than perl.mak.

This is fixed by redirecting stdout to stderr in Makefile.PL.

Signed-off-by: Johannes E. Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-16 13:43:50 -08:00
Junio C Hamano a9877f83e0 git-rm documentation: remove broken behaviour from the example.
The example section were talking about the old broken default
behaviour.  Correct it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-16 11:50:29 -08:00
Junio C Hamano dc36f26525 git-push documentation: remaining bits
Mention --thin, --no-thin, --repo and -v.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-16 11:46:03 -08:00
Uwe Kleine-K,Av(Bnig 5214f77044 document --exec for git-push
The text is just copied from git-send-pack.txt.

Signed-off-by: Uwe Kleine-K,Av(Bnig <zeisberg@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-16 11:33:38 -08:00
Eric Wong 6f729591d1 git-svn: print and flush authentication prompts to STDERR
People that redirect STDOUT output should always see STDERR
prompts interactively.

STDERR should always be flushed without buffering, so
they should always show up.  If that is unset, we still
explicitly flush by calling STDERR->flush.

The svn command-line client prompts to STDERR, too.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-15 22:30:42 -08:00
Jason Riedy d9e74d5745 Solaris 5.8 returns ENOTDIR for inappropriate renames.
The reflog code clears empty directories when rename returns
either EISDIR or ENOTDIR.  Seems to be the only place.

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-15 22:27:05 -08:00
Jason Riedy 2aad957a51 Replace "echo -n" with printf in shell scripts.
Not all echos know -n.  This was causing a test failure in
t5401-update-hooks.sh, but not t3800-mktag.sh for some reason.

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-15 22:23:21 -08:00
Jason Riedy fb9522062c Set _ALL_SOURCE for AIX, but avoid its struct list.
AIX 5.3 seems to need _ALL_SOURCE for struct addrinfo, but that
introduces a struct list in grp.h.

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-15 22:22:24 -08:00
Jason Riedy 5ab9cc86ae Start all test scripts with /bin/sh.
My bash refused to run the two scripts missing a #!, and it's
better to use the same line for all the scripts.

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-15 18:57:48 -08:00
Jeff King a74b1706c8 git-pull: disallow implicit merging to detached HEAD
Instead, we complain to the user and suggest that they explicitly
specify the remote and branch. We depend on the exit status of
git-symbolic-ref, so let's go ahead and document that.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-15 15:37:22 -08:00
Junio C Hamano a0f4280f9e Fix git-fetch while on detached HEAD not to give needlessly alarming errors
When we are on a detached HEAD, there is no current branch.
There is no reason to leak the error messages to the end user
since this is a situation we expect to see.

This adds -q option to git-symbolic-ref to exit without issuing
an error message if the given name is not a symbolic ref.

By the way, with or without this patch, there currently is no
good way to tell failure modes between "git symbolic-ref HAED"
and "git symbolic-ref HEAD".  Both says "is not a symbolic ref".

We may want to do something about it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-15 15:35:07 -08:00
Junio C Hamano 15261e3b33 git reflog expire: document --stale-fix option.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-15 14:43:03 -08:00
Junio C Hamano 38ebbacd93 Merge git://git.kernel.org/pub/scm/gitk/gitk
* git://git.kernel.org/pub/scm/gitk/gitk:
  [PATCH] Make gitk work when launched in a subdirectory
  [PATCH] gitk: add current directory to main window title
2007-01-14 23:43:47 -08:00
Shawn O. Pearce 6e2931a8ed Use nice names in conflict markers during cherry-pick/revert.
Always call the current HEAD 'HEAD', and name the patch being
cherry-picked or reverted by its oneline subject rather than
its SHA1.  This matches git am's behavior and is done because
users most commonly are cherry-picking by SHA1 rather than by
ref name.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-14 23:17:32 -08:00
Junio C Hamano acb4441e0d Use merge-recursive in git-revert/git-cherry-pick
This makes revert and cherry-pick to use merge-recursive, to
allow them to notice renames.  A pair of test scripts
demonstrate that an old change before a rename happened can be
applied (reverted) after a rename with cherry-pick (with revert).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-14 22:00:34 -08:00
Junio C Hamano 5fe3acc43d Documentation: merge-output is not too verbose now.
We've squelched output from merge-recursive, and git-merge when
used with recursive does not attempt the trivial one first
anymore, so there won't be "Trying ... Nope." messages now.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-14 21:31:30 -08:00
Shawn O. Pearce e7eb50347b Remove hash in git-describe in favor of util slot.
Currently we don't use the util field of struct commit but we want
fast access to the highest priority name that references any given
commit object during our matching loop.  A really simple approach
is to just store the name directly in the util field.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-14 21:17:27 -08:00
Shawn O. Pearce cf69fd49ec Correct priority of lightweight tags in git-describe.
We really want to always favor an annotated tag over a lightweight
tag when describing a commit.  Unfortunately git-describe wasn't
doing this as it was favoring the depth attribute of a possible_tag
over the priority.  Now priority is the highest sort and we only
consider a lightweight tag if no annotated tags were identified.

Rather than searching for the minimum tag using a simple loop we
now sort them using a stable sort algorithm, this way the possible
tags display in order if --debug gets used.  The stable sort helps
to preseve the inherit topology/date order that we obtain during
our search loop.

This fix allows the tests in t6120-describe.sh to pass.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-14 21:17:27 -08:00
Junio C Hamano 5312ab11fb Add describe test.
... with help from Shawn.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-14 21:17:27 -08:00
Shawn O. Pearce 8713ab3079 Improve git-describe performance by reducing revision listing.
My prior version of git-describe ran very slowly on even reasonably
sized projects like git.git and linux.git as it tended to identify
a large number of possible tags and then needed to generate the
revision list for each of those tags to sort them and select the
best tag to describe the input commit.

All we really need is the number of commits in the input revision
which are not in the tag.  We can generate these counts during
the revision walking and tag matching loop by assigning a color to
each tag and coloring the commits as we walk them.  This limits us
to identifying no more than 26 possible tags, as there is limited
space available within the flags field of struct commit.

The limitation of 26 possible tags is hopefully not going to be a
problem in real usage, as most projects won't create 26 maintenance
releases and merge them back into a development trunk after the
development trunk was tagged with a release candidate tag.  If that
does occur git-describe will start to revert to its old behavior of
using the newer maintenance release tag to describe the development
trunk, rather than the development trunk's own tag.  The suggested
workaround would be to retag the development trunk's tip.

However since even 26 possible tags can take a while to generate a
description for on some projects I'm defaulting the limit to 10 but
offering the user --candidates to increase the number of possible
matches if they need a more accurate result.  I specifically chose
10 for the default as it seems unlikely projects will have more
than 10 maintenance releases merged into a development trunk before
retagging the development trunk, and it seems to perform about the
same on linux.git as v1.4.4.4 git-describe.

A large amount of debugging information was also added during
the development of this change, so I've left it in to be toggled
on with --debug.  It may be useful to the end user to help them
understand why git-describe took one particular tag over another.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-14 21:17:27 -08:00
Shawn O. Pearce 910c0d7b5e Use binary searching on large buckets in git-describe.
If a project has a really huge number of tags (such as several
thousand tags) then we are likely to have nearly a hundred tags in
some buckets.  Scanning those buckets as linked lists could take
a large amount of time if done repeatedly during history traversal.

Since we are searching for a unique commit SHA1 we can sort all
tags by commit SHA1 and perform a binary search within the bucket.
Once we identify a particular tag as matching this commit we walk
backwards within the bucket matches to make sure we pick up the
highest priority tag for that commit, as the binary search may
have landed us in the middle of a set of tags which point at the
same commit.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-14 21:17:27 -08:00
Shawn O. Pearce c3e3cd4bf8 Hash tags by commit SHA1 in git-describe.
If a project has a very large number of tags then git-describe
will spend a good part of its time looping over the tags testing
them one at a time to determine if it matches a given commit.
For 10 tags this is not a big deal, but for hundreds of tags the
time could become considerable if we don't find an exact match for
the input commit and we need to walk back along the history chain.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-14 21:17:27 -08:00