Code

git.git
17 years agoMove --pretty options into Documentation/pretty-formats.txt
Chris Riddoch [Tue, 21 Nov 2006 23:49:15 +0000 (16:49 -0700)]
Move --pretty options into Documentation/pretty-formats.txt

Asciidoc-include it into the manuals for programs that use the
--pretty command-line option, for consistency among the docs.

This describes all the pretty-formats currently listed in the cmit_fmt
enum in commit.h, and also briefly describes the presence and format
of the 'Merge: ' line in some pretty formats.

There's a hedge that limiting your view of history can affect what
goes in the Merge: line, and that --abbrev/--no-abbrev do nothing to
the 'raw' format.

Signed-off-by: Chris Riddoch <chris@syntacticsugar.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoStore peeled refs in packed-refs (take 2).
Junio C Hamano [Wed, 22 Nov 2006 07:36:35 +0000 (23:36 -0800)]
Store peeled refs in packed-refs (take 2).

This fixes the previous implementation which failed to optimize
repositories with tons of lightweight tags.  The updated
packed-refs format begins with "# packed-refs with:" line that
lists the kind of extended data the file records.  Currently,
there is only one such extension defined, "peeled".  This stores
the "peeled tag" on a line that immediately follows a line for a
tag object itself in the format "^<sha-1>".

The header line itself and any extended data are ignored by
older implementation, so packed-refs file generated with this
version can still be used by older git.  packed-refs made by
older git can of course be used with this version.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoAdd support to git-branch to show local and remote branches
Andy Parkins [Tue, 21 Nov 2006 19:31:24 +0000 (19:31 +0000)]
Add support to git-branch to show local and remote branches

Instead of storing a list of refnames in append_ref, a list of
structures is created.  Each of these stores the refname and a
symbolic constant representing its type.

The creation of the list is filtered based on a command line
switch; no switch means "local branches only", "-r" means "remote
branches only" (as they always did); but now "-a" means "local
branches or remote branches".

As a side effect, the list is now not global, but allocated in
print_ref_list() where it used.

Also a memory leak is plugged, the memory allocated during the
list creation was never freed.

It lays a groundwork to also display tags, but the command being
'git branch' it is not currently used.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agomerge: allow merging into a yet-to-be-born branch.
Junio C Hamano [Wed, 22 Nov 2006 05:13:28 +0000 (21:13 -0800)]
merge: allow merging into a yet-to-be-born branch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-merge: make it usable as the first class UI
Junio C Hamano [Mon, 20 Nov 2006 09:06:09 +0000 (01:06 -0800)]
git-merge: make it usable as the first class UI

This teaches the oft-requested syntax

git merge $commit

to implement merging the named commit to the current branch.
This hopefully would make "git merge" usable as the first class
UI instead of being a mere backend for "git pull".

Most notably, $commit above can be any committish, so you can
say for example:

git merge js/shortlog~2

to merge early part of a topic branch without merging the rest
of it.

A custom merge message can be given with the new --message=<msg>
parameter.  The message is prepended in front of the usual
"Merge ..." message autogenerated with fmt-merge-message.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoremove merge-recursive-old
Junio C Hamano [Mon, 20 Nov 2006 08:49:31 +0000 (00:49 -0800)]
remove merge-recursive-old

This frees the Porcelain-ish that comes with the core Python-free.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoImprove git-prune -n output
Andy Parkins [Thu, 2 Nov 2006 11:12:26 +0000 (12:12 +0100)]
Improve git-prune -n output

prune_object() in show_only mode would previously just show the path to the
object that would be deleted.  The path the object is stored in shouldn't be
shown to users, they only know about sha1 identifiers so show that instead.

Further, the sha1 alone isn't that useful for examining what is going to be
deleted.  This patch also adds the object type to the output, which makes it
easy to pick out, say, the commits and use git-show to display them.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDoc: Make comment about merging in tutorial.txt more clear
Paolo Ciarrocchi [Mon, 20 Nov 2006 20:29:41 +0000 (21:29 +0100)]
Doc: Make comment about merging in tutorial.txt more clear

Rephrased a sentence in order to make more clear the concept of
pull . branch

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoarchive: use setvbuf() instead of setlinebuf()
Michal Rokos [Tue, 21 Nov 2006 22:19:28 +0000 (23:19 +0100)]
archive: use setvbuf() instead of setlinebuf()

This tiny patch makes GIT compile again on HP-UX 11i.

