Code

git.git
17 years agoMerge branch 'maint'
Junio C Hamano [Thu, 7 Dec 2006 05:53:32 +0000 (21:53 -0800)]
Merge branch 'maint'

* maint:
  cvsserver: Avoid miscounting bytes in Perl v5.8.x

17 years agocvsserver: Avoid miscounting bytes in Perl v5.8.x
Martin Langhoff [Thu, 7 Dec 2006 03:38:50 +0000 (16:38 +1300)]
cvsserver: Avoid miscounting bytes in Perl v5.8.x

At some point between v5.6 and 5.8 Perl started to assume its input,
output and filehandles are UTF-8. This breaks the counting of bytes
for the CVS protocol, resulting in the client expecting less data
than we actually send, and storing truncated files.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agochange the unpack limit treshold to a saner value
Nicolas Pitre [Thu, 7 Dec 2006 04:01:00 +0000 (23:01 -0500)]
change the unpack limit treshold to a saner value

Currently the treshold is 5000.  The likelihood of this value to ever be
crossed for a single push is really small making it not really useful.

The optimal treshold for a pure space saving on a filesystem with 4kb
blocks is 3.  However this is likely to create many small packs
concentrating a large number of files in a single directory compared to
the same objects which are spread over 256 directories when loose.  This
means we would need 512 objects per pack on average to approximagte the
same directory cost (a pack has 2 files because of the index).

But 512 is a really high value just like 5000 since most pushes are
unlikely to have that many objects.  So let's try with a value of 100
which should have a good balance between small pushes going to be
exploded into loose objects and large pushes kept as whole packs.

This is not a replacement for periodic repacks of course.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDocumentation: reorganize cvs-migration.txt
J. Bruce Fields [Thu, 7 Dec 2006 04:18:05 +0000 (23:18 -0500)]
Documentation: reorganize cvs-migration.txt

Modify cvs-migration.txt so it explains first how to develop against a
shared repository, then how to set up a shared repository, then how to
import a repository from cvs.  Though this seems chronologically
backwards, it's still readable in this order, and it puts the more
commonly needed material closer to the front.

Remove the annotate/pickaxe section; perhaps it can find a place elsewhere
in the future.  Remove most of the "why git is better than cvs" stuff from
the introduction.

Add some minor clarifications, including two that have come up several
times on the mailing list:

1. Recommend committing any changes before running pull.
2. Note that changes must be commited before they can be pushed.

Update the clone discussion to reflect the new --use-separate-remotes
default, and add a brief mention of git-cvsserver.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-merge: fix "fix confusion between tag and branch" for real
Junio C Hamano [Wed, 6 Dec 2006 19:22:55 +0000 (11:22 -0800)]
git-merge: fix "fix confusion between tag and branch" for real

An earlier commit 3683dc5a broke the merge message generation with
a careless use of && where it was not needed, breaking the merge
message for cases where non branches are given.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-svn: avoid network timeouts for long-running fetches
Eric Wong [Mon, 4 Dec 2006 08:51:16 +0000 (00:51 -0800)]
git-svn: avoid network timeouts for long-running fetches

Long-running fetches run inside children to avoid memory leaks.
When we refork, the connection in the parent can be idle for a
long time; attempting to reuse it in the next child can result
in timeouts.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Allow PNG, GIF, JPEG images to be displayed in "blob" view
Jakub Narebski [Mon, 4 Dec 2006 22:47:22 +0000 (23:47 +0100)]
gitweb: Allow PNG, GIF, JPEG images to be displayed in "blob" view

