Code

git.git
17 years agogitweb: Change summary, shortlog actions to use parse_commits.
Robert Fitzsimons [Sun, 24 Dec 2006 14:31:44 +0000 (14:31 +0000)]
gitweb: Change summary, shortlog actions to use parse_commits.

Also added missing accesskey.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: We do longer need the --parents flag in rev-list.
Robert Fitzsimons [Sun, 24 Dec 2006 14:31:43 +0000 (14:31 +0000)]
gitweb: We do longer need the --parents flag in rev-list.

We only want to know the direct parents of a given commit object,
these parents are available in the --header output of rev-list.  If
--parents is supplied with --full-history the output includes merge
commits that aren't relevant.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Add parse_commits, used to bulk load commit objects.
Robert Fitzsimons [Sun, 24 Dec 2006 14:31:42 +0000 (14:31 +0000)]
gitweb: Add parse_commits, used to bulk load commit objects.

Add a new method parse_commits which is able to parse multiple commit
objects at once.  Reworked parse_commit to share the commit object
parsing logic.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'jc/skip-count'
Junio C Hamano [Mon, 25 Dec 2006 11:27:41 +0000 (03:27 -0800)]
Merge branch 'jc/skip-count'

* jc/skip-count:
  revision: --skip=<n>

17 years agoMerge branch 'jc/git-add--interactive'
Junio C Hamano [Mon, 25 Dec 2006 09:31:17 +0000 (01:31 -0800)]
Merge branch 'jc/git-add--interactive'

* jc/git-add--interactive:
  git-add --interactive: add documentation
  git-add --interactive: hunk splitting
  git-add --interactive

17 years agogit-add --interactive: add documentation
Junio C Hamano [Mon, 25 Dec 2006 09:30:55 +0000 (01:30 -0800)]
git-add --interactive: add documentation

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'sb/merge-friendly'
Junio C Hamano [Sun, 24 Dec 2006 10:18:35 +0000 (02:18 -0800)]
Merge branch 'sb/merge-friendly'

* sb/merge-friendly:
  Display 'theirs' branch name when possible in merge.
  Use extended SHA1 syntax in merge-recursive conflicts.

17 years agoMerge branch 'js/rerere'
Junio C Hamano [Sun, 24 Dec 2006 10:10:55 +0000 (02:10 -0800)]
Merge branch 'js/rerere'

* js/rerere:
  Make git-rerere a builtin
  Add a test for git-rerere
  move read_mmfile() into xdiff-interface

17 years agocommit-tree: encourage UTF-8 commit messages.
Johannes Schindelin [Fri, 22 Dec 2006 21:06:08 +0000 (22:06 +0100)]
commit-tree: encourage UTF-8 commit messages.

Introduce is_utf() to check if a text looks like it is encoded
in UTF-8, utf8_width() to count display width, and implements
print_wrapped_text() using them.

git-commit-tree warns if the commit message does not minimally
conform to the UTF-8 encoding when i18n.commitencoding is either
unset, or set to "utf-8".

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoSwitch git_mmap to use pread.
Shawn O. Pearce [Sun, 24 Dec 2006 05:45:47 +0000 (00:45 -0500)]
Switch git_mmap to use pread.

Now that Git depends on pread in index-pack its safe to say we can
also depend on it within the git_mmap emulation we activate when
NO_MMAP is set.  On most systems pread should be slightly faster
than an lseek/read/lseek sequence as its one system call vs. three
system calls.

We also now honor EAGAIN and EINTR error codes from pread and
restart the prior read.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRename gitfakemmap to git_mmap.
Shawn O. Pearce [Sun, 24 Dec 2006 05:45:37 +0000 (00:45 -0500)]
Rename gitfakemmap to git_mmap.

This minor cleanup was suggested by Johannes Schindelin.

The mmap is still fake in the sense that we don't support PROT_WRITE
or MAP_SHARED with external modification at all, but that hasn't
stopped us from using mmap() thoughout the Git code.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Paginate commit/author/committer search output
Robert Fitzsimons [Sat, 23 Dec 2006 14:57:12 +0000 (14:57 +0000)]
gitweb: Paginate commit/author/committer search output

Paginate commit/author/committer search output to only show 100 commits
at a time, added appropriate nav links.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMakefile: add quick-install-doc for installing pre-built manpages
Eric Wong [Sat, 23 Dec 2006 16:26:09 +0000 (08:26 -0800)]
Makefile: add quick-install-doc for installing pre-built manpages

This adds and uses the install-doc-quick.sh file to
Documentation/, which is usable for people who track either the
'html' or 'man' heads in Junio's repository (prefixed with
'origin/' if cloned locally).  You may override this by
specifying DOC_REF in the make environment or in config.mak.

GZ may also be set in the environment (or config.mak) if you
wish to gzip the documentation after installing it.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDisplay 'theirs' branch name when possible in merge.
Shawn O. Pearce [Sat, 23 Dec 2006 08:44:47 +0000 (03:44 -0500)]
Display 'theirs' branch name when possible in merge.

Displaying the SHA1 of 'their' branch (the branch being merged into
the current branch) is not nearly as friendly as just displaying
the name of that branch, especially if that branch is already local
to this repository.

git-merge now sets the environment variable 'GITHEAD_%(sha1)=%(name)'
for each argument it gets passed, making the actual input name that
resolved to the commit '%(sha1)' easily available to the invoked
merge strategy.