[jc: The setlinebuf() is described as unportable to BSD before
 4.2; it's not even in POSIX, while setvbuf() is in ISO C.]

Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Finish restoring "blob" links in git_difftree_body
Jakub Narebski [Sun, 19 Nov 2006 21:51:39 +0000 (22:51 +0100)]
gitweb: Finish restoring "blob" links in git_difftree_body

This finishes work started by commit 4777b0141a4812177390da4b6ebc9d40ac3da4b5
  "gitweb: Restore object-named links in item lists"
by Petr Baudis. It brings back rest of "blob" links in difftree-raw
like part of "commit" and "commitdiff" views, namely in
git_difftree_body subroutine.

Now the td.link table cell has the following links:
 * link to diff ("blobdiff" view) in "commit" view, if applicable
   (there is no link to uninteresting creation/deletion diff), or
   link to patch anchor in "commitdiff" view.
 * link to current version of file ("blob" view), with the obvious
   exception of file deletion, where it is link to the parent
   version.
 * link to "blame" view, if it is enabled, and file was not just
   created (i.e. it has any history).
 * link to history of the file ("history" view), again with sole
   exception of the case of new file.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Refactor feed generation, make output prettier, add Atom feed
Jakub Narebski [Sun, 19 Nov 2006 14:05:22 +0000 (15:05 +0100)]
gitweb: Refactor feed generation, make output prettier, add Atom feed

Add support for more modern Atom web feed format. Both RSS and Atom
feeds are generated by git_feed subroutine to avoid code duplication;
git_rss and git_atom are thin wrappers around git_feed. Add links to
Atom feed in HTML header and in page footer (but not in OPML; we
should use APP, Atom Publishing Proptocol instead).

Allow for feed generation for branches other than current (HEAD)
branch, and for generation of feeds for file or directory history.

Do not use "pre ${\sub_returning_scalar(...)} post" trick, but join
strings instead: "pre " . sub_returning_scalar(...) . " post".
Use href(-full=>1, ...) instead of hand-crafting gitweb urls.

Make output prettier:
* Use title similar to the title of web page
* Use project description (if exists) for description/subtitle
* Do not add anything (committer name, commit date) to feed entry title
* Wrap the commit message in <pre>
* Make file names into an unordered list
* Add links (diff, conditional blame, history) to the file list.

In addition to the above points, the attached patch emits a
Last-Changed: HTTP response header field, and doesn't compute the feed
body if the HTTP request type was HEAD. This helps keep the web server
load down for well-behaved feed readers that check if the feed needs
updating.

If browser (feed reader) sent Accept: header, and it prefers 'text/xml' type
to 'application/rss+xml' (in the case of RSS feed) or 'application/atom+xml'
(in the case of Atom feed), then use 'text/xml' as content type.

Both RSS and Atom feeds validate at http://feedvalidator.org
and at http://validator.w3.org/feed/

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Andreas Fuchs <asf@boinkor.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Add an option to href() to return full URL
Jakub Narebski [Sun, 19 Nov 2006 14:05:21 +0000 (15:05 +0100)]
gitweb: Add an option to href() to return full URL

href subroutine by default generates absolute URL (generated using
CGI::url(-absolute=>1), and saved in $my_uri) using $my_uri as base;
add an option to generate full URL using $my_url as base.

New feature usage: href(..., -full=>1)

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: New improved formatting of chunk header in diff
Jakub Narebski [Sat, 18 Nov 2006 22:35:40 +0000 (23:35 +0100)]
gitweb: New improved formatting of chunk header in diff

If we have provided enough info, and diff is not combined diff,
and if provided diff line is chunk header, then:
* split chunk header into .chunk_info and .section span elements,
  first containing proper chunk header, second section heading
  (aka. which function), for separate styling: the proper chunk
  header is on non-white background, section heading part uses
  slightly lighter color.
* hyperlink from-file-range to starting line of from-file, if file
  was not created.
* hyperlink to-file-range to starting line of to-file, if file
  was not deleted.
Links are of invisible variety (and "list" class).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Default to $hash_base or HEAD for $hash in "commit" and "commitdiff"
Jakub Narebski [Sat, 18 Nov 2006 22:35:41 +0000 (23:35 +0100)]
gitweb: Default to $hash_base or HEAD for $hash in "commit" and "commitdiff"

Set $hash parameter to $hash_base || "HEAD" if it is not set (if it is
not true to be more exact). This allows [hand-edited] URLs with 'action'
"commit" or "commitdiff" but without 'hash' parameter.

If there is 'h' (hash) parameter provided, then gitweb tries
to use this. HEAD is used _only_ if nether hash, nor hash_base
are provided, i.e. for URL like below
  URL?p=project.git;a=commit
i.e. without neither 'h' nor 'hb'.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Buffer diff header to deal with split patches + git_patchset_body refactoring
Jakub Narebski [Sat, 18 Nov 2006 22:35:39 +0000 (23:35 +0100)]
gitweb: Buffer diff header to deal with split patches + git_patchset_body refactoring

There are some cases when one line from "raw" git-diff output (raw format)
corresponds to more than one patch in the patchset git-diff output. To deal
with this buffer git diff header and extended diff header (everything up to
actual patch) to check from information from "index <hash>..<hash>" extended
header line if the patch corresponds to the same or next difftree raw line.

This could also be used to gather information needed for hyperlinking, and
used for printing gitweb quoted filenames, from extended diff header instead
of raw git-diff output.

While at it, refactor git_patchset_body subroutine from the event-driven,
AWK-like state-machine parsing to sequential parsing: for each patch
parse (and output) git diff header, parse extended diff header, parse two-line
from-file/to-file diff header, parse patch itself; patch ends with the end
of input [file] or the line matching m/^diff /.

For better understanding the code, there were added assertions in the
comments a la Carp::Assert module. Just in case there is commented out code
dealing with unexpected end of input (should not happen, hence commented
out).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Protect against possible warning in git_commitdiff
Jakub Narebski [Sat, 18 Nov 2006 22:35:38 +0000 (23:35 +0100)]
gitweb: Protect against possible warning in git_commitdiff

We may read an undef from <$fd> and unconditionally chomping it
would result in a warning.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agobuiltin git-shortlog is broken
Nicolas Pitre [Tue, 21 Nov 2006 20:49:45 +0000 (15:49 -0500)]
builtin git-shortlog is broken

Another small patch to fix the output result to be conform with the
perl version.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoshortlog: fix "-n"
Johannes Schindelin [Tue, 21 Nov 2006 20:12:06 +0000 (21:12 +0100)]
shortlog: fix "-n"

Since it is now a builtin optionally taking a range, we have to parse
the options before the rev machinery, to be able to shadow the short
hand "-n" for "--max-count".

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTeach SubmittingPatches about git-commit -s
Paolo Ciarrocchi [Tue, 21 Nov 2006 18:55:20 +0000 (19:55 +0100)]
Teach SubmittingPatches about git-commit -s

As discussed on git mailing list let's teach the reader about
the possiblity to have automatically signed off the commit running
the git-commit -s command

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoshortlog: handle email addresses case-insensitively
Johannes Schindelin [Sun, 19 Nov 2006 16:29:14 +0000 (17:29 +0100)]
shortlog: handle email addresses case-insensitively

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoshortlog: read mailmap from ./.mailmap again
Johannes Schindelin [Sun, 19 Nov 2006 16:28:51 +0000 (17:28 +0100)]
shortlog: read mailmap from ./.mailmap again

While at it, remove the linux specific mailmap into
contrib/mailmap.linux.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoshortlog: do not crash on parsing "[PATCH"
Johannes Schindelin [Sun, 19 Nov 2006 16:28:25 +0000 (17:28 +0100)]
shortlog: do not crash on parsing "[PATCH"

Annoyingly, it looked for the closing bracket in the author name
instead of in the message, and then accessed the NULL pointer.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoBuild in shortlog
Johannes Schindelin [Sun, 22 Oct 2006 11:23:31 +0000 (13:23 +0200)]
Build in shortlog

[jc: with minimum squelching of compiler warning under "-pedantic"
 compilation options.]

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoStore peeled refs in packed-refs file.
Junio C Hamano [Sun, 19 Nov 2006 21:22:44 +0000 (13:22 -0800)]
Store peeled refs in packed-refs file.

This would speed up "show-ref -d" in a repository with mostly
packed tags.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agodo_for_each_ref: perform the same sanity check for leftovers.
Junio C Hamano [Sun, 19 Nov 2006 06:13:33 +0000 (22:13 -0800)]
do_for_each_ref: perform the same sanity check for leftovers.

An earlier commit b37a562a added a check to see if the ref
points at a valid object (as a part of 'negative ref' support
which we currently do not use), but did so only while iterating
over both packed and loose refs, and forgot to apply the same
check while iterating over the remaining ones.

We might want to replace the "if null then omit it" check with
"eh --- what business does a 0{40} value have here?" complaint
later since we currently do not use negative refs, but that is
a separate issue.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-fetch: follow lightweit tags as well.
Junio C Hamano [Sun, 19 Nov 2006 05:39:17 +0000 (21:39 -0800)]
git-fetch: follow lightweit tags as well.

This side-ports commit fd19f620 from Cogito, in which I fixed
exactly the same bug.  Somehow nobody noticed this for a long
time in git.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDocumentation: Correct alternates documentation, document http-alternates
Petr Baudis [Sat, 18 Nov 2006 23:30:15 +0000 (00:30 +0100)]
Documentation: Correct alternates documentation, document http-alternates

For one, the documentation invalidly claimed that the paths have to be
absolute when that's not the case and in fact there is a very valid reason
not to use absolute paths (documented the reason as well).

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDocumentation: Define symref and update HEAD description
Petr Baudis [Sat, 18 Nov 2006 19:44:08 +0000 (20:44 +0100)]
Documentation: Define symref and update HEAD description

HEAD was still described as a symlink instead of a symref.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDocument git-runstatus
Rene Scharfe [Sat, 18 Nov 2006 14:15:49 +0000 (15:15 +0100)]
Document git-runstatus

I copied most of the text from git-status.txt.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-apply: slightly clean up bitfield usage
Rene Scharfe [Sat, 18 Nov 2006 12:07:09 +0000 (13:07 +0100)]
git-apply: slightly clean up bitfield usage

This patch fixes a sparse warning about inaccurate_eof being a
"dubious one-bit signed bitfield", makes three more binary
variables members of this (now unsigned) bitfield and adds a
short comment to indicate the nature of two ternary variables.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agosparse fix: Using plain integer as NULL pointer
Rene Scharfe [Sat, 18 Nov 2006 12:06:56 +0000 (13:06 +0100)]
sparse fix: Using plain integer as NULL pointer

Z_NULL is defined as 0, use a proper NULL pointer in its stead.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agosparse fix: non-ANSI function declaration
Rene Scharfe [Sat, 18 Nov 2006 12:07:06 +0000 (13:07 +0100)]
sparse fix: non-ANSI function declaration

The declaration of discard_cache() in cache.h already has its "void".

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-apply: Documentation typo fix
Petr Baudis [Sat, 18 Nov 2006 05:05:11 +0000 (06:05 +0100)]
git-apply: Documentation typo fix

inacurate -> inaccurate, sorry if it was a pun. ;-)

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoFix git-for-each-refs broken for tags
Petr Baudis [Sat, 18 Nov 2006 02:56:52 +0000 (03:56 +0100)]
Fix git-for-each-refs broken for tags

