1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-01 06:47:52 +01:00
Commit graph

49163 commits

Author SHA1 Message Date
Brandon Williams
02f2f56bc3 diff: convert flags to be stored in bitfields
We cannot add many more flags to the diff machinery due to the
limitations of the number of flags that can be stored in a single
unsigned int.  In order to allow for more flags to be added to the diff
machinery in the future this patch converts the flags to be stored in
bitfields in 'struct diff_flags'.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-01 11:50:02 +09:00
Brandon Williams
c9f348e926 add, reset: use DIFF_OPT_SET macro to set a diff flag
Instead of explicitly setting the 'DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG'
flag, use the 'DIFF_OPT_SET' macro.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-31 13:33:08 +09:00
Junio C Hamano
2f899857a9 Hopefully final batch before 2.15
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-28 10:20:30 +09:00
Junio C Hamano
d8f3074c48 Merge branch 'sg/rev-list-doc-reorder-fix'
Doc flow fix.

* sg/rev-list-doc-reorder-fix:
  rev-list-options.txt: use correct directional reference
2017-10-28 10:18:42 +09:00
Junio C Hamano
986ffdc83e Merge branch 'sb/rev-parse-show-superproject-root'
Doc markup fix.

* sb/rev-parse-show-superproject-root:
  docs: fix formatting of rev-parse's --show-superproject-working-tree
2017-10-28 10:18:40 +09:00
Junio C Hamano
fd052e4f9a Merge branch 'ao/path-use-xmalloc'
A possible oom error is now caught as a fatal error, instead of
continuing and dereferencing NULL.

* ao/path-use-xmalloc:
  path.c: use xmalloc() in add_to_trie()
2017-10-28 10:18:40 +09:00
Junio C Hamano
2d8f12d282 Merge branch 'np/config-path-doc'
Doc update.

* np/config-path-doc:
  config doc: clarify "git config --path" example
2017-10-28 10:18:39 +09:00
Sebastian Schuberth
e38c681fb7 docs: fix formatting of rev-parse's --show-superproject-working-tree
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-27 10:31:46 +09:00
SZEDER Gábor
4f851dc883 rev-list-options.txt: use correct directional reference
The descriptions of the options '--parents', '--children' and
'--graph' say "see 'History Simplification' below", although the
referred section is in fact above the description of these options.

Send readers in the right direction by saying "above" instead of
"below".

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-27 10:29:38 +09:00
Junio C Hamano
4e40fb302e Merge branch 'mh/ref-locking-fix'
Transactions to update multiple references that involves a deletion
was quite broken in an error codepath and did not abort everything
correctly.

* mh/ref-locking-fix:
  files_transaction_prepare(): fix handling of ref lock failure
  t1404: add a bunch of tests of D/F conflicts
2017-10-26 12:29:23 +09:00
Andrey Okoshkin
55d7d15847 path.c: use xmalloc() in add_to_trie()
Add usage of xmalloc() instead of malloc() in add_to_trie() as xmalloc wraps
and checks memory allocation result.

Signed-off-by: Andrey Okoshkin <a.okoshkin@samsung.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-25 16:16:22 +09:00
Michael Haggerty
da5267f1b6 files_transaction_prepare(): fix handling of ref lock failure
Since dc39e09942 (files_ref_store: use a transaction to update packed
refs, 2017-09-08), failure to lock a reference has been handled
incorrectly by `files_transaction_prepare()`. If
`lock_ref_for_update()` fails in the lock-acquisition loop of that
function, it sets `ret` then breaks out of that loop. Prior to
dc39e09942, that was OK, because the only thing following the loop was
the cleanup code. But dc39e09942 added another blurb of code between
the loop and the cleanup. That blurb sometimes resets `ret` to zero,
making the cleanup code think that the locking was successful.

Specifically, whenever

* One or more reference deletions have been processed successfully in
  the lock-acquisition loop. (Processing the first such reference
  causes a packed-ref transaction to be initialized.)

* Then `lock_ref_for_update()` fails for a subsequent reference. Such
  a failure can happen for a number of reasons, such as the old SHA-1
  not being correct, lock contention, etc. This causes a `break` out
  of the lock-acquisition loop.

* The `packed-refs` lock is acquired successfully and
  `ref_transaction_prepare()` succeeds for the packed-ref transaction.
  This has the effect of resetting `ret` back to 0, and making the
  cleanup code think that lock acquisition was successful.

In that case, any reference updates that were processed prior to
breaking out of the loop would be carried out (loose and packed), but
the reference that couldn't be locked and any subsequent references
would silently be ignored.

This can easily cause data loss if, for example, the user was trying
to push a new name for an existing branch while deleting the old name.
After the push, the branch could be left unreachable, and could even
subsequently be garbage-collected.

This problem was noticed in the context of deleting one reference and
creating another in a single transaction, when the two references D/F
conflict with each other, like

    git update-ref --stdin <<EOF
    delete refs/foo
    create refs/foo/bar HEAD
    EOF

This triggers the above bug because the deletion is processed
successfully for `refs/foo`, then the D/F conflict causes
`lock_ref_for_update()` to fail when `refs/foo/bar` is processed. In
this case the transaction *should* fail, but instead it causes
`refs/foo` to be deleted without creating `refs/foo`. This could
easily result in data loss.

The fix is simple: instead of just breaking out of the loop, jump
directly to the cleanup code. This fixes some tests in t1404 that were
added in the previous commit.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-25 15:08:26 +09:00
Michael Haggerty
2e9de01aa0 t1404: add a bunch of tests of D/F conflicts
It is currently not allowed, in a single transaction, to add one
reference and delete another reference if the two reference names D/F
conflict with each other (e.g., like `refs/foo/bar` and `refs/foo`).
The reason is that the code would need to take locks

    $GIT_DIR/refs/foo.lock
    $GIT_DIR/refs/foo/bar.lock

But the latter lock couldn't coexist with the loose reference file

    $GIT_DIR/refs/foo

, because `$GIT_DIR/refs/foo` cannot be both a directory and a file at
the same time (hence the name "D/F conflict).

Add a bunch of tests that we cleanly reject such transactions.

In fact, many of the new tests currently fail. They will be fixed in
the next commit along with an explanation.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-25 15:08:26 +09:00
Junio C Hamano
ba78f398be l10n for Git 2.15.0 round 2
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZ7qObAAoJEMek6Rt1RHoo+hsP/R5Sw5vqBW5PEhzGjbSElMSo
 jGHrrhir/4SIOIjX1ayCTfjjXBSBScYUsOiEo6wECHn1OEyGUpSs2GXEc/ESokqQ
 zs5iazU2XQZQt2Os18UpKLWSOxpq0AqxsAPi7Uk8Tezh3NzvpL2zyy1SUMkWH/WD
 VYEv8dYVP2y9NKHUOfxSwwSH0etAJ4K9BWQ2lWxuQbKRXFx83Bo0YKjrRiVLVcNN
 /g7VqLbE/422L/8Q554n7/LFbAvWOPslh8XhAfSz+g/sc5lVX0XF2e/EaWss/q8e
 JtJObBXZPGTWMHxPhjKjL9UQ8HwDH9zcoN2mOcZFqI+PYpas7NZ2LrN0XLTENOe7
 Ya4fls/tofKDohY0A5KqzLN2DeTkUnSS7eImB9tLmb9RenS29PklNCWd8RwsZlNB
 5ReNEiGFlK3heLGEmyl8vnEex7lOzbG7HK75OfJslvmR/kc3D1ytzaZx3j3LxlMN
 L5VsSxE7fPZM1pevjq93xVbHT7dLNCkCAzKQxQTgnONCKALjO/KTql94maFNWiVt
 1XRn06YQC+LUmhmiqfNjlA4F67qFExz2K7wuZJwRXEnoSZ2RyO6nLKNPlzRDx73g
 IMrTsUNbqu3mtUN9rHzve4npVxdzKQr1D4AOXBg++UEjTWbYeyuCIhGclq9PE4re
 191Z0SKX4loqpBLdjk1w
 =jovy
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.15.0-rnd2' of git://github.com/git-l10n/git-po

l10n for Git 2.15.0 round 2

* tag 'l10n-2.15.0-rnd2' of git://github.com/git-l10n/git-po: (22 commits)
  l10n: zh_CN: review for git v2.15.0 l10n round 2
  l10n: zh_CN: for git v2.15.0 l10n round 2
  l10n: de.po: fix typos
  l10n: de.po: translate 70 new messages
  l10n: ru.po: update Russian translation
  l10n: vi.po(3245t): Updated Vietnamese translation for v2.15.0 round 2
  l10n: sv.po: Update Swedish translation (3245t0f0u)
  l10n: fr.po: v2.15.0 round 2
  l10n: fr.po change translation of "First, rewinding"
  l10n: fr.po fix some mistakes
  l10n: Update Catalan translation
  l10n: ko.po: Update Korean translation
  l10n: es.po: v2.15.0 round 2
  l10n: git.pot: v2.15.0 round 2 (2 new, 2 removed)
  l10n: ru.po: update Russian translation
  l10n: bg.po: Updated Bulgarian translation (3245t)
  l10n: sv.po: Update Swedish translation (3245t0f0u)
  l10n: vi.po(3245t): Updated Vietnamese translation for v2.15.0
  l10n: es.po: Update translation v2.15.0 round 1
  l10n: git.pot: v2.15.0 round 1 (68 new, 36 removed)
  ...
2017-10-24 11:44:52 +09:00
Jiang Xin
1165e3c317 Merge branch 'jx/zh_CN-proposed' of github.com:jiangxin/git
* 'jx/zh_CN-proposed' of github.com:jiangxin/git:
  l10n: zh_CN: review for git v2.15.0 l10n round 2
  l10n: zh_CN: for git v2.15.0 l10n round 2
2017-10-24 10:11:48 +08:00
Ray Chen
493a93228f l10n: zh_CN: review for git v2.15.0 l10n round 2
Signed-off-by: Ray Chen <oldsharp@gmail.com>
2017-10-24 10:06:39 +08:00
Jiang Xin
6937cb4e3a l10n: zh_CN: for git v2.15.0 l10n round 2
Translate 69 messages (3245t0f0u) for git v2.15.0-rc2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Reviewed-by: 依云 <lilydjwg@gmail.com>
2017-10-24 09:56:58 +08:00
Jiang Xin
466b0d833b Merge branch 'master' of https://github.com/ralfth/git-po-de
* 'master' of https://github.com/ralfth/git-po-de:
  l10n: de.po: fix typos
  l10n: de.po: translate 70 new messages
2017-10-24 09:56:09 +08:00
Andre Hinrichs
27e3e09520 l10n: de.po: fix typos
Signed-off-by: Andre Hinrichs <andre.hinrichs@gmx.de>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2017-10-23 18:42:01 +02:00
Ralf Thielow
38178d7be4 l10n: de.po: translate 70 new messages
Translate 70 new messages came from git.pot update in 25eab542b
(l10n: git.pot: v2.15.0 round 1 (68 new, 36 removed)) and 9c07fab78
(l10n: git.pot: v2.15.0 round 2 (2 new, 2 removed)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2017-10-23 18:41:51 +02:00
Junio C Hamano
c52ca88430 Git 2.14.3
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJZ7YHBAAoJELC16IaWr+bLbCMP/iLZm1btOvbXcATV6sCrqdWJ
 lJdaDxAPipF2vOCvvppw7/lzbcuXokPBWW0v9dMAyXe7fJ1DxfZYReQyBJEHzrdG
 cG6l0SBUL7CSs4IdqFsvq3Qo/4xGqfrdd+54M6ujn+Qus12/0FaE9efVrhv2PhYm
 OAwIlFQCciN8y3YneO/ayo/NmBwNZ3eyQ2LACYjGjCWzNcPi4FHHrWXDQ3oFapGh
 bPzrmME8xRtWEsTB3EZmfjVNrI4K5+WgisHRMjDYiPf18j9dx1ByKOW6WgwBHUDH
 xg4dAS0a4Q18lVY8D4B0BjT71l8VpTtXQwtH4znD5Va9LQWYEc7XkagQp9EFRNBH
 MuIPazfwI9zkZckrkEbOj/y9Fh936IMGhiicCA7gJ9n/Z60AgGJqrHzUwrWzsEfz
 vEvw2lbGhn37tCBaDMdyYnR1iaZzYcsUmw5txESICdIlkPbnmuVOIoRrl4RXBLP+
 /mai3FJr1NDKCzcaWsRkE8YGZAhQukZil/cw61zA3TYeg20ZmzlBY3WUNyjcP2pb
 YAhVXPEDTegbS8BfU3QaWKTbdvQ5yszr5zOYYakVbHJD7TUlKUV+6MWYPNqUYT52
 jHOqWMXMF25/ieJbijdwyYT3/RpgSxWgj4vo5xs5XJ6HCXgtsmYjW8hkG7kY33ed
 e3h76qohhTtdyvpeKtRz
 =7wWT
 -----END PGP SIGNATURE-----

Sync with 2.14.3
2017-10-23 14:54:30 +09:00
Junio C Hamano
fc849d8d6b Git 2.14.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-23 14:44:17 +09:00
Junio C Hamano
95c1a79630 Merge branch 'jk/info-alternates-fix' into maint
A regression fix for 2.11 that made the code to read the list of
alternate object stores overrun the end of the string.

* jk/info-alternates-fix:
  read_info_alternates: warn on non-trivial errors
  read_info_alternates: read contents into strbuf
2017-10-23 14:40:00 +09:00
Junio C Hamano
9fc7bc6568 Merge branch 'jc/fetch-refspec-doc-update' into maint
"git fetch <there> <src>:<dst>" allows an object name on the <src>
side when the other side accepts such a request since Git v2.5, but
the documentation was left stale.

* jc/fetch-refspec-doc-update:
  fetch doc: src side of refspec could be full SHA-1
2017-10-23 14:39:08 +09:00
Junio C Hamano
96c6bb566e Merge branch 'jk/write-in-full-fix' into maint
Many codepaths did not diagnose write failures correctly when disks
go full, due to their misuse of write_in_full() helper function,
which have been corrected.

* jk/write-in-full-fix:
  read_pack_header: handle signed/unsigned comparison in read result
  config: flip return value of store_write_*()
  notes-merge: use ssize_t for write_in_full() return value
  pkt-line: check write_in_full() errors against "< 0"
  convert less-trivial versions of "write_in_full() != len"
  avoid "write_in_full(fd, buf, len) != len" pattern
  get-tar-commit-id: check write_in_full() return against 0
  config: avoid "write_in_full(fd, buf, len) < len" pattern
2017-10-23 14:37:22 +09:00
Junio C Hamano
7186408f24 Merge branch 'rj/no-sign-compare' into maint
Many codepaths have been updated to squelch -Wsign-compare
warnings.

* rj/no-sign-compare:
  ALLOC_GROW: avoid -Wsign-compare warnings
  cache.h: hex2chr() - avoid -Wsign-compare warnings
  commit-slab.h: avoid -Wsign-compare warnings
  git-compat-util.h: xsize_t() - avoid -Wsign-compare warnings
2017-10-23 14:20:18 +09:00
Junio C Hamano
dd3bfe4f5f Merge branch 'ma/ts-cleanups' into maint
Assorted bugfixes and clean-ups.

* ma/ts-cleanups:
  ThreadSanitizer: add suppressions
  strbuf_setlen: don't write to strbuf_slopbuf
  pack-objects: take lock before accessing `remaining`
  convert: always initialize attr_action in convert_attrs
2017-10-23 14:19:02 +09:00
Junio C Hamano
a37b73e9bb Merge branch 'ls/travis-scriptify' into maint
The scripts to drive TravisCI has been reorganized and then an
optimization to avoid spending cycles on a branch whose tip is
tagged has been implemented.

* ls/travis-scriptify:
  travis-ci: fix "skip_branch_tip_with_tag()" string comparison
  travis: dedent a few scripts that are indented overly deeply
  travis-ci: skip a branch build if equal tag is present
  travis-ci: move Travis CI code into dedicated scripts
2017-10-23 14:17:53 +09:00
Junio C Hamano
031062dcab Merge branch 'er/fast-import-dump-refs-on-checkpoint' into maint
The checkpoint command "git fast-import" did not flush updates to
refs and marks unless at least one object was created since the
last checkpoint, which has been corrected, as these things can
happen without any new object getting created.

* er/fast-import-dump-refs-on-checkpoint:
  fast-import: checkpoint: dump branches/tags/marks even if object_count==0
2017-10-23 14:17:27 +09:00
Junio C Hamano
120ce97f9d Merge branch 'jt/fast-export-copy-modify-fix' into maint
"git fast-export" with -M/-C option issued "copy" instruction on a
path that is simultaneously modified, which was incorrect.

* jt/fast-export-copy-modify-fix:
  fast-export: do not copy from modified file
2017-10-23 14:14:51 +09:00
Junio C Hamano
5253ad109a Merge branch 'nd/worktree-kill-parse-ref' into maint
"git branch -M a b" while on a branch that is completely unrelated
to either branch a or branch b misbehaved when multiple worktree
was in use.  This has been fixed.

* nd/worktree-kill-parse-ref:
  branch: fix branch renaming not updating HEADs correctly
2017-10-23 14:14:16 +09:00
Dimitriy Ryazantcev
c8e2301d56 l10n: ru.po: update Russian translation
Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
2017-10-22 20:35:13 +03:00
Jiang Xin
1129cf60a5 Merge branch 'master' of https://github.com/vnwildman/git
* 'master' of https://github.com/vnwildman/git:
  l10n: vi.po(3245t): Updated Vietnamese translation for v2.15.0 round 2
2017-10-22 19:01:07 +08:00
Junio C Hamano
4843cdefe3 Git 2.15-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-19 14:49:17 +09:00
Junio C Hamano
a4ebf9e0c5 Merge branch 'jc/branch-force-doc-readability-fix'
Doc update.

* jc/branch-force-doc-readability-fix:
  branch doc: sprinkle a few commas for readability
2017-10-19 14:45:45 +09:00
Junio C Hamano
e336afdfb6 Merge branch 'dg/filter-branch-filter-order-doc'
Update the documentation for "git filter-branch" so that the filter
options are listed in the same order as they are applied, as
described in an earlier part of the doc.

* dg/filter-branch-filter-order-doc:
  doc: list filter-branch subdirectory-filter first
2017-10-19 14:45:45 +09:00
Junio C Hamano
39a2aeacc5 Merge branch 'jc/fetch-refspec-doc-update'
"git fetch <there> <src>:<dst>" allows an object name on the <src>
side when the other side accepts such a request since Git v2.5, but
the documentation was left stale.

* jc/fetch-refspec-doc-update:
  fetch doc: src side of refspec could be full SHA-1
2017-10-19 14:45:45 +09:00
Junio C Hamano
9f8468be43 Merge branch 'wk/merge-options-gpg-sign-doc'
Doc updates.

* wk/merge-options-gpg-sign-doc:
  Documentation/merge-options.txt: describe -S/--gpg-sign for 'pull'
2017-10-19 14:45:43 +09:00
Nathan Payre
32fceba3fd config doc: clarify "git config --path" example
Change the word "bla" to "section.variable"; "bla" is a placeholder
for a variable name but it wasn't clear for everyone.

While we're here, also reformat this sample command line to use
monospace instead of italics, to better match the rest of the file.

Use a space instead of a dash in "git config", as is common in the
rest of Git's documentation.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: MOY Matthieu <matthieu.moy@univ-lyon1.fr>
Signed-off-by: Daniel Bensoussan <daniel.bensoussan--bohm@etu.univ-lyon1.fr>
Signed-off-by: Timothee Albertin <timothee.albertin@etu.univ-lyon1.fr>
Signed-off-by: Nathan Payre <nathan.payre@etu.univ-lyon1.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-19 13:52:49 +09:00
Jiang Xin
f0d56fb69b Merge branch 'l10n_fr_v2.15.0r2' of git://github.com/jnavila/git
* 'l10n_fr_v2.15.0r2' of git://github.com/jnavila/git:
  l10n: fr.po: v2.15.0 round 2
  l10n: fr.po change translation of "First, rewinding"
  l10n: fr.po fix some mistakes
2017-10-19 08:17:23 +08:00
Jiang Xin
c84ba210d1 Merge branch 'master' of git://github.com/nafmo/git-l10n-sv
* 'master' of git://github.com/nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation (3245t0f0u)
2017-10-19 08:16:30 +08:00
Jiang Xin
56714a998f Merge branch 'master' of https://github.com/Softcatala/git-po
* 'master' of https://github.com/Softcatala/git-po:
  l10n: Update Catalan translation
2017-10-19 08:14:55 +08:00
Jiang Xin
c271fa460c Merge branch 'translation' of https://github.com/ChrisADR/git-po
* 'translation' of https://github.com/ChrisADR/git-po:
  l10n: es.po: v2.15.0 round 2
2017-10-19 08:13:29 +08:00
Tran Ngoc Quan
c744f54e19 l10n: vi.po(3245t): Updated Vietnamese translation for v2.15.0 round 2
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2017-10-19 07:08:04 +07:00
Peter Krefting
51d32e4535 l10n: sv.po: Update Swedish translation (3245t0f0u)
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2017-10-18 19:35:32 +01:00
Jean-Noel Avila
26ce3a3cc8 l10n: fr.po: v2.15.0 round 2
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
2017-10-18 20:28:33 +02:00
Nicolas Cornu
9de197e77b l10n: fr.po change translation of "First, rewinding"
Signed-off-by: Nicolas Cornu <nicolac76@yahoo.fr>
2017-10-18 20:25:57 +02:00
Jean-Noel Avila
285d1b4ee7 l10n: fr.po fix some mistakes
Reported-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jean-Noel Avila <jean-noel.avila@scantech.fr>
2017-10-18 20:25:57 +02:00
Junio C Hamano
660fb3dfa8 Sync with maint
* maint:
  Prepare for 2.14.3
2017-10-18 14:32:17 +09:00
Junio C Hamano
4c2224e839 Prepare for 2.14.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-18 14:24:09 +09:00