git-merge-recursive makes use of these environment variables when
they are available by using '%(name)' whenever it outputs the commit
identification rather than '%(sha1)'.  This is most obvious in the
conflict hunks created by xdl_merge:

  $ git mege sideb~1
  <<<<<<< HEAD:INSTALL
     Good!
  =======
     Oops.
  >>>>>>> sideb~1:INSTALL

[jc: adjusted a test script and a minor constness glitch.]

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoUse extended SHA1 syntax in merge-recursive conflicts.
Shawn O. Pearce [Sat, 23 Dec 2006 08:44:00 +0000 (03:44 -0500)]
Use extended SHA1 syntax in merge-recursive conflicts.

When we get a line-level conflict in merge-recursive and print out
the two sides in the conflict hunk header and footer we should use
the standard extended SHA1 syntax to specify the specific blob,
as this allows the user to copy and paste the line right into
'git show' to view the complete version.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Allow search to be disabled from the config file.
Robert Fitzsimons [Sat, 23 Dec 2006 03:35:16 +0000 (03:35 +0000)]
gitweb: Allow search to be disabled from the config file.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Require a minimum of two character for the search text.
Robert Fitzsimons [Sat, 23 Dec 2006 03:35:15 +0000 (03:35 +0000)]
gitweb: Require a minimum of two character for the search text.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Use rev-list pattern search options.
Robert Fitzsimons [Sat, 23 Dec 2006 03:35:14 +0000 (03:35 +0000)]
gitweb: Use rev-list pattern search options.

Use rev-list pattern search options instead of hand coded perl.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agocheckout: make the message about the need for a new branch a bit clearer
Nicolas Pitre [Fri, 22 Dec 2006 20:06:54 +0000 (15:06 -0500)]
checkout: make the message about the need for a new branch a bit clearer

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: optimize git_summary.
Robert Fitzsimons [Fri, 22 Dec 2006 19:38:15 +0000 (19:38 +0000)]
gitweb: optimize git_summary.

We don't need to call git_get_head_hash at all just pass in "HEAD" and
use the return id field.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: optimize git_shortlog_body.
Robert Fitzsimons [Fri, 22 Dec 2006 19:38:14 +0000 (19:38 +0000)]
gitweb: optimize git_shortlog_body.

Don't call gitweb_have_snapshot from within the loop.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: optimize git_get_last_activity.
Robert Fitzsimons [Fri, 22 Dec 2006 19:38:13 +0000 (19:38 +0000)]
gitweb: optimize git_get_last_activity.

Only return one line of output and we don't need the refname value.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Add missing show '...' links change.
Robert Fitzsimons [Fri, 22 Dec 2006 19:38:12 +0000 (19:38 +0000)]
gitweb: Add missing show '...' links change.

Part of the patch for "gitweb: Show '...' links in "summary" view only
if there are more items" (313ce8cee665447e4476d7e8985b270346a8e5a1) is
missing.  Add it back in.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMake git-show-branch options similar to git-branch.
Brian Gernhardt [Fri, 22 Dec 2006 13:58:39 +0000 (08:58 -0500)]
Make git-show-branch options similar to git-branch.

Branch has "-r" for remote branches and "-a" for local and remote.
It seems logical to mirror that in show-branch.  Also removes the
dubiously useful "--tags" option (as part of changing the meaning
for "--all").

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoKeep "git --git-dir" from causing a bus error.
Brian Gernhardt [Fri, 22 Dec 2006 13:56:25 +0000 (08:56 -0500)]
Keep "git --git-dir" from causing a bus error.

The option checking code for --git-dir had an off by 1 error that
would cause it to access uninitialized memory if it was the last
argument.  This causes it to display an error and display the usage
string instead.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-svn: enable common fetch/commit options for dcommit
Eric Wong [Sat, 23 Dec 2006 05:59:24 +0000 (21:59 -0800)]
git-svn: enable common fetch/commit options for dcommit

dcommit does commits and fetches, so all options used for those
should work, too, including --authors-file.

Reported missing by Nicolas Vilz.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agovc-git: Ignore errors caused by a non-existent directory in vc-git-registered.
Alexandre Julliard [Fri, 22 Dec 2006 13:56:15 +0000 (14:56 +0100)]
vc-git: Ignore errors caused by a non-existent directory in vc-git-registered.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRemove NO_ACCURATE_DIFF options from build systems
Eric Wong [Sat, 23 Dec 2006 06:18:03 +0000 (22:18 -0800)]
Remove NO_ACCURATE_DIFF options from build systems

The code no longer uses it, as we have --inaccurate-eof in
git-apply.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-tag: lose exit after die
Junio C Hamano [Sat, 23 Dec 2006 06:48:46 +0000 (22:48 -0800)]
git-tag: lose exit after die

We are not running under /bin/resurrection shell ;-)

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoReally fix headers for __FreeBSD__
Junio C Hamano [Sat, 23 Dec 2006 06:46:11 +0000 (22:46 -0800)]
Really fix headers for __FreeBSD__

The symbol to detect FreeBSD is __FreeBSD__, not __FreeBSD.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDo not support "partial URL shorthand" anymore.
Junio C Hamano [Fri, 22 Dec 2006 23:37:48 +0000 (15:37 -0800)]
Do not support "partial URL shorthand" anymore.