Unfortunately, git-for-each-refs is currently unusable for peeking into tag
comments, since it uses freed pointers, so it just prints out all sort of
garbage.

This makes it strdup() contents and body values.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agopack-objects: tweak "do not even attempt delta" heuristics
Junio C Hamano [Wed, 15 Nov 2006 06:18:31 +0000 (22:18 -0800)]
pack-objects: tweak "do not even attempt delta" heuristics

The heuristics to give up deltification when both the source and the
target are both in the same pack affects negatively when we are
repacking the subset of objects in the existing pack.  This caused
any incremental updates to use suboptimal packs.  Tweak the heuristics
to avoid this problem.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years ago"git fmt-merge-msg" SIGSEGV
Linus Torvalds [Fri, 17 Nov 2006 06:57:20 +0000 (22:57 -0800)]
"git fmt-merge-msg" SIGSEGV

Ok, this is a _really_ stupid case, and I don't think it matters, but hey,
we should never SIGSEGV.

Steps to reproduce:

mkdir duh
cd duh
git init-db
git-fmt-merge-msg < /dev/null

will cause a SIGSEGV in cmd_fmt_merge_msg(), because we're doing a
strncmp() with a NULL current_branch.

And yeah, it's an insane schenario, and no, it doesn't really matter. The
only reason I noticed was that a broken version of my "git pull" into an
empty directory would cause this.