Allow images in one of web formats (PNG, GIF, JPEG) - actually files
with mimetype of image/png, image/git, image/jpeg - to be displayed in
"blob" view using <img /> element, instead of using "blob_plain" view
for them, like for all other files except also text/* mimetype files.

This makes possible to easily go to file history, to HEAD version of
the file, to appropriate commit etc; all of those are not available
in "blob_plain" (raw) view.

Only text files can have "blame" view link in the formats part of
navbar.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-merge: squelch needless error message.
Junio C Hamano [Wed, 6 Dec 2006 18:52:04 +0000 (10:52 -0800)]
git-merge: squelch needless error message.

While deciding if the new style command line argument is a tag
or a branch, we checked it with "git show-ref -s --verify" to
see if results in an error, but when it is not a branch, the
check leaked the error message out, which was not needed to be
shown to the end user.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge
Junio C Hamano [Wed, 6 Dec 2006 18:48:08 +0000 (10:48 -0800)]
Merge

17 years agoMerge branch 'maint'
Junio C Hamano [Wed, 6 Dec 2006 18:47:37 +0000 (10:47 -0800)]
Merge branch 'maint'

* maint:
  git-reset to remove "$GIT_DIR/MERGE_MSG"
  unpack-trees: make sure "df_conflict_entry.name" is NUL terminated.

17 years agogit-reset to remove "$GIT_DIR/MERGE_MSG" v1.4.4.2
Junio C Hamano [Tue, 5 Dec 2006 03:44:40 +0000 (19:44 -0800)]
git-reset to remove "$GIT_DIR/MERGE_MSG"

An earlier commit a9cb3c6e changed git-commit to use the
contents of MERGE_MSG even when we do not have MERGE_HEAD (the
rationale is in its log message).

However, the change tricks the following sequence to include a
merge message in a completely unrelated commit:

$ git pull somewhere
: oops, the conflicts are too much.  forget it.
        $ git reset --hard
        : work work work
        $ git commit

To fix this confusion, this patch makes "git reset" to remove
the leftover MERGE_MSG that was prepared when the user abandoned
the merge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Acked-by: Luben Tuikov <ltuikov@yahoo.com
17 years agocvs-migration: improved section titles, better push/commit explanation
J. Bruce Fields [Wed, 6 Dec 2006 17:19:50 +0000 (12:19 -0500)]
cvs-migration: improved section titles, better push/commit explanation

Rename the section titles to make the "how-to" content of the section
obvious.  Also clarify that changes have to be commited before they can
be pushed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agocvs-migration document: make the need for "push" more obvious
Johannes Schindelin [Wed, 6 Dec 2006 12:27:40 +0000 (13:27 +0100)]
cvs-migration document: make the need for "push" more obvious

It really is an important concept to grasp for people coming
from CVS. Even if it is briefly mentioned, it is not obvious
enough to sink in.

[jc: with wording updates from J. Bruce Fields]

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDocument git-diff whitespace flags -b and -w
Jakub Narebski [Sun, 3 Dec 2006 16:24:41 +0000 (17:24 +0100)]
Document git-diff whitespace flags -b and -w

Document git diff options -b / --ignore-space-change and
-w / --ignore-all-space, introduced by Johannes Schindelin
in commit 0d21efa5, "Teach diff about -b and -w flags".

The description of options is taken from GNU diff man page and
GNU Diffutils info documentation.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agodiff -b: ignore whitespace at end of line
Johannes Schindelin [Sun, 3 Dec 2006 18:25:34 +0000 (19:25 +0100)]
diff -b: ignore whitespace at end of line

This is _not_ the same as "treat eol as whitespace", since that would mean
that multiple empty lines would be treated as equal to e.g. a space.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Junio C Hamano [Tue, 5 Dec 2006 00:30:00 +0000 (16:30 -0800)]
Merge branch 'maint'

* maint:
  receive-pack: do not insist on fast-forward outside refs/heads/
  git-mv: search more precisely for source directory in index

Conflicts:

receive-pack.c

17 years agounpack-trees: make sure "df_conflict_entry.name" is NUL terminated.
Junio C Hamano [Mon, 4 Dec 2006 10:11:39 +0000 (02:11 -0800)]
unpack-trees: make sure "df_conflict_entry.name" is NUL terminated.

The structure that ends with a flexible array member (or 0
length array with older GCC) "char name[FLEX_ARRAY]" is
allocated on the stack and we use it after clearing its entire
size with memset.  That does not guarantee that "name" is
properly NUL terminated as we intended on platforms with more
forgiving structure alignment requirements.

Reported breakage on m68k by Roman Zippel.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoreceive-pack: do not insist on fast-forward outside refs/heads/
Junio C Hamano [Mon, 4 Dec 2006 22:24:12 +0000 (14:24 -0800)]
receive-pack: do not insist on fast-forward outside refs/heads/

Especially refs/tags/ hierarchy should match what git-fetch
checks.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-fetch: ignore dereferenced tags in expand_refs_wildcard
Michael Loeffler [Mon, 4 Dec 2006 19:34:34 +0000 (20:34 +0100)]
git-fetch: ignore dereferenced tags in expand_refs_wildcard

There was a little bug in the brace expansion which should remove
the ^{} from the tagname. It used ${name#'^{}'} instead of $(name%'^{}'},
the difference is that '#' will remove the given pattern only from the
beginning of a string and '%' only from the end of a string.

Signed-off-by: Michael Loeffler <zvpunry@zvpunry.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-clone: Rename --use-immingled-remote option to --no-separate-remote
Jakub Narebski [Mon, 4 Dec 2006 13:29:09 +0000 (14:29 +0100)]
git-clone: Rename --use-immingled-remote option to --no-separate-remote

With making --use-separate-remote default when creating non-bare
clone, there was need for the flag which would turn off this behavior.
It was called --use-immingled-remote.

Immingle means to blend, to combine into one, to intermingle, but it
is a bit obscure word. I think it would be better to use simply
--no-separate-remote as the opposite to --use-separate-remote
option to git clone.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Fix Atom feed <logo>: it is $logo, not $logo_url
Jakub Narebski [Mon, 4 Dec 2006 13:09:43 +0000 (14:09 +0100)]
gitweb: Fix Atom feed <logo>: it is $logo, not $logo_url

Fix contents of Atom feed <logo> element; it should be URL
of $logo, not URL pointed by logo link.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMake perl/ build procedure ActiveState friendly.
Alex Riesen [Mon, 4 Dec 2006 09:50:04 +0000 (10:50 +0100)]
Make perl/ build procedure ActiveState friendly.

On Cygwin + ActivateState Perl, Makefile generated with
MakeMaker is not usable because of line-endings and
back-slashes.

This teaches perl/Makefile to write a handcrafted equivalent
perl.mak file with 'make NO_PERL_MAKEMAKER=NoThanks'.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoPass -M to diff in request-pull
David Miller [Mon, 4 Dec 2006 07:17:00 +0000 (23:17 -0800)]
Pass -M to diff in request-pull

Linus recommended this, otherwise any renames cause the
diffstat output to be ridiculous in some circumstances.

Because the corresponding "git-pull" done when the requestee
actually makes pull shows the stat with rename detection
enabled, it makes sense to match what the request message
includes to that output, to make the result easier to verify.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoSet permissions of each new file before "cvs add"ing it.
Jim Meyering [Mon, 4 Dec 2006 07:44:08 +0000 (08:44 +0100)]
Set permissions of each new file before "cvs add"ing it.

Otherwise, an executable script in git would end up being
checked into the CVS repository without the execute bit.

[jc: with an additional test script from Robin Rosenberg.]

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-mv: search more precisely for source directory in index
Johannes Schindelin [Sun, 3 Dec 2006 19:42:47 +0000 (20:42 +0100)]
git-mv: search more precisely for source directory in index

A move of a directory should find the entries in the index by
searching for the name _including_ the slash. Otherwise, the
directory can be shadowed by a file when it matches the prefix
and is lexicographically smaller, e.g. "ab.c" shadows "ab/".

Noticed by Sergey Vlasov.

[jc: added Sergey's original reproduction recipe as a test case
 at the end of t7001.]

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Junio C Hamano [Sun, 3 Dec 2006 01:26:58 +0000 (17:26 -0800)]
Merge branch 'maint'

* maint:
  git-svn: avoid fetching files twice in the same revision

17 years agogit-svn: avoid fetching files twice in the same revision
Eric Wong [Sun, 3 Dec 2006 00:19:31 +0000 (16:19 -0800)]
git-svn: avoid fetching files twice in the same revision

SVN is not entirely consistent in returning log information and
sometimes returns file information when adding subdirectories,
and sometimes it does not (only returning information about the
directory that was added).  This caused git-svn to occasionally
add a file to the list of files to be fetched twice.  Now we
change the data structure to be hash to avoid repeated fetches.

As of now (in master), this only affects repositories fetched
without deltas enabled (file://, and when manually overriden
with GIT_SVN_DELTA_FETCH=0); so this bug mainly affects users of
1.4.4.1 and maint.

Thanks to Florian Weimer for reporting this bug.

[jc: backported for maint]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-merge: fix confusion between tag and branch
Junio C Hamano [Sun, 3 Dec 2006 00:58:30 +0000 (16:58 -0800)]
git-merge: fix confusion between tag and branch

In a repository with core.warnambiguousrefs turned off, and with
a branch and a tag that have the same name 'frotz',

git merge frotz

would merge the commit pointed at by the tag 'frotz' but
incorrectly would identify what was merged as 'branch frotz' in
the merge message.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDe-emphasise the symbolic link documentation.
Andy Parkins [Thu, 30 Nov 2006 10:50:28 +0000 (10:50 +0000)]
De-emphasise the symbolic link documentation.

The fact that git has previously used symbolic links for representing
symbolic refs doesn't seem relevant to the current function of
git-symbolic-ref.  This patch makes less of a big deal about the
symbolic link history and instead focuses on what git does now.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-diff: Introduce --index and deprecate --cached.
Andreas Ericsson [Thu, 30 Nov 2006 11:43:13 +0000 (12:43 +0100)]
git-diff: Introduce --index and deprecate --cached.

'git diff --cached' still works, but its use is discouraged
in the documentation. 'git diff --index' does the same thing
and is consistent with how 'git apply --index' works.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agols-files: Give hints when errors happen.
Andreas Ericsson [Thu, 30 Nov 2006 11:28:28 +0000 (12:28 +0100)]
ls-files: Give hints when errors happen.

Without this patch "git commit file.c file2.c" produces the not
so stellar output:

error: pathspec 'file.c' did not match any.
error: pathspec 'file2.c' did not match any.

With this patch, the output is changed to:

error: pathspec 'file.c' did not match any file(s) known to git.
error: pathspec 'file2.c' did not match any file(s) known to git.
Did you forget to 'git add'?

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agopack-objects: remove redundent status information
Nicolas Pitre [Wed, 29 Nov 2006 22:15:48 +0000 (17:15 -0500)]
pack-objects: remove redundent status information

The final 'nr_result' and 'written' values must always be the same
otherwise we're in deep trouble.  So let's remove a redundent report.

And for paranoia sake let's make sure those two variables are actually
equal after all objects are written (one never knows).

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge master.kernel.org:/pub/scm/gitk/gitk
Junio C Hamano [Wed, 29 Nov 2006 22:24:51 +0000 (14:24 -0800)]
Merge master.kernel.org:/pub/scm/gitk/gitk

* master.kernel.org:/pub/scm/gitk/gitk:
  gitk: Fix enabling/disabling of menu items on Mac OS X

17 years agoMerge branch 'maint'
Junio C Hamano [Wed, 29 Nov 2006 20:16:55 +0000 (12:16 -0800)]
Merge branch 'maint'

* branch 'maint':
  Document git-repo-config --bool/--int options.
  tutorial: talk about user.name early and don't start with commit -a
  git-blame: fix rev parameter handling.

17 years agoDocument git-repo-config --bool/--int options.
Andy Parkins [Wed, 29 Nov 2006 08:25:40 +0000 (08:25 +0000)]
Document git-repo-config --bool/--int options.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agotutorial: talk about user.name early and don't start with commit -a
Junio C Hamano [Wed, 29 Nov 2006 08:17:01 +0000 (00:17 -0800)]
tutorial: talk about user.name early and don't start with commit -a

Introducing yourself to git early would be a good idea; otherwise
the user may not find the mistake until much later when "git log"
is learned.

Teaching "commit -a" without saying that it is a shortcut for
listing the paths to commit leaves the user puzzled.  Teach the
form with explicit paths first.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-blame: fix rev parameter handling.
Alex Riesen [Wed, 15 Nov 2006 21:52:25 +0000 (22:52 +0100)]
git-blame: fix rev parameter handling.

We lacked "--" termination in the underlying init_revisions() call
which made it impossible to specify a revision that happens to
have the same name as an existing file.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'jc/globfetch'
Junio C Hamano [Wed, 29 Nov 2006 07:07:20 +0000 (23:07 -0800)]
Merge branch 'jc/globfetch'

* jc/globfetch:
  fetch-pack: do not barf when duplicate re patterns are given
  git-fetch: allow forcing glob pattern in refspec
  git-fetch: allow glob pattern in refspec
  git-fetch: fix dumb protocol transport to fetch from pack-pruned ref
  git-fetch: reuse ls-remote result.

17 years agoMerge branch 'maint'
Junio C Hamano [Wed, 29 Nov 2006 06:32:41 +0000 (22:32 -0800)]
Merge branch 'maint'

* maint:
  git blame -C: fix output format tweaks when crossing file boundary.

17 years agogit blame -C: fix output format tweaks when crossing file boundary.
Junio C Hamano [Wed, 29 Nov 2006 06:29:18 +0000 (22:29 -0800)]
git blame -C: fix output format tweaks when crossing file boundary.

We used to get the case that more than two paths came from the
same commit wrong when computing the output width and deciding
to turn on --show-name option automatically.  When we find that
lines that came from a path that is different from what we
started digging from, we should always turn --show-name on, and
we should count the name length for all files involved.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-svn: fix multi-init
Eric Wong [Wed, 29 Nov 2006 02:51:42 +0000 (18:51 -0800)]
git-svn: fix multi-init

After the bugfix to connect to repositories where the user has
limited read permissions, multi-init was broken due to our
SVN::Ra connection being limited to working in a subdirectory;
so we now create a new Ra connection for init-ing branches
and another for tags

Along with that fix, allow the user to use the command-line
option flags for multi-init (--revision being the most notable;
but also --no-auth-cache, --config-dir, --username (for passing
to SVN), and --shared/--template for passing to git-init-db

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-svn: documentation updates
Eric Wong [Wed, 29 Nov 2006 02:51:41 +0000 (18:51 -0800)]
git-svn: documentation updates

Eliminate 'commit' from some places and plug 'dcommit' more.
Also update the section --id (GIT_SVN_ID) usage since we
have multi-init/multi-fetch now.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-svn: color support for the log command
Eric Wong [Wed, 29 Nov 2006 02:51:40 +0000 (18:51 -0800)]
git-svn: color support for the log command

 * match LESS environment settings to those in pager.c
 * parse diff.color and pager.color settings in the
   config file, and pass --color to git-log
 * --color and --pager= settings are supported

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoident.c: Trim hint printed when gecos is empty.
Han-Wen Nienhuys [Tue, 28 Nov 2006 10:27:39 +0000 (11:27 +0100)]
ident.c: Trim hint printed when gecos is empty.

Also remove asterisks for readability, and suggest use of
git-config for easy cut & pasting.

Signed-off-by: Han-Wen Nienhuys <hanwen@xs4all.nl>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoFix broken bash completion of local refs.
Shawn O. Pearce [Tue, 28 Nov 2006 17:12:26 +0000 (12:12 -0500)]
Fix broken bash completion of local refs.

Commit 35e65ecc broke completion of local refs, e.g. "git pull . fo<tab>"
no longer would complete to "foo".  Instead it printed out an internal
git error ("fatal: Not a git repository: '.'").

The break occurred when I tried to improve performance by switching from
git-peek-remote to git-for-each-ref.  Apparently git-peek-remote will
drop into directory "$1/.git" (where $1 is its first parameter) if it
is given a repository with a working directory.  This allowed the bash
completion code to work properly even though it was not handing over
the true repository directory.

So now we do a stat in bash to see if we need to add "/.git" to the
path string before running any command with --git-dir.

I also tried to optimize away two "git rev-parse --git-dir" invocations
in common cases like "git log fo<tab>" as typically the user is in the
top level directory of their project and therefore the .git subdirectory
is in the current working directory.  This should make a difference on
systems where fork+exec might take a little while.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTeach bash how to complete long options for git-commit.
Shawn O. Pearce [Tue, 28 Nov 2006 17:12:08 +0000 (12:12 -0500)]
Teach bash how to complete long options for git-commit.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-svn: fix output reporting from the delta fetcher
Eric Wong [Tue, 28 Nov 2006 10:50:17 +0000 (02:50 -0800)]
git-svn: fix output reporting from the delta fetcher

There was nothing printed in the code originally because I left
out a pair of parentheses.  Nevertheless, the affected code has
been replaced with a more efficient version that respects the -q
flag as well as requiring less bandwidth.

We save some bandwidth by not requesting changed paths
information when calling get_log() since we're using the delta
fetcher.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-svn: error out when the SVN connection fails during a fetch
Eric Wong [Tue, 28 Nov 2006 22:06:05 +0000 (14:06 -0800)]
git-svn: error out when the SVN connection fails during a fetch

finish_report does seem to return a useful value indicating success
or failure, so we'll just set a flag when close_edit is called
(it is not called on failures, nor is abort_edit) and check
the flag before proceeding.

Thanks to Pazu for pointing this out.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoshortlog: remove range check
René Scharfe [Tue, 28 Nov 2006 21:49:17 +0000 (22:49 +0100)]
shortlog: remove range check

Don't force the user to specify more than one revision parameter,
thus making git-shortlog behave more like git-log.
'git-shortlog master' will now produce the expected results; the
other end of the range simply is the (oldest) root commit.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-svn: update tests for recent changes
Eric Wong [Tue, 28 Nov 2006 05:46:50 +0000 (21:46 -0800)]
git-svn: update tests for recent changes

* Enable test for delta transfers in full-svn-test.

* Run tests against the root of the repository so we won't have
  to revisit 308906fa6e98132cab839a4f42701386fba368ef and
  efe4631def181d32f932672a7ea31e52ee0ab308 again.
  The graft-branches test still runs as before.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-svn: enable delta transfers during fetches when using SVN:: libs
Eric Wong [Tue, 28 Nov 2006 05:44:48 +0000 (21:44 -0800)]
git-svn: enable delta transfers during fetches when using SVN:: libs

This should drastically reduce bandwidth used for network
transfers.  This is not enabled for file:// repositories by
default because of the increased CPU usage and I/O needed.

GIT_SVN_DELTA_FETCH may be set to a true value to enable or
false (0) to disable delta transfers regardless of the
repository type.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoUse .git/config for storing "origin" shortcut repository
Andy Parkins [Sun, 26 Nov 2006 12:10:52 +0000 (12:10 +0000)]
Use .git/config for storing "origin" shortcut repository

Rather than use a separate config .git/remotes/ for remote shortcuts, this
patch adds the analagous definitions to .git/config using git-repo-config
calls.

For example what was previously .git/remotes/origin
  URL: proto://host/path
  Pull: refs/heads/master:refs/heads/origin
Is now added to .git/config as
  [remote "origin"]
  url = proto://host/path
  fetch = refs/heads/master:refs/heads/origin

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agosha1_object_info(): be consistent with read_sha1_file()
Johannes Schindelin [Mon, 27 Nov 2006 23:18:55 +0000 (00:18 +0100)]
sha1_object_info(): be consistent with read_sha1_file()

We used to try loose objects first with sha1_object_info(), but packed
objects first with read_sha1_file(). Now, prefer packed objects over loose
ones with sha1_object_info(), too.

Usually the old behaviour would pose no problem, but when you tried to fix
a fscked up repository by inserting a known-good pack,

git cat-file $(git cat-file -t <sha1>) <sha1>

could fail, even when

git cat-file blob <sha1>

would _not_ fail. Worse, a repack would fail, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoshortlog: use pager
Johannes Schindelin [Mon, 27 Nov 2006 23:29:21 +0000 (00:29 +0100)]
shortlog: use pager

On request of the kingpenguin, shortlog now uses the pager if output
goes to a tty.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agocvsimport: style fixup.
Junio C Hamano [Mon, 27 Nov 2006 22:21:30 +0000 (14:21 -0800)]
cvsimport: style fixup.

This should not change any functionality, but just makes it readable by
having a space between syntactic construct keyword and open parenthesis
(e.g. "if (expr", not "if(expr") and between close parenthesis and open
brace (e.g. "if (expr) {" not "if (expr){").

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-svn: use ~/.subversion config files when using SVN:: libraries
Eric Wong [Mon, 27 Nov 2006 21:20:53 +0000 (13:20 -0800)]
git-svn: use ~/.subversion config files when using SVN:: libraries

This allows users to use HTTP proxy information (among other settings)
from ~/.subversion/servers and ~/.subversion/config

--config-dir (as before) may be passed to git-svn to override the
default choice of '~/.subversion' for the configuration directory.

Thanks to tko on #git for pointing this out.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTeach bash about git-am/git-apply and their whitespace options.
Shawn O. Pearce [Mon, 27 Nov 2006 20:12:03 +0000 (15:12 -0500)]
Teach bash about git-am/git-apply and their whitespace options.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoCache the list of merge strategies and available commands during load.
Shawn O. Pearce [Mon, 27 Nov 2006 20:11:52 +0000 (15:11 -0500)]
Cache the list of merge strategies and available commands during load.

Since the user's git installation is not likely to grow a new command
or merge strategy in the lifespan of the current shell process we can
save time during completion operations by caching these lists during
sourcing of the completion support.

If the git executable is not available or we run into errors while
caching at load time then we defer these to runtime and generate
the list on the fly.  This might happen if the user doesn't put git
into their PATH until after the completion script gets sourced.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoSupport --strategy=x completion in addition to --strategy x.
Shawn O. Pearce [Mon, 27 Nov 2006 20:10:42 +0000 (15:10 -0500)]
Support --strategy=x completion in addition to --strategy x.

Because git-merge and git-rebase both accept -s, --strategy or --strategy=
we should recognize all three formats in the bash completion functions and
issue back all merge strategies on demand.

I also moved the prior word testing to be before the current word testing,
as the current word cannot be completed with -- if the prior word was an
option which requires a parameter, such as -s or --strategy.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTeach bash about git-repo-config.
Shawn O. Pearce [Mon, 27 Nov 2006 09:44:47 +0000 (04:44 -0500)]
Teach bash about git-repo-config.

This is a really ugly completion script for git-repo-config, but it has
some nice properties.  I've added all of the documented configuration
parameters from Documentation/config.txt to the script, allowing the
user to complete any standard configuration parameter name.

We also have some intelligence for the remote.*.* and branch.*.* keys
by completing not only the key name (e.g. remote.origin) but also the
values (e.g. remote.*.fetch completes to the branches available on the
corresponding remote).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoSupport bash completion of refs/remote.
Shawn O. Pearce [Mon, 27 Nov 2006 08:42:32 +0000 (03:42 -0500)]
Support bash completion of refs/remote.

Now that people are really likely to start using separate remotes
(due to the default in git-clone changing) we should support ref
completion for these refs in as many commands as possible.

While we are working on this routine we should use for-each-ref
to obtain a list of local refs, as this should run faster than
peek-remote as it does not need to dereference tag objects in
order to produce the list of refs back to us.  It should also
be more friendly to users of StGIT as we won't generate a list
of the StGIT metadata refs.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTeach bash about git log/show/whatchanged options.
Shawn O. Pearce [Mon, 27 Nov 2006 08:42:18 +0000 (03:42 -0500)]
Teach bash about git log/show/whatchanged options.

Typing out options to git log/show/whatchanged can take a while, but
we can easily complete them with bash.  So list the most common ones,
especially --pretty=online|short|medium|... so that users don't need
to type everything out.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTeach bash how to complete git-rebase.
Shawn O. Pearce [Mon, 27 Nov 2006 08:42:07 +0000 (03:42 -0500)]
Teach bash how to complete git-rebase.

As git-rebase is a popular command bash should know how to complete
reference names and its long options.  We only support completions
which make sense given the current state of the repository, that
way users don't get shown --continue/--skip/--abort on the first
execution.

Also added support for long option --strategy to git-merge, as I
missed that option earlier and just noticed it while implementing
git-rebase.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTeach bash how to complete git-cherry-pick.
Shawn O. Pearce [Mon, 27 Nov 2006 08:41:59 +0000 (03:41 -0500)]
Teach bash how to complete git-cherry-pick.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTeach bash how to complete git-format-patch.
Shawn O. Pearce [Mon, 27 Nov 2006 08:41:43 +0000 (03:41 -0500)]
Teach bash how to complete git-format-patch.

Provide completion for currently known long options supported by
git-format-patch as well as the revision list specification argument,
which is generally either a refname or in the form a..b.

Since _git_log was the only code that knew how to complete a..b, but
we want to start adding option support to _git_log also refactor the
a..b completion logic out into its own function.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoAdd current branch in PS1 support to git-completion.bash.
Shawn O. Pearce [Mon, 27 Nov 2006 08:41:28 +0000 (03:41 -0500)]
Add current branch in PS1 support to git-completion.bash.

Many users want to display the current branch name of the current git
repository as part of their PS1 prompt, much as their PS1 prompt might
also display the current working directory name.

We don't force our own PS1 onto the user.  Instead we let them craft
their own PS1 string and offer them the function __git_ps1 which they
can invoke to obtain either "" (when not in a git repository) or
"(%s)" where %s is the name of the current branch, as read from HEAD,
with the leading refs/heads/ removed.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTeach bash how to complete options for git-name-rev.
Shawn O. Pearce [Mon, 27 Nov 2006 08:41:12 +0000 (03:41 -0500)]
Teach bash how to complete options for git-name-rev.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoHide plumbing/transport commands from bash completion.
Shawn O. Pearce [Mon, 27 Nov 2006 08:41:01 +0000 (03:41 -0500)]
Hide plumbing/transport commands from bash completion.

Users generally are not going to need to invoke plumbing-level commands
from within one line shell commands.  If they are invoking these commands
then it is likely that they are glueing them together into a shell script
to perform an action, in which case bash completion for these commands is
of relatively little use.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTeach git-completion.bash how to complete git-merge.
Shawn O. Pearce [Mon, 27 Nov 2006 08:40:47 +0000 (03:40 -0500)]
Teach git-completion.bash how to complete git-merge.

Now that git-merge is high-level Porcelain users are going to expect
to be able to use it from the command line, in which case we really
should also be able to complete ref names as parameters.

I'm also including completion support for the merge strategies
that are supported by git-merge.sh, should the user wish to use a
different strategy than their default.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoUpdate documentation to remove incorrect GIT_DIFF_OPTS example.
Sean [Mon, 27 Nov 2006 19:37:43 +0000 (14:37 -0500)]
Update documentation to remove incorrect GIT_DIFF_OPTS example.

Git no longer calls an external diff program to generate patches.
Remove the documentation which suggests that you can pass
arbitrary diff options via the GIT_DIFF_OPTS environment variable.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'js/shortlog'
Junio C Hamano [Mon, 27 Nov 2006 06:51:38 +0000 (22:51 -0800)]
Merge branch 'js/shortlog'

* js/shortlog:
  git-shortlog: make common repository prefix configurable with .mailmap
  git-shortlog: fix common repository prefix abbreviation.
  builtin git-shortlog is broken
  shortlog: fix "-n"
  shortlog: handle email addresses case-insensitively
  shortlog: read mailmap from ./.mailmap again
  shortlog: do not crash on parsing "[PATCH"
  Build in shortlog

18 years agoMerge branch 'jc/push-delete-ref'
Junio C Hamano [Mon, 27 Nov 2006 06:51:17 +0000 (22:51 -0800)]
Merge branch 'jc/push-delete-ref'

* jc/push-delete-ref:
  Allow git push to delete remote ref.

18 years agoMerge branch 'jc/merge'
Junio C Hamano [Mon, 27 Nov 2006 06:19:56 +0000 (22:19 -0800)]
Merge branch 'jc/merge'

* branch 'jc/merge':
  git-merge: do not leak rev-parse output used for checking internally.
  git-merge: tighten error checking.
  merge: allow merging into a yet-to-be-born branch.
  git-merge: make it usable as the first class UI
  remove merge-recursive-old

18 years agogit-merge: do not leak rev-parse output used for checking internally.
Junio C Hamano [Mon, 27 Nov 2006 06:19:42 +0000 (22:19 -0800)]
git-merge: do not leak rev-parse output used for checking internally.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-merge: tighten error checking.
Junio C Hamano [Mon, 27 Nov 2006 06:16:31 +0000 (22:16 -0800)]
git-merge: tighten error checking.

If a branch name to be merged is misspelled, the command leaked error
messages from underlying plumbing commands, which were helpful only
to people who know how the command are implemented to diagnose the
breakage, but simply puzzling and unhelpful for the end users.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'jc/pack-peeled'
Junio C Hamano [Mon, 27 Nov 2006 06:09:41 +0000 (22:09 -0800)]
Merge branch 'jc/pack-peeled'

* jc/pack-peeled:
  Store peeled refs in packed-refs (take 2).
  Store peeled refs in packed-refs file.

18 years agogrep: do not skip unmerged entries when grepping in the working tree.
Junio C Hamano [Sun, 26 Nov 2006 20:47:52 +0000 (12:47 -0800)]
grep: do not skip unmerged entries when grepping in the working tree.

We used to skip unmerged entries, which made sense for grepping
in the cached copies, but not for grepping in the working tree.

Noticed by Johannes Sixt.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-tag: allow empty tag message if -m is given explicitly.
Han-Wen Nienhuys [Sun, 26 Nov 2006 16:42:49 +0000 (17:42 +0100)]
git-tag: allow empty tag message if -m is given explicitly.

Signed-off-by: Han-Wen Nienhuys <hanwen@xs4all.nl>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'jn/web'
Junio C Hamano [Sun, 26 Nov 2006 06:54:45 +0000 (22:54 -0800)]
Merge branch 'jn/web'

* jn/web:
  gitweb: Make project description in projects list link to summary view
  gitweb: Use author_epoch for pubdate in gitweb feeds
  gitweb: Add author and contributor email to Atom feed
  gitweb: Add author and committer email extraction to parse_commit
  gitweb: Use git-show-ref instead of git-peek-remote
  gitweb: Do not use esc_html in esc_path

18 years agoDocumentation: clarify tutorial pull/merge discussion
J. Bruce Fields [Sun, 26 Nov 2006 03:45:02 +0000 (22:45 -0500)]
Documentation: clarify tutorial pull/merge discussion

Attempt to clarify somewhat the difference between pull and merge,
and give a little more details on the pull syntax.

I'm still not happy with this section: the explanation of the origin
branch isn't great, but maybe that should be left alone pending the
use-separate-remotes change; and we need to explain how to set up a
public repository and push to it.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Make project description in projects list link to summary view
Jakub Narebski [Sun, 26 Nov 2006 01:18:26 +0000 (02:18 +0100)]
gitweb: Make project description in projects list link to summary view

Make (shortened) project description in the "projects list" view
hyperlink to the "summary" view of the project. Project names are
sometimes short; having project description be hyperling gives larger
are to click. While at it, display full description on mouseover via
'title' attribute to introduced link.

Additionally, fix whitespace usage in modified git_project_list_body
subroutine: tabs are for indent, spaces are for align.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-svn: allow SVN:: lib users to track the root of the repository (again)
Eric Wong [Sun, 26 Nov 2006 01:38:41 +0000 (17:38 -0800)]
git-svn: allow SVN:: lib users to track the root of the repository (again)

I broke this again in 747fa12cef73b6ca04fffaddaad7326cf546cdea.

Thanks to merlyn for pointing this out to me on IRC.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Use author_epoch for pubdate in gitweb feeds
Jakub Narebski [Sat, 25 Nov 2006 14:54:34 +0000 (15:54 +0100)]
gitweb: Use author_epoch for pubdate in gitweb feeds

Use creation date (author_epoch) instead of former commit date
(committer_epoch) as publish date in gitweb feeds (RSS, Atom).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Add author and contributor email to Atom feed
Jakub Narebski [Sat, 25 Nov 2006 14:54:33 +0000 (15:54 +0100)]
gitweb: Add author and contributor email to Atom feed

Add author email (from 'author_email') and contributor email (from
'committer_email') to items in the Atom format gitweb feed.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Add author and committer email extraction to parse_commit
Jakub Narebski [Sat, 25 Nov 2006 14:54:32 +0000 (15:54 +0100)]
gitweb: Add author and committer email extraction to parse_commit

Extract author email to 'author_email' key, and comitter mail to
'committer_mail' key; uniquify committer and author lines handling
by the way.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Use git-show-ref instead of git-peek-remote
Jakub Narebski [Sat, 25 Nov 2006 10:32:08 +0000 (11:32 +0100)]
gitweb: Use git-show-ref instead of git-peek-remote

Use "git show-ref --dereference" instead of "git peek-remote
$projectroot/project" in git_get_references. git-show-ref is faster
than git-peek-remote (40ms vs 56ms user+sys for git.git repository);
even faster is reading info/refs file (if it exists), but the
information in info/refs can be stale; that and the fact that
info/refs is meant for dumb protocol transports, not for gitweb.

git-show-ref is available since v1.4.4; the output format is slightly
different than git-peek-remote output format, but we accept both.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Do not use esc_html in esc_path
Jakub Narebski [Sat, 25 Nov 2006 08:43:59 +0000 (09:43 +0100)]
gitweb: Do not use esc_html in esc_path

Do not use esc_html in esc_path subroutine to avoid double quoting;
expand esc_html body (except quoting) in esc_path.

Move esc_path before quot_cec and quot_upr. Add some comments.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agofetch-pack: do not barf when duplicate re patterns are given
Junio C Hamano [Sat, 25 Nov 2006 09:33:06 +0000 (01:33 -0800)]
fetch-pack: do not barf when duplicate re patterns are given

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-fetch: allow forcing glob pattern in refspec
Junio C Hamano [Sat, 25 Nov 2006 09:10:10 +0000 (01:10 -0800)]
git-fetch: allow forcing glob pattern in refspec

Building on top of the earlier refspec glob pattern enhancement,
this allows a glob pattern to say the updates should be forced
by prefixing it with '+' as usual, like this:

Pull: +refs/heads/*:refs/remotes/origin/*

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'master' into jc/globfetch
Junio C Hamano [Sat, 25 Nov 2006 09:04:54 +0000 (01:04 -0800)]
Merge branch 'master' into jc/globfetch

This is to pick up the fix made on master:

  git-fetch: exit with non-zero status when fast-forward check fails

18 years agogit-fetch: exit with non-zero status when fast-forward check fails
Junio C Hamano [Sat, 25 Nov 2006 09:04:28 +0000 (01:04 -0800)]
git-fetch: exit with non-zero status when fast-forward check fails

When update_local_ref() refuses to update a branch head due to
fast-forward check, it was not propagated properly in the call
chain and the command did not exit with non-zero status as a
result.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-shortlog: make common repository prefix configurable with .mailmap
Junio C Hamano [Sat, 25 Nov 2006 08:07:54 +0000 (00:07 -0800)]
git-shortlog: make common repository prefix configurable with .mailmap

The code had "/pub/scm/linux/kernel/git/" hardcoded which was
too specific to the kernel project.

With this, a line in the .mailmap file:

# repo-abbrev: /pub/scm/linux/kernel/git/

can be used to cause the substring to be abbreviated to /.../
on the title line of the commit message.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-shortlog: fix common repository prefix abbreviation.
Junio C Hamano [Sat, 25 Nov 2006 08:01:27 +0000 (00:01 -0800)]
git-shortlog: fix common repository prefix abbreviation.

The code to abbreviate the common repository prefix was totally
borked.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-svn: exit with status 1 for test failures
Eric Wong [Sat, 25 Nov 2006 06:38:18 +0000 (22:38 -0800)]
git-svn: exit with status 1 for test failures

Some versions of the SVN libraries cause die() to exit with 255,
and 40cf043389ef4cdf3e56e7c4268d6f302e387fa0 tightened up
test_expect_failure to reject return values >128.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-svn: correctly access repos when only given partial read permissions
Eric Wong [Sat, 25 Nov 2006 06:38:17 +0000 (22:38 -0800)]
git-svn: correctly access repos when only given partial read permissions

Sometimes users are given only read access to a subtree inside a
repository, and git-svn could not read log information (and thus
fetch commits) when connecting a session to the root of the
repository.  We now start an SVN::Ra session with the full URL
of what we're tracking, and not the repository root as before.

This change was made much easier with a cleanup of
repo_path_split() usage as well as improving the accounting of
authentication batons.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-branch -D: make it work even when on a yet-to-be-born branch
Junio C Hamano [Sat, 25 Nov 2006 07:10:23 +0000 (23:10 -0800)]
git-branch -D: make it work even when on a yet-to-be-born branch

This makes "git branch -D other_branch" work even when HEAD
points at a yet-to-be-born branch.

Earlier, we checked the HEAD ref for the purpose of "subset"
check even when the deletion was forced (i.e. not -d but -D).
Because of this, you cannot delete a branch even with -D while
on a yet-to-be-born branch.

With this change, the following sequence that now works:

mkdir newdir && cd newdir
git init-db
git fetch -k $other_repo refs/heads/master:refs/heads/othre
# oops, typo
git branch other othre
git branch -D othre

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoAdd -v and --abbrev options to git-branch
Lars Hjemli [Fri, 24 Nov 2006 13:45:10 +0000 (14:45 +0100)]
Add -v and --abbrev options to git-branch

The new -v option makes git-branch show the abbreviated sha1 + subjectline
for each branch.

Additionally, minimum abbreviation length can be specified with
--abbrev=<length>

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-clone: stop dumb protocol from copying refs outside heads/ and tags/.
Junio C Hamano [Sat, 25 Nov 2006 03:07:24 +0000 (19:07 -0800)]
git-clone: stop dumb protocol from copying refs outside heads/ and tags/.

Most notably, the original code first copied refs/remotes/ that
remote side had to local, and overwrote them by mapping refs/heads/
from the remote when a dumb protocol transport was used.

This makes the clone behaviour by dumb protocol in line with the
git native and rsync transports.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: (style) use chomp without parentheses consistently.
Junio C Hamano [Fri, 24 Nov 2006 22:04:01 +0000 (14:04 -0800)]
gitweb: (style) use chomp without parentheses consistently.

It seems that gitweb tries to consistently use chomp without parentheses
around its operands, but there were two places that said "chomp($var);".

Let's be consistent.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Replace SPC with &nbsp; also in tag comment
Jakub Narebski [Fri, 24 Nov 2006 21:25:50 +0000 (22:25 +0100)]
gitweb: Replace SPC with &nbsp; also in tag comment

Commit messages had SPC replaced with &nbsp; entity;
make it so also in tag message (tag comment).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>