gitweb.git
t5510: start tracking-ref tests from a known stateJeff King Sat, 11 May 2013 16:14:03 +0000 (18:14 +0200)

t5510: start tracking-ref tests from a known state

We have three sequential tests for for whether tracking refs
are updated by various fetches and pulls; the first two
should not update the ref, and the third should. Each test
depends on the state left by the test before.

This is fragile (a failing early test will confuse later
tests), and means we cannot add more "should update" tests
after the third one.

Let's instead save the initial state before these tests, and
then reset to a known state before running each test.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-bzr: do not use unportable sed '\+'Torsten Bögershausen Sat, 11 May 2013 13:25:52 +0000 (15:25 +0200)

test-bzr: do not use unportable sed '\+'

Using sed -e '/[0-9]\+//' to find "one or more digits" is not
portable.

Use the Basic Regular Expression '/[0-9][0-9]*//' instead.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge git://git.bogomips.org/git-svnJunio C Hamano Sat, 11 May 2013 18:09:00 +0000 (11:09 -0700)

Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
git-svn: added an --include-path flag
Git::SVN::*: add missing "NAME" section to perldoc
git-svn: avoid self-referencing mergeinfo

Makefile: fix default regex settings on DarwinDavid Aguilar Sat, 11 May 2013 08:22:26 +0000 (01:22 -0700)

Makefile: fix default regex settings on Darwin

t0070-fundamental.sh fails on Mac OS X 10.8:

$ uname -a
Darwin lustrous 12.2.0 Darwin Kernel Version 12.2.0:
Sat Aug 25 00:48:52 PDT 2012;
root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64

$ ./t0070-fundamental.sh -v
fatal: regex bug confirmed: re-build git with NO_REGEX=1

Fix it by using Git's regex library.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitk: Add menu item for reverting commitsKnut Franke Sat, 27 Apr 2013 14:36:13 +0000 (16:36 +0200)

gitk: Add menu item for reverting commits

Sometimes it's helpful (at least psychologically) to have this feature
easily accessible. Code borrows heavily from cherrypick.

Signed-off-by: Knut Franke <Knut.Franke@gmx.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Simplify file filteringFelipe Contreras Sat, 27 Apr 2013 22:01:39 +0000 (17:01 -0500)

gitk: Simplify file filtering

git diff is perfectly able to do this with '-- files', no need for
manual filtering. This makes gettreediffs consistent with getblobdiffs.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Display the date of a tag in a human-friendly wayAnand Kumria Mon, 29 Apr 2013 05:20:48 +0000 (06:20 +0100)

gitk: Display the date of a tag in a human-friendly way

By selecting a tag within gitk you can display information about it.
This information is output by using the command

'git cat-file tag <tagid>'

This outputs the *raw* information from the tag, amongst which is the
time - in seconds since the epoch. As useful as that value is, I find it
a lot easier to read and process time which it is something like:

"Mon Dec 31 14:26:11 2012 -0800"

This change will modify the display of tags in gitk like so:

@@ -1,7 +1,7 @@
object 5d417842efeafb6e109db7574196901c4e95d273
type commit
tag v1.8.1
-tagger Junio C Hamano <gitster@pobox.com> 1356992771 -0800
+tagger Junio C Hamano <gitster@pobox.com> Mon Dec 31 14:26:11 2012 -0800

Git 1.8.1
-----BEGIN PGP SIGNATURE-----

Signed-off-by: Anand Kumria <wildfire@progsoc.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Improve behaviour of drop-down listsPaul Mackerras Sat, 11 May 2013 07:08:41 +0000 (17:08 +1000)

gitk: Improve behaviour of drop-down lists

The drop-down lists used for things like the criteria for finding
commits (containing/touching paths/etc.) use a combobox if we are
using the ttk widgets. By default the combobox exports its value
as the selection when it is changed, which is unnecessary, and sometimes
the combobox wouldn't release the selection, which is annoying.

To fix this, we make these comboboxes not export their selection,
and also clear their selection whenever they are changed. This makes
them more like a simple selection of alternatives, improving the look
and feel of gitk.

Signed-off-by: Paul Mackerras <paulus@samba.org>

transport-helper: fix remote helper namespace regressionFelipe Contreras Fri, 10 May 2013 12:08:30 +0000 (07:08 -0500)

transport-helper: fix remote helper namespace regression

Commit 664059f (transport-helper: update remote helper namespace)
updates the namespace when the push succeeds or not; we should do it
only when it succeeded.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

CodingGuidelines: Documentation/*.txt are the sourcesDale Worley Tue, 7 May 2013 17:39:46 +0000 (13:39 -0400)

CodingGuidelines: Documentation/*.txt are the sources

People not familiar with AsciiDoc may not realize they are
supposed to update *.txt files and not *.html/*.1 files when
preparing patches to the project.

Signed-off-by: Dale Worley <worley@ariadne.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: remote-helper: add missing andFelipe Contreras Fri, 10 May 2013 12:08:29 +0000 (07:08 -0500)

test: remote-helper: add missing and

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with v1.8.2.3Junio C Hamano Thu, 9 May 2013 20:32:54 +0000 (13:32 -0700)

Sync with v1.8.2.3

* maint:
Git 1.8.2.3
t5004: avoid using tar for checking emptiness of archive
t5004: ignore pax global header file
mergetools/kdiff3: do not use --auto when diffing
transport-helper: trivial style cleanup

Git 1.8.2.3 v1.8.2.3Junio C Hamano Thu, 9 May 2013 19:37:53 +0000 (12:37 -0700)

Git 1.8.2.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'mv/sequencer-pick-error-diag'Junio C Hamano Thu, 9 May 2013 20:30:19 +0000 (13:30 -0700)

Merge branch 'mv/sequencer-pick-error-diag'

Fix "git cherry-pick $annotated_tag", which was mistakenly rejected.

* mv/sequencer-pick-error-diag:
cherry-pick: picking a tag that resolves to a commit is OK

cherry-pick: picking a tag that resolves to a commit... Junio C Hamano Thu, 9 May 2013 20:27:49 +0000 (13:27 -0700)

cherry-pick: picking a tag that resolves to a commit is OK

Earlier, 21246dbb9e0a (cherry-pick: make sure all input objects are
commits, 2013-04-11) tried to catch an unlikely "git cherry-pick $blob"
as an error, but broke a more important use case to cherry-pick a
tag that points at a commit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'tr/copy-revisions-from-stdin' into maintJunio C Hamano Thu, 9 May 2013 19:42:17 +0000 (12:42 -0700)

Merge branch 'tr/copy-revisions-from-stdin' into maint

* tr/copy-revisions-from-stdin:
read_revisions_from_stdin: make copies for handle_revision_arg

t5004: avoid using tar for checking emptiness of archiveRené Scharfe Thu, 9 May 2013 13:13:47 +0000 (15:13 +0200)

t5004: avoid using tar for checking emptiness of archive

Test 2 of t5004 checks if a supposedly empty tar archive really
contains no files. 24676f02 (t5004: fix issue with empty archive test
and bsdtar) removed our commit hash to make it work with bsdtar, but
the test still fails on NetBSD and OpenBSD, which use their own tar
that considers a tar file containing only NULs as broken.

Here's what the different archivers do when asked to create a tar
file without entries:

$ uname -v
NetBSD 6.0.1 (GENERIC)
$ gtar --version | head -1
tar (GNU tar) 1.26
$ bsdtar --version
bsdtar 2.8.4 - libarchive 2.8.4

$ : >zero.tar
$ perl -e 'print "\0" x 10240' >tenk.tar
$ sha1 zero.tar tenk.tar
SHA1 (zero.tar) = da39a3ee5e6b4b0d3255bfef95601890afd80709
SHA1 (tenk.tar) = 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c

$ : | tar cf - -T - | sha1
da39a3ee5e6b4b0d3255bfef95601890afd80709
$ : | gtar cf - -T - | sha1
34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
$ : | bsdtar cf - -T - | sha1
34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c

So NetBSD's native tar creates an empty file, while GNU tar and bsdtar
both give us 10KB of NULs -- just like git archive with an empty tree.
Now let's see how the archivers handle these two kinds of empty tar
files:

$ tar tf zero.tar; echo $?
tar: Unexpected EOF on archive file
1
$ gtar tf zero.tar; echo $?
gtar: This does not look like a tar archive
gtar: Exiting with failure status due to previous errors
2
$ bsdtar tf zero.tar; echo $?
0

$ tar tf tenk.tar; echo $?
tar: Cannot identify format. Searching...
tar: End of archive volume 1 reached
tar: Sorry, unable to determine archive format.
1
$ gtar tf tenk.tar; echo $?
0
$ bsdtar tf tenk.tar; echo $?
0

NetBSD's tar complains about both, bsdtar happily accepts any of them
and GNU tar doesn't like zero-length archive files. So the safest
course of action is to stay with our block-of-NULs format which is
compatible with GNU tar and bsdtar, as we can't make NetBSD's native
tar happy anyway.

We can simplify our test, however, by taking tar out of the picture.
Instead of extracting the archive and checking for the non-presence of
files, check if the file has a size of 10KB and contains only NULs.
This makes t5004 pass on NetBSD and OpenBSD.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5004: resurrect original empty tar archive testRené Scharfe Thu, 9 May 2013 13:36:10 +0000 (15:36 +0200)

t5004: resurrect original empty tar archive test

Add a test to verify the emptiness of an archive by extracting its
contents. Don't run this test if the version of tar doesn't support
archives containing only a comment header, though.

The existing check 'tar archive of empty tree is empty' used to work
like that (minus the tar capability check) but was changed to depend
on the exact representation of empty tar files created by git archive
instead of on the behaviour of tar in order to avoid issues with
different tar versions.

The different approaches test different things: The existing one is
for empty trees, for which we know the exact expected output and thus
we can simply check it without extracting; the new one is for commits
with empty trees, whose archives include stamps and so the more
"natural" check by extraction is a better fit because it focuses on
the interesting aspect, namely the absence of any archive entries.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5004: avoid using tar for checking emptiness of archiveRené Scharfe Thu, 9 May 2013 13:13:47 +0000 (15:13 +0200)

t5004: avoid using tar for checking emptiness of archive

Test 2 of t5004 checks if a supposedly empty tar archive really
contains no files. 24676f02 (t5004: fix issue with empty archive test
and bsdtar) removed our commit hash to make it work with bsdtar, but
the test still fails on NetBSD and OpenBSD, which use their own tar
that considers a tar file containing only NULs as broken.

Here's what the different archivers do when asked to create a tar
file without entries:

$ uname -v
NetBSD 6.0.1 (GENERIC)
$ gtar --version | head -1
tar (GNU tar) 1.26
$ bsdtar --version
bsdtar 2.8.4 - libarchive 2.8.4

$ : >zero.tar
$ perl -e 'print "\0" x 10240' >tenk.tar
$ sha1 zero.tar tenk.tar
SHA1 (zero.tar) = da39a3ee5e6b4b0d3255bfef95601890afd80709
SHA1 (tenk.tar) = 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c

$ : | tar cf - -T - | sha1
da39a3ee5e6b4b0d3255bfef95601890afd80709
$ : | gtar cf - -T - | sha1
34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
$ : | bsdtar cf - -T - | sha1
34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c

So NetBSD's native tar creates an empty file, while GNU tar and bsdtar
both give us 10KB of NULs -- just like git archive with an empty tree.
Now let's see how the archivers handle these two kinds of empty tar
files:

$ tar tf zero.tar; echo $?
tar: Unexpected EOF on archive file
1
$ gtar tf zero.tar; echo $?
gtar: This does not look like a tar archive
gtar: Exiting with failure status due to previous errors
2
$ bsdtar tf zero.tar; echo $?
0

$ tar tf tenk.tar; echo $?
tar: Cannot identify format. Searching...
tar: End of archive volume 1 reached
tar: Sorry, unable to determine archive format.
$ gtar tf tenk.tar; echo $?
0
$ bsdtar tf tenk.tar; echo $?
0

NetBSD's tar complains about both, bsdtar happily accepts any of them
and GNU tar doesn't like zero-length archive files. So the safest
course of action is to stay with our block-of-NULs format which is
compatible with GNU tar and bsdtar, as we can't make NetBSD's native
tar happy anyway.

We can simplify our test, however, by taking tar out of the picture.
Instead of extracting the archive and checking for the non-presence of
files, check if the file has a size of 10KB and contains only NULs.
This makes t5004 pass on NetBSD and OpenBSD.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5004: ignore pax global header fileRené Scharfe Thu, 9 May 2013 13:10:48 +0000 (15:10 +0200)

t5004: ignore pax global header file

Versions of tar that don't know pax headers -- like the ones in NetBSD 6
and OpenBSD 5.2 -- extract them as regular files. Explicitly ignore the
file created for our global header when checking the list of extracted
files, as this is normal and harmless fall-back behaviour. This fixes
test 3 of t5004 on these platforms.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mergetools/kdiff3: do not use --auto when diffingDavid Aguilar Thu, 9 May 2013 09:13:28 +0000 (02:13 -0700)

mergetools/kdiff3: do not use --auto when diffing

The `kdiff3 --auto` help message is, "No GUI if all conflicts are auto-
solvable." This flag was carried over from the original mergetool
commands. diff_cmd() is for two-way comparisons only so remove the
superfluous flag.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport-helper: trivial style cleanupFelipe Contreras Thu, 9 May 2013 01:16:56 +0000 (20:16 -0500)

transport-helper: trivial style cleanup

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: added an --include-path flagPaul Walmsley Fri, 3 May 2013 23:10:18 +0000 (00:10 +0100)

git-svn: added an --include-path flag

The SVN::Fetcher module is now able to filter for inclusion as well
as exclusion (as used by --ignore-path). Also added tests, documentation
changes and git completion script.

If you have an SVN repository with many top level directories and you
only want a git-svn clone of some of them then using --ignore-path is
difficult as it requires a very long regexp. In this case it's much
easier to filter for inclusion.

[ew: remove trailing whitespace]

Signed-off-by: Paul Walmsley <pjwhams@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>

Git::SVN::*: add missing "NAME" section to perldocJonathan Nieder Sun, 5 May 2013 07:50:33 +0000 (00:50 -0700)

Git::SVN::*: add missing "NAME" section to perldoc

lexgrog(1) relies on the NAME section to find a manpage's subject's
name and description for easy access later using "man -k". Add the
section it expects.

Noticed using lintian.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn: avoid self-referencing mergeinfoMichael Contreras Sat, 30 Mar 2013 22:06:42 +0000 (18:06 -0400)

git-svn: avoid self-referencing mergeinfo

When svn.pushmergeinfo is set, the target branch is included in the
mergeinfo if it was previously merged into one of the source branches.
SVN does not do this.

Remove merge target branch path from resulting mergeinfo when
svn.pushmergeinfo is set to better match the behavior of SVN. Update the
svn-mergeinfo-push test.

[ew: 80 columns]

Signed-off-by: Michael Contreras <michael@inetric.com>
Reported-by: Avishay Lavie <avishay.lavie@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>

merge: use help_unknown_ref()Vikrant Varma Sat, 4 May 2013 00:04:20 +0000 (05:34 +0530)

merge: use help_unknown_ref()

Use help.c:help_unknown_ref() instead of die() to provide a
friendlier error message before exiting, when one of the refs
specified in a merge is unknown.

Signed-off-by: Vikrant Varma <vikrant.varma94@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

help: add help_unknown_ref()Vikrant Varma Sat, 4 May 2013 00:04:19 +0000 (05:34 +0530)

help: add help_unknown_ref()

When the user gives an unknown string to a command that expects to
get a ref, we could be more helpful than just saying "that's not a
ref" and die.

Add helper function help_unknown_ref() to take care of displaying an
error message along with a list of suggested refs the user might
have meant. An interaction with "git merge" might go like this:

$ git merge foo
merge: foo - not something we can merge

Did you mean one of these?
origin/foo
upstream/foo

Signed-off-by: Vikrant Varma <vikrant.varma94@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: synchronize zsh wrapperFelipe Contreras Wed, 8 May 2013 07:37:01 +0000 (02:37 -0500)

completion: synchronize zsh wrapper

So it's closer to the full zsh wrapper.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: cleanup zsh wrapperFelipe Contreras Wed, 8 May 2013 07:37:00 +0000 (02:37 -0500)

completion: cleanup zsh wrapper

There's no need for a separate function; we can call
'emulate -k ksh func'.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes for 1.8.3Junio C Hamano Wed, 8 May 2013 05:50:05 +0000 (22:50 -0700)

Update draft release notes for 1.8.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-helpers: trivial cleanupFelipe Contreras Tue, 7 May 2013 23:45:15 +0000 (18:45 -0500)

remote-helpers: trivial cleanup

The comment was copied from hg-fast-export, not used anymore.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: fix for disappeared revisionsFelipe Contreras Tue, 7 May 2013 23:39:35 +0000 (18:39 -0500)

remote-bzr: fix for disappeared revisions

It's possible that the previous tip goes away, we should not assume it's
always present. Fortunately we are only using it to calculate the
progress to display to the user, so only that needs to be fixed.

Also, add a test that triggers this issue.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge git://github.com/git-l10n/git-poJunio C Hamano Wed, 8 May 2013 01:24:31 +0000 (18:24 -0700)

Merge git://github.com/git-l10n/git-po

* git://github.com/git-l10n/git-po:
l10n: zh_CN.po: translate 44 messages (2080t0f0u)
l10n: de.po: translate 44 new messages
l10n: Update Vietnamese translation (2080t0f0u)
l10n: Update Swedish translation (2080t0f0u)
l10n: git.pot: v1.8.3 round 2 (44 new, 12 removed)

l10n: zh_CN.po: translate 44 messages (2080t0f0u)Jiang Xin Sat, 13 Apr 2013 02:02:43 +0000 (10:02 +0800)

l10n: zh_CN.po: translate 44 messages (2080t0f0u)

Translate 44 new messages came from git.pot update in c6bc7d4
(l10n: git.pot: v1.8.3 round 2 (44 new, 12 removed))

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

fast-{import,export}: use get_sha1_hex() to read from... Felipe Contreras Sun, 5 May 2013 22:38:52 +0000 (17:38 -0500)

fast-{import,export}: use get_sha1_hex() to read from marks file

It's wrong to call get_sha1() if they should be SHA-1s, plus
inefficient.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: de.po: translate 44 new messagesRalf Thielow Tue, 30 Apr 2013 05:38:05 +0000 (07:38 +0200)

l10n: de.po: translate 44 new messages

Translate 44 new messages came from git.pot update in
c6bc7d4 (l10n: git.pot: v1.8.3 round 2 (44 new, 12 removed)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Thomas Rast <trast@inf.ethz.ch>

clone: allow cloning local paths with colons in themNguyễn Thái Ngọc Duy Sat, 4 May 2013 02:19:33 +0000 (09:19 +0700)

clone: allow cloning local paths with colons in them

Usually "foo:bar" is interpreted as an ssh url. This patch allows to
clone from such paths by putting at least one slash before the colon
(i.e. /path/to/foo:bar or just ./foo:bar).

file://foo:bar should also work, but local optimizations are off in
that case, which may be unwanted. While at there, warn the users about
--local being ignored in this case.

Reported-by: William Giokas <1007380@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-export: don't parse commits while reading marks... Felipe Contreras Sun, 5 May 2013 22:38:54 +0000 (17:38 -0500)

fast-export: don't parse commits while reading marks file

We don't need the parsed objects at this point, merely the
information that they have marks.

Seems to be three times faster in my setup with lots of objects.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-export: do not parse non-commit objects while... Felipe Contreras Sun, 5 May 2013 22:38:53 +0000 (17:38 -0500)

fast-export: do not parse non-commit objects while reading marks file

We read from the marks file and keep only marked commits, but in
order to find the type of object, we are parsing the whole thing,
which is slow, specially in big repositories with lots of big files.

There's no need for that, we can query the object information with
sha1_object_info().

Before this, loading the objects of a fresh emacs import, with 260598
blobs took 14 minutes, after this patch, it takes 3 seconds.

This is the way fast-import does it. Also die if the object is not
found (like fast-import).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jk/merge-tree-added-identically'Junio C Hamano Tue, 7 May 2013 05:18:25 +0000 (22:18 -0700)

Merge branch 'jk/merge-tree-added-identically'

* jk/merge-tree-added-identically:
merge-tree: handle directory/empty conflict correctly

merge-tree: handle directory/empty conflict correctlyJohn Keeping Mon, 6 May 2013 15:20:54 +0000 (16:20 +0100)

merge-tree: handle directory/empty conflict correctly

git-merge-tree causes a null pointer dereference when a directory
entry exists in only one or two of the three trees being compared with
no corresponding entry in the other tree(s).

When this happens, we want to handle the entry as a directory and not
attempt to mark it as a file merge. Do this by setting the entries bit
in the directory mask when the entry is missing or when it is a
directory, only performing the file comparison when we know that a file
entry exists.

Reported-by: Andreas Jacobsen <andreas@andreasjacobsen.com>
Signed-off-by: John Keeping <john@keeping.me.uk>
Tested-by: Andreas Jacobsen <andreas@andreasjacobsen.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'fc/remote-bzr'Junio C Hamano Tue, 7 May 2013 05:16:26 +0000 (22:16 -0700)

Merge branch 'fc/remote-bzr'

* fc/remote-bzr:
remote-bzr: avoid bad refs
remote-bzr: convert all unicode keys to str
remote-bzr: access branches only when needed
remote-bzr: delay peer branch usage
remote-bzr: iterate revisions properly
remote-bzr: improve progress reporting
remote-bzr: add option to specify branches
remote-bzr: add custom method to find branches
remote-bzr: improve author sanitazion
remote-bzr: add support for shared repo
remote-bzr: fix branch names
remote-bzr: add support for bzr repos
remote-bzr: use branch variable when appropriate
remote-bzr: fix partially pushed merge
remote-bzr: fixes for branch diverge
remote-bzr: add support to push merges
remote-bzr: always try to update the worktree
remote-bzr: fix order of locking in CustomTree
remote-bzr: delay blob fetching until the very end
remote-bzr: cleanup CustomTree

remote-bzr: avoid bad refsFelipe Contreras Sat, 4 May 2013 00:31:07 +0000 (19:31 -0500)

remote-bzr: avoid bad refs

Versions of fast-export before v1.8.2 throws a bad 'reset' commands
because of a behavior in transport-helper that is not even needed.
We should ignore them, otherwise we will treat them as branches and
fail.

This was fixed in v1.8.2, but some people use this script in older
versions of git.

Also, check if the ref was a tag, and skip it for now.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: convert all unicode keys to strFelipe Contreras Sat, 4 May 2013 00:31:06 +0000 (19:31 -0500)

remote-bzr: convert all unicode keys to str

Otherwise some versions of bazaar might barf.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/Makefile: don't define TEST_RESULTS_DIRECTORY recursivelyJohn Keeping Mon, 6 May 2013 12:35:46 +0000 (13:35 +0100)

t/Makefile: don't define TEST_RESULTS_DIRECTORY recursively

Commit 54bb901 (t/Makefile: fix result handling with
TEST_OUTPUT_DIRECTORY - 2013-04-26) incorrectly defined
TEST_RESULTS_DIRECTORY relative to itself, when it should be relative to
TEST_OUTPUT_DIRECTORY. Fix this.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'fc/push-with-export-reporting-result'Junio C Hamano Sun, 5 May 2013 18:12:12 +0000 (11:12 -0700)

Merge branch 'fc/push-with-export-reporting-result'

* fc/push-with-export-reporting-result:
transport-helper: improve push messages

transport-helper: improve push messagesFelipe Contreras Fri, 3 May 2013 23:41:59 +0000 (18:41 -0500)

transport-helper: improve push messages

If there's already a remote-helper tracking ref, we can fetch the
SHA-1 to report proper push messages (as opposed to always reporting
[new branch]).

The remote-helper currently can specify the old SHA-1 to avoid this
problem, but there's no point in forcing all remote-helpers to be aware
of git commit ids; they should be able to be agnostic of them.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.8.3-rc1 v1.8.3-rc1Junio C Hamano Fri, 3 May 2013 22:23:45 +0000 (15:23 -0700)

Git 1.8.3-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'tr/unpack-entry-use-after-free-fix'Junio C Hamano Fri, 3 May 2013 22:18:04 +0000 (15:18 -0700)

Merge branch 'tr/unpack-entry-use-after-free-fix'

* tr/unpack-entry-use-after-free-fix:
unpack_entry: avoid freeing objects in base cache

Sync with maintJunio C Hamano Fri, 3 May 2013 22:17:38 +0000 (15:17 -0700)

Sync with maint

* maint:
completion: zsh: don't override suffix on _detault
Documentation/git-commit: Typo under --edit

Merge branch 'tr/remote-tighten-commandline-parsing... Junio C Hamano Fri, 3 May 2013 22:12:38 +0000 (15:12 -0700)

Merge branch 'tr/remote-tighten-commandline-parsing' into maint

* tr/remote-tighten-commandline-parsing:
remote: 'show' and 'prune' can take more than one remote
remote: check for superfluous arguments in 'git remote add'
remote: add a test for extra arguments, according to docs

Merge branch 'jn/glossary-revision' into maintJunio C Hamano Fri, 3 May 2013 22:12:16 +0000 (15:12 -0700)

Merge branch 'jn/glossary-revision' into maint

* jn/glossary-revision:
glossary: a revision is just a commit

completion: zsh: don't override suffix on _detaultFelipe Contreras Fri, 3 May 2013 21:35:50 +0000 (16:35 -0500)

completion: zsh: don't override suffix on _detault

zsh is smart enough to add the right suffix while completing, there's no
point in trying to do the same as bash.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-commit: Typo under --editAnders Granskogen Bjørnstad Thu, 2 May 2013 18:24:15 +0000 (20:24 +0200)

Documentation/git-commit: Typo under --edit

-C takes a commit object, not a file.

Signed-off-by: Anders Granskogen Bjørnstad <andersgb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5500: add test for fetching with an unknown 'shallow'Michael Heemskerk Thu, 2 May 2013 14:56:07 +0000 (00:56 +1000)

t5500: add test for fetching with an unknown 'shallow'

When the client sends a 'shallow' line for an object that the server does
not have, the server should just ignore it and let the client keep that
unknown shallow boundary.

Signed-off-by: Michael Heemskerk <mheemskerk@atlassian.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

lookup_object: prioritize recently found objectsJeff King Wed, 1 May 2013 20:34:50 +0000 (16:34 -0400)

lookup_object: prioritize recently found objects

The lookup_object function is backed by a hash table of all
objects we have seen in the program. We manage collisions
with a linear walk over the colliding entries, checking each
with hashcmp(). The main cost of lookup is in these
hashcmp() calls; finding our item in the first slot is
cheaper than finding it in the second slot, which is cheaper
than the third, and so on.

If we assume that there is some locality to the object
lookups (e.g., if X and Y collide, and we have just looked
up X, the next lookup is more likely to be for X than for
Y), then we can improve our average lookup speed by checking
X before Y.

This patch does so by swapping a found item to the front of
the collision chain. The p0001 perf test reveals that this
does indeed exploit locality in the case of "rev-list --all
--objects":

Test origin this tree
-------------------------------------------------------------------------
0001.1: rev-list --all 0.40(0.38+0.02) 0.40(0.36+0.03) +0.0%
0001.2: rev-list --all --objects 2.24(2.17+0.05) 1.86(1.79+0.05) -17.0%

This is not surprising, as the full object traversal will
hit the same tree entries over and over (e.g., for every
commit that doesn't change "Documentation/", we will have to
look up the same sha1 just to find out that we already
processed it).

The reason why this technique works (and does not violate
any properties of the hash table) is subtle and bears some
explanation. Let's imagine we get a lookup for sha1 `X`, and
it hashes to bucket `i` in our table. That stretch of the
table may look like:

index | i-1 | i | i+1 | i+2 |
-----------------------------------
entry ... | A | B | C | X | ...
-----------------------------------

We start our probe at i, see that B does not match, nor does
C, and finally find X. There may be multiple C's in the
middle, but we know that there are no empty slots (or else
we would not find X at all).

We do not know the original index of B; it may be `i`, or it
may be less than i (e.g., if it were `i-1`, it would collide
with A and spill over into the `i` bucket). So it is
acceptable for us to move it to the right of a contiguous
stretch of entries (because we will find it from a linear
walk starting anywhere at `i` or before), but never to the
left (if we moved it to `i-1`, we would miss it when
starting our walk at `i`).

We do know the original index of X; it is `i`, so it is safe
to place it anywhere in the contiguous stretch between `i`
and where we found it (`i+2` in the this case).

This patch does a pure swap; after finding X in the
situation above, we would end with:

index | i-1 | i | i+1 | i+2 |
-----------------------------------
entry ... | A | X | C | B | ...
-----------------------------------

We could instead bump X into the `i` slot, and then shift
the whole contiguous chain down by one, resulting in:

index | i-1 | i | i+1 | i+2 |
-----------------------------------
entry ... | A | X | B | C | ...
-----------------------------------

That puts our chain in true most-recently-used order.
However, experiments show that it is not any faster (and in
fact, is slightly slower due to the extra manipulation).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: handle the main ref_cache speciallyMichael Haggerty Mon, 22 Apr 2013 19:52:41 +0000 (21:52 +0200)

refs: handle the main ref_cache specially

Hold the ref_cache instance for the main repository in a dedicated,
statically-allocated instance to avoid the need for a function call
and a linked-list traversal when it is needed.

Suggested by: Heiko Voigt <hvoigt@hvoigt.net>

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: change do_for_each_*() functions to take ref_cach... Michael Haggerty Mon, 22 Apr 2013 19:52:40 +0000 (21:52 +0200)

refs: change do_for_each_*() functions to take ref_cache arguments

Change the callers convert submodule names into ref_cache pointers.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack_one_ref(): do some cheap tests before a more expen... Michael Haggerty Mon, 22 Apr 2013 19:52:39 +0000 (21:52 +0200)

pack_one_ref(): do some cheap tests before a more expensive one

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack_one_ref(): use write_packed_entry() to do the... Michael Haggerty Mon, 22 Apr 2013 19:52:38 +0000 (21:52 +0200)

pack_one_ref(): use write_packed_entry() to do the writing

Change pack_refs() to work with a file descriptor instead of a FILE*
(making the file-locking code less awkward) and use
write_packed_entry() to do the writing.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack_one_ref(): use function peel_entry()Michael Haggerty Mon, 22 Apr 2013 19:52:37 +0000 (21:52 +0200)

pack_one_ref(): use function peel_entry()

Change pack_one_ref() to call peel_entry() rather than using its own
code for peeling references. Aside from sharing code, this lets it
take advantage of the optimization introduced by 6c4a060d7d.

Please note that we *could* use any peeled values that happen to
already be stored in the ref_entries, which would avoid some object
lookups for references that were already packed. But doing so would
also propagate any peeling errors across runs of "git pack-refs" and
give no way to recover from such errors. And "git pack-refs" isn't
run often enough that the performance cost is a problem. So instead,
add a new option to peel_entry() to force the entry to be re-peeled,
and call it with that option set.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: inline function do_not_prune()Michael Haggerty Mon, 22 Apr 2013 19:52:36 +0000 (21:52 +0200)

refs: inline function do_not_prune()

Function do_not_prune() was redundantly checking REF_ISSYMREF, which
was already tested at the top of pack_one_ref(), so remove that check.
And the rest was trivial, so inline the function.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack_refs(): change to use do_for_each_entry()Michael Haggerty Mon, 22 Apr 2013 19:52:35 +0000 (21:52 +0200)

pack_refs(): change to use do_for_each_entry()

pack_refs() was not using any of the extra features of for_each_ref(),
so change it to use do_for_each_entry(). This also gives it access to
the ref_entry and in particular its peeled field, which will be taken
advantage of in the next commit.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: use same lock_file object for both ref-packing... Michael Haggerty Mon, 22 Apr 2013 19:52:34 +0000 (21:52 +0200)

refs: use same lock_file object for both ref-packing functions

Use a single struct lock_file for both pack_refs() and
repack_without_ref().

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack_one_ref(): rename "path" parameter to "refname"Michael Haggerty Mon, 22 Apr 2013 19:52:33 +0000 (21:52 +0200)

pack_one_ref(): rename "path" parameter to "refname"

Make this function conform to the naming convention established in
65385ef7d4 for the rest of the refs.c file.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-refs: merge code from pack-refs.{c,h} into refs... Michael Haggerty Mon, 22 Apr 2013 19:52:32 +0000 (21:52 +0200)

pack-refs: merge code from pack-refs.{c,h} into refs.{c,h}

pack-refs.c doesn't contain much code, and the code it does contain is
closely related to reference handling. Moreover, there is some
duplication between pack_refs() and repack_without_ref(). Therefore,
merge pack-refs.c into refs.c and pack-refs.h into refs.h.

The code duplication will be addressed in future commits.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-refs: rename handle_one_ref() to pack_one_ref()Michael Haggerty Mon, 22 Apr 2013 19:52:31 +0000 (21:52 +0200)

pack-refs: rename handle_one_ref() to pack_one_ref()

This code is about to be moved, so name the function more
distinctively.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: extract a function write_packed_entry()Michael Haggerty Mon, 22 Apr 2013 19:52:30 +0000 (21:52 +0200)

refs: extract a function write_packed_entry()

Extract the I/O code from the "business logic" in repack_ref_fn().
Later there will be another caller for this function.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

repack_without_ref(): write peeled refs in the rewritte... Michael Haggerty Mon, 22 Apr 2013 19:52:29 +0000 (21:52 +0200)

repack_without_ref(): write peeled refs in the rewritten file

When a reference that existed in the packed-refs file is deleted, the
packed-refs file must be rewritten. Previously, the file was
rewritten without any peeled refs, even if the file contained peeled
refs when it was read. This was not a bug, because the packed-refs
file header didn't claim that the file contained peeled values. But
it had a performance cost, because the repository would lose the
benefit of having precomputed peeled references until pack-refs was
run again.

Teach repack_without_ref() to write peeled refs to the packed-refs
file (regardless of whether they were present in the old version of
the file).

This means that if the old version of the packed-refs file was not
fully peeled, then repack_without_ref() will have to peel references.
To avoid the expense of reading lots of loose references, we take two
shortcuts relative to pack-refs:

* If the peeled value of a reference is already known (i.e., because
it was read from the old version of the packed-refs file), then
output that peeled value again without any checks. This is the
usual code path and should avoid any noticeable overhead. (This is
different than pack-refs, which always re-peels references.)

* We don't verify that the packed ref is still current. It could be
that a packed references is overridden by a loose reference, in
which case the packed ref is no longer needed and might even refer
to an object that has been garbage collected. But we don't check;
instead, we just try to peel all references. If peeling is
successful, the peeled value is written out (even though it might
not be needed any more); if not, then the reference is silently
omitted from the output.

The extra overhead of peeling references in repack_without_ref()
should only be incurred the first time the packed-refs file is written
by a version of Git that knows about the "fully-peeled" attribute.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3211: demonstrate loss of peeled refs if a packed... Michael Haggerty Mon, 22 Apr 2013 19:52:28 +0000 (21:52 +0200)

t3211: demonstrate loss of peeled refs if a packed ref is deleted

Add a test that demonstrates that the peeled values recorded in
packed-refs are lost if a packed ref is deleted. (The code in
repack_without_ref() doesn't even attempt to write peeled refs.) This
will be fixed in a moment.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: change how packed refs are deletedMichael Haggerty Mon, 22 Apr 2013 19:52:27 +0000 (21:52 +0200)

refs: change how packed refs are deleted

Add a function remove_ref(), which removes a single entry from a
reference cache.

Use this function to reimplement repack_without_ref(). The old
version iterated over all refs, packing all of them except for the one
to be deleted, then discarded the entire packed reference cache. The
new version deletes the doomed reference from the cache *before*
iterating.

This has two advantages:

* the code for writing packed-refs becomes simpler, because it doesn't
have to exclude one of the references.

* it is no longer necessary to discard the packed refs cache after
deleting a reference: symbolic refs cannot be packed, so packed
references cannot depend on each other, so the rest of the packed
refs cache remains valid after a reference is deleted.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

search_ref_dir(): return an index rather than a pointerMichael Haggerty Mon, 22 Apr 2013 19:52:26 +0000 (21:52 +0200)

search_ref_dir(): return an index rather than a pointer

Change search_ref_dir() to return the index of the sought entry (or -1
on error) rather than a pointer to the entry. This will make it more
natural to use the function for removing an entry from the list.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

repack_without_ref(): silence errors for dangling packe... Michael Haggerty Mon, 22 Apr 2013 19:52:25 +0000 (21:52 +0200)

repack_without_ref(): silence errors for dangling packed refs

Stop emitting an error message when deleting a packed reference if we
find another dangling packed reference that is overridden by a loose
reference. See the previous commit for a longer explanation of the
issue.

We have to be careful to make sure that the invalid packed reference
really *is* overridden by a loose reference; otherwise what we have
found is repository corruption, which we *should* report.

Please note that this approach is vulnerable to a race condition
similar to the race conditions already known to affect packed
references [1]:

* Process 1 tries to peel packed reference X as part of deleting
another packed reference. It discovers that X does not refer to a
valid object (because the object that it referred to has been
garbage collected).

* Process 2 tries to delete reference X. It starts by deleting the
loose reference X.

* Process 1 checks whether there is a loose reference X. There is not
(it has just been deleted by process 2), so process 1 reports a
spurious error "X does not point to a valid object!"

The worst case seems relatively harmless, and the fix is identical to
the fix that will be needed for the other race conditions (namely
holding a lock on the packed-refs file during *all* reference
deletions), so we leave the cleaning up of all of them as a future
project.

[1] http://thread.gmane.org/gmane.comp.version-control.git/211956

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3210: test for spurious error messages for dangling... Michael Haggerty Mon, 22 Apr 2013 19:52:24 +0000 (21:52 +0200)

t3210: test for spurious error messages for dangling packed refs

A packed reference can be overridden by a loose reference, in which
case the packed reference is obsolete and is never used. The object
pointed to by such a reference can be garbage collected. Since
d66da478f2, this could lead to the emission of a spurious error
message:

error: refs/heads/master does not point to a valid object!

The error is generated by repack_without_ref() if there is an obsolete
dangling packed reference in packed-refs when the packed-refs file has
to be rewritten due to the deletion of another packed reference. Add
a failing test demonstrating this problem and some passing tests of
related scenarios.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: change the internal reference-iteration APIMichael Haggerty Mon, 22 Apr 2013 19:52:23 +0000 (21:52 +0200)

refs: change the internal reference-iteration API

Establish an internal API for iterating over references, which gives
the callback functions direct access to the ref_entry structure
describing the reference. (Do not change the iteration API that is
exposed outside of the module.)

Define a new internal callback signature

int each_ref_entry_fn(struct ref_entry *entry, void *cb_data)

Change do_for_each_ref_in_dir() and do_for_each_ref_in_dirs() to
accept each_ref_entry_fn callbacks, and rename them to
do_for_each_entry_in_dir() and do_for_each_entry_in_dirs(),
respectively. Adapt their callers accordingly.

Add a new function do_for_each_entry() analogous to do_for_each_ref()
but using the new callback style.

Change do_one_ref() into an each_ref_entry_fn that does some
bookkeeping and then calls a wrapped each_ref_fn.

Reimplement do_for_each_ref() in terms of do_for_each_entry(), using
do_one_ref() as an adapter.

Please note that the responsibility for setting current_ref remains in
do_one_ref(), which means that current_ref is *not* set when iterating
over references via the new internal API. This is not a disadvantage,
because current_ref is not needed by callers of the internal API (they
receive a pointer to the current ref_entry anyway). But more
importantly, this change prevents peel_ref() from returning invalid
results in the following scenario:

When iterating via the external API, the iteration always includes
both packed and loose references, and in particular never presents a
packed ref if there is a loose ref with the same name. The internal
API, on the other hand, gives the option to iterate over only the
packed references. During such an iteration, there is no check
whether the packed ref might be hidden by a loose ref of the same
name. But until now the packed ref was recorded in current_ref during
the iteration. So if peel_ref() were called with the reference name
corresponding to current ref, it would return the peeled version of
the packed ref even though there might be a loose ref that peels to a
different value. This scenario doesn't currently occur in the code,
but fix it to prevent things from breaking in a very confusing way in
the future.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: extract a function peel_entry()Michael Haggerty Mon, 22 Apr 2013 19:52:22 +0000 (21:52 +0200)

refs: extract a function peel_entry()

Peel the entry, and as a side effect store the peeled value in the
entry. Use this function from two places in peel_ref(); a third
caller will be added soon.

Please note that this change can lead to ref_entries for unpacked refs
being peeled. This has no practical benefit but is harmless.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

peel_ref(): fix return value for non-peelable, not... Michael Haggerty Mon, 22 Apr 2013 19:52:21 +0000 (21:52 +0200)

peel_ref(): fix return value for non-peelable, not-current reference

The old version was inconsistent: when a reference was
REF_KNOWS_PEELED but with a null peeled value, it returned non-zero
for the current reference but zero for other references. Change the
behavior for non-current references to match that of current_ref,
which is what callers expect. Document the behavior.

Current callers only call peel_ref() from within a for_each_ref-style
iteration and only for the current ref; therefore, the buggy code path
was never reached.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

peel_object(): give more specific information in return... Michael Haggerty Mon, 22 Apr 2013 19:52:20 +0000 (21:52 +0200)

peel_object(): give more specific information in return value

Instead of just returning a success/failure bit, return an enumeration
value that explains the reason for any failure. This will come in
handy shortly.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: extract function peel_object()Michael Haggerty Mon, 22 Apr 2013 19:52:19 +0000 (21:52 +0200)

refs: extract function peel_object()

It is a nice, logical unit of work, and putting it in a function
removes the need to use a goto in peel_ref(). Soon it will also have
other uses.

The algorithm is unchanged.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: extract a function ref_resolves_to_object()Michael Haggerty Mon, 22 Apr 2013 19:52:18 +0000 (21:52 +0200)

refs: extract a function ref_resolves_to_object()

It is a nice unit of work and soon will be needed from multiple
locations.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

repack_without_ref(): use function get_packed_ref()Michael Haggerty Mon, 22 Apr 2013 19:52:17 +0000 (21:52 +0200)

repack_without_ref(): use function get_packed_ref()

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

peel_ref(): use function get_packed_ref()Michael Haggerty Mon, 22 Apr 2013 19:52:16 +0000 (21:52 +0200)

peel_ref(): use function get_packed_ref()

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

get_packed_ref(): return a ref_entryMichael Haggerty Mon, 22 Apr 2013 19:52:15 +0000 (21:52 +0200)

get_packed_ref(): return a ref_entry

Instead of copying the reference's SHA1 into a caller-supplied
variable, just return the ref_entry itself (or NULL if there is no
such entry). This change will allow the function to be used from
elsewhere.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

do_for_each_ref_in_dirs(): remove dead codeMichael Haggerty Mon, 22 Apr 2013 19:52:14 +0000 (21:52 +0200)

do_for_each_ref_in_dirs(): remove dead code

There is no way to drop out of the while loop. This code has been
dead since 432ad41e.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: define constant PEELED_LINE_LENGTHMichael Haggerty Mon, 22 Apr 2013 19:52:13 +0000 (21:52 +0200)

refs: define constant PEELED_LINE_LENGTH

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: document how current_ref is usedMichael Haggerty Mon, 22 Apr 2013 19:52:12 +0000 (21:52 +0200)

refs: document how current_ref is used

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: document do_for_each_ref() and do_one_ref()Michael Haggerty Mon, 22 Apr 2013 19:52:11 +0000 (21:52 +0200)

refs: document do_for_each_ref() and do_one_ref()

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: document the fields of struct ref_valueMichael Haggerty Sun, 14 Apr 2013 12:54:17 +0000 (14:54 +0200)

refs: document the fields of struct ref_value

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: document flags constants REF_*Michael Haggerty Sun, 14 Apr 2013 12:54:16 +0000 (14:54 +0200)

refs: document flags constants REF_*

Document the bits that can appear in the "flags" parameter passed to
an each_ref_function and/or in the ref_entry::flag field.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.8.3Junio C Hamano Wed, 1 May 2013 22:32:24 +0000 (15:32 -0700)

Update draft release notes to 1.8.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix grammar in the 1.8.3 release notes.Marc Branchaud Mon, 29 Apr 2013 19:15:04 +0000 (15:15 -0400)

Fix grammar in the 1.8.3 release notes.

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'hb/git-pm-tempfile'Junio C Hamano Wed, 1 May 2013 22:24:15 +0000 (15:24 -0700)

Merge branch 'hb/git-pm-tempfile'

* hb/git-pm-tempfile:
Git.pm: call tempfile from File::Temp as a regular function

Merge branch 'rs/pp-user-info-without-extra-allocation'Junio C Hamano Wed, 1 May 2013 22:24:08 +0000 (15:24 -0700)

Merge branch 'rs/pp-user-info-without-extra-allocation'

* rs/pp-user-info-without-extra-allocation:
pretty: remove intermediate strbufs from pp_user_info()
pretty: simplify output line length calculation in pp_user_info()
pretty: simplify input line length calculation in pp_user_info()

Merge branch 'tr/remote-tighten-commandline-parsing'Junio C Hamano Wed, 1 May 2013 22:24:01 +0000 (15:24 -0700)

Merge branch 'tr/remote-tighten-commandline-parsing'

* tr/remote-tighten-commandline-parsing:
remote: 'show' and 'prune' can take more than one remote
remote: check for superfluous arguments in 'git remote add'
remote: add a test for extra arguments, according to docs

Merge branch 'zk/prompt-rebase-step'Junio C Hamano Wed, 1 May 2013 22:23:56 +0000 (15:23 -0700)

Merge branch 'zk/prompt-rebase-step'

* zk/prompt-rebase-step:
bash-prompt.sh: show where rebase is at when stopped

contrib/subtree: don't delete remote branches if split... John Keeping Wed, 1 May 2013 08:25:52 +0000 (09:25 +0100)

contrib/subtree: don't delete remote branches if split fails

When using "git subtree push" to split out a subtree and push it to a
remote repository, we do not detect if the split command fails which
causes the LHS of the refspec to be empty, deleting the remote branch.

Fix this by pulling the result of the split command into a variable so
that we can die if the command fails.

Reported-by: Steffen Jaeckel <steffen.jaeckel@stzedn.de>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge remote-tracking branch 'vi-vnwildman/master'Jiang Xin Wed, 1 May 2013 11:49:18 +0000 (19:49 +0800)

Merge remote-tracking branch 'vi-vnwildman/master'

* vi-vnwildman/master:
l10n: Update Vietnamese translation (2080t0f0u)

l10n: Update Vietnamese translation (2080t0f0u)Tran Ngoc Quan Wed, 1 May 2013 07:29:03 +0000 (14:29 +0700)

l10n: Update Vietnamese translation (2080t0f0u)

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>

remote-bzr: access branches only when neededFelipe Contreras Wed, 1 May 2013 01:10:10 +0000 (20:10 -0500)

remote-bzr: access branches only when needed

Bazaar doesn't seem to be tested for multiple usage of branches, so
resources seem to be leaked all over. Let's try to minimize this by
accessing the Branch objects only when needed.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: delay peer branch usageFelipe Contreras Wed, 1 May 2013 01:10:09 +0000 (20:10 -0500)

remote-bzr: delay peer branch usage

So it doesn't time out.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>