This silly patch just replaces the SIGSEGV with a controlled exit with an
error message.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-pull: allow pulling into an empty repository
Linus Torvalds [Thu, 16 Nov 2006 19:47:22 +0000 (11:47 -0800)]
git-pull: allow pulling into an empty repository

We used to complain that we cannot merge anything we fetched
with a local branch that does not exist yet.  Just treat the
case as a natural extension of fast forwarding and make the
local branch'es tip point at the same commit we just fetched.
After all an empty repository without an initial commit is an
ancestor of any commit.

[jc: I added a trivial test.  We've become sloppy but we should
 stick to the discipline of covering new behaviour with new
 tests. ]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoconvert-objects: set _XOPEN_SOURCE to 600
Junio C Hamano [Wed, 15 Nov 2006 22:57:47 +0000 (14:57 -0800)]
convert-objects: set _XOPEN_SOURCE to 600

Otherwise OpenBSD header files drop S_ISLNK() definition which is used in
an inline defined in cache.h

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRun "git repack -a -d" once more at end, if there's 1MB or more of not-packed data.
Jim Meyering [Wed, 15 Nov 2006 20:15:44 +0000 (21:15 +0100)]
Run "git repack -a -d" once more at end, if there's 1MB or more of not-packed data.

Although I converted upstream coreutils to git last month, I just
reconverted coreutils once again, as a test, and ended up with a
git repository of about 130MB (contrast with my packed git repo of
size 52MB).  That was because there were a lot of commits (but < 1024)
after the final automatic "git-repack -a -d".

Running a final
  git-repack -a -d && git-prune-packed
cut the final repository size down to the expected size.

So this looks like an easy way to improve git-cvsimport.
Just run "git repack ..." at the end if there's more than
some reasonable amount of not-packed data.

My choice of 1MB is a little arbitrarily.  I wouldn't mind missing
the minimal repo size by 1MB.  At the other end of the spectrum,
it's probably not worthwhile to pack everything when the total
repository size is less than 1MB.

Here's the patch:

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Put back shortlog instead of graphiclog in the project list.
Alexandre Julliard [Wed, 15 Nov 2006 20:37:50 +0000 (21:37 +0100)]
gitweb: Put back shortlog instead of graphiclog in the project list.

Looks like a repo.or.cz-specific change slipped in.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-checkout: allow pathspec to recover lost working tree directory
Junio C Hamano [Wed, 15 Nov 2006 18:54:10 +0000 (10:54 -0800)]
git-checkout: allow pathspec to recover lost working tree directory

It is often wanted on the #git channel that this were to work to
recover removed directory:

rm -fr Documentation
git checkout -- Documentation
git checkout HEAD -- Documentation ;# alternatively

Now it does.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-checkout: do not allow -f and -m at the same time.
Junio C Hamano [Wed, 15 Nov 2006 18:46:10 +0000 (10:46 -0800)]
git-checkout: do not allow -f and -m at the same time.

Instead of silently ignoring one over the other, complain on
this incompatible combination.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoSeek back to current filepos when mmap()ing with NO_MMAP
Johannes Schindelin [Wed, 15 Nov 2006 16:27:54 +0000 (17:27 +0100)]
Seek back to current filepos when mmap()ing with NO_MMAP

"git-index-pack --fix-thin" relies on mmap() not changing the current
file position (otherwise the pack will be corrupted when writing the
final SHA1). Meet that expectation.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoapply --numstat: mark binary diffstat with - -, not 0 0
Junio C Hamano [Wed, 15 Nov 2006 06:23:18 +0000 (22:23 -0800)]
apply --numstat: mark binary diffstat with - -, not 0 0

We do not even know number of lines so showing it as 0 0 is
lying.  This would also help Porcelains like cvsexportcommit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoGIT 1.4.4 v1.4.4
Junio C Hamano [Wed, 15 Nov 2006 06:11:26 +0000 (22:11 -0800)]
GIT 1.4.4

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Junio C Hamano [Mon, 13 Nov 2006 22:30:39 +0000 (14:30 -0800)]
Merge branch 'maint'

* maint:
  Rework cvsexportcommit to handle binary files for all cases.
  Catch errors when writing an index that contains invalid objects.
  test-lib.sh: A command dying due to a signal is an unexpected failure.
  git-update-index(1): fix use of quoting in section title

17 years agoRework cvsexportcommit to handle binary files for all cases.
Robin Rosenberg [Sun, 12 Nov 2006 15:29:42 +0000 (16:29 +0100)]
Rework cvsexportcommit to handle binary files for all cases.

