Felipe Contreras [Tue, 28 May 2013 12:54:29 +0000 (07:54 -0500)]
test: trivial cleanups
No functional changes.
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Tue, 28 May 2013 12:54:27 +0000 (07:54 -0500)]
remote: trivial style cleanup
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
John 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 <redacted>
Signed-off-by: John Keeping <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Nguyễ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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Sat, 25 May 2013 02:29:59 +0000 (21:29 -0500)]
remote-hg: add check_push() helper
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Sat, 25 May 2013 02:29:42 +0000 (21:29 -0500)]
remote-hg: add test for bookmark diverge
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Sat, 25 May 2013 02:29:36 +0000 (21:29 -0500)]
remote-bzr: simplify test checks
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Sat, 25 May 2013 02:29:32 +0000 (21:29 -0500)]
remote-hg: trivial cleanups
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Sat, 25 May 2013 02:29:31 +0000 (21:29 -0500)]
remote-hg: ensure remote rebasing works
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Sat, 25 May 2013 02:24:24 +0000 (21:24 -0500)]
remote-bzr: trivial cleanups
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Sat, 25 May 2013 02:24:19 +0000 (21:24 -0500)]
remote-bzr: recover from failed clones
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Sat, 25 May 2013 02:41:02 +0000 (21:41 -0500)]
build: cleanup using $^
There's no need to list again the prerequisites. No functional changes.
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Sat, 25 May 2013 02:41:01 +0000 (21:41 -0500)]
build: trivial simplification
SCRIPT_PYTHON_GEN is '$(patsubst %.py,%,$(SCRIPT_PYTHON))', so replace
'$(patsubst %.py,%,$(SCRIPT_PYTHON))' with it
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Fri, 24 May 2013 18:34:46 +0000 (11:34 -0700)]
Git 1.8.3
Signed-off-by: Junio C Hamano <redacted>
Nguyễn Thái Ngọc Duy [Fri, 24 May 2013 15:44:03 +0000 (22:44 +0700)]
urls.txt: avoid auto converting to hyperlink
file:///path/to/repo.git/ is converted to a hyperlink while others are
not. Put a backslash to avoid the conversion. Tested with asciidoc
8.6.5.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Thomas Rast [Thu, 23 May 2013 13:34:11 +0000 (15:34 +0200)]
Document push --no-verify
ec55559 (push: Add support for pre-push hooks, 2013-01-13) forgot to
add a note to git-push(1) about the new --no-verify option.
Signed-off-by: Thomas Rast <redacted>
Signed-off-by: Junio C Hamano <redacted>
Torstein Hegge [Wed, 22 May 2013 22:27:53 +0000 (00:27 +0200)]
bisect: Fix log output for multi-parent skip ranges
The bisect log output of skipped commits introduced in
f989cac "bisect:
Log possibly bad, skipped commits at bisection end" should obtain the range of
skipped commits from
git rev-list bad --not good-1 good-2
not
git rev-list bad --not good-1 --not good-2
when the skipped range contains a merge with good points in each parent.
Signed-off-by: Torstein Hegge <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ramkumar Ramachandra [Wed, 22 May 2013 10:39:54 +0000 (16:09 +0530)]
sha1_name: fix error message for @{u}
Currently, when no (valid) upstream is configured for a branch, you get
an error like:
$ git show @{u}
error: No upstream configured for branch 'upstream-error'
error: No upstream configured for branch 'upstream-error'
fatal: ambiguous argument '@{u}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
The "error: " line actually appears twice, and the rest of the error
message is useless. In sha1_name.c:interpret_branch_name(), there is
really no point in processing further if @{u} couldn't be resolved, and
we might as well die() instead of returning an error(). After making
this change, you get:
$ git show @{u}
fatal: No upstream configured for branch 'upstream-error'
Also tweak a few tests in t1507 to expect this output.
This only turns error() that may be called after we know we are
dealing with an @{upstream} marker into die(), without touching
silent error returns "return -1" from the function. Any caller that
wants to handle an error condition itself will not be hurt by this
change, unless they want to see the message from error() and then
exit silently without giving its own message, which needs to be
fixed anyway.
Signed-off-by: Ramkumar Ramachandra <redacted>
Signed-off-by: Junio C Hamano <redacted>
Thomas Gummerer [Wed, 22 May 2013 07:40:39 +0000 (09:40 +0200)]
prompt: fix show upstream with svn and zsh
Currently the __git_ps1 git prompt gives the following error with a
repository converted by git-svn, when used with zsh:
__git_ps1_show_upstream:19: bad pattern: svn_remote[
__git_ps1_show_upstream:45: bad substitution
To reproduce the problem, the __git_ps1_show_upstream function can be
executed in a repository converted with git-svn. Both those errors are
triggered by spaces after the '['.
Zsh also doesn't support initializing an array with `local var=(...)`.
This triggers the following error:
__git_ps1_show_upstream:41: bad pattern: svn_upstream=(commit
Use
local -a
var=(...)
instead to make is compatible.
This was introduced by
6d158cba (bash completion: Support "divergence
from upstream" messages in __git_ps1), when the script was for bash
only.
Signed-off-by: Thomas Gummerer <redacted>
Acked-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
David Aguilar [Sun, 19 May 2013 10:23:36 +0000 (06:23 -0400)]
imap-send: eliminate HMAC deprecation warnings on Mac OS X
As of Mac OS X 10.7, Apple deprecated all OpenSSL functions due to
OpenSSL ABI instability. Silence the warnings by using Apple's
CommonCrypto HMAC replacement functions.
[es: reworded commit message; check APPLE_COMMON_CRYPTO instead of
abusing COMMON_DIGEST_FOR_OPENSSL]
Signed-off-by: David Aguilar <redacted>
Signed-off-by: Eric Sunshine <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Fri, 17 May 2013 21:10:08 +0000 (16:10 -0500)]
remote-hg: tests: fix hg merge
Let's specify a merge tool, otherwise mercurial might open one and hang
our tests waiting for user input.
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Fri, 17 May 2013 21:10:07 +0000 (16:10 -0500)]
remote-helpers: tests: use python directly
These remote helpers use 'env python', not PYTHON_PATH, so that's where
we should check for the extensions. Otherwise, if 'python' is not
PYTHON_PATH (e.g. /usr/bin/python: Makefile's default), there will be a
mismatch between the python libraries actually accessible to the remote
helpers.
Suggested by: Torsten Bögershausen <redacted>
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Tue, 21 May 2013 01:32:04 +0000 (20:32 -0500)]
transport-helper: check if the dry-run is supported
Certain remote-helpers (the ones with 'export') would try to push
regardless.
Obviously this is not what the user wants.
Also, add a check for the 'dry-run' option, so remote-helpers can
implement it.
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Tue, 21 May 2013 01:02:45 +0000 (20:02 -0500)]
transport-helper: barf when user tries old:new
Otherwise with certain remote helpers (the ones that support 'export'),
the users will be pushing to the wrong branch:
git push topic:master
Will push the topic branch, as if the user typed:
git push topic
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Tue, 21 May 2013 03:47:53 +0000 (22:47 -0500)]
remote-hg: fix order of configuration comments
The other configurations were added in the wrong place.
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Tue, 21 May 2013 03:47:52 +0000 (22:47 -0500)]
remote-hg: trivial configuration note cleanup
Follow the style of the previous configurations.
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Felipe Contreras [Tue, 21 May 2013 00:33:03 +0000 (19:33 -0500)]
completion: regression fix for zsh
zsh completion wrapper doesn't reimplement __gitcompadd(). Although it
should be trivial to do that, let's use __gitcomp_nl() which achieves
exactly the same thing, specially since the suffix ($4) has to be empty.
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
Dmitry Marakasov [Mon, 20 May 2013 20:24:34 +0000 (00:24 +0400)]
contrib/git-subtree: Use /bin/sh interpreter instead of /bin/bash
Use /bin/sh interpreter instead of /bin/bash for contrib/git-subtree:
it's required for systems which don't use bash by default (for example,
FreeBSD), while there seem to be no bashisms in the script (confirmed
by looking through the source and tesing subtree functionality with
FreeBSD's /bin/sh) to require specifically bash and not the generic
posix shell.
Signed-off-by: Dmitry Marakasov <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 20 May 2013 23:06:48 +0000 (16:06 -0700)]
Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
git-svn: introduce --parents parameter for commands branch and tag
git-svn: clarify explanation of --destination argument
git-svn: multiple fetch/branches/tags keys are supported
Junio C Hamano [Mon, 20 May 2013 05:01:20 +0000 (22:01 -0700)]
Documentation/diff-index: mention two modes of operation
"diff-index" can be used to compare a tree with the tracked working
tree files (when used without the --index option), or with the index
(when used with the --index option).
The text however did not say anything about the comparison with the
working tree at all. Fix this.
Reported-by: Albert Netymk <redacted>
Helped-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Mon, 20 May 2013 09:58:29 +0000 (11:58 +0200)]
t5000: test long filenames
Add a file with a long name to the test archive in order to check
entries with pax extended headers. Also add a check for tar versions
that doen't understand this format. Those versions should extract the
headers as a regular files. Add code to check_tar() to interpret the
path header if present, so that our tests work even with those tar
versions.
It's important to use the fallback code only if needed to still be
able to detect git archive errorously creating pax headers as regular
file entries (with a suitable tar version, of course).
The archive used to check for pax header support in tar was generated
using GNU tar 1.26 and its option --format=pax.
Tested successfully on NetBSD 6.1, which has a tar version lacking pax
header support.
Signed-off-by: René Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Mon, 20 May 2013 09:58:28 +0000 (11:58 +0200)]
t5000: simplify tar-tree tests
Just compare the archives created by git tar-tree with the ones created
using git archive with the equivalent options, whose contents are
checked already, instead of extracting them again.
Signed-off-by: René Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Mon, 20 May 2013 09:58:27 +0000 (11:58 +0200)]
t5000: use check_tar for prefix test
Perform the full range of checks against all archived files instead of
looking only at the file type of a few of them. Also add a test of a
git archive with a prefix ending in with a slash, i.e. adding a full
directory level.
Signed-off-by: René Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Mon, 20 May 2013 09:58:26 +0000 (11:58 +0200)]
t5000: factor out check_tar
Create a helper function that extracts a tar archive and checks its
contents, modelled after check_zip in t5003.
Signed-off-by: René Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Mon, 20 May 2013 09:58:25 +0000 (11:58 +0200)]
t5000, t5003: create directories for extracted files lazily
Create the directories b and c just before they are needed instead of
up front. For t5003 it turns out we don't need them at all. For t5000
it makes the coming modifications easier.
Signed-off-by: René Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Mon, 20 May 2013 09:58:24 +0000 (11:58 +0200)]
t5000: integrate export-subst tests into regular tests
Instead of creating extra archives for testing substitutions, set the
attribute export-subst and overwrite the marked file with the expected
(expanded) content right between committing and archiving. Thus
placeholder expansion based on the committed content is performed with
each archive creation and the comparison with the contents of directory
a yields the correct result. We can then remove the special tests for
export-subst.
Signed-off-by: René Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tobias Schulte [Wed, 15 May 2013 20:14:43 +0000 (22:14 +0200)]
git-svn: introduce --parents parameter for commands branch and tag
This parameter is equivalent to the parameter --parents on svn cp commands
and is useful for non-standard repository layouts.
Signed-off-by: Tobias Schulte <redacted>
Signed-off-by: Eric Wong <redacted>
Jonathan Nieder [Tue, 20 Dec 2011 01:24:30 +0000 (19:24 -0600)]
git-svn: clarify explanation of --destination argument
The existing documentation for "-d" does not make it obvious whether
its argument is supposed to be a full svn path, a partial svn path,
the glob from the config file, or what. Clarify the text and add an
example to get the reader started.
Reported-by: Nathan Gray <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Eric Wong <redacted>
Nathan Gray [Tue, 20 Dec 2011 01:23:50 +0000 (19:23 -0600)]
git-svn: multiple fetch/branches/tags keys are supported
"git svn" can be configured to use multiple fetch, branches, and tags
refspecs by passing multiple --branches or --tags options at init time
or editing the configuration file later, which can be handy when
working with messy Subversion repositories. Add a note to the
configuration section documenting how this works.
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Eric Wong <redacted>
Amit Bakshi [Sun, 19 May 2013 11:53:48 +0000 (06:53 -0500)]
remote-hg: set stdout to binary mode on win32
git clone hangs on windows, and file.write would return errno 22 inside
of mercurial's windows.winstdout wrapper class. This patch sets stdout's
mode to binary, fixing both issues.
[fc: cleaned up]
Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
David Aguilar [Sun, 19 May 2013 10:23:35 +0000 (06:23 -0400)]
cache.h: eliminate SHA-1 deprecation warnings on Mac OS X
As of Mac OS X 10.7, Apple deprecated all OpenSSL functions due to
OpenSSL ABI instability, thus leading to build diagnostics such as:
warning: 'SHA1_Init' is deprecated
(declared at /usr/include/openssl/sha.h:121)
Silence the warnings by using Apple's CommonCrypto SHA-1 replacement
functions for SHA1_Init(), SHA1_Update(), and SHA1_Final().
COMMON_DIGEST_FOR_OPENSSL is defined to instruct
<CommonCrypto/CommonDigest.h> to provide compatibility macros
associating OpenSSL SHA-1 functions with their CommonCrypto
counterparts.
[es: reworded commit message]
Signed-off-by: David Aguilar <redacted>
Signed-off-by: Eric Sunshine <redacted>
Signed-off-by: Junio C Hamano <redacted>
David Aguilar [Sun, 19 May 2013 10:23:34 +0000 (06:23 -0400)]
Makefile: add support for Apple CommonCrypto facility
As of Mac OS X 10.7, Apple deprecated all OpenSSL functions due to
OpenSSL ABI instability, thus leading to build warnings. As a
replacement, Apple encourages developers to migrate to its own (stable)
CommonCrypto facility.
Introduce boilerplate which controls whether Apple's CommonCrypto
facility is employed (enabled by default). Also add a
NO_APPLE_COMMON_CRYPTO build flag with which the user can opt out to
use OpenSSL instead.
[es: extracted CommonCrypto-related Makefile boilerplate into separate
introductory patch]
Signed-off-by: David Aguilar <redacted>
Signed-off-by: Eric Sunshine <redacted>
Signed-off-by: Junio C Hamano <redacted>
Mike Crowe [Fri, 17 May 2013 20:56:18 +0000 (21:56 +0100)]
describe: Add --first-parent option
Only consider the first parent commit when walking the commit history. This
is useful if you only wish to match tags on your branch after a merge.
Signed-off-by: Mike Crowe <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Fri, 17 May 2013 19:19:20 +0000 (12:19 -0700)]
Git 1.8.3-rc3
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Fri, 17 May 2013 19:16:49 +0000 (12:16 -0700)]
Merge branch 'fc/doc-style'
* fc/doc-style:
documentation: trivial style cleanups
Junio C Hamano [Fri, 17 May 2013 19:16:44 +0000 (12:16 -0700)]
Merge branch 'dw/asciidoc-sources-are-dot-txt-files'
* dw/asciidoc-sources-are-dot-txt-files:
CodingGuidelines: Documentation/*.txt are the sources