1
0
mirror of https://github.com/git/git.git synced 2024-10-20 21:38:38 +02:00
Commit Graph

37470 Commits

Author SHA1 Message Date
Junio C Hamano
80b616d04b Git 2.1.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.1.2
2014-09-29 22:15:00 -07:00
Junio C Hamano
46c8f859b7 Merge branch 'jk/fsck-exit-code-fix' into maint
"git fsck" failed to report that it found corrupt objects via its
exit status in some cases.

* jk/fsck-exit-code-fix:
  fsck: return non-zero status on missing ref tips
  fsck: exit with non-zero status upon error from fsck_obj()
2014-09-29 22:10:55 -07:00
Junio C Hamano
102edda4df Merge branch 'ta/config-add-to-empty-or-true-fix' into maint
"git config --add section.var val" used to lose existing
section.var whose value was an empty string.

* ta/config-add-to-empty-or-true-fix:
  config: avoid a funny sentinel value "a^"
  make config --add behave correctly for empty and NULL values
2014-09-29 22:10:25 -07:00
Junio C Hamano
421ec4f8d1 Merge branch 'mk/reachable-protect-detached-head' into maint
Reachability check (used in "git prune" and friends) did not add a
detached HEAD as a starting point to traverse objects still in use.

* mk/reachable-protect-detached-head:
  reachable.c: add HEAD to reachability starting commits
2014-09-29 22:10:04 -07:00
Junio C Hamano
5b830a8588 Merge branch 'mb/fast-import-delete-root' into maint
An attempt to remove the entire tree in the "git fast-import" input
stream caused it to misbehave.

* mb/fast-import-delete-root:
  fast-import: fix segfault in store_tree()
  t9300: test filedelete command
2014-09-29 22:09:48 -07:00
Junio C Hamano
46092ebf22 Merge branch 'jk/index-pack-threading-races' into maint
When receiving an invalid pack stream that records the same object
twice, multiple threads got confused due to a race.

* jk/index-pack-threading-races:
  index-pack: fix race condition with duplicate bases
2014-09-29 22:09:24 -07:00
Junio C Hamano
060517093e Merge branch 'jk/send-pack-many-refspecs' into maint
"git push" over HTTP transport had an artificial limit on number of
refs that can be pushed imposed by the command line length.

* jk/send-pack-many-refspecs:
  send-pack: take refspecs over stdin
2014-09-29 22:08:17 -07:00
Junio C Hamano
e7867e80f0 Merge branch 'so/rebase-doc' into maint
* so/rebase-doc:
  Documentation/git-rebase.txt: <upstream> must be given to specify <branch>
  Documentation/git-rebase.txt: -f forces a rebase that would otherwise be a no-op
2014-09-29 22:08:12 -07:00
Junio C Hamano
62b553cdd6 Merge branch 'maint' of git://github.com/git-l10n/git-po into maint
* 'maint' of git://github.com/git-l10n/git-po:
  l10n: de.po: use comma before "um"
  l10n: de.po: change Email to E-Mail
  po/TEAMS: add new member to German translation team
2014-09-28 00:02:57 -07:00
Phillip Sz
061540fcf7 l10n: de.po: use comma before "um"
This patch adds a comma before the "um". See:
http://www.duden.de/sprachwissen/rechtschreibregeln/komma#K117

Signed-off-by: Phillip Sz <phillip.szelat@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2014-09-25 20:26:27 +02:00
Phillip Sz
f51ccda810 l10n: de.po: change Email to E-Mail
Change all Email to E-Mail, as this is the correct form in German.

Signed-off-by: Phillip Sz <phillip.szelat@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2014-09-25 20:25:55 +02:00
Ralf Thielow
89a0ead829 po/TEAMS: add new member to German translation team
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2014-09-25 20:25:30 +02:00
Junio C Hamano
349cb50963 Git 2.1.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.1.1
2014-09-19 14:21:31 -07:00
Junio C Hamano
b8f7239058 Merge branch 'et/spell-poll-infinite-with-minus-one-only' into maint
* et/spell-poll-infinite-with-minus-one-only:
  upload-pack: keep poll(2)'s timeout to -1
2014-09-19 14:05:13 -07:00
Junio C Hamano
08fd8a055c Merge branch 'nd/fetch-pass-quiet-to-gc-child-process' into maint
* nd/fetch-pass-quiet-to-gc-child-process:
  fetch: silence git-gc if --quiet is given
  fetch: convert argv_gc_auto to struct argv_array
2014-09-19 14:05:12 -07:00
Junio C Hamano
fb6f843a8f Merge branch 'jk/prune-top-level-refs-after-packing' into maint
* jk/prune-top-level-refs-after-packing:
  pack-refs: prune top-level refs like "refs/foo"
2014-09-19 14:05:12 -07:00
Junio C Hamano
04481347ec Merge branch 'jk/fast-import-fixes' into maint
* jk/fast-import-fixes:
  fast-import: fix buffer overflow in dump_tags
  fast-import: clean up pack_data pointer in end_packfile
2014-09-19 14:05:12 -07:00
Junio C Hamano
a28e876b9d Merge branch 'jn/unpack-trees-checkout-m-carry-deletion' into maint
* jn/unpack-trees-checkout-m-carry-deletion:
  checkout -m: attempt merge when deletion of path was staged
  unpack-trees: use 'cuddled' style for if-else cascade
  unpack-trees: simplify 'all other failures' case
2014-09-19 14:05:12 -07:00
Junio C Hamano
f7153344cf Merge branch 'sp/pack-protocol-doc-on-shallow' into maint
* sp/pack-protocol-doc-on-shallow:
  Document LF appearing in shallow command during send-pack/receive-pack
2014-09-19 14:05:11 -07:00
Junio C Hamano
8ec959fbce Merge branch 'jk/prompt-stash-could-be-packed' into maint
* jk/prompt-stash-could-be-packed:
  git-prompt: do not look for refs/stash in $GIT_DIR
2014-09-19 14:05:11 -07:00
Junio C Hamano
92ea1ac826 Merge branch 'rs/refresh-beyond-symlink' into maint
* rs/refresh-beyond-symlink:
  read-cache: check for leading symlinks when refreshing index
2014-09-19 14:05:11 -07:00
Junio C Hamano
ffe41f8d32 Merge branch 'lf/bundle-exclusion' into maint
* lf/bundle-exclusion:
  bundle: fix exclusion of annotated tags
2014-09-19 14:05:11 -07:00
Junio C Hamano
bb6ac5ea13 Merge branch 'jc/apply-ws-prefix' into maint
* jc/apply-ws-prefix:
  apply: omit ws check for excluded paths
  apply: hoist use_patch() helper for path exclusion up
  apply: use the right attribute for paths in non-Git patches

Conflicts:
	builtin/apply.c
2014-09-19 14:05:10 -07:00
Junio C Hamano
04cd47f553 Merge branch 'jk/command-line-config-empty-string' into maint
* jk/command-line-config-empty-string:
  config: teach "git -c" to recognize an empty string

Conflicts:
	config.c
2014-09-19 14:05:10 -07:00
Junio C Hamano
723361a572 Merge branch 'jk/pretty-empty-format' into maint
* jk/pretty-empty-format:
  pretty: make empty userformats truly empty
  pretty: treat "--format=" as an empty userformat
  revision: drop useless string offset when parsing "--pretty"
2014-09-19 14:05:09 -07:00
Sergey Organov
95c68267ff Documentation/git-rebase.txt: <upstream> must be given to specify <branch>
Current syntax description makes one wonder if there is any
syntactic way to distinguish between <branch> and <upstream> so that
one can specify <branch> but not <upstream>, but that is not the
case.

Make it explicit that these arguments are positional, i.e. the
earlier ones cannot be omitted if you want to give later ones.

Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-09-16 11:27:12 -07:00
Jeff King
30d1038d1b fsck: return non-zero status on missing ref tips
Fsck tries hard to detect missing objects, and will complain
(and exit non-zero) about any inter-object links that are
missing. However, it will not exit non-zero for any missing
ref tips, meaning that a severely broken repository may
still pass "git fsck && echo ok".

The problem is that we use for_each_ref to iterate over the
ref tips, which hides broken tips. It does at least print an
error from the refs.c code, but fsck does not ever see the
ref and cannot note the problem in its exit code. We can solve
this by using for_each_rawref and noting the error ourselves.

In addition to adding tests for this case, we add tests for
all types of missing-object links (all of which worked, but
which we were not testing).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-09-12 10:45:49 -07:00
Jeff King
c1063be2a3 config: avoid a funny sentinel value "a^"
Introduce CONFIG_REGEX_NONE as a more explicit sentinel value to say
"we do not want to replace any existing entry" and use it in the
implementation of "git config --add".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-09-11 16:33:54 -07:00
Jeff King
2e770fe47e fsck: exit with non-zero status upon error from fsck_obj()
Upon finding a corrupt loose object, we forgot to note the error to
signal it with the exit status of the entire process.

[jc: adjusted t1450 and added another test]

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-09-10 09:40:53 -07:00
Max Kirillov
c40fdd01dd reachable.c: add HEAD to reachability starting commits
HEAD is not explicitly used as a starting commit for
calculating reachability, so if it's detached and reflogs
are disabled it may be pruned.

Add tests which demonstrate it. Test 'prune: prune former HEAD after checking
out branch' also reverts changes to repository.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-09-03 10:47:44 -07:00
Jeff King
ab791dd138 index-pack: fix race condition with duplicate bases
When we are resolving deltas in an indexed pack, we do it by
first selecting a potential base (either one stored in full
in the pack, or one created by resolving another delta), and
then resolving any deltas that use that base.  When we
resolve a particular delta, we flip its "real_type" field
from OBJ_{REF,OFS}_DELTA to whatever the real type is.

We assume that traversing the objects this way will visit
each delta only once. This is correct for most packs; we
visit the delta only when we process its base, and each
object (and thus each base) appears only once. However, if a
base object appears multiple times in the pack, we will try
to resolve any deltas based on it once for each instance.

We can detect this case by noting that a delta we are about
to resolve has already had its real_type field flipped, and
we already do so with an assert().  However, if multiple
threads are in use, we may race with another thread on
comparing and flipping the field. We need to synchronize the
access.

The right mechanism for doing this is a compare-and-swap (we
atomically "claim" the delta for our own and find out
whether our claim was successful). We can implement this
in C by using a pthread mutex to protect the operation. This
is not the fastest way of doing a compare-and-swap; many
processors provide instructions for this, and gcc and other
compilers provide builtins to access them. However, some
experiments showed that lock contention does not cause a
significant slowdown here. Adding c-a-s support for many
compilers would increase the maintenance burden (and we
would still end up including the pthread version as a
fallback).

Note that we only need to touch the OBJ_REF_DELTA codepath
here. An OBJ_OFS_DELTA object points to its base using an
offset, and therefore has only one base, even if another
copy of that base object appears in the pack (we do still
touch it briefly because the setting of real_type is
factored out of resolve_data).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-08-29 14:50:43 -07:00
Maxim Bublis
2668d692eb fast-import: fix segfault in store_tree()
Branch tree is NULLified by filedelete command if we are trying
to delete root tree. Add sanity check and use load_tree() in that case.

Signed-off-by: Maxim Bublis <satori@yandex-team.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-08-29 10:31:14 -07:00
Maxim Bublis
8d30d8a89a t9300: test filedelete command
Add new fast-import test series for filedelete command.

Signed-off-by: Maxim Bublis <satori@yandex-team.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-08-29 10:30:14 -07:00
Junio C Hamano
96db324a73 Merge git://github.com/git-l10n/git-po
* git://github.com/git-l10n/git-po:
  po/TEAMS: add new members to German translation team
  l10n: de.po: translate 38 new messages
2014-08-29 10:18:22 -07:00
Ralf Thielow
782ac539ea po/TEAMS: add new members to German translation team
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2014-08-29 07:08:17 +02:00
Ralf Thielow
d35ea4dec6 l10n: de.po: translate 38 new messages
Translate 38 new messages came from git.pot update in fe05e19
(l10n: git.pot: v2.1.0 round 1 (38 new, 9 removed)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2014-08-29 07:07:59 +02:00
Shawn Pearce
5d146f7a0f Document LF appearing in shallow command during send-pack/receive-pack
The implementation sends an LF, but the protocol documentation was
missing this detail.

Signed-off-by: Shawn Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-08-28 15:13:55 -07:00
Jeff King
26be19ba8d send-pack: take refspecs over stdin
Pushing a large number of refs works over most transports,
because we implement send-pack as an internal function.
However, it can sometimes fail when pushing over http,
because we have to spawn "git send-pack --stateless-rpc" to
do the heavy lifting, and we pass each refspec on the
command line. This can cause us to overflow the OS limits on
the size of the command line for a large push.

We can solve this by giving send-pack a --stdin option and
using it from remote-curl.  We already dealt with this on
the fetch-pack side in 078b895 (fetch-pack: new --stdin
option to read refs from stdin, 2012-04-02). The stdin
option (and in particular, its use of packet-lines for
stateless-rpc input) is modeled after that solution.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-08-26 12:58:02 -07:00
Junio C Hamano
4109c28e05 Merge branch 'jk/diff-tree-t-fix'
Fix (rarely used) "git diff-tree -t" regression in 2.0.

* jk/diff-tree-t-fix:
  intersect_paths: respect mode in git's tree-sort
2014-08-26 11:16:26 -07:00
Junio C Hamano
a3d54f9a1f Merge branch 'jk/pack-shallow-always-without-bitmap'
Reachability bitmaps do not work with shallow operations.
Fixes regression in 2.0.

* jk/pack-shallow-always-without-bitmap:
  pack-objects: turn off bitmaps when we see --shallow lines
2014-08-26 11:16:25 -07:00
Junio C Hamano
212d781c96 Merge branch 'jk/fix-profile-feedback-build'
Fix profile-feedback build broken in 2.1 for tarball releases.

* jk/fix-profile-feedback-build:
  Makefile: make perf tests optional for profile build
2014-08-26 11:16:25 -07:00
Jonathan Nieder
6a143aa2b2 checkout -m: attempt merge when deletion of path was staged
twoway_merge() is missing an o->gently check in the case where a file
that needs to be modified is missing from the index but present in the
old and new trees.  As a result, in this case 'git checkout -m' errors
out instead of trying to perform a merge.

Fix it by checking o->gently.  While at it, inline the o->gently check
into reject_merge to prevent future call sites from making the same
mistake.

Noticed by code inspection.  The test for the motivating case was
added by JC.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-08-25 15:17:34 -07:00
Junio C Hamano
c285171dac Merge git://github.com/git-l10n/git-po
* git://github.com/git-l10n/git-po:
  l10n: de.po: improve message when switching branches
  l10n: de.po: fix typo
  po/TEAMS: Add Catalan team
  l10n: Add Catalan translation
  l10n: fr.po (2257t) update for version 2.1.0
  l10n: sv.po: Update Swedish translation (2257t0f0u)
  l10n: vi.po (2257t): Update translation
  l10n: Updated Bulgarian translation of git (2257t,0f,0u)
  l10n: zh_CN: translations for git v2.1.0-rc0
  l10n: git.pot: v2.1.0 round 1 (38 new, 9 removed)
  l10n: Updated Bulgarian translation of git (2247t,0f,0u)
  l10n: Updated Bulgarian translation of git (2228t,0f,0u)
  l10n: Fix more typos in the Swedish translations
2014-08-25 15:12:58 -07:00
Jeff King
0fa7f01635 git-prompt: do not look for refs/stash in $GIT_DIR
Since dd0b72c (bash prompt: use bash builtins to check stash
state, 2011-04-01), git-prompt checks whether we have a
stash by looking for $GIT_DIR/refs/stash. Generally external
programs should never do this, because they would miss
packed-refs.

That commit claims that packed-refs does not pack
refs/stash, but that is not quite true. It does pack the
ref, but due to a bug, fails to prune the ref. When we fix
that bug, we would want to be doing the right thing here.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-08-25 12:21:17 -07:00
Jeff King
c252785982 fast-import: fix buffer overflow in dump_tags
When creating a new annotated tag, we sprintf the refname
into a static-sized buffer. If we have an absurdly long
tagname, like:

  git init repo &&
  cd repo &&
  git commit --allow-empty -m foo &&
  git tag -m message mytag &&
  git fast-export mytag |
  perl -lpe '/^tag/ and s/mytag/"a" x 8192/e' |
  git fast-import <input

we'll overflow the buffer. We can fix it by using a strbuf.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-08-25 12:20:57 -07:00
Jeff King
3c078b9c86 fast-import: clean up pack_data pointer in end_packfile
We have a global pointer pack_data pointing to the current
pack we have open. Inside end_packfile we have two new
pointers, old_p and new_p. The latter points to pack_data,
and the former points to the new "installed" version of the
packfile we get when we hand the file off to the regular
sha1_file machinery. When then free old_p.

Presumably the extra old_p pointer was there so that we
could overwrite pack_data with new_p and still free old_p,
but we don't do that. We just leave pack_data pointing to
bogus memory, and don't overwrite it until we call
start_packfile again (if ever).

This can cause problems for our die routine, which calls
end_packfile to clean things up. If we die at the wrong
moment, we can end up looking at invalid memory in
pack_data left after the last end_packfile().

Instead, let's make sure we set pack_data to NULL after we
free it, and make calling endfile() again with a NULL
pack_data a noop (there is nothing to end).

We can further make things less confusing by dropping old_p
entirely, and moving new_p closer to its point of use.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-08-25 12:20:24 -07:00
Jeff King
afd11d3ebc pack-refs: prune top-level refs like "refs/foo"
After we have packed all refs, we prune any loose refs that
correspond to what we packed. We do so by first taking a
lock with lock_ref_sha1, and then deleting the loose ref
file.

However, lock_ref_sha1 will refuse to take a lock on any
refs that exist at the top-level of the "refs/" directory,
and we skip pruning the ref.  This is almost certainly not
what we want to happen here. The criteria to be pruned
should not differ from that to be packed; if a ref makes it
to prune_ref, it's because we want it both packed and
pruned (if there are refs you do not want to be packed, they
should be omitted much earlier by pack_ref_is_possible,
which we do in this case if --all is not given).

We can fix this by switching to lock_any_ref_for_update.
This behaves exactly the same with the exception of this
top-level check.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-08-25 12:19:50 -07:00
Ralf Thielow
869951babc l10n: de.po: improve message when switching branches
Suggested-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2014-08-23 19:17:38 +02:00
Ralf Thielow
795b9ff872 l10n: de.po: fix typo
Reported-by: Hartmut Henkel
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2014-08-23 19:17:38 +02:00
Alex Henrie
47abf17be5 po/TEAMS: Add Catalan team
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2014-08-22 20:10:30 -06:00