Also adds test cases for adding removing and deleting
binary and text files plus two tests for the checks on
binary files.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoCatch errors when writing an index that contains invalid objects.
Johannes Sixt [Mon, 13 Nov 2006 13:50:00 +0000 (13:50 +0000)]
Catch errors when writing an index that contains invalid objects.

If git-write-index is called without --missing-ok, it reports invalid
objects that it finds in the index. But without this patch it dies
right away or may run into an infinite loop.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agotest-lib.sh: A command dying due to a signal is an unexpected failure.
Johannes Sixt [Mon, 13 Nov 2006 13:50:04 +0000 (13:50 +0000)]
test-lib.sh: A command dying due to a signal is an unexpected failure.

When test_expect_failure detects that a command failed, it still has to
treat a program that crashed from a signal as unexpected failure.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-update-index(1): fix use of quoting in section title
Jonas Fonseca [Sun, 12 Nov 2006 21:28:43 +0000 (22:28 +0100)]
git-update-index(1): fix use of quoting in section title

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoGIT 1.4.4-rc2 v1.4.4-rc2
Junio C Hamano [Sun, 12 Nov 2006 02:22:31 +0000 (18:22 -0800)]
GIT 1.4.4-rc2

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Junio C Hamano [Sun, 12 Nov 2006 02:30:31 +0000 (18:30 -0800)]
Merge branch 'maint'

* maint:
  git-cvsserver: read from git with -z to get non-ASCII pathnames.

17 years agogit-cvsserver: read from git with -z to get non-ASCII pathnames. v1.4.3.5
Junio C Hamano [Fri, 10 Nov 2006 19:53:41 +0000 (11:53 -0800)]
git-cvsserver: read from git with -z to get non-ASCII pathnames.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Junio C Hamano [Sat, 11 Nov 2006 22:49:25 +0000 (14:49 -0800)]
Merge branch 'maint'

* maint:
  path-list: fix path-list-insert return value

17 years agopath-list: fix path-list-insert return value
Junio C Hamano [Sat, 11 Nov 2006 22:45:35 +0000 (14:45 -0800)]
path-list: fix path-list-insert return value

When path-list-insert is called on an existing path, it returned an
unrelated element in the list.  Luckily most of the callers are
ignoring the return value, but merge-recursive uses it at three places
and this would have resulted in a bogus rename detection.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-annotate: fix -S on graft file with comments.
Junio C Hamano [Fri, 10 Nov 2006 21:39:01 +0000 (13:39 -0800)]
git-annotate: fix -S on graft file with comments.

The graft file can contain comment lines and read_graft_line can
return NULL for such an input, which should be skipped by the
reader.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-annotate: no need to exec blame; it is built-in now.
Junio C Hamano [Fri, 10 Nov 2006 21:36:44 +0000 (13:36 -0800)]
git-annotate: no need to exec blame; it is built-in now.

17 years agoMerge branch 'maint'
Junio C Hamano [Thu, 9 Nov 2006 23:08:19 +0000 (15:08 -0800)]
Merge branch 'maint'

* maint:
  git-rebase: Use --ignore-if-in-upstream option when executing git-format-patch.
  git-svn: fix dcommit losing changes when out-of-date from svn
  git-svn: don't die on rebuild when --upgrade is specified
  git-svn: avoid printing filenames of files we're not tracking

17 years agogit-rebase: Use --ignore-if-in-upstream option when executing git-format-patch.
Robert Shearman [Tue, 3 Oct 2006 16:29:26 +0000 (17:29 +0100)]
git-rebase: Use --ignore-if-in-upstream option when executing git-format-patch.

This reduces the number of conflicts when rebasing after a series of
patches to the same piece of code is committed upstream.

Signed-off-by: Robert Shearman <rob@codeweavers.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDocumentation: move blame examples
Junio C Hamano [Thu, 9 Nov 2006 18:44:56 +0000 (10:44 -0800)]
Documentation: move blame examples

This moves the example to specify a line range with regexps to
a later part of the manual page that has similar examples.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Junio C Hamano [Thu, 9 Nov 2006 17:40:59 +0000 (09:40 -0800)]
Merge branch 'maint'

* maint:
  Nicer error messages in case saving an object to db goes wrong

17 years agogit-svn: fix dcommit losing changes when out-of-date from svn
Eric Wong [Thu, 9 Nov 2006 09:19:37 +0000 (01:19 -0800)]
git-svn: fix dcommit losing changes when out-of-date from svn

There was a bug in dcommit (and commit-diff) which caused deltas
to be generated against the latest version of the changed file
in a repository, and not the revision we are diffing (the tree)
against locally.

This bug can cause recent changes to the svn repository to be
silently clobbered by git-svn if our repository is out-of-date.

Thanks to Steven Grimm for noticing the bug.

The (few) people using the commit-diff command are now required
to use the -r/--revision argument.  dcommit usage is unchanged.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-svn: don't die on rebuild when --upgrade is specified
Eric Wong [Sun, 5 Nov 2006 05:51:11 +0000 (21:51 -0800)]
git-svn: don't die on rebuild when --upgrade is specified

--copy-remote and --upgrade are rarely (never?) used together,
so if --copy-remote is specified, that means the user really
wanted to copy the remote ref, and we should fail if that fails.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-svn: avoid printing filenames of files we're not tracking
Eric Wong [Sun, 5 Nov 2006 05:51:10 +0000 (21:51 -0800)]
git-svn: avoid printing filenames of files we're not tracking

