gitweb.git
Merge branch 'as/check-ignore'Junio C Hamano Wed, 29 May 2013 21:23:39 +0000 (14:23 -0700)

Merge branch 'as/check-ignore'

Enhance "check-ignore" (1.8.2 update) to work more like "check-attr"
over bidi-pipes.

* as/check-ignore:
t0008: use named pipe (FIFO) to test check-ignore streaming
Documentation: add caveats about I/O buffering for check-{attr,ignore}
check-ignore: allow incremental streaming of queries via --stdin
check-ignore: move setup into cmd_check_ignore()
check-ignore: add -n / --non-matching option
t0008: remove duplicated test fixture data

Merge branch 'jh/checkout-auto-tracking'Junio C Hamano Wed, 29 May 2013 21:23:10 +0000 (14:23 -0700)

Merge branch 'jh/checkout-auto-tracking'

Update "git checkout foo" that DWIMs the intended "upstream" and
turns it into "git checkout -t -b foo remotes/origin/foo" to
correctly take existing remote definitions into account.

The remote "origin" may be what uniquely map its own branch to
remotes/some/where/foo but that some/where may not be "origin".

* jh/checkout-auto-tracking:
glossary: Update and rephrase the definition of a remote-tracking branch
branch.c: Validate tracking branches with refspecs instead of refs/remotes/*
t9114.2: Don't use --track option against "svn-remote"-tracking branches
t7201.24: Add refspec to keep --track working
t3200.39: tracking setup should fail if there is no matching refspec.
checkout: Use remote refspecs when DWIMming tracking branches
t2024: Show failure to use refspec when DWIMming remote branch names
t2024: Add tests verifying current DWIM behavior of 'git checkout <branch>'

Merge branch 'jc/prune-all'Junio C Hamano Wed, 29 May 2013 21:23:03 +0000 (14:23 -0700)

Merge branch 'jc/prune-all'

We used the approxidate() parser for "--expire=<timestamp>" options
of various commands, but it is better to treat --expire=all and
--expire=now a bit more specially than using the current timestamp.
Update "git gc" and "git reflog" with a new parsing function for
expiry dates.

* jc/prune-all:
prune: introduce OPT_EXPIRY_DATE() and use it
api-parse-options.txt: document "no-" for non-boolean options
git-gc.txt, git-reflog.txt: document new expiry options
date.c: add parse_expiry_date()

Merge branch 'mh/fetch-into-shallow'Junio C Hamano Wed, 29 May 2013 21:20:30 +0000 (14:20 -0700)

Merge branch 'mh/fetch-into-shallow'

"git fetch" into a shallow repository from a repository that does
not know about the shallow boundary commits (e.g. a different fork
from the repository the current shallow repository was cloned from)
did not work correctly.

* mh/fetch-into-shallow:
t5500: add test for fetching with an unknown 'shallow'
upload-pack: ignore 'shallow' lines with unknown obj-ids

Merge branch 'js/transport-helper-error-reporting-fix'Junio C Hamano Wed, 29 May 2013 21:20:25 +0000 (14:20 -0700)

Merge branch 'js/transport-helper-error-reporting-fix'

Finishing touches to fc/transport-helper-error-reporting topic.

* js/transport-helper-error-reporting-fix:
git-remote-testgit: build it to run under $SHELL_PATH
git-remote-testgit: further remove some bashisms
git-remote-testgit: avoid process substitution

Merge branch 'fc/transport-helper-error-reporting'Junio C Hamano Wed, 29 May 2013 21:20:16 +0000 (14:20 -0700)

Merge branch 'fc/transport-helper-error-reporting'

Update transport helper to report errors and maintain ref hierarchy
used to keep track of remote helper state better.

* fc/transport-helper-error-reporting:
transport-helper: fix remote helper namespace regression
test: remote-helper: add missing and
t5801: "VAR=VAL shell_func args" is forbidden
transport-helper: update remote helper namespace
transport-helper: trivial code shuffle
transport-helper: warn when refspec is not used
transport-helper: clarify pushing without refspecs
transport-helper: update refspec documentation
transport-helper: clarify *:* refspec
transport-helper: improve push messages
transport-helper: mention helper name when it dies
transport-helper: report errors properly

completion: zsh: improve bash script loadingFelipe Contreras Sat, 25 May 2013 03:31:44 +0000 (22:31 -0500)

completion: zsh: improve bash script loading

It's better to check in multiple locations, so the user doesn't have to.

And update the documentation.

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

archive-zip:write_zip_entry: Remove second reset of... Stefan Beller Sun, 26 May 2013 19:11:35 +0000 (21:11 +0200)

archive-zip:write_zip_entry: Remove second reset of size variable to zero.

It is set to zero just 3 lines before.
Reported by cppcheck.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

difftool --dir-diff: allow changing any clean working... Kenichi Saita Wed, 29 May 2013 16:01:23 +0000 (01:01 +0900)

difftool --dir-diff: allow changing any clean working tree file

The temporary directory prepared by "difftool --dir-diff" to
show the result of a change can be modified by the user via
the tree diff program, and we try hard not to lose changes
to them after tree diff program returns to us.

However, the set of files to be copied back is computed
differently between --symlinks and --no-symlinks modes. The
former checks all paths that start out as identical to the
working tree file, while the latter checks paths that
already had a local modification in the working tree,
allowing changes made in the tree diff program to paths that
did not have any local change to be lost.

Signed-off-by: Kenichi Saita <nitoyon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

push: factor out the detached HEAD error messageRamkumar Ramachandra Wed, 29 May 2013 19:21:49 +0000 (00:51 +0530)

push: factor out the detached HEAD error message

With push.default set to upstream or simple, and a detached HEAD, git
push prints the following error:

$ git push
fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use

git push ram HEAD:<name-of-remote-branch>

This error is not unique to upstream or simple: current cannot push with
a detached HEAD either. So, factor out the error string in preparation
for using it in current.

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

get_sha1: warn about full or short object names that... Nguyễn Thái Ngọc Duy Wed, 29 May 2013 12:12:42 +0000 (19:12 +0700)

get_sha1: warn about full or short object names that look like refs

When we get 40 hex digits, we immediately assume it's an SHA-1. This
is the right thing to do because we have no way else to specify an
object. If there is a ref with the same object name, it will be
ignored. Warn the user about this case because the ref with full
object name is likely a mistake, for example

git checkout -b $empty_var $(git rev-parse something)

advice.object_name_warning is not documented because frankly people
should not be aware about it until they encounter this situation.

While at there, warn about ambiguation with abbreviated SHA-1 too.

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

prompt: fix for simple rebaseFelipe Contreras Wed, 29 May 2013 06:21:28 +0000 (01:21 -0500)

prompt: fix for simple rebase

When we are rebasing without options ('am' mode), the head rebased lives
in '$g/rebase-apply/head-name', so lets use that information so it's
reported the same way as if we were doing other rebases (-i or -m).

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

rebase: implement --[no-]autostash and rebase.autostashRamkumar Ramachandra Sun, 12 May 2013 11:56:41 +0000 (17:26 +0530)

rebase: implement --[no-]autostash and rebase.autostash

This new feature allows a rebase to be executed on a dirty worktree or
index. It works by creating a temporary "dangling merge commit" out
of the worktree and index changes (via 'git stash create'), and
automatically applying it after a successful rebase or abort.

rebase stores the SHA-1 hex of the temporary merge commit, along with
the rest of the rebase state, in either
.git/{rebase-merge,rebase-apply}/autostash depending on the kind of
rebase. Since $state_dir is automatically removed at the end of a
successful rebase or abort, so is the autostash.

The advantage of this approach is that we do not affect the normal
stash's reflogs, making the autostash invisible to the end-user. This
means that you can use 'git stash' during a rebase as usual.

When the autostash application results in a conflict, we push
$state_dir/autostash onto the normal stash and remove $state_dir
ending the rebase. The user can inspect the stash, and pop or drop at
any time.

Most significantly, this feature means that a caller like pull (with
pull.rebase set to true) can easily be patched to remove the
require_clean_work_tree restriction.

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

git-remote-mediawiki: better error message when HTTP... Matthieu Moy Wed, 29 May 2013 12:06:29 +0000 (14:06 +0200)

git-remote-mediawiki: better error message when HTTP(S) access fails

My use-case is an invalid SSL certificate. Pulling from the wiki with a
recent version of libwww-perl fails, and git-remote-mediawiki gave no
clue about the reason. Give the mediawiki API detailed error message, and
since it is not so informative, hint the user about an invalid SSL
certificate on https:// urls.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trivial: Add missing period in documentationPhil Hord Tue, 28 May 2013 19:36:44 +0000 (19:36 +0000)

trivial: Add missing period in documentation

Signed-off-by: Phil Hord <hordp@cisco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit: don't start editor if empty message is given... René Scharfe Sat, 25 May 2013 21:43:34 +0000 (23:43 +0200)

commit: don't start editor if empty message is given with -m

If an empty message is specified with the option -m of git commit then
the editor is started. That's unexpected and unnecessary. Instead of
using the length of the message string for checking if the user
specified one, directly remember if the option -m was given.

Reported-by: Mislav Marohnić <mislav.marohnic@gmail.com>
Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

credential-osxkeychain: support more protocolsXidorn Quan Tue, 28 May 2013 02:36:21 +0000 (10:36 +0800)

credential-osxkeychain: support more protocols

Add protocol imap, imaps, ftp and smtp for credential-osxkeychain.

Signed-off-by: Xidorn Quan <quanxunzhen@gmail.com>
Acked-by: John Szakmeister <john@szakmeister.net>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fix segfault with git log -c --followClemens Buchacher Mon, 27 May 2013 22:49:57 +0000 (00:49 +0200)

fix segfault with git log -c --follow

In diff_tree_combined we make a copy of diffopts. In
try_to_follow_renames, called via diff_tree_sha1, we free and
re-initialize diffopts->pathspec->items. Since we did not make a deep
copy of diffopts in diff_tree_combined, the original diffopts does not
get the update. By the time we return from diff_tree_combined,
rev->diffopt->pathspec->items points to an invalid memory address. We
get a segfault next time we try to access that pathspec.

Instead, along with the copy of diffopts, make a copy pathspec->items as
well.

We would also have to make a copy of pathspec->raw to keep it consistent
with pathspec->items, but nobody seems to rely on that.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: remove warning about unset chainreplytoFelipe Contreras Sat, 25 May 2013 03:44:52 +0000 (22:44 -0500)

send-email: remove warning about unset chainreplyto

Three years and a half is probably more than enough time to give users
the opportunity to configure Git to do what they want. If they haven't
changed the configuration by now, this warning message is not going to
do anything for them anyway.

This effectively reverts commit 528fb08 (prepare send-email for smoother
change of --chain-reply-to default).

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

find_first_merges(): remove unnecessary codeMichael Haggerty Sat, 25 May 2013 09:08:13 +0000 (11:08 +0200)

find_first_merges(): remove unnecessary code

No names are ever set for the object_array_entries in merges, so there
is no need to pretend to copy them to the result array.

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

find_first_merges(): initialize merges variable using... Michael Haggerty Sat, 25 May 2013 09:08:12 +0000 (11:08 +0200)

find_first_merges(): initialize merges variable using initializer

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

fsck: don't put a void*-shaped peg in a char*-shaped... Michael Haggerty Sat, 25 May 2013 09:08:11 +0000 (11:08 +0200)

fsck: don't put a void*-shaped peg in a char*-shaped hole

The source of this nonsense was

04d3975937 fsck: reduce stack footprint

, which wedged a pointer to parent into the object_array_entry's name
field. The parent pointer was passed to traverse_one_object(), even
though that function *didn't use it*.

The useless code has been deleted over time. Commit

a1cdc25172 fsck: drop unused parameter from traverse_one_object()

removed the parent pointer from traverse_one_object()'s
signature. Commit

c0aa335c95 Remove unused variables

removed the code that read the parent pointer back out of the name
field.

This commit takes the last step: don't write the parent pointer into
the name field in the first place.

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

object_array_remove_duplicates(): rewrite to reduce... Michael Haggerty Sat, 25 May 2013 09:08:10 +0000 (11:08 +0200)

object_array_remove_duplicates(): rewrite to reduce copying

The old version copied one entry to its destination position, then
deleted any matching entries from the tail of the array. This
required the tail of the array to be copied multiple times. It didn't
affect the complexity of the algorithm because the whole tail has to
be searched through anyway. But all the copying was unnecessary.

Instead, check for the existence of an entry with the same name in the
*head* of the list before copying an entry to its final position.
This way each entry has to be copied at most one time.

Extract a helper function contains_name() to do a bit of the work.

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

revision: use object_array_filter() in implementation... Michael Haggerty Sat, 25 May 2013 09:08:09 +0000 (11:08 +0200)

revision: use object_array_filter() in implementation of gc_boundary()

Use object_array_filter(), which will soon be made smarter about
cleaning up discarded entries properly. Also add a function comment.

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

object_array: add function object_array_filter()Michael Haggerty Sat, 25 May 2013 09:08:08 +0000 (11:08 +0200)

object_array: add function object_array_filter()

Add a function that allows unwanted entries in an object_array to be
removed. This encapsulation is a step towards giving object_array
ownership of its entries' name memory.

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

revision: split some overly-long linesMichael Haggerty Sat, 25 May 2013 09:08:07 +0000 (11:08 +0200)

revision: split some overly-long lines

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

cmd_diff(): make it obvious which cases are exclusive... Michael Haggerty Sat, 25 May 2013 09:08:06 +0000 (11:08 +0200)

cmd_diff(): make it obvious which cases are exclusive of each other

At first glance the OBJ_COMMIT, OBJ_TREE, and OBJ_BLOB cases look like
they might be mutually exclusive. But the OBJ_COMMIT case doesn't end
the loop iteration with "continue" like the other two cases, but
rather falls through. So use if...else if...else construct to make it
more obvious that only the last two cases are mutually exclusive.

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

cmd_diff(): rename local variable "list" -> "entry"Michael Haggerty Sat, 25 May 2013 09:08:05 +0000 (11:08 +0200)

cmd_diff(): rename local variable "list" -> "entry"

It's not a list, it's an array entry.

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

cmd_diff(): use an object_array for holding treesMichael Haggerty Sat, 25 May 2013 09:08:04 +0000 (11:08 +0200)

cmd_diff(): use an object_array for holding trees

Change cmd_diff() to use a (struct object_array) for holding the trees
that it accumulates, rather than rolling its own equivalent.

Incidentally, this change removes a hard-coded limit of 100 trees in
combined diff, not that it matters in practice.

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

builtin_diff_tree(): make it obvious that function... Michael Haggerty Sat, 25 May 2013 09:08:03 +0000 (11:08 +0200)

builtin_diff_tree(): make it obvious that function wants two entries

Instead of accepting an array and using exactly two elements from the
array, take two single (struct object_array_entry *) arguments.

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

add_rev_cmdline(): make a copy of the name argumentMichael Haggerty Sat, 25 May 2013 09:08:02 +0000 (11:08 +0200)

add_rev_cmdline(): make a copy of the name argument

Instead of assuming that the memory pointed to by the name argument
will live forever, make a local copy of it before storing it in the
ref_cmdline_info.

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

fetch: make own copies of refnamesMichael Haggerty Sat, 25 May 2013 09:08:01 +0000 (11:08 +0200)

fetch: make own copies of refnames

Do not retain references to refnames passed to the each_ref_fn
callback add_existing(), because their lifetime is not guaranteed.

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

describe: make own copy of refnameMichael Haggerty Sat, 25 May 2013 09:08:00 +0000 (11:08 +0200)

describe: make own copy of refname

Do not retain a reference to the refname passed to the each_ref_fn
callback get_name(), because there is no guarantee of the lifetimes of
these names. Instead, make a local copy when needed.

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

prune-packed: avoid implying "1" is DRY_RUN in prune_pa... Nguyễn Thái Ngọc Duy Mon, 27 May 2013 11:18:47 +0000 (18:18 +0700)

prune-packed: avoid implying "1" is DRY_RUN in prune_packed_objects()

Commit b60daf0 (Make git-prune-packed a bit more chatty. - 2007-01-12)
changes the meaning of prune_packed_objects()'s argument, from "dry
run or not dry run" to a bitmap.

It however forgot to update prune_packed_objects() caller in
builtin/prune.c to use new DRY_RUN macro. It's fine (for a long time!)
but there is a risk that someday someone may change the value of
DRY_RUN to something else and builtin/prune.c suddenly breaks. Avoid
that possibility.

While at there, change "opts == VERBOSE" to "opts & VERBOSE" as there
is no obvious reason why we only be chatty when DRY_RUN is not set.

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

test: rebase: fix --interactive testFelipe Contreras Tue, 28 May 2013 12:54:31 +0000 (07:54 -0500)

test: rebase: fix --interactive test

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

test: trivial cleanupsFelipe Contreras Tue, 28 May 2013 12:54:29 +0000 (07:54 -0500)

test: trivial cleanups

No functional changes.

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

remote: trivial style cleanupFelipe Contreras Tue, 28 May 2013 12:54:27 +0000 (07:54 -0500)

remote: trivial style cleanup

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

fetch: don't try to update unfetched tracking refsJohn Keeping Mon, 27 May 2013 16:33:09 +0000 (17:33 +0100)

fetch: don't try to update unfetched tracking refs

Since commit f269048 (fetch: opportunistically update tracking refs,
2013-05-11) we update tracking refs opportunistically when fetching
remote branches. However, if there is a configured non-pattern refspec
that does not match any of the refspecs given on the command line then a
fatal error occurs.

Fix this by setting the "missing_ok" flag when calling get_fetch_map.

Test-added-by: Jeff King <peff@peff.net>
Signed-off-by: John Keeping <john@keeping.me.uk>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clone: open a shortcut for connectivity checkNguyễn Thái Ngọc Duy Sun, 26 May 2013 01:16:17 +0000 (08:16 +0700)

clone: open a shortcut for connectivity check

In order to make sure the cloned repository is good, we run "rev-list
--objects --not --all $new_refs" on the repository. This is expensive
on large repositories. This patch attempts to mitigate the impact in
this special case.

In the "good" clone case, we only have one pack. If all of the
following are met, we can be sure that all objects reachable from the
new refs exist, which is the intention of running "rev-list ...":

- all refs point to an object in the pack
- there are no dangling pointers in any object in the pack
- no objects in the pack point to objects outside the pack

The second and third checks can be done with the help of index-pack as
a slight variation of --strict check (which introduces a new condition
for the shortcut: pack transfer must be used and the number of objects
large enough to call index-pack). The first is checked in
check_everything_connected after we get an "ok" from index-pack.

"index-pack + new checks" is still faster than the current "index-pack
+ rev-list", which is the whole point of this patch. If any of the
conditions fail, we fall back to the good old but expensive "rev-list
..". In that case it's even more expensive because we have to pay for
the new checks in index-pack. But that should only happen when the
other side is either buggy or malicious.

Cloning linux-2.6 over file://

before after
real 3m25.693s 2m53.050s
user 5m2.037s 4m42.396s
sys 0m13.750s 0m16.574s

A more realistic test with ssh:// over wireless

before after
real 11m26.629s 10m4.213s
user 5m43.196s 5m19.444s
sys 0m35.812s 0m37.630s

This shortcut is not applied to shallow clones, partly because shallow
clones should have no more objects than a usual fetch and the cost of
rev-list is acceptable, partly to avoid dealing with corner cases when
grafting is involved.

This shortcut does not apply to unpack-objects code path either
because the number of objects must be small in order to trigger that
code path.

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

index-pack: remove dead code (it should never happen)Nguyễn Thái Ngọc Duy Sun, 26 May 2013 01:16:16 +0000 (08:16 +0700)

index-pack: remove dead code (it should never happen)

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

fetch-pack: prepare updated shallow file before fetchin... Nguyễn Thái Ngọc Duy Sun, 26 May 2013 01:16:15 +0000 (08:16 +0700)

fetch-pack: prepare updated shallow file before fetching the pack

index-pack --strict looks up and follows parent commits. If shallow
information is not ready by the time index-pack is run, index-pack may
be led to non-existent objects. Make fetch-pack save shallow file to
disk before invoking index-pack.

git learns new global option --shallow-file to pass on the alternate
shallow file path. Undocumented (and not even support --shallow-file=
syntax) because it's unlikely to be used again elsewhere.

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

remote-hg: add support for --forceFelipe Contreras Sat, 25 May 2013 02:30:04 +0000 (21:30 -0500)

remote-hg: add support for --force

And get rid of the remote-hg.force-push option hack.

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

remote-hg: add support for --dry-runFelipe Contreras Sat, 25 May 2013 02:30:03 +0000 (21:30 -0500)

remote-hg: add support for --dry-run

This needs a specific patch from Git not applied yet.

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

remote-hg: check if a fetch is neededFelipe Contreras Sat, 25 May 2013 02:30:02 +0000 (21:30 -0500)

remote-hg: check if a fetch is needed

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

remote-hg: trivial cleanupFelipe Contreras Sat, 25 May 2013 02:30:01 +0000 (21:30 -0500)

remote-hg: trivial cleanup

It's better to catch the exception later on.

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

remote-helpers: improve marks usageFelipe Contreras Sat, 25 May 2013 02:30:00 +0000 (21:30 -0500)

remote-helpers: improve marks usage

Always convert to strings (they are unicode because they come from JSON).

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

remote-hg: add check_push() helperFelipe Contreras Sat, 25 May 2013 02:29:59 +0000 (21:29 -0500)

remote-hg: add check_push() helper

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

remote-hg: add setup_big_push() helperFelipe Contreras Sat, 25 May 2013 02:29:58 +0000 (21:29 -0500)

remote-hg: add setup_big_push() helper

So we don't duplicate these commands.

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

remote-hg: remove files before modificationsFelipe Contreras Sat, 25 May 2013 02:29:57 +0000 (21:29 -0500)

remote-hg: remove files before modifications

Otherwise replacing a file with a directory doesn't work.

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

remote-hg: improve lightweight tag authorFelipe Contreras Sat, 25 May 2013 02:29:56 +0000 (21:29 -0500)

remote-hg: improve lightweight tag author

Use git's committer.

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

remote-hg: use remote 'default' not local oneFelipe Contreras Sat, 25 May 2013 02:29:55 +0000 (21:29 -0500)

remote-hg: use remote 'default' not local one

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

remote-hg: improve branch listingFelipe Contreras Sat, 25 May 2013 02:29:54 +0000 (21:29 -0500)

remote-hg: improve branch listing

We want to show the remote heads, not the internal ones, which might
have garbage.

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

remote-hg: simplify branch_tip()Felipe Contreras Sat, 25 May 2013 02:29:53 +0000 (21:29 -0500)

remote-hg: simplify branch_tip()

It simply picks the last head that is not closed, but we have a stored
list of open heads.

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

remote-hg: check diverged bookmarksFelipe Contreras Sat, 25 May 2013 02:29:52 +0000 (21:29 -0500)

remote-hg: check diverged bookmarks

So that we can report a proper error.

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

remote-hg: pass around revision refsFelipe Contreras Sat, 25 May 2013 02:29:51 +0000 (21:29 -0500)

remote-hg: pass around revision refs

So that when a diverge is detected, we know which ref to report an error
for.

Also, since we are not throwing an exception, return a proper error
code.

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

remote-hg: implement custom checkheads()Felipe Contreras Sat, 25 May 2013 02:29:50 +0000 (21:29 -0500)

remote-hg: implement custom checkheads()

The version from Mercurial is extremely inefficient and convoluted, this
version achieves basically the same, at least for our purposes.

No functional changes.

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

remote-hg: implement custom push()Felipe Contreras Sat, 25 May 2013 02:29:49 +0000 (21:29 -0500)

remote-hg: implement custom push()

The one from mercurial does a ton of things we are not interested in,
and we need some special modifications which are impossible otherwise.

Most of the code is borrowed from Mercurial, and cleaned up, but should
be functionally the same for our purposes, except that multiple heads
are not detected.

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

remote-hg: only update necessary revisionsFelipe Contreras Sat, 25 May 2013 02:29:48 +0000 (21:29 -0500)

remote-hg: only update necessary revisions

We don't care about the rest, and in fact, we shouldn't try to push
everything, as there might be garbage from previous failed pushes.

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

remote-hg: force remote bookmark push selectivelyFelipe Contreras Sat, 25 May 2013 02:29:47 +0000 (21:29 -0500)

remote-hg: force remote bookmark push selectively

If we update the 'old' node, we might be updating the remote bookmark
even when our 'new' node is not related at all to what the remote has,
effectively forcing an update.

Let's do that only when forced push is configured.

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

remote-hg: reorganize bookmark handlingFelipe Contreras Sat, 25 May 2013 02:29:46 +0000 (21:29 -0500)

remote-hg: reorganize bookmark handling

We don't need to update both internal and remote bookmarks, so let's do
one or the other, and move the shared code earlier, so it's simpler.

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

remote-hg: add test for failed double pushFelipe Contreras Sat, 25 May 2013 02:29:45 +0000 (21:29 -0500)

remote-hg: add test for failed double push

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

remote-hg: add test for big pushFelipe Contreras Sat, 25 May 2013 02:29:44 +0000 (21:29 -0500)

remote-hg: add test for big push

With lots branches and bookmarks, non-ff, updated and new.

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

remote-hg: add test for new bookmark specialFelipe Contreras Sat, 25 May 2013 02:29:43 +0000 (21:29 -0500)

remote-hg: add test for new bookmark special

From the point of view of Mercurial, this creates a new branch head,
and requires a forced push.

Ideally, however, we would want it to work just like in git; new
branches can be pushed without problems.

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

remote-hg: add test for bookmark divergeFelipe Contreras Sat, 25 May 2013 02:29:42 +0000 (21:29 -0500)

remote-hg: add test for bookmark diverge

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

remote-hg: add test for diverged pushFelipe Contreras Sat, 25 May 2013 02:29:41 +0000 (21:29 -0500)

remote-hg: add test for diverged push

Neither mercurial nor git allows pushing to a remote when it's a
non-fast-forward push. We should be able to detect these errors and
report them properly, as opposed to throwing an exception
stack-trace.

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

remote-hg: add test to push new bookmarkFelipe Contreras Sat, 25 May 2013 02:29:40 +0000 (21:29 -0500)

remote-hg: add test to push new bookmark

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

remote-hg: add remote testsFelipe Contreras Sat, 25 May 2013 02:29:39 +0000 (21:29 -0500)

remote-hg: add remote tests

The logic when working with a local repository is totally different from
the one where we work with a remote repository; we need to pull and push
from it.

All this logic is currently not tested at all, so let's introduce a
variable to force the remote behavior.

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

remote-hg: update bookmarks when using a remoteFelipe Contreras Sat, 25 May 2013 02:29:38 +0000 (21:29 -0500)

remote-hg: update bookmarks when using a remote

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

remote-hg: add check_bookmark() test helperFelipe Contreras Sat, 25 May 2013 02:29:37 +0000 (21:29 -0500)

remote-hg: add check_bookmark() test helper

And check in a more proper way.

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

remote-bzr: simplify test checksFelipe Contreras Sat, 25 May 2013 02:29:36 +0000 (21:29 -0500)

remote-bzr: simplify test checks

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

remote-hg: add tests for 'master' bookmarkFelipe Contreras Sat, 25 May 2013 02:29:35 +0000 (21:29 -0500)

remote-hg: add tests for 'master' bookmark

We want to make sure everything works correctly, even if there's a
'master' bookmark in Mercurial.

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

remote-hg: always point HEAD to masterFelipe Contreras Sat, 25 May 2013 02:29:34 +0000 (21:29 -0500)

remote-hg: always point HEAD to master

Mercurial always checks out the 'default' branch, so there's no point in
complicating our lives trying to do something fancier, which causes
different behavior depending on whether the repository is local or
remote.

So let's always use 'default' (which we translate to 'master'), unless
we are in hg-git mode, which expects us to use the 'master' bookmark
instead.

Also, update the tests that used to check for different checkout
behaviors to simply check that the refs are there, remove unnecessary
ones, and fix the ones that expect something different.

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

remote-hg: improve progress calculationFelipe Contreras Sat, 25 May 2013 02:29:33 +0000 (21:29 -0500)

remote-hg: improve progress calculation

No need to manually keep track of the revision count.

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

remote-hg: trivial cleanupsFelipe Contreras Sat, 25 May 2013 02:29:32 +0000 (21:29 -0500)

remote-hg: trivial cleanups

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

remote-hg: ensure remote rebasing worksFelipe Contreras Sat, 25 May 2013 02:29:31 +0000 (21:29 -0500)

remote-hg: ensure remote rebasing works

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

remote-hg: upgrade version 1 marksFelipe Contreras Sat, 25 May 2013 02:29:30 +0000 (21:29 -0500)

remote-hg: upgrade version 1 marks

As suggested by Jed Brown; there's no need to re-import all the commits.

Cc: Jed Brown <jed@59a2.org>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-hg: switch from revisions to SHA-1 noteidsFelipe Contreras Sat, 25 May 2013 02:29:29 +0000 (21:29 -0500)

remote-hg: switch from revisions to SHA-1 noteids

Otherwise we won't know if revisions are replaced.

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

remote-hg: add version checks to the marksFelipe Contreras Sat, 25 May 2013 02:29:28 +0000 (21:29 -0500)

remote-hg: add version checks to the marks

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

remote-hg: improve node traversingFelipe Contreras Sat, 25 May 2013 02:29:27 +0000 (21:29 -0500)

remote-hg: improve node traversing

We won't be able to count the unmarked commits, but we are not going to
be able to do that anyway when we switch to SHA-1 ids.

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

remote-hg: shuffle some codeFelipe Contreras Sat, 25 May 2013 02:29:26 +0000 (21:29 -0500)

remote-hg: shuffle some code

In preparation to shift to SHA-1's.

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

remote-hg: use a shared repository storeFelipe Contreras Sat, 25 May 2013 02:29:25 +0000 (21:29 -0500)

remote-hg: use a shared repository store

This way we don't have to have duplicated Mercurial objects.

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

remote-hg: load all extensionsFelipe Contreras Sat, 25 May 2013 02:29:24 +0000 (21:29 -0500)

remote-hg: load all extensions

The user might have then configured differently, plus, all of them will
be loaded anyway later on.

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

remote-hg: test: simplify previous branch checkoutFelipe Contreras Sat, 25 May 2013 02:29:23 +0000 (21:29 -0500)

remote-hg: test: simplify previous branch checkout

@{-1} does the same thing.

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

remote-helpers: test: simplify remote URLsFelipe Contreras Sat, 25 May 2013 02:29:22 +0000 (21:29 -0500)

remote-helpers: test: simplify remote URLs

No need to specify $PWD any more.

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

remote-helpers: tests: general improvementsFelipe Contreras Sat, 25 May 2013 02:29:21 +0000 (21:29 -0500)

remote-helpers: tests: general improvements

So that we don't need a temporary directory.

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

remote-helpers: test: cleanup styleFelipe Contreras Sat, 25 May 2013 02:29:20 +0000 (21:29 -0500)

remote-helpers: test: cleanup style

So it's more standardized between all the tests.

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

remote-helpers: test: cleanup white-spacesFelipe Contreras Sat, 25 May 2013 02:29:19 +0000 (21:29 -0500)

remote-helpers: test: cleanup white-spaces

We prefer tabs to spaces.

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

remote-hg: trivial reorganizationFelipe Contreras Sat, 25 May 2013 02:29:18 +0000 (21:29 -0500)

remote-hg: trivial reorganization

We only need to get the remote dict once.

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

remote-hg: test: be a little more quietFelipe Contreras Sat, 25 May 2013 02:29:17 +0000 (21:29 -0500)

remote-hg: test: be a little more quiet

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

remote-bzr: add fallback check for a partial cloneFelipe Contreras Sat, 25 May 2013 02:24:26 +0000 (21:24 -0500)

remote-bzr: add fallback check for a partial clone

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

remote-bzr: reorganize the way 'wanted' worksFelipe Contreras Sat, 25 May 2013 02:24:25 +0000 (21:24 -0500)

remote-bzr: reorganize the way 'wanted' works

If the user specified a list of branches, we ignore what the remote
repository lists, and simply use the branches directly. Since some
remotes don't report the branches correctly, this is useful.

Otherwise either fetch the repo, or the branch.

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

remote-bzr: trivial cleanupsFelipe Contreras Sat, 25 May 2013 02:24:24 +0000 (21:24 -0500)

remote-bzr: trivial cleanups

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

remote-bzr: change global repoFelipe Contreras Sat, 25 May 2013 02:24:23 +0000 (21:24 -0500)

remote-bzr: change global repo

It's not used anyway.

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

remote-bzr: delay cloning/pullingFelipe Contreras Sat, 25 May 2013 02:24:22 +0000 (21:24 -0500)

remote-bzr: delay cloning/pulling

Until the branch is actually going to be used.

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

remote-bzr: simplify get_remote_branch()Felipe Contreras Sat, 25 May 2013 02:24:21 +0000 (21:24 -0500)

remote-bzr: simplify get_remote_branch()

No need for 'origin', it's only needed for the bzrdir 'sprout' method,
which can be greatly simplified.

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

remote-bzr: fix for files with spacesFelipe Contreras Sat, 25 May 2013 02:24:20 +0000 (21:24 -0500)

remote-bzr: fix for files with spaces

Set the maximum number of splits to make when dividing the diff stat
lines based on space characters.

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

remote-bzr: recover from failed clonesFelipe Contreras Sat, 25 May 2013 02:24:19 +0000 (21:24 -0500)

remote-bzr: recover from failed clones

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

build: do not install git-remote-testpyFelipe Contreras Sat, 25 May 2013 02:41:06 +0000 (21:41 -0500)

build: do not install git-remote-testpy

It's only meant for testing.

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

build: add NO_INSTALL variableFelipe Contreras Sat, 25 May 2013 02:41:05 +0000 (21:41 -0500)

build: add NO_INSTALL variable

So that we can specify which scripts we do not want to install (they are
for testing).

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

build: cleanup using $<Felipe Contreras Sat, 25 May 2013 02:41:03 +0000 (21:41 -0500)

build: cleanup using $<

No need to list the first prerequisite. No functional changes.

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