gitweb.git
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

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>

remote-bzr: iterate revisions properlyFelipe Contreras Wed, 1 May 2013 01:10:08 +0000 (20:10 -0500)

remote-bzr: iterate revisions properly

This way we don't need to store the list of all the revisions, which
doesn't seem to be very memory efficient with bazaar's design, for
whatever reason.

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

remote-bzr: improve progress reportingFelipe Contreras Wed, 1 May 2013 01:10:07 +0000 (20:10 -0500)

remote-bzr: improve progress reporting

No need to manually count the revisions, and also, this would help to
iterate more properly.

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

remote-bzr: add option to specify branchesFelipe Contreras Wed, 1 May 2013 01:10:06 +0000 (20:10 -0500)

remote-bzr: add option to specify branches

We might not want all the branches. And branch handling in bazaar is
rather tricky, so it's safer to simply specify them.

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

remote-bzr: add custom method to find branchesFelipe Contreras Wed, 1 May 2013 01:10:05 +0000 (20:10 -0500)

remote-bzr: add custom method to find branches

The official method is incredibly inefficient and slow.

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

remote-bzr: improve author sanitazionFelipe Contreras Wed, 1 May 2013 01:10:04 +0000 (20:10 -0500)

remote-bzr: improve author sanitazion

So that we don't end up with '<None>', and also synchronize it with the
one from remote-hg.

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

remote-bzr: add support for shared repoFelipe Contreras Wed, 1 May 2013 01:10:03 +0000 (20:10 -0500)

remote-bzr: add support for shared repo

This way all the remotes share the same data, so adding multiple
remotes, or renaming them doesn't create extra overhead.

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

remote-bzr: fix branch namesFelipe Contreras Wed, 1 May 2013 01:10:02 +0000 (20:10 -0500)

remote-bzr: fix branch names

When branches have '/' in their name (aka. sub-branches), bazaar seems
to choke while creating the new directory.

Also, git cannot have both 'foo' and 'foo/bar'.

So let's replace slashes with a plus sign.

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

remote-bzr: add support for bzr reposFelipe Contreras Wed, 1 May 2013 01:10:01 +0000 (20:10 -0500)

remote-bzr: add support for bzr repos

In bazaar, a repository can contain multiple branches, and previously we
were supporting only one branch at a time. Now we fetch them all.

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

remote-bzr: use branch variable when appropriateFelipe Contreras Wed, 1 May 2013 01:10:00 +0000 (20:10 -0500)

remote-bzr: use branch variable when appropriate

There should be no functional changes. Basically we want to reserve the
'repo' variable.

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

remote-bzr: fix partially pushed mergeFelipe Contreras Wed, 1 May 2013 01:09:59 +0000 (20:09 -0500)

remote-bzr: fix partially pushed merge

If part of the merge was already pushed, we don't have the blob_marks
available, however, the commits are already stored in bazaar, so we can
use the revision_tree to fetch the contents.

We want to do this only when there's no other option.

There's no easy way to test this.

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

remote-bzr: fixes for branch divergeFelipe Contreras Wed, 1 May 2013 01:09:58 +0000 (20:09 -0500)

remote-bzr: fixes for branch diverge

If the branches diverge we want to reset the pointer to where the remote
actually is. Since we can access remote branches just as easily as local
ones, let's do so.

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

remote-bzr: add support to push mergesFelipe Contreras Wed, 1 May 2013 01:09:57 +0000 (20:09 -0500)

remote-bzr: add support to push merges

In order to do that, we need to store the marks of every file, so that
they can be fetched when needed. Unfortunately we can't tell bazaar that
nothing changed, we need to send the data so that it can figure it out
by itself.

And since it will be requesting a bunch of information by the file_id,
it's better to have a helper dict (rev_files), so that we can fetch it
quickly.

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

remote-bzr: always try to update the worktreeFelipe Contreras Wed, 1 May 2013 01:09:56 +0000 (20:09 -0500)

remote-bzr: always try to update the worktree

And fail properly when we can't.

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

remote-bzr: fix order of locking in CustomTreeFelipe Contreras Wed, 1 May 2013 01:09:55 +0000 (20:09 -0500)