This is purely an aesthetic change, we already skip importing of
files that don't affect the subdirectory we import.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoNicer error messages in case saving an object to db goes wrong
Petr Baudis [Thu, 9 Nov 2006 12:52:05 +0000 (13:52 +0100)]
Nicer error messages in case saving an object to db goes wrong

Currently the error e.g. when pushing to a read-only repository is quite
confusing, this attempts to clean it up, unifies error reporting between
various object writers and uses error() on couple more places.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: fix unmatched div in commitdiff
Junio C Hamano [Thu, 9 Nov 2006 10:33:35 +0000 (02:33 -0800)]
gitweb: fix unmatched div in commitdiff

When the last filepair changed only metainfo we failed to close the
extended header <div>.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: protect commit messages from controls.
Junio C Hamano [Thu, 9 Nov 2006 08:57:13 +0000 (00:57 -0800)]
gitweb: protect commit messages from controls.

The same change as the previous.  It is rather sad that commit log
message parser gives list of chomped lines while tag message parser
gives unchomped ones.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: protect blob and diff output lines from controls.
Junio C Hamano [Wed, 8 Nov 2006 23:11:10 +0000 (15:11 -0800)]
gitweb: protect blob and diff output lines from controls.

This revealed that the output from blame and tag was not chomped
properly and was relying on HTML output not noticing that extra
whitespace that resulted from the newline, which was also fixed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-pickaxe: retire pickaxe
Junio C Hamano [Thu, 9 Nov 2006 02:47:54 +0000 (18:47 -0800)]
git-pickaxe: retire pickaxe

Just make it take over blame's place.  Documentation and command
have all stopped mentioning "git-pickaxe".  The built-in synonym
is left in the command table, so you can still say "git pickaxe",
but it probably is a good idea to retire it as well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge git://git.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Wed, 8 Nov 2006 21:43:08 +0000 (13:43 -0800)]
Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
  [PATCH] gitk: Fix nextfile() and add prevfile()

17 years agogit-status: quote LF in its output
Junio C Hamano [Wed, 8 Nov 2006 21:20:46 +0000 (13:20 -0800)]
git-status: quote LF in its output

Otherwise, commit log template would get the remainder of the
filename start on a new line unquoted and the log gets messed
up.

I initially considered using the full quote_c_style(), but the
output from the command is primarily for human consumption so
chose to leave other control characters and bytes with high-bits
unmolested.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: do not give blame link unconditionally in diff-tree view
Junio C Hamano [Wed, 8 Nov 2006 20:22:04 +0000 (12:22 -0800)]
gitweb: do not give blame link unconditionally in diff-tree view

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: New improved patchset view
Jakub Narebski [Wed, 8 Nov 2006 16:59:41 +0000 (17:59 +0100)]
gitweb: New improved patchset view

Replace "gitweb diff header" with its full sha1 of blobs and replace
it by "git diff" header and extended diff header. Change also somewhat
highlighting of diffs.

Added `file_type_long' subroutine to convert file mode in octal to
file type description (only for file modes which used by git).

Changes:
* "gitweb diff header" which looked for example like below:
    file:_<sha1 before>_ -> file:_<sha1 after>_
  where 'file' is file type and '<sha1>' is full sha1 of blob is
  changed to
    diff --git _a/<file before>_ _b/<file after>_
  In both cases links are visible and use default link style. If file
  is added, a/<file> is not hyperlinked. If file is deleted, b/<file>
  is not hyperlinked.
* there is added "extended diff header", with <path> and <hash>
  hyperlinked (and <hash> shortened to 7 characters), and <mode>
  explained: '<mode>' is extended to '<mode> (<file type description>)',
  where added text is slightly lighter to easy distinguish that it
  was added (and it is difference from git-diff output).
* from-file/to-file two-line header lines have slightly darker color
  than removed/added lines.
* chunk header has now delicate line above for easier finding chunk
  boundary, and top margin of 2px, both barely visible.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Use character or octal escape codes (and add span.cntrl) in esc_path
Jakub Narebski [Wed, 8 Nov 2006 10:50:07 +0000 (11:50 +0100)]
gitweb: Use character or octal escape codes (and add span.cntrl) in esc_path

Instead of simply hiding control characters in esc_path by replacing
them with '?', use Character Escape Codes (CEC) i.e. alphabetic
backslash sequences like those found in C programming language and
many other languages influenced by it, such as Java and Perl.  If
control characted doesn't have corresponding character escape code,
use octal char sequence to escape it.

Alternatively, controls can be replaced with Unicode Control
Pictures U+2400 - U+243F (9216 - 9279), the Unicode characters
reserved for representing control characters when it is
necessary to print or display them.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Better git-unquoting and gitweb-quoting of pathnames
Jakub Narebski [Wed, 8 Nov 2006 10:48:56 +0000 (11:48 +0100)]
gitweb: Better git-unquoting and gitweb-quoting of pathnames

Extend unquote subroutine, which unquotes quoted and escaped filenames
which git may return, to deal not only with octal char sequence
quoting, but also quoting ordinary characters including '\"' and '\\'
which are respectively quoted '"' and '\', and to deal also with
C escape sequences including '\t' for TAB and '\n' for LF.

Add esc_path subroutine for gitweb quoting and HTML escaping filenames
(currently it does equivalent of ls' --hide-control-chars, which means
showing undisplayable characters (including '\n' and '\t') as '?'
(question mark) character, and use 'span' element with cntrl CSS class
to help rendering them differently.

Convert gitweb to use esc_path correctly to print pathnames.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: minimally fix "fork" support.
Junio C Hamano [Wed, 8 Nov 2006 06:37:17 +0000 (22:37 -0800)]
gitweb: minimally fix "fork" support.

A forked project is defined to be $projname/$forkname.git for
$projname.git; the code did not check this correctly and mistook
$projname/.git to be a fork of itself.  This minimally fixes the
breakage.

Also forks were not checked when index.aux file was in use.
Listing the forked ones in index.aux would show them also on the
toplevel index which may go against the hierarchical nature of
forks, but again this is a minimal fix to whip it in a better
shape suitable to be in the 'master' branch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: fix disabling of "forks"
Junio C Hamano [Wed, 8 Nov 2006 06:00:45 +0000 (22:00 -0800)]
gitweb: fix disabling of "forks"

Apparently this code was never tested without "forks".  check-feature
returns a one-element list (0) when disabled, and assigning that to a
scalar variable made it to be called in a scalar context, which meant
my $check_forks = gitweb_check_feature("forks") were always 1!

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoGIT 1.4.3-rc1 v1.4.4-rc1
Junio C Hamano [Wed, 8 Nov 2006 00:36:11 +0000 (16:36 -0800)]
GIT 1.4.3-rc1

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Junio C Hamano [Wed, 8 Nov 2006 00:34:30 +0000 (16:34 -0800)]
Merge branch 'maint'

* maint:
  remove an unneeded test

17 years agoMerge branch 'jc/pickaxe'
Junio C Hamano [Wed, 8 Nov 2006 00:33:59 +0000 (16:33 -0800)]
Merge branch 'jc/pickaxe'

17 years agogit-pickaxe: allow "-L <something>,+N"
Junio C Hamano [Wed, 8 Nov 2006 00:20:02 +0000 (16:20 -0800)]
git-pickaxe: allow "-L <something>,+N"

With this,

git pickaxe -L '/--progress/,+20' v1.4.0 -- pack-objects.c

gives you 20 lines starting from the first occurrence of
'--progress' in pack-objects, digging from v1.4.0 version.

You can also say

git pickaxe -L '/--progress/,-5' v1.4.0 -- pack-objects.c

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-pack-objects progress flag documentation and cleanup
Nicolas Pitre [Tue, 7 Nov 2006 15:51:23 +0000 (10:51 -0500)]
git-pack-objects progress flag documentation and cleanup

This adds documentation for --progress and --all-progress, remove a
duplicate --progress handling and make usage string more readable.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoremove an unneeded test
Tero Roponen [Tue, 7 Nov 2006 10:44:33 +0000 (12:44 +0200)]
remove an unneeded test

In wt-status.c there is a test which does nothing.
This patch removes it.

Signed-off-by: Tero Roponen <teanropo@jyu.fi>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'jc/read-tree'
Junio C Hamano [Tue, 7 Nov 2006 23:41:34 +0000 (15:41 -0800)]
Merge branch 'jc/read-tree'

* jc/read-tree:
  t6022: ignoring untracked files by merge-recursive when they do not matter
  merge-recursive: adjust to loosened "working file clobbered" check
  merge-recursive: make a few functions static.
  merge-recursive: use abbreviated commit object name.
  merge: loosen overcautious "working file will be lost" check.

17 years agoMerge branch 'np/index-pack'
Junio C Hamano [Tue, 7 Nov 2006 23:39:56 +0000 (15:39 -0800)]
Merge branch 'np/index-pack'

* np/index-pack:
  remove .keep pack lock files when done with refs update
  have index-pack create .keep file more carefully
  improve fetch-pack's handling of kept packs
  git-fetch can use both --thin and --keep with fetch-pack now
  Teach receive-pack how to keep pack files based on object count.
  Allow pack header preprocessing before unpack-objects/index-pack.
  Remove unused variable in receive-pack.
  Revert "send-pack --keep: do not explode into loose objects on the receiving end."
  missing small substitution
  Teach git-index-pack how to keep a pack file.
  Only repack active packs by skipping over kept packs.
  Allow short pack names to git-pack-objects --unpacked=.
  send-pack --keep: do not explode into loose objects on the receiving end.
  index-pack: minor fixes to comment and function name
  enhance clone and fetch -k experience
  mimic unpack-objects when --stdin is used with index-pack
  add progress status to index-pack
  make index-pack able to complete thin packs.
  enable index-pack streaming capability

17 years agoMerge branch 'maint'
Junio C Hamano [Tue, 7 Nov 2006 06:56:07 +0000 (22:56 -0800)]
Merge branch 'maint'

* maint:
  Documentation: Transplanting branch with git-rebase --onto
  merge-recursive implicitely depends on trust_executable_bit
  adjust_shared_perm: chmod() only when needed.
  Fix git-runstatus for repositories containing a file named HEAD

17 years agogit-pickaxe: -L /regexp/,/regexp/
Junio C Hamano [Tue, 7 Nov 2006 01:08:32 +0000 (17:08 -0800)]
git-pickaxe: -L /regexp/,/regexp/

With this change, you can specify the beginning and the ending
line of the range you wish to inspect with pattern matching.

For example, these are equivalent with the git.git sources:

    git pickaxe -L 7,21                       v1.4.0 -- commit.c
    git pickaxe -L '/^struct sort_node/,/^}/' v1.4.0 -- commit.c
    git pickaxe -L '7,/^}/'                   v1.4.0 -- commit.c
    git pickaxe -L '/^struct sort_node/,21'   v1.4.0 -- commit.c

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDocumentation: Transplanting branch with git-rebase --onto
Jakub Narebski [Mon, 6 Nov 2006 18:12:45 +0000 (19:12 +0100)]
Documentation: Transplanting branch with git-rebase --onto

Added example of transplantig feature branch from one development
branch (for example "next") into the other development branch (for
example "master").

[jc: talking Carl's advice this contains both examples sent to
 the list by Jakub in his original message.]

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDocument git-pack-refs and link it to git(7).
Junio C Hamano [Mon, 6 Nov 2006 08:28:52 +0000 (00:28 -0800)]
Document git-pack-refs and link it to git(7).

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agomerge-recursive implicitely depends on trust_executable_bit
Alex Riesen [Mon, 6 Nov 2006 10:38:52 +0000 (11:38 +0100)]
merge-recursive implicitely depends on trust_executable_bit

Read the configuration in to get core.filemode value for this
particular repository.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoadjust_shared_perm: chmod() only when needed.
Junio C Hamano [Sat, 4 Nov 2006 20:24:05 +0000 (12:24 -0800)]
adjust_shared_perm: chmod() only when needed.

When widening permission for files and directories in a 'shared'
repository for a user with inappropriate umask() setting for
shared work, make sure we call chmod() only when we actually
need to.

The primary idea owes credit to Johannes.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoFix git-runstatus for repositories containing a file named HEAD
Jeff King [Sun, 5 Nov 2006 22:22:15 +0000 (17:22 -0500)]
Fix git-runstatus for repositories containing a file named HEAD

The wt_status_print_updated() and wt_status_print_untracked() routines
call setup_revisions() with 'HEAD' being the reference to the tip of the
current branch. However, setup_revisions() gets confused if the branch
also contains a file named 'HEAD' resulting in a fatal error.

Instead, don't pass an argv to setup_revisions() at all; simply give it no
arguments, and make 'HEAD' the default revision.

Bug noticed by Rocco Rutte <pdmef@gmx.net>.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRemove more sed invocations from within bash completion.
Shawn O. Pearce [Sun, 5 Nov 2006 11:25:25 +0000 (06:25 -0500)]
Remove more sed invocations from within bash completion.

This change removes between 1 and 4 sed invocations per completion
entered by the user.  In the case of cat-file the 4 invocations per
completion can take a while on Cygwin; running these replacements
directly within bash saves some time for the end user.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoSupport bash completion on symmetric difference operator.
Shawn O. Pearce [Sun, 5 Nov 2006 11:24:56 +0000 (06:24 -0500)]
Support bash completion on symmetric difference operator.

Now that log, whatchanged, rev-list, etc. support the symmetric
difference operator '...' we should provide bash completion for it
just like we do for '..'.

While we are at it we can remove two sed invocations during the
interactive prompt and replace them with internal bash operations.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTake --git-dir into consideration during bash completion.
Shawn O. Pearce [Sun, 5 Nov 2006 11:21:57 +0000 (06:21 -0500)]
Take --git-dir into consideration during bash completion.

If the user has setup a command line of "git --git-dir=baz" then
anything we complete must be performed within the scope of "baz"
and not the current working directory.

This is useful with commands such as "git --git-dir=git.git log m"
to complete out "master" and view the log for the master branch of
the git.git repository.  As a nice side effect this also works for
aliases within the target repository, just as git would honor them.

Unfortunately because we still examine arguments by absolute position
in most of the more complex commands (e.g. git push) using --git-dir
with those commands will probably still cause completion to fail.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoBash completion support for remotes in .git/config.
Shawn O. Pearce [Sun, 5 Nov 2006 11:21:03 +0000 (06:21 -0500)]
Bash completion support for remotes in .git/config.

Now that Git natively supports remote specifications within the
config file such as:

[remote "origin"]
url = ...

we should provide bash completion support "out of the box" for
these remotes, just like we do for the .git/remotes directory.

Also cleaned up the __git_aliases expansion to use the same form
of querying and filtering repo-config as this saves two fork/execs
in the middle of a user prompted completion.  Finally also forced
the variable 'word' to be local within __git_aliased_command.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoOnly load .exe suffix'd completions on Cygwin.
Shawn O. Pearce [Sun, 5 Nov 2006 11:20:25 +0000 (06:20 -0500)]
Only load .exe suffix'd completions on Cygwin.

The only platform which actually needs to define .exe suffixes as
part of its completion set is Cygwin.  So don't define them on any
other platform.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoAdded missing completions for show-branch and merge-base.
Shawn O. Pearce [Sun, 5 Nov 2006 11:20:02 +0000 (06:20 -0500)]
Added missing completions for show-branch and merge-base.

The show-branch and merge-base commands were partially supported
when it came to bash completions as they were only specified in
one form another.  Now we specify them in both forms.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-pickaxe: optimize by avoiding repeated read_sha1_file().
Junio C Hamano [Sun, 5 Nov 2006 19:51:41 +0000 (11:51 -0800)]
git-pickaxe: optimize by avoiding repeated read_sha1_file().

It turns out that pickaxe reads the same blob repeatedly while
blame can reuse the blob already read for the parent when
handling a child commit when it's parent's turn to pass its
blame to the grandparent.  Have a cache in the origin structure
to keep the blob there, which will be garbage collected when the
origin loses the last reference to it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-blame: add internal statistics to count read blobs.
Junio C Hamano [Sun, 5 Nov 2006 19:47:53 +0000 (11:47 -0800)]
git-blame: add internal statistics to count read blobs.