We used to support specifying the top part of remote URL in
remotes and use that as a short-hand for the URL.

$ cat .git/remotes/jgarzik
URL: git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/
$ git pull jgarzik/misc-2.6

This is confusing when somebody attempts to do this:

$ git pull origin/foo

which is not syntactically correct (unless you have origin/foo.git
repository) and should fail, but it resulted in a mysterious
access to the 'foo' subdirectory of the origin repository.

Which was what it was designed to do, but because this is an
oddball "feature" I suspect nobody uses, let's remove it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agodefault pull: forget about "newbie protection" for now.
Junio C Hamano [Fri, 22 Dec 2006 23:25:21 +0000 (15:25 -0800)]
default pull: forget about "newbie protection" for now.

This will not be backward compatible no matter how you cut it.
Shelve it for now until somebody comes up with a better way to
determine when we can safely refuse to use the first set of
branchse for merging without upsetting valid workflows.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agomerge and reset: adjust for "reset --hard" messages
Junio C Hamano [Fri, 22 Dec 2006 23:21:55 +0000 (15:21 -0800)]
merge and reset: adjust for "reset --hard" messages

An earlier commit made "reset --hard" chattier but leaking its
message from "git rebase" (which calls it when first rewinding
the current branch to prepare replaying our own changes) without
explanation was confusing, so add an extra message to mention
it.  Inside restorestate in merge (which is rarely exercised
codepath, where more than one strategies are attempted),
resetting to the original state uses "reset --hard" -- this can
be squelched entirely.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agocommit-tree: do not overflow MAXPARENT
Junio C Hamano [Fri, 22 Dec 2006 07:49:13 +0000 (23:49 -0800)]
commit-tree: do not overflow MAXPARENT

We have a static allocation of MAXPARENT, but that limit was not
enforced, other than by a lucky invocation of the program segfaulting.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMake git-rerere a builtin
Johannes Schindelin [Wed, 20 Dec 2006 16:39:41 +0000 (17:39 +0100)]
Make git-rerere a builtin

The perl version used modules which are non-standard in some setups.
This patch brings the full power of rerere to a wider audience.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoAdd a test for git-rerere
Johannes Schindelin [Thu, 21 Dec 2006 09:21:28 +0000 (10:21 +0100)]
Add a test for git-rerere

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agomove read_mmfile() into xdiff-interface
Johannes Schindelin [Wed, 20 Dec 2006 16:37:07 +0000 (17:37 +0100)]
move read_mmfile() into xdiff-interface

read_file() was a useful function if you want to work with the xdiff stuff,
so it was renamed and put into a more central place.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoIntroduce a global level warn() function.
Shawn O. Pearce [Fri, 22 Dec 2006 00:48:32 +0000 (19:48 -0500)]
Introduce a global level warn() function.

Like the existing error() function the new warn() function can be
used to describe a situation that probably should not be occuring,
but which the user (and Git) can continue to work around without
running into too many problems.

An example situation is a bad commit SHA1 found in a reflog.
Attempting to read this record out of the reflog isn't really an
error as we have skipped over it in the past.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRename imap-send's internal info/warn functions.
Shawn O. Pearce [Fri, 22 Dec 2006 00:48:12 +0000 (19:48 -0500)]
Rename imap-send's internal info/warn functions.

Because I am about to introduce a global warn() function (much
like the global error function) this global declaration would
conflict with the one supplied by imap-send.  Further since
imap-send's warn function output depends on its Quiet setting
we cannot simply remove its internal definition and use the
forthcoming global one.

So refactor warn() -> imap_warn() and info() -> imap_info()
(the latter was done just to be consistent in naming).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years ago_XOPEN_SOURCE problem also exists on FreeBSD
Junio C Hamano [Fri, 22 Dec 2006 06:51:42 +0000 (22:51 -0800)]
_XOPEN_SOURCE problem also exists on FreeBSD

Suggested by Rocco Rutte, Marco Roeland and others.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoparse-remote: mark all refs not for merge only when fetching more than one
Junio C Hamano [Fri, 22 Dec 2006 06:39:09 +0000 (22:39 -0800)]
parse-remote: mark all refs not for merge only when fetching more than one

An earlier commit a71fb0a1 implemented much requested safety
valve to refuse "git pull" or "git pull origin" without explicit
refspecs from using the first set of remote refs obtained by
reading .git/remotes/origin file or branch.*.fetch configuration
variables to create a merge.  The argument was that while on a
branch different from the default branch, it is often wrong to
merge the default remote ref suitable for merging into the master.

That is fine as a theory.  But many repositories already in use
by people in the real world do not have any of the per branch
configuration crap.  They did not need it, and they do not need
it now.  Merging with the first remote ref listed was just fine,
because they had only one ref (e.g. 'master' from linux-2.6.git)
anyway.

So this changes the safety valve to be a lot looser.  When "git
fetch" gets only one remote branch, the irritating warning would
not trigger anymore.

I think we could also make the warning trigger when branch.*.merge
is not specified for the current branch, but is for some other
branch.  That is for another commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Junio C Hamano [Fri, 22 Dec 2006 06:56:04 +0000 (22:56 -0800)]
Merge branch 'maint'

* maint:
  diff --check: fix off by one error
  spurious .sp in manpages

17 years agogit-reset --hard: tell the user what the HEAD was reset to
Johannes Schindelin [Thu, 21 Dec 2006 14:26:35 +0000 (15:26 +0100)]
git-reset --hard: tell the user what the HEAD was reset to

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-tag: support -F <file> option
Johannes Schindelin [Thu, 21 Dec 2006 14:13:02 +0000 (15:13 +0100)]
git-tag: support -F <file> option

This imitates the behaviour of git-commit.

Noticed by Han-Wen Nienhuys.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRevert "git-pull: refuse default merge without branch.*.merge"
Junio C Hamano [Fri, 22 Dec 2006 06:10:56 +0000 (22:10 -0800)]
Revert "git-pull: refuse default merge without branch.*.merge"

This reverts commit a71fb0a1412c82405f078fb536797d3f5de68d53.

The logic to decide when to refuse to use the default "first set of
refs fetched" for merge was utterly bogus.

In a repository that happily worked correctly without any of the
per-branch configuration crap did not have (and did not have to
have) any branch.<current>.merge.  With that broken commit, pulling
from origin no longer would work.

17 years agoSuggest 'add' in am/revert/cherry-pick.
Shawn O. Pearce [Fri, 22 Dec 2006 02:30:17 +0000 (21:30 -0500)]
Suggest 'add' in am/revert/cherry-pick.

Now that we have decided to make 'add' behave like 'update-index'
(and therefore fully classify update-index as strictly plumbing)
the am/revert/cherry-pick family of commands should not steer the
user towards update-index.  Instead send them to the command they
probably already know, 'add'.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoUse git-merge-file in git-merge-one-file, too
Johannes Schindelin [Fri, 22 Dec 2006 02:20:55 +0000 (03:20 +0100)]
Use git-merge-file in git-merge-one-file, too

Would you believe? I edited git-merge-one-file (note the missing ".sh"!)
when I submitted the patch which became commit e2b7008752...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agodiff --check: fix off by one error
Johannes Schindelin [Fri, 22 Dec 2006 02:20:11 +0000 (03:20 +0100)]
diff --check: fix off by one error

When parsing the diff line starting with '@@', the line number of the
'+' file is parsed. For the subsequent line parses, the line number
should therefore be incremented after the parse, not before it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDocumentation/git-branch: new -r to delete remote-tracking branches.
Quy Tonthat [Thu, 21 Dec 2006 04:18:07 +0000 (15:18 +1100)]
Documentation/git-branch: new -r to delete remote-tracking branches.

Signed-off-by: Quy Tonthat <qtonthat@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoFix system header problems on Mac OS X
Terje Sten Bjerkseth [Thu, 21 Dec 2006 01:32:21 +0000 (17:32 -0800)]
Fix system header problems on Mac OS X

For Mac OS X 10.4, _XOPEN_SOURCE defines _POSIX_C_SOURCE which
hides many symbols from the program.

Breakage noticed and initial analysis provided by Randal
L. Schwartz.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'ew/svn-pm'
Junio C Hamano [Thu, 21 Dec 2006 01:20:45 +0000 (17:20 -0800)]
Merge branch 'ew/svn-pm'

* ew/svn-pm:
  git-svn: rename 'commit' command to 'set-tree'
  git-svn: remove support for the svn command-line client
  git-svn: convert to using Git.pm

17 years agodiff documentation: mostly talk about <commit>
Junio C Hamano [Wed, 20 Dec 2006 22:41:54 +0000 (14:41 -0800)]
diff documentation: mostly talk about <commit>

This corrects minor remaining bits that still talked about <tree-ish>;
the Porcelain users (as opposed to plumbers) are mostly interested in
commits so use <commit> consistently and keep a sentence that mentions
that <tree-ish> can be used in place of them.

17 years agoMerge branch 'jc/leftright'
Junio C Hamano [Wed, 20 Dec 2006 22:20:17 +0000 (14:20 -0800)]
Merge branch 'jc/leftright'

* jc/leftright:
  Revert "Make left-right automatic."
  Make left-right automatic.
  Teach all of log family --left-right output.
  rev-list --left-right

17 years agoMerge branch 'jc/blame'
Junio C Hamano [Wed, 20 Dec 2006 21:58:10 +0000 (13:58 -0800)]
Merge branch 'jc/blame'

* jc/blame:
  blame: -b (blame.blankboundary) and --root (blame.showroot)

17 years agoMerge branch 'jc/branch-remove-remote'
Junio C Hamano [Wed, 20 Dec 2006 21:57:59 +0000 (13:57 -0800)]
Merge branch 'jc/branch-remove-remote'

* jc/branch-remove-remote:
  git-branch -d: do not stop at the first failure.
  Teach git-branch to delete tracking branches with -r -d

17 years agoMerge branch 'jc/clone'
Junio C Hamano [Wed, 20 Dec 2006 21:56:14 +0000 (13:56 -0800)]
Merge branch 'jc/clone'

* jc/clone:
  Move "no merge candidate" warning into git-pull
  Use preprocessor constants for environment variable names.
  Do not create $GIT_DIR/remotes/ directory anymore.
  Introduce GIT_TEMPLATE_DIR
  Revert "fix testsuite: make sure they use templates freshly built from the source"
  fix testsuite: make sure they use templates freshly built from the source
  git-clone: lose the traditional 'no-separate-remote' layout
  git-clone: lose the artificial "first" fetch refspec
  git-pull: refuse default merge without branch.*.merge
  git-clone: use wildcard specification for tracking branches

17 years agocompat/inet_ntop: do not use u_int
Junio C Hamano [Wed, 20 Dec 2006 21:45:55 +0000 (13:45 -0800)]
compat/inet_ntop: do not use u_int

It is pointless.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agospurious .sp in manpages
Junio C Hamano [Wed, 13 Dec 2006 08:58:28 +0000 (00:58 -0800)]
spurious .sp in manpages

This cherry-picks 7ef04350 that has been applied to the 'master'
to fix ".sp" in generated manpages.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-add: error out when given no arguments.
Junio C Hamano [Wed, 20 Dec 2006 21:06:46 +0000 (13:06 -0800)]
git-add: error out when given no arguments.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agorevision: --skip=<n>
Junio C Hamano [Wed, 20 Dec 2006 02:25:32 +0000 (18:25 -0800)]
revision: --skip=<n>

This adds --skip=<n> option to revision traversal machinery.
Documentation and test were added by Robert Fitzsimons.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Junio C Hamano [Wed, 20 Dec 2006 19:24:56 +0000 (11:24 -0800)]
Merge branch 'maint'

* maint:
  GIT 1.4.4.3

17 years agoGIT 1.4.4.3 v1.4.4.3
Junio C Hamano [Wed, 20 Dec 2006 19:23:22 +0000 (11:23 -0800)]
GIT 1.4.4.3

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoclarify some error messages wrt unknown object types
Nicolas Pitre [Wed, 20 Dec 2006 18:34:05 +0000 (13:34 -0500)]
clarify some error messages wrt unknown object types

If ever new object types are added for future extensions then better
have current git version report them as "unknown" instead of
"corrupted".

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agosimplify inclusion of system header files.
Junio C Hamano [Tue, 19 Dec 2006 22:34:12 +0000 (14:34 -0800)]
simplify inclusion of system header files.

This is a mechanical clean-up of the way *.c files include
system header files.

 (1) sources under compat/, platform sha-1 implementations, and
     xdelta code are exempt from the following rules;

 (2) the first #include must be "git-compat-util.h" or one of
     our own header file that includes it first (e.g. config.h,
     builtin.h, pkt-line.h);

 (3) system headers that are included in "git-compat-util.h"
     need not be included in individual C source files.

 (4) "git-compat-util.h" does not have to include subsystem
     specific header files (e.g. expat.h).

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoindex-pack usage of mmap() is unacceptably slower on many OSes other than Linux
Nicolas Pitre [Tue, 19 Dec 2006 15:53:08 +0000 (10:53 -0500)]
index-pack usage of mmap() is unacceptably slower on many OSes other than Linux

It was reported by Randal L. Schwartz <merlyn@stonehenge.com> that
indexing the Linux repository ~150MB pack takes about an hour on OS x
while it's a minute on Linux.  It seems that the OS X mmap()
implementation is more than 2 orders of magnitude slower than the Linux
one.

Linus proposed a patch replacing mmap() with pread() bringing index-pack
performance on OS X in line with the Linux one.  The performances on
Linux also improved by a small margin.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Show '...' links in "summary" view only if there are more items
Robert Fitzsimons [Tue, 19 Dec 2006 12:08:54 +0000 (12:08 +0000)]
gitweb: Show '...' links in "summary" view only if there are more items

Show "..." links in "summary" view to shortlog, heads (if there are
any), and tags (if there are any) only if there are more items to show
than shown already.

This means that "..." link is shown below shortened shortlog if there
are more than 16 commits, "..." link below shortened heads list if
there are more than 16 heads refs (16 branches), "..." link below
shortened tags list if there are more than 16 tags.

Modified patch from Jakub to to apply cleanly to master, also preform
the same "..." link logic to the forks list.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoconfig_rename_section: fix FILE* leak
Junio C Hamano [Wed, 20 Dec 2006 05:55:27 +0000 (21:55 -0800)]
config_rename_section: fix FILE* leak

Noticed by SungHyun Nam.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRemove COLLISION_CHECK from Makefile since it's not used.
Brian Gernhardt [Wed, 20 Dec 2006 03:25:13 +0000 (22:25 -0500)]
Remove COLLISION_CHECK from Makefile since it's not used.

It's rather misleading to have configuration options that don't do
anything.  If someone adds collision checking they might also want to
restore this option.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agofix populate-filespec
Junio C Hamano [Wed, 20 Dec 2006 02:26:48 +0000 (18:26 -0800)]
fix populate-filespec

I hand munged the original patch when committing 1510fea78, and
screwed up the conversion.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-cvsserver: fix breakage when calling git merge-file
Eric Wong [Tue, 19 Dec 2006 22:58:20 +0000 (14:58 -0800)]
git-cvsserver: fix breakage when calling git merge-file

In the same vein as 8336afa563fbeff35e531396273065161181f04c,
this fixes the the RCS merge to git-merge-file conversion in
commit e2b70087.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRevert "Make left-right automatic."
Junio C Hamano [Tue, 19 Dec 2006 10:28:16 +0000 (02:28 -0800)]
Revert "Make left-right automatic."

This reverts commit 5761231975ceffa531d86d9bab0f9a9a370674f6.

Feeding symmetric difference to gitk is so useful, and it is the
same for other graphical Porcelains.  Rather than forcing them
to pass --no-left-right, making it optional.

Noticed and reported by Jeff King.

17 years agoMove "no merge candidate" warning into git-pull
Josef Weidendorfer [Tue, 19 Dec 2006 00:39:07 +0000 (01:39 +0100)]
Move "no merge candidate" warning into git-pull

The warning triggered even when running "git fetch" only
when resulting .git/FETCH_HEAD only contained
branches marked as 'not-for-merge'.

Signed-off-by: Josef Weidendorfer <weidendo@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoUse preprocessor constants for environment variable names.
Junio C Hamano [Tue, 19 Dec 2006 09:28:15 +0000 (01:28 -0800)]
Use preprocessor constants for environment variable names.

We broke the discipline Linus set up to allow compiler help us
avoid typos in environment names in the early days of git over
time.  This defines a handful preprocessor constants for
environment variable names used in relatively core parts of the
system.

I've left out variable names specific to subsystems such as HTTP
and SSL as I do not think they are big problems.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDo not create $GIT_DIR/remotes/ directory anymore.
Junio C Hamano [Tue, 19 Dec 2006 09:50:37 +0000 (01:50 -0800)]
Do not create $GIT_DIR/remotes/ directory anymore.

Because we do not use --no-separate-remote anymore, there is no
reason to create that directory from the template.

t5510 test is updated to test both $GIT_DIR/remotes/ based
configuration and $GIT_DIR/config variable (credits to
Johannes).

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'jc/test-clone' into jc/clone
Junio C Hamano [Tue, 19 Dec 2006 09:38:18 +0000 (01:38 -0800)]
Merge branch 'jc/test-clone' into jc/clone

* jc/test-clone: (35 commits)
  Introduce GIT_TEMPLATE_DIR
  Revert "fix testsuite: make sure they use templates freshly built from the source"
  fix testsuite: make sure they use templates freshly built from the source
  rerere: fix breakage of resolving.
  Add config example with respect to branch
  Add documentation for show-branch --topics
  make git a bit less cryptic on fetch errors
  make patch_delta() error cases a bit more verbose
  racy-git: documentation updates.
  show-ref: fix --exclude-existing
  parse-remote::expand_refs_wildcard()
  vim syntax: follow recent changes to commit template
  show-ref: fix --verify --hash=length
  show-ref: fix --quiet --verify
  avoid accessing _all_ loose refs in git-show-ref --verify
  git-fetch: Avoid reading packed refs over and over again
  Teach show-branch how to show ref-log data.
  markup fix in svnimport documentation.
  Documentation: new option -P for git-svnimport
  Fix mis-mark-up in git-merge-file.txt documentation
  ...

17 years agoIntroduce GIT_TEMPLATE_DIR
Johannes Schindelin [Tue, 19 Dec 2006 08:18:09 +0000 (09:18 +0100)]
Introduce GIT_TEMPLATE_DIR

Instead of passing --template explicitely to init-db and clone, you can
just set the environment variable GIT_TEMPLATE_DIR.

Also make use of it in the tests, to make sure that the templates are
copied.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRevert "fix testsuite: make sure they use templates freshly built from the source"
Junio C Hamano [Tue, 19 Dec 2006 09:14:35 +0000 (01:14 -0800)]
Revert "fix testsuite: make sure they use templates freshly built from the source"

This reverts commit 74d20040cafdced657efbf49795183d209a3a07b.
Version from Johannes to introduce GIT_TEMPLATE_DIR is simpler,
although I unconsciously stayed away from introducing yet another
environment variable.

17 years agogit-add --interactive: hunk splitting
Junio C Hamano [Tue, 12 Dec 2006 01:09:26 +0000 (17:09 -0800)]
git-add --interactive: hunk splitting

This adds hunk splitting and recounting the patch lines.  The
'patch' subcommand now allows you to split a large hunk at
context lines in the middle.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-add --interactive
Junio C Hamano [Mon, 11 Dec 2006 04:55:50 +0000 (20:55 -0800)]
git-add --interactive

A script to be driven when the user says "git add --interactive"
is introduced.

When it is run, first it runs its internal 'status' command to
show the current status, and then goes into its internactive
command loop.

The command loop shows the list of subcommands available, and
gives a prompt "What now> ".  In general, when the prompt ends
with a single '>', you can pick only one of the choices given
and type return, like this:

    *** Commands ***
      1: status       2: update       3: revert       4: add untracked
      5: patch        6: diff         7: quit         8: help
    What now> 1

You also could say "s" or "sta" or "status" above as long as the
choice is unique.

The main command loop has 6 subcommands (plus help and quit).

 * 'status' shows the change between HEAD and index (i.e. what
   will be committed if you say "git commit"), and between index
   and working tree files (i.e. what you could stage further
   before "git commit" using "git-add") for each path.  A sample
   output looks like this:

              staged     unstaged path
     1:       binary      nothing foo.png
     2:     +403/-35        +1/-1 git-add--interactive.perl

   It shows that foo.png has differences from HEAD (but that is
   binary so line count cannot be shown) and there is no
   difference between indexed copy and the working tree
   version (if the working tree version were also different,
   'binary' would have been shown in place of 'nothing').  The
   other file, git-add--interactive.perl, has 403 lines added
   and 35 lines deleted if you commit what is in the index, but
   working tree file has further modifications (one addition and
   one deletion).

 * 'update' shows the status information and gives prompt
   "Update>>".  When the prompt ends with double '>>', you can
   make more than one selection, concatenated with whitespace or
   comma.  Also you can say ranges.  E.g. "2-5 7,9" to choose
   2,3,4,5,7,9 from the list.  You can say '*' to choose
   everything.

   What you chose are then highlighted with '*', like this:

              staged     unstaged path
     1:       binary      nothing foo.png
   * 2:     +403/-35        +1/-1 git-add--interactive.perl

   To remove selection, prefix the input with - like this:

        Update>> -2

   After making the selection, answer with an empty line to
   stage the contents of working tree files for selected paths
   in the index.

 * 'revert' has a very similar UI to 'update', and the staged
   information for selected paths are reverted to that of the
   HEAD version.  Reverting new paths makes them untracked.

 * 'add untracked' has a very similar UI to 'update' and
   'revert', and lets you add untracked paths to the index.

 * 'patch' lets you choose one path out of 'status' like
   selection.  After choosing the path, it presents diff between
   the index and the working tree file and asks you if you want
   to stage the change of each hunk.  You can say:

        y - add the change from that hunk to index
        n - do not add the change from that hunk to index
        a - add the change from that hunk and all the rest to index
        d - do not the change from that hunk nor any of the rest to index
        j - do not decide on this hunk now, and view the next
            undecided hunk
        J - do not decide on this hunk now, and view the next hunk
        k - do not decide on this hunk now, and view the previous
            undecided hunk
        K - do not decide on this hunk now, and view the previous hunk

   After deciding the fate for all hunks, if there is any hunk
   that was chosen, the index is updated with the selected hunks.

 * 'diff' lets you review what will be committed (i.e. between
   HEAD and index).

This is still rough, but does everything except a few things I
think are needed.

 * 'patch' should be able to allow splitting a hunk into
   multiple hunks.

 * 'patch' does not adjust the line offsets @@ -k,l +m,n @@
   in the hunk header.  This does not have major problem in
   practice, but it _should_ do the adjustment.

 * It does not have any explicit support for a merge in
   progress; it may not work at all.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoblame: -b (blame.blankboundary) and --root (blame.showroot)
Junio C Hamano [Mon, 18 Dec 2006 22:04:38 +0000 (14:04 -0800)]
blame: -b (blame.blankboundary) and --root (blame.showroot)

When blame.blankboundary is set (or -b option is given), commit
object names are blanked out in the "human readable" output
format for boundary commits.

When blame.showroot is not set (or --root is not given), the
root commits are treated as boundary commits.  The code still
attributes the lines to them, but with -b their object names are
not shown.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-branch -d: do not stop at the first failure.
Quy Tonthat [Mon, 18 Dec 2006 22:42:16 +0000 (09:42 +1100)]
git-branch -d: do not stop at the first failure.

If there are more than one branches to be deleted, failure on
one will no longer stop git-branch to process the next ones.
The command still reports failures by exitting non-zero status.

Signed-off-by: Quy Tonthat <qtonthat@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTeach git-branch to delete tracking branches with -r -d
Junio C Hamano [Mon, 18 Dec 2006 07:58:16 +0000 (23:58 -0800)]
Teach git-branch to delete tracking branches with -r -d

Because -r already means "remote" when listing, you can say:

$ git branch -d -r origin/todo origin/html origin/man

I just twisted it not to check fast-forwardness with the current
branch when you are removing a tracking branch.  Most likely,
removal of a tracking branch is not because you are "done with"
it (for a local branch, it usually means "you merged it up"),
but because you are not even interested in it.  In other words,
remote tracking branches are more like tags than branches.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agofix testsuite: make sure they use templates freshly built from the source
Junio C Hamano [Mon, 18 Dec 2006 23:27:43 +0000 (15:27 -0800)]
fix testsuite: make sure they use templates freshly built from the source

The initial t/trash repository for testing was created properly
but over time we gained many tests that create secondary test
repositories with init-db or clone and they were not careful
enough.

This fixes it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agorerere: fix breakage of resolving.
Junio C Hamano [Tue, 19 Dec 2006 00:20:53 +0000 (16:20 -0800)]
rerere: fix breakage of resolving.

commit e2b70087 botched the RCS merge to git-merge-file conversion.
There is no command called "git merge-file" (yes, we are using safer
variant of Perl's system(3)).

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoAdd config example with respect to branch
Aneesh Kumar K.V [Thu, 7 Dec 2006 06:36:55 +0000 (12:06 +0530)]
Add config example with respect to branch

Update config.txt with example with respect to branch
config variable. This give a better idea regarding
how branch names are expected.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoAdd documentation for show-branch --topics
Brian Gernhardt [Mon, 18 Dec 2006 15:48:33 +0000 (10:48 -0500)]
Add documentation for show-branch --topics

Add a quick paragraph explaining the --topics option for show-branch.
The explanation is an abbreviated version of the commit message from
d320a5437f8304cf9ea3ee1898e49d643e005738.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agomake git a bit less cryptic on fetch errors
Nicolas Pitre [Mon, 18 Dec 2006 20:16:58 +0000 (15:16 -0500)]
make git a bit less cryptic on fetch errors

The remote server might not want to tell why it doesn't like us for
security reasons, but let's make the client report such error in a bit
less confusing way.  The remote failure remains a mystery, but the local
message might be a bit less so.

[jc: with a gentle wording updates from Andy Parkins]

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agomake patch_delta() error cases a bit more verbose
Nicolas Pitre [Mon, 18 Dec 2006 21:06:50 +0000 (16:06 -0500)]
make patch_delta() error cases a bit more verbose

It is especially important to distinguish between a malloc() failure
from all the other cases.  An out of memory condition is much less
worrisome than a compatibility/corruption problem.

Also make test-delta compilable again.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoracy-git: documentation updates.
Junio C Hamano [Mon, 18 Dec 2006 22:18:54 +0000 (14:18 -0800)]
racy-git: documentation updates.

We've removed the workaround for runtime penalty that did not
exist in practice some time ago, but the technical paper that
proposed that change still said "we probably should do so".

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoshow-ref: fix --exclude-existing
Junio C Hamano [Mon, 18 Dec 2006 21:33:47 +0000 (13:33 -0800)]
show-ref: fix --exclude-existing

Do not falsely document --filter-invalid which does not even exist.
Also make sure the line is long enough to have ^{} suffix before
checking for it.

Pointed out by Dscho.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoparse-remote::expand_refs_wildcard()
Junio C Hamano [Mon, 18 Dec 2006 20:13:46 +0000 (12:13 -0800)]
parse-remote::expand_refs_wildcard()

Work around dash incompatibility by not using "${name%'^{}'}".

Noticed by Jeff King; dash seems to mistake the closing brace
inside the single quote as the terminating brace for parameter
expansion.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agovim syntax: follow recent changes to commit template
Jeff King [Mon, 18 Dec 2006 07:26:42 +0000 (02:26 -0500)]
vim syntax: follow recent changes to commit template

This patch changes the syntax highlighting to correctly match the new
text of the commit message introduced by
  82dca84871637ac9812c0dec27f56d07cfba524c

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoshow-ref: fix --verify --hash=length
Junio C Hamano [Mon, 18 Dec 2006 03:27:49 +0000 (19:27 -0800)]
show-ref: fix --verify --hash=length

An earlier optimization for --verify broke a lot of stuff
because it did not take interaction with other flags into
account.

This also fixes an unrelated argument parsing error; --hash=8
should mean the same as "--hash --abbrev=8".

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoshow-ref: fix --quiet --verify
Junio C Hamano [Mon, 18 Dec 2006 02:53:24 +0000 (18:53 -0800)]
show-ref: fix --quiet --verify

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'jc/blame-boundary'
Junio C Hamano [Mon, 18 Dec 2006 02:34:51 +0000 (18:34 -0800)]
Merge branch 'jc/blame-boundary'

* jc/blame-boundary:
  git-blame: show lines attributed to boundary commits differently.

17 years agoMerge branch 'jc/reflog' (early part)
Junio C Hamano [Mon, 18 Dec 2006 02:31:24 +0000 (18:31 -0800)]
Merge branch 'jc/reflog' (early part)

* 'jc/reflog' (early part):
  Teach show-branch how to show ref-log data.

17 years agoMerge branch 'js/branch-config'
Junio C Hamano [Mon, 18 Dec 2006 02:27:17 +0000 (18:27 -0800)]
Merge branch 'js/branch-config'

* js/branch-config:
  git-branch: rename config vars branch.<branch>.*, too
  add a function to rename sections in the config

17 years agoMerge branch 'jn/web' (early part)
Junio C Hamano [Mon, 18 Dec 2006 02:27:17 +0000 (18:27 -0800)]
Merge branch 'jn/web' (early part)

* 'jn/web' (early part):
  gitweb: Add "next" link to commit view
  gitweb: Add title attribute to ref marker with full ref name
  gitweb: Do not show difftree for merges in "commit" view
  gitweb: SHA-1 in commit log message links to "object" view
  gitweb: Hyperlink target of symbolic link in "tree" view (if possible)
  gitweb: Add generic git_object subroutine to display object of any type
  gitweb: Show target of symbolic link in "tree" view
  gitweb: Don't use Content-Encoding: header in git_snapshot

17 years agoavoid accessing _all_ loose refs in git-show-ref --verify
Junio C Hamano [Mon, 18 Dec 2006 02:08:52 +0000 (18:08 -0800)]
avoid accessing _all_ loose refs in git-show-ref --verify

If you want to verify a ref, it is overkill to first read all loose refs
into a linked list, and then check if the desired ref is there.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
17 years agogit-fetch: Avoid reading packed refs over and over again
Junio C Hamano [Mon, 18 Dec 2006 01:57:19 +0000 (17:57 -0800)]
git-fetch: Avoid reading packed refs over and over again

When checking which tags to fetch, the old code used to call
git-show-ref --verify for each remote tag. Since reading even
packed refs is not a cheap operation when there are a lot of
local refs, the code became quite slow.

This fixes it by teaching git-show-ref to filter out existing
refs using a new mode of operation of git-show-ref.

Signed-off-by: Junio C Hamano <junkio@cox.net>