remote-bzr: fix order of locking in CustomTree

It doesn't seem to make any difference, but revision_tree() requires a
lock.

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

remote-bzr: delay blob fetching until the very endFelipe Contreras Wed, 1 May 2013 01:09:54 +0000 (20:09 -0500)

remote-bzr: delay blob fetching until the very end

Might be more efficient, but the real reason to use the marks will be
revealed in upcoming patches.

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

remote-bzr: cleanup CustomTreeFelipe Contreras Wed, 1 May 2013 01:09:53 +0000 (20:09 -0500)

remote-bzr: cleanup CustomTree

This code was not used at all.

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

unpack_entry: avoid freeing objects in base cacheThomas Rast Tue, 30 Apr 2013 12:53:06 +0000 (14:53 +0200)

unpack_entry: avoid freeing objects in base cache

In the !delta_data error path of unpack_entry(), we run free(base).
This became a window for use-after-free() in abe601b (sha1_file:
remove recursion in unpack_entry, 2013-03-27), as follows:

Before abe601b, we got the 'base' from cache_or_unpack_entry(..., 0);
keep_cache=0 tells it to also remove that entry. So the 'base' is at
this point not cached, and freeing it in the error path is the right
thing.

After abe601b, the structure changed: we use a three-phase approach
where phase 1 finds the innermost base or a base that is already in
the cache. In phase 3 we therefore know that all bases we unpack are
not part of the delta cache yet. (Observe that we pop from the cache
in phase 1, so this is also true for the very first base.) So we make
no further attempts to look up the bases in the cache, and just call
add_delta_base_cache() on every base object we have assembled.

But the !delta_data error path remained unchanged, and now calls
free() on a base that has already been entered in the cache. This
means that there is a use-after-free if we later use the same base
again.

So remove that free(); we are still going to use that data.

Reported-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: Update Swedish translation (2080t0f0u)Peter Krefting Tue, 30 Apr 2013 11:30:21 +0000 (12:30 +0100)

l10n: Update Swedish translation (2080t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>

l10n: git.pot: v1.8.3 round 2 (44 new, 12 removed)Jiang Xin Tue, 30 Apr 2013 00:31:19 +0000 (08:31 +0800)

l10n: git.pot: v1.8.3 round 2 (44 new, 12 removed)

Generate po/git.pot from v1.8.3-rc0-19-g7e6a0 for git v1.8.3
l10n round 2.

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

t0008: use named pipe (FIFO) to test check-ignore streamingAdam Spiers Mon, 29 Apr 2013 22:55:25 +0000 (23:55 +0100)

t0008: use named pipe (FIFO) to test check-ignore streaming

sleeps in the check-ignore test suite are not ideal since they can
fail when the system is under load, or when a tool like valgrind is
used which drastically alters the timing. Therefore we replace them
with a more robust solution using a named pipe (FIFO).

Thanks to Jeff King for coming up with the redirection wizardry
required to make this work.

http://article.gmane.org/gmane.comp.version-control.git/220916

Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-completion.bash: add remote.pushdefault to config... Ramkumar Ramachandra Mon, 29 Apr 2013 12:49:41 +0000 (18:19 +0530)

git-completion.bash: add remote.pushdefault to config list

224c2171 (remote.c: introduce remote.pushdefault, 2013-04-02)
introduced the remote.pushdefault configuration variable, but forgot
to teach git-completion.bash about it. Fix this.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-completion.bash: add branch.*.pushremote to config... Ramkumar Ramachandra Mon, 29 Apr 2013 12:49:40 +0000 (18:19 +0530)

git-completion.bash: add branch.*.pushremote to config list

9f765ce (remote.c: introduce branch.<name>.pushremote, 2013-04-02)
introduced the configuration variable branch.*.pushremote, but forgot
to teach git-completion.bash about it. Fix this.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Mon, 29 Apr 2013 16:57:38 +0000 (09:57 -0700)

Merge branch 'maint'

* maint:
complete: zsh: use zsh completion for the main cmd
complete: zsh: trivial simplification
git-completion.bash: complete branch.*.rebase as boolean
git-completion.bash: add diff.submodule to config list
git-completion.bash: lexical sorting for diff.statGraphWidth

Merge branch 'fc/zsh-completion' into maintJunio C Hamano Mon, 29 Apr 2013 16:52:18 +0000 (09:52 -0700)

Merge branch 'fc/zsh-completion' into maint

* fc/zsh-completion:
complete: zsh: use zsh completion for the main cmd
complete: zsh: trivial simplification

complete: zsh: use zsh completion for the main cmdFelipe Contreras Sat, 27 Apr 2013 20:34:06 +0000 (15:34 -0500)

complete: zsh: use zsh completion for the main cmd

So that we can have a nice zsh completion output:

% git <tab>
add -- add file contents to the index
bisect -- find by binary search the change that introduced a bug
branch -- list, create, or delete branches
checkout -- checkout a branch or paths to the working tree
clone -- clone a repository into a new directory
commit -- record changes to the repository
diff -- show changes between commits, commit and working tree, etc
fetch -- download objects and refs from another repository
grep -- print lines matching a pattern
init -- create an empty Git repository or reinitialize an existing one
log -- show commit logs
merge -- join two or more development histories together
mv -- move or rename a file, a directory, or a symlink
pull -- fetch from and merge with another repository or a local branch
push -- update remote refs along with associated objects
rebase -- forward-port local commits to the updated upstream head
reset -- reset current HEAD to the specified state
rm -- remove files from the working tree and from the index
show -- show various types of objects
status -- show the working tree status
tag -- create, list, delete or verify a tag object signed with GPG

And other niceties, like 'git --git-dir=<tab>' showing only directories.

For the rest, the bash completion stuff is still used.

Also, add my copyright, since this more than a thin wrapper.

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

complete: zsh: trivial simplificationFelipe Contreras Sat, 27 Apr 2013 20:34:05 +0000 (15:34 -0500)

complete: zsh: trivial simplification

There should be no functional changes.

The only reason I wrapped this code around a sub-function is because zsh
did the same in it's bashcompinit script in order to declare the special
variable 'words' as hidden, but only in this context.

There's no need for that any more since we access __git_main directly,
so 'words' is not modified, so there's no need for the sub-function.

In zsh mode the array indexes are different though.

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

git-completion.bash: complete branch.*.rebase as booleanRamkumar Ramachandra Mon, 29 Apr 2013 12:49:39 +0000 (18:19 +0530)

git-completion.bash: complete branch.*.rebase as boolean

6fac1b83 (completion: add missing config variables, 2009-06-29) added
"rebase" to the list of completions for "branch.*.*", but forgot to
specify completions for the values that this configuration variable
can take (namely "false" and "true"). Fix this.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-completion.bash: add diff.submodule to config listRamkumar Ramachandra Mon, 29 Apr 2013 12:49:38 +0000 (18:19 +0530)

git-completion.bash: add diff.submodule to config list

c47ef57 (diff: introduce diff.submodule configuration variable,
2012-11-13) introduced the diff.submodule configuration variable, but
forgot to teach git-completion.bash about it. Fix this.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-completion.bash: lexical sorting for diff.statGraph... Ramkumar Ramachandra Mon, 29 Apr 2013 12:49:37 +0000 (18:19 +0530)

git-completion.bash: lexical sorting for diff.statGraphWidth

df44483a (diff --stat: add config option to limit graph width,
2012-03-01) added the option diff.startGraphWidth to the list of
configuration variables in git-completion.bash, but failed to notice
that the list is sorted alphabetically. Move it to its rightful place
in the list.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git.pm: call tempfile from File::Temp as a regular... H. Merijn Brand Mon, 29 Apr 2013 08:09:57 +0000 (01:09 -0700)

Git.pm: call tempfile from File::Temp as a regular function

We call File::Temp's "tempfile" function as a class method, but it was
never designed to be called this way. Older versions seemed to
tolerate it, but as of File::Temp 0.23, it blows up like this:

$ git svn fetch
'tempfile' can't be called as a method at .../Git.pm line 1117.

Fix it by calling it as a regular function, just inside the File::Temp
namespace.

Signed-off-by: H. Merijn Brand <h.m.brand@xs4all.nl>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

upload-pack: ignore 'shallow' lines with unknown obj-idsMichael Heemskerk Mon, 29 Apr 2013 05:32:04 +0000 (22:32 -0700)

upload-pack: ignore 'shallow' lines with unknown obj-ids

When the client sends a 'shallow' line for an object that the server does
not have, the server currently dies with the error: "did not find object
for shallow <obj-id>". The client may have truncated the history at
the commit by fetching shallowly from a different server, or the commit
may have been garbage collected by the server. In either case, this
unknown commit is not relevant for calculating the pack that is to be
sent and can be safely ignored, and it is not used when recomputing where
the updated history of the client is cauterised.

The documentation in technical/pack-protocol.txt has been updated to
remove the restriction that "Clients MUST NOT mention an obj-id which it
does not know exists on the server". This requirement is not realistic
because clients cannot know whether an object has been garbage collected
by the server.

Signed-off-by: Michael Heemskerk <mheemskerk@atlassian.com>
Reviewed-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-testgit: build it to run under $SHELL_PATHJunio C Hamano Fri, 26 Apr 2013 23:30:40 +0000 (16:30 -0700)

git-remote-testgit: build it to run under $SHELL_PATH

Just like all the other shell scripts, replace the shebang line to
make sure it runs under the shell the user specified.

As this no longer depends on bashisms, t5801 does not have to say
bash must be available somewhere on the system.

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

git-remote-testgit: further remove some bashismsJohannes Sixt Thu, 25 Apr 2013 10:59:41 +0000 (12:59 +0200)

git-remote-testgit: further remove some bashisms

Signed-off-by: Johannes Sixt <j6t@kdbg.org>

Merge branch 'maint'Junio C Hamano Sun, 28 Apr 2013 21:47:24 +0000 (14:47 -0700)

Merge branch 'maint'

* maint:
documentation: trivial whitespace cleanups
t/Makefile: remove smoke test targets

documentation: trivial whitespace cleanupsFelipe Contreras Sat, 27 Apr 2013 22:00:07 +0000 (17:00 -0500)

documentation: trivial whitespace cleanups

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

t/Makefile: remove smoke test targetsJohn Keeping Fri, 26 Apr 2013 17:58:24 +0000 (18:58 +0100)

t/Makefile: remove smoke test targets

Commit d24fbca (Remove Git's support for smoke testing - 2011-12-23)
removed the smoke test support from the test suite but it was
re-added by commit 342e9ef (Introduce a performance testing
framework - 2012-02-17). This appears to be the result of a
mis-rebase, since re-adding the smoke testing infrastructure does
not relate to the subject of that commit.

The current 'smoke' target is broken since the 'harness' script it
uses no longer exists, so just reapply this section of commit d24fbca
and remove all of the smoke testing section in the makefile.

Signed-off-by: John Keeping <john@keeping.me.uk>
Acked-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'nd/pretty-formats'Junio C Hamano Sun, 28 Apr 2013 19:10:03 +0000 (12:10 -0700)

Merge branch 'nd/pretty-formats'

* nd/pretty-formats:
pretty: Fix bug in truncation support for %>, %< and %><

pretty: Fix bug in truncation support for %>, %< and %><Ramsay Jones Sat, 27 Apr 2013 19:43:36 +0000 (20:43 +0100)

pretty: Fix bug in truncation support for %>, %< and %><

Some systems experience failures in t4205-*.sh (tests 18-20, 27)
which all relate to the use of truncation with the %< padding
placeholder. This capability was added in the commit a7f01c6b
("pretty: support truncating in %>, %< and %><", 19-04-2013).

The truncation support was implemented with the assistance of a
new strbuf function (strbuf_utf8_replace). This function contains
the following code:

strbuf_attach(sb_src, strbuf_detach(&sb_dst, NULL),
sb_dst.len, sb_dst.alloc);

Unfortunately, this code is subject to unspecified behaviour. In
particular, the order of evaluation of the argument expressions
(along with the associated side effects) is not specified by the
C standard. Note that the second argument expression is a call to
strbuf_detach() which, as a side effect, sets the 'len' and 'alloc'
fields of the sb_dst argument to zero. Depending on the order of
evaluation of the argument expressions to the strbuf_attach call,
this can lead to assigning an empty string to 'sb_src'.

In order to remove the undesired behaviour, we replace the above
line of code with:

strbuf_swap(sb_src, &sb_dst);
strbuf_release(&sb_dst);

which achieves the desired effect without provoking unspecified
behaviour.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Duy Nguyen <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jk/check-corrupt-objects-carefully'Junio C Hamano Sun, 28 Apr 2013 18:57:54 +0000 (11:57 -0700)

Merge branch 'jk/check-corrupt-objects-carefully'

* jk/check-corrupt-objects-carefully:
clone: Make the 'junk_mode' symbol a file static

clone: Make the 'junk_mode' symbol a file staticRamsay Jones Sat, 27 Apr 2013 18:39:04 +0000 (19:39 +0100)

clone: Make the 'junk_mode' symbol a file static

Sparse issues an "'junk_mode' not declared. Should it be static?"
warning. In order to suppress the warning, since this symbol does
not need more than file visibility, we simply add the static
modifier to its declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jk/merge-tree-added-identically'Junio C Hamano Sun, 28 Apr 2013 18:53:57 +0000 (11:53 -0700)

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

off-by-one fix.

* jk/merge-tree-added-identically:
merge-tree: fix typo in "both changed identically"

merge-tree: fix typo in "both changed identically"John Keeping Sat, 27 Apr 2013 13:40:33 +0000 (14:40 +0100)

merge-tree: fix typo in "both changed identically"

Commit aacecc3 (merge-tree: don't print entries that match "local" -
2013-04-07) had a typo causing the "same in both" check to be incorrect
and check if both the base and "their" versions are removed instead of
checking that both the "our" and "their" versions are removed. Fix
this.

Reported-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Test-written-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: add missing format-patch optionsFelipe Contreras Sat, 27 Apr 2013 20:17:44 +0000 (15:17 -0500)

completion: add missing format-patch options

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

git-remote-testgit: avoid process substitutionJohannes Sixt Sat, 27 Apr 2013 19:13:13 +0000 (21:13 +0200)

git-remote-testgit: avoid process substitution

The implementation of bash on Windows does not offer process substitution.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.8.3-rc0 v1.8.3-rc0Junio C Hamano Fri, 26 Apr 2013 22:45:09 +0000 (15:45 -0700)

Git 1.8.3-rc0

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

Merge branch 'rr/shortlog-doc'Junio C Hamano Fri, 26 Apr 2013 22:28:39 +0000 (15:28 -0700)

Merge branch 'rr/shortlog-doc'

Update documentation for "log" and "shortlog".

* rr/shortlog-doc:
builtin/shortlog.c: make usage string consistent with log
builtin/log.c: make usage string consistent with doc
git-shortlog.txt: make SYNOPSIS match log, update OPTIONS
git-log.txt: rewrite note on why "--" may be required
git-log.txt: generalize <since>..<until>
git-log.txt: order OPTIONS properly; move <since>..<until>
revisions.txt: clarify the .. and ... syntax
git-shortlog.txt: remove (-h|--help) from OPTIONS

Merge branch 'th/bisect-skipped-log'Junio C Hamano Fri, 26 Apr 2013 22:28:37 +0000 (15:28 -0700)

Merge branch 'th/bisect-skipped-log'

* th/bisect-skipped-log:
bisect: Log possibly bad, skipped commits at bisection end

Merge branch 'ph/rebase-original'Junio C Hamano Fri, 26 Apr 2013 22:28:34 +0000 (15:28 -0700)

Merge branch 'ph/rebase-original'

* ph/rebase-original:
rebase: find orig_head unambiguously

Merge branch 'jn/glossary-revision'Junio C Hamano Fri, 26 Apr 2013 22:28:23 +0000 (15:28 -0700)

Merge branch 'jn/glossary-revision'

The wording for "revision" in the glossary wanted to say it refers
to "commit (noun) as a concept" but it was badly phrased.

This may need further updates to hint that in contexts where it is
clear, the word may refer to an object name, not necessarily a
commit. But the patch as-is is already an improvement.

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

Merge branch 'jc/add-ignore-removal'Junio C Hamano Fri, 26 Apr 2013 22:28:09 +0000 (15:28 -0700)

Merge branch 'jc/add-ignore-removal'

Introduce "--ignore-removal" as a synonym to "--no-all" for "git
add", and improve the 2.0 migration warning with it.

* jc/add-ignore-removal:
git add: rephrase -A/--no-all warning
git add: --ignore-removal is a better named --no-all

remote-bzr: strip extra newlineFelipe Contreras Fri, 26 Apr 2013 21:12:38 +0000 (16:12 -0500)

remote-bzr: strip extra newline

It's added by fast-export, the user didn't type it.

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

remote-bzr: tell bazaar to be quietFelipe Contreras Fri, 26 Apr 2013 21:12:37 +0000 (16:12 -0500)

remote-bzr: tell bazaar to be quiet

Otherwise we get notification, progress bars, and what not.

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

remote-bzr: store converted URLFelipe Contreras Fri, 26 Apr 2013 21:12:36 +0000 (16:12 -0500)

remote-bzr: store converted URL

Bazaar might convert the URL to something more appropriate, like an
absolute path. Lets store that instead of the original URL, which won't
work from a different working directory if it's relative.

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

remote-hg: use hashlib instead of hg sha1 utilFelipe Contreras Fri, 26 Apr 2013 21:12:35 +0000 (16:12 -0500)

remote-hg: use hashlib instead of hg sha1 util

To be in sync with remote-bzr.

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

remote-bzr: add support to push URLsFelipe Contreras Fri, 26 Apr 2013 21:12:34 +0000 (16:12 -0500)

remote-bzr: add support to push URLs

Just like in remote-hg.

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

remote-bzr: fix bad state issueFelipe Contreras Fri, 26 Apr 2013 21:12:33 +0000 (16:12 -0500)

remote-bzr: fix bad state issue

Carried from remote-hg.

The problem reportedly happened after doing a push that fails, the abort
causes the state of remote-hg to go bad, this happens because
remote-hg's marks are not stored, but 'git fast-export' marks are.

Ensure that the marks are _always_ stored.

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

remote-hg: remove extra checkFelipe Contreras Fri, 26 Apr 2013 21:12:32 +0000 (16:12 -0500)

remote-hg: remove extra check

Not needed since we use xrange ourselves.

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

remote-helpers: trivial cleanupsFelipe Contreras Fri, 26 Apr 2013 21:12:31 +0000 (16:12 -0500)

remote-helpers: trivial cleanups

No functional changes. Typos, unused variables, redundant operations,
and white-spaces.

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

Merge branch 'fc/remote-hg'Junio C Hamano Fri, 26 Apr 2013 22:19:03 +0000 (15:19 -0700)

Merge branch 'fc/remote-hg'

* fc/remote-hg:
remote-hg: strip extra newline
remote-hg: use marks instead of inlined files
remote-hg: small performance improvement
remote-hg: allow refs with spaces
remote-hg: don't update bookmarks unnecessarily
remote-hg: add support for schemes extension
remote-hg: improve email sanitation
remote-hg: add custom local tag write code
remote-hg: write tags in the appropriate branch
remote-hg: custom method to write tags
remote-hg: add support for tag objects
remote-hg: add branch_tip() helper
remote-hg: properly mark branches up-to-date
remote-hg: use python urlparse
remote-hg: safer bookmark pushing
remote-helpers: avoid has_key

Merge branch 'fc/remote-bzr'Junio C Hamano Fri, 26 Apr 2013 22:18:26 +0000 (15:18 -0700)

Merge branch 'fc/remote-bzr'

* fc/remote-bzr:
remote-bzr: use proper push method

Merge branch 'jc/warn-pathless-add-finishing-touches'Junio C Hamano Fri, 26 Apr 2013 22:17:48 +0000 (15:17 -0700)

Merge branch 'jc/warn-pathless-add-finishing-touches'

* jc/warn-pathless-add-finishing-touches:
git add: avoid "-u/-A without pathspec" warning on stat-dirty paths

git add: avoid "-u/-A without pathspec" warning on... Junio C Hamano Fri, 26 Apr 2013 20:44:35 +0000 (13:44 -0700)

git add: avoid "-u/-A without pathspec" warning on stat-dirty paths

In preparation for Git 2.0, "git add -u/-A" without pathspec checks
all the working tree (not limited to the current directory) and
issues a warning when it finds any path that we might add in Git
2.0, because that would mean the users' fingers need to be trained
to explicitly say "." if they want to keep the current behaviour.

However, the check was incomplete, because "git add" usually does
not refresh the index, considers a path that is stat-dirty but has
contents that is otherwise up-to-date in the index as "we might
add", and relies on that it is a no-op to add the same thing again
via the add_file_to_index() API (which also knows not to say "added"
in verbose mode when this happens). We do not want to trigger the
warning for a path that is outside the current directory is merely
stat-dirty, as it won't be added in Git 2.0, either.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>

Sync with 1.8.2.2Junio C Hamano Fri, 26 Apr 2013 20:00:42 +0000 (13:00 -0700)

Sync with 1.8.2.2

Git 1.8.2.2 v1.8.2.2Junio C Hamano Fri, 26 Apr 2013 18:30:08 +0000 (11:30 -0700)

Git 1.8.2.2

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

Merge branch 'jk/a-thread-only-dies-once' into maintJunio C Hamano Fri, 26 Apr 2013 18:25:59 +0000 (11:25 -0700)

Merge branch 'jk/a-thread-only-dies-once' into maint

* jk/a-thread-only-dies-once:
run-command: use thread-aware die_is_recursing routine
usage: allow pluggable die-recursion checks

Merge branch 'jn/gitweb-install-doc' into maintJunio C Hamano Fri, 26 Apr 2013 18:12:48 +0000 (11:12 -0700)

Merge branch 'jn/gitweb-install-doc' into maint

* jn/gitweb-install-doc:
gitweb/INSTALL: GITWEB_CONFIG_SYSTEM is for backward compatibility
gitweb/INSTALL: Simplify description of GITWEB_CONFIG_SYSTEM

Merge branch 'fc/untracked-zsh-prompt' into maintJunio C Hamano Fri, 26 Apr 2013 18:12:30 +0000 (11:12 -0700)

Merge branch 'fc/untracked-zsh-prompt' into maint

* fc/untracked-zsh-prompt:
prompt: fix untracked files for zsh

Merge branch 'jk/receive-pack-deadlocks-with-early... Junio C Hamano Fri, 26 Apr 2013 18:12:17 +0000 (11:12 -0700)

Merge branch 'jk/receive-pack-deadlocks-with-early-failure' into maint

* jk/receive-pack-deadlocks-with-early-failure:
receive-pack: close sideband fd on early pack errors

Merge branch 'jk/chopped-ident' into maintJunio C Hamano Fri, 26 Apr 2013 18:11:51 +0000 (11:11 -0700)

Merge branch 'jk/chopped-ident' into maint

* jk/chopped-ident:
blame: handle broken commit headers gracefully
pretty: handle broken commit headers gracefully
cat-file: print tags raw for "cat-file -p"

Merge branch 'rt/commentchar-fmt-merge-msg' into maintJunio C Hamano Fri, 26 Apr 2013 18:10:47 +0000 (11:10 -0700)

Merge branch 'rt/commentchar-fmt-merge-msg' into maint

* rt/commentchar-fmt-merge-msg:
t6200: avoid path mangling issue on Windows
fmt-merge-msg: use core.commentchar in tag signatures completely
fmt-merge-msg: respect core.commentchar in people credits

Merge branch 'rs/empty-archive' into maintJunio C Hamano Fri, 26 Apr 2013 18:03:31 +0000 (11:03 -0700)

Merge branch 'rs/empty-archive' into maint

* rs/empty-archive:
t5004: fix issue with empty archive test and bsdtar

Merge branch 'pe/pull-rebase-v-q' into maintJunio C Hamano Fri, 26 Apr 2013 18:00:14 +0000 (11:00 -0700)

Merge branch 'pe/pull-rebase-v-q' into maint

* pe/pull-rebase-v-q:
pull: Apply -q and -v options to rebase mode as well