Граф коммитов

56617 Коммитов

Автор SHA1 Сообщение Дата
Denton Liu 2b9bd488ae completion: teach rebase to use __gitcomp_builtin
Currently, _git_rebase() uses a hardcoded list of options for its
completion. However, we can use __gitcomp_builtin() to get a dynamically
generated list of completions instead.

Teach _git_rebase() to use __gitcomp_builtin() so that newly implemented
options in rebase will be automatically completed without any mucking
around in git-completion.bash.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-09-12 13:45:28 -07:00
Junio C Hamano f1d4a28250 Second batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-09-09 12:31:27 -07:00
Junio C Hamano c8ada15456 Merge branch 'bc/reread-attributes-during-rebase'
The "git am" based backend of "git rebase" ignored the result of
updating ".gitattributes" done in one step when replaying
subsequent steps.

* bc/reread-attributes-during-rebase:
  am: reload .gitattributes after patching it
  path: add a function to check for path suffix
2019-09-09 12:26:40 -07:00
Junio C Hamano 8f3ba423e7 Merge branch 'tg/t0021-racefix'
A test fix.

* tg/t0021-racefix:
  t0021: make sure clean filter runs
2019-09-09 12:26:40 -07:00
Junio C Hamano a477abe9e4 Merge branch 'mp/for-each-ref-missing-name-or-email'
"for-each-ref" and friends that shows refs did not protect themselves
against ancient tags that did not record tagger names when asked to
show "%(taggername)", which have been corrected.

* mp/for-each-ref-missing-name-or-email:
  ref-filter: initialize empty name or email fields
2019-09-09 12:26:39 -07:00
Junio C Hamano d49c2c3466 Merge branch 'sb/userdiff-dts'
Device-tree files learned their own userdiff patterns.

* sb/userdiff-dts:
  userdiff: add a builtin pattern for dts files
2019-09-09 12:26:39 -07:00
Junio C Hamano 2743b61bc6 Merge branch 'rs/sort-oid-array-thread-safe'
Prepare get_short_oid() codepath to be thread-safe.

* rs/sort-oid-array-thread-safe:
  sha1-name: make sort_ambiguous_oid_array() thread-safe
2019-09-09 12:26:39 -07:00
Junio C Hamano 4c49dd042d Merge branch 'nd/diff-parseopt'
Compilation fix.

* nd/diff-parseopt:
  parseopt: move definition of enum parse_opt_result up
2019-09-09 12:26:38 -07:00
Junio C Hamano d8b1ce7972 Merge branch 'jt/diff-lazy-fetch-submodule-fix'
On-demand object fetching in lazy clone incorrectly tried to fetch
commits from submodule projects, while still working in the
superproject, which has been corrected.

* jt/diff-lazy-fetch-submodule-fix:
  diff: skip GITLINK when lazy fetching missing objs
2019-09-09 12:26:38 -07:00
Junio C Hamano 8ce8a63b46 Merge branch 'ds/midx-expire-repack'
Code cleanup.

* ds/midx-expire-repack:
  packfile.h: drop extern from function declaration
2019-09-09 12:26:38 -07:00
Junio C Hamano 9437394661 Merge branch 'cb/fetch-set-upstream'
"git fetch" learned "--set-upstream" option to help those who first
clone from their private fork they intend to push to, add the true
upstream via "git remote add" and then "git fetch" from it.

* cb/fetch-set-upstream:
  pull, fetch: add --set-upstream option
2019-09-09 12:26:37 -07:00
Junio C Hamano af2b8faf49 Merge branch 'rs/pax-extended-header-length-fix'
"git archive" recorded incorrect length in extended pax header in
some corner cases, which has been corrected.

* rs/pax-extended-header-length-fix:
  archive-tar: turn length miscalculation warning into BUG
  archive-tar: use size_t in strbuf_append_ext_header()
  archive-tar: fix pax extended header length calculation
  archive-tar: report wrong pax extended header length
2019-09-09 12:26:37 -07:00
Junio C Hamano fa9e7934c7 Merge branch 'bm/repository-layout-typofix'
Typofix.

* bm/repository-layout-typofix:
  repository-layout.txt: correct pluralization of 'object'
2019-09-09 12:26:37 -07:00
Junio C Hamano d1a251a1fa Merge branch 'en/checkout-mismerge-fix'
Fix a mismerge that happened in 2.22 timeframe.

* en/checkout-mismerge-fix:
  checkout: remove duplicate code
2019-09-09 12:26:36 -07:00
Junio C Hamano e1151704f2 Merge branch 'sg/diff-indent-heuristic-non-experimental'
We promoted the "indent heuristics" that decides where to split
diff hunks from experimental to the default a few years ago, but
some stale documentation still marked it as experimental, which has
been corrected.

* sg/diff-indent-heuristic-non-experimental:
  diff: 'diff.indentHeuristic' is no longer experimental
2019-09-09 12:26:36 -07:00
Junio C Hamano f4f8dfe127 Merge branch 'ds/feature-macros'
A mechanism to affect the default setting for a (related) group of
configuration variables is introduced.

* ds/feature-macros:
  repo-settings: create feature.experimental setting
  repo-settings: create feature.manyFiles setting
  repo-settings: parse core.untrackedCache
  commit-graph: turn on commit-graph by default
  t6501: use 'git gc' in quiet mode
  repo-settings: consolidate some config settings
2019-09-09 12:26:36 -07:00
Junio C Hamano 4a12f89865 Merge branch 'jk/eoo'
The command line parser learned "--end-of-options" notation; the
standard convention for scripters to have hardcoded set of options
first on the command line, and force the command to treat end-user
input as non-options, has been to use "--" as the delimiter, but
that would not work for commands that use "--" as a delimiter
between revs and pathspec.

* jk/eoo:
  gitcli: document --end-of-options
  parse-options: allow --end-of-options as a synonym for "--"
  revision: allow --end-of-options to end option parsing
2019-09-09 12:26:36 -07:00
Junio C Hamano b4a1eec332 Merge branch 'jk/repo-init-cleanup'
Further clean-up of the initialization code.

* jk/repo-init-cleanup:
  config: stop checking whether the_repository is NULL
  common-main: delay trace2 initialization
  t1309: use short branch name in includeIf.onbranch test
2019-09-09 12:26:35 -07:00
Junio C Hamano 70336bd50a Merge branch 'py/git-gui-do-quit'
"git gui" learned to call the clean-up procedure before exiting.

* py/git-gui-do-quit:
  git-gui: call do_quit before destroying the main window
2019-09-09 12:26:35 -07:00
brian m. carlson 2c65d90f75 am: reload .gitattributes after patching it
When applying multiple patches with git am, or when rebasing using the
am backend, it's possible that one of our patches has updated a
gitattributes file. Currently, we cache this information, so if a
file in a subsequent patch has attributes applied, the file will be
written out with the attributes in place as of the time we started the
rebase or am operation, not with the attributes applied by the previous
patch. This problem does not occur when using the -m or -i flags to
rebase.

To ensure we write the correct data into the working tree, expire the
cache after each patch that touches a path ending in ".gitattributes".
Since we load these attributes in multiple separate files, we must
expire them accordingly.

Verify that both the am and rebase code paths work correctly, including
the conflict marker size with am -3.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-09-03 15:16:18 -07:00
brian m. carlson ce17feb1b3 path: add a function to check for path suffix
We have a function to strip the path suffix from a commit, but we don't
have one to check for a path suffix. For a plain filename, we can use
basename, but that requires an allocation, since POSIX allows it to
modify its argument. Refactor strip_path_suffix into a helper function
and a new function, ends_with_path_components, to meet this need.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-26 10:36:13 -07:00
Junio C Hamano 745f681289 First batch after Git 2.23
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-22 12:41:04 -07:00
Junio C Hamano d4b12b9e07 Merge branch 'sg/worktree-remove-errormsg'
Error message update/clarification.

* sg/worktree-remove-errormsg:
  worktree remove: clarify error message on dirty worktree
2019-08-22 12:34:12 -07:00
Junio C Hamano 22e86e85cb Merge branch 'en/fast-import-merge-doc'
Doc update.

* en/fast-import-merge-doc:
  git-fast-import.txt: clarify that multiple merge commits are allowed
2019-08-22 12:34:12 -07:00
Junio C Hamano 9c7573581c Merge branch 'jk/perf-no-dups'
Test & perf scripts must use unique numeric prefix, but a pair
shared the same number, which is fixed here.

* jk/perf-no-dups:
  t/perf: rename duplicate-numbered test script
2019-08-22 12:34:11 -07:00
Junio C Hamano 4336fdb2ef Merge branch 'rs/nedalloc-fixlets'
Compilation fix.

* rs/nedalloc-fixlets:
  nedmalloc: avoid compiler warning about unused value
  nedmalloc: do assignments only after the declaration section
2019-08-22 12:34:11 -07:00
Junio C Hamano 8ae7a46c4d Merge branch 'sg/show-failed-test-names'
The first line of verbose output from each test piece now carries
the test name and number to help scanning with eyeballs.

* sg/show-failed-test-names:
  tests: show the test name and number at the start of verbose output
  t0000-basic: use realistic test script names in the verbose tests
2019-08-22 12:34:11 -07:00
Junio C Hamano 6ba06b582b Merge branch 'sg/commit-graph-validate'
The code to write commit-graph over given commit object names has
been made a bit more robust.

* sg/commit-graph-validate:
  commit-graph: error out on invalid commit oids in 'write --stdin-commits'
  commit-graph: turn a group of write-related macro flags into an enum
  t5318-commit-graph: use 'test_expect_code'
2019-08-22 12:34:11 -07:00
Junio C Hamano 072735ea58 Merge branch 'vn/restore-empty-ita-corner-case-fix'
"git checkout" and "git restore" to re-populate the index from a
tree-ish (typically HEAD) did not work correctly for a path that
was removed and then added again with the intent-to-add bit, when
the corresponding working tree file was empty.  This has been
corrected.

* vn/restore-empty-ita-corner-case-fix:
  restore: add test for deleted ita files
  checkout.c: unstage empty deleted ita files
2019-08-22 12:34:11 -07:00
Junio C Hamano 207ad3cb20 Merge branch 'sc/pack-refs-deletion-racefix'
"git pack-refs" can lose refs that are created while running, which
is getting corrected.

* sc/pack-refs-deletion-racefix:
  pack-refs: always refresh after taking the lock file
2019-08-22 12:34:10 -07:00
Junio C Hamano 77067b6ce8 Merge branch 'sg/do-not-skip-non-httpd-tests'
Test fix.

* sg/do-not-skip-non-httpd-tests:
  t: warn against adding non-httpd-specific tests after sourcing 'lib-httpd'
  t5703: run all non-httpd-specific tests before sourcing 'lib-httpd.sh'
  t5510-fetch: run non-httpd-specific test before sourcing 'lib-httpd.sh'
2019-08-22 12:34:10 -07:00
Junio C Hamano 1b01cdbf2e Merge branch 'jk/tree-walk-overflow'
Codepaths to walk tree objects have been audited for integer
overflows and hardened.

* jk/tree-walk-overflow:
  tree-walk: harden make_traverse_path() length computations
  tree-walk: add a strbuf wrapper for make_traverse_path()
  tree-walk: accept a raw length for traverse_path_len()
  tree-walk: use size_t consistently
  tree-walk: drop oid from traverse_info
  setup_traverse_info(): stop copying oid
2019-08-22 12:34:10 -07:00
Junio C Hamano 8aa76abba5 Merge branch 'sg/t5510-test-i18ngrep-fix'
Test fix.

* sg/t5510-test-i18ngrep-fix:
  t5510-fetch: fix negated 'test_i18ngrep' invocation
2019-08-22 12:34:10 -07:00
Junio C Hamano 307179732d Merge branch 'mt/grep-submodules-working-tree'
"git grep --recurse-submodules" that looks at the working tree
files looked at the contents in the index in submodules, instead of
files in the working tree.

* mt/grep-submodules-working-tree:
  grep: fix worktree case in submodules
2019-08-22 12:34:10 -07:00
Thomas Gummerer 58166c2e9d t0021: make sure clean filter runs
In t0021.15 one of the things we are checking is that the clean filter
is run when checking out empty-branch.  The clean filter needs to be
run to make sure there are no modifications on the file system for the
test.r file, and thus it isn't dangerous to overwrite it.

However in the current test setup it is not always necessary to run
the clean filter, and thus the test sometimes fails, as debug.log
isn't written.

This happens when test.r has an older mtime than the index itself.
That mtime is also recorded as stat data for test.r in the index, and
based on the heuristic we're using for index entries, git correctly
assumes this file is up-to-date.

Usually this test succeeds because the mtime of test.r is the same as
the mtime of the index.  In this case test.r is racily clean, so git
actually checks the contents, for which the clean filter is run.

Fix the test by updating the mtime of test.r, so git is forced to
check the contents of the file, and the clean filter is run as the
test expects.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-22 12:32:59 -07:00
Mischa POSLAWSKY 8b3f33ef11 ref-filter: initialize empty name or email fields
Formatting $(taggername) on headerless tags such as v0.99 in Git
causes a SIGABRT with error "munmap_chunk(): invalid pointer",
because of an oversight in commit f0062d3b74 (ref-filter: free
item->value and item->value->s, 2018-10-19).

Signed-off-by: Mischa POSLAWSKY <git@shiar.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-22 11:14:45 -07:00
Stephen Boyd 3c81760bc6 userdiff: add a builtin pattern for dts files
The Linux kernel receives many patches to the devicetree files each
release. The hunk header for those patches typically show nothing,
making it difficult to figure out what node is being modified without
applying the patch or opening the file and seeking to the context. Let's
add a builtin 'dts' pattern to git so that users can get better diff
output on dts files when they use the diff=dts driver.

The regex has been constructed based on the spec at devicetree.org[1]
and with some help from Johannes Sixt.

[1] https://github.com/devicetree-org/devicetree-specification/releases/latest

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-21 15:09:34 -07:00
Jonathan Tan a63694f523 diff: skip GITLINK when lazy fetching missing objs
In 7fbbcb21b1 ("diff: batch fetching of missing blobs", 2019-04-08),
diff was taught to batch the fetching of missing objects when operating
on a partial clone, but was not taught to refrain from fetching
GITLINKs. Teach diff to check if an object is a GITLINK before including
it in the set to be fetched.

(As stated in the commit message of that commit, unpack-trees was also
taught a similar thing prior, but unpack-trees correctly checks for
GITLINK before including objects in the set to be fetched.)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-20 15:04:26 -07:00
René Scharfe 7cfcb16b0e sha1-name: make sort_ambiguous_oid_array() thread-safe
Use QSORT_S instead of QSORT, which allows passing the repository
pointer to the comparison function without using a static variable.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-20 13:59:59 -07:00
René Scharfe 19800bdc3f parseopt: move definition of enum parse_opt_result up
Define enum parse_opt_result before using it in a typedef.  This avoids
the following compiler warning:

   ./parse-options.h:53:14: error: ISO C forbids forward references to 'enum' types [-Werror,-Wpedantic]
   typedef enum parse_opt_result parse_opt_ll_cb(struct parse_opt_ctx_t *ctx,
                ^

While GCC and Clang both accept such a forward reference by default,
other compilers might be less forgiving.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-20 12:37:30 -07:00
Denton Liu 415b770b88 packfile.h: drop extern from function declaration
In 336226c259 (packfile.h: drop extern from function declarations,
2019-04-05), `extern` was removed from function declarations because
it's redundant. However, in 8434e85d5f (repack: refactor pack deletion
for future use, 2019-06-10), an `extern` was mistakenly included.

Remove this spurious `extern`.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-20 11:29:31 -07:00
Ben Milman 1c24a54ea4 repository-layout.txt: correct pluralization of 'object'
In the description of 'objects/pack', 'object' should be
pluralized to match the subject and agree with the
rest of the sentence.

Signed-off-by: Ben Milman <bpmilman@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-19 15:28:51 -07:00
Corentin BOMPARD 24bc1a1292 pull, fetch: add --set-upstream option
Add the --set-upstream option to git pull/fetch
which lets the user set the upstream configuration
(branch.<current-branch-name>.merge and
branch.<current-branch-name>.remote) for the current branch.

A typical use-case is:

    git clone http://example.com/my-public-fork
    git remote add main http://example.com/project-main-repo
    git pull --set-upstream main master

or, instead of the last line:

    git fetch --set-upstream main master
    git merge # or git rebase

This is mostly equivalent to cloning project-main-repo (which sets
upsteam) and then "git remote add" my-public-fork, but may feel more
natural for people using a hosting system which allows forking from
the web UI.

This functionality is analog to "git push --set-upstream".

Signed-off-by: Corentin BOMPARD <corentin.bompard@etu.univ-lyon1.fr>
Signed-off-by: Nathan BERBEZIER <nathan.berbezier@etu.univ-lyon1.fr>
Signed-off-by: Pablo CHABANNE <pablo.chabanne@etu.univ-lyon1.fr>
Signed-off-by: Matthieu Moy <git@matthieu-moy.fr>
Patch-edited-by: Matthieu Moy <git@matthieu-moy.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-19 13:05:58 -07:00
René Scharfe 71d41ff651 archive-tar: turn length miscalculation warning into BUG
Now that we're confident our pax extended header calculation is correct,
turn the criticality of the assertion up to the maximum, from warning
right up to BUG.  Simplify the test, as the stderr comparison step would
not be reached in case the BUG message is triggered.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-19 10:49:00 -07:00
René Scharfe 17e9ef00d2 archive-tar: use size_t in strbuf_append_ext_header()
One of its callers already passes in a size_t value.  Use it
consistently in this function.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-19 10:49:00 -07:00
René Scharfe 82a46af13e archive-tar: fix pax extended header length calculation
A pax extended header record starts with a decimal number.  Its value
is the length of the whole record, including its own length.

The calculation of that number in strbuf_append_ext_header() is off by
one in case the length of the rest is close to a higher order of
magnitude.  This affects paths and link targets a bit shorter than 1000,
10000, 100000 etc. characters -- paths with a length of up to 100 fit
into the tar header and don't need a pax extended header.

The mistake has been present since the function was added by ae64bbc18c
("tar-tree: Introduce write_entry()", 2006-03-25).

Account for digits added to len during the loop and keep incrementing
until we have enough space for len and the rest.  The crucial change is
to check against the current value of len before each iteration, instead
of against its value before the loop.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-19 10:48:02 -07:00
René Scharfe 4060c1990a archive-tar: report wrong pax extended header length
Extended header entries contain a length value that is a bit tricky to
calculate because it includes its own length (number of decimal digits)
as well.  We get it wrong in corner cases.  Add a check, report wrong
results as a warning and add a test for exercising it.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-19 10:47:28 -07:00
Junio C Hamano 5fa0f5238b Git 2.23
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-16 10:28:23 -07:00
Junio C Hamano 8e0fa0e056 l10n-2.23.0-rnd2
-----BEGIN PGP SIGNATURE-----
 
 iQJNBAABCgA3FiEET/4dIHc7EQTOoGRdx6TpG3VEeigFAl1WcV4ZHHdvcmxkaGVs
 bG8ubmV0QGdtYWlsLmNvbQAKCRDHpOkbdUR6KMXWD/99nW+vms2G0BfpWcCdBzmS
 e4TCLis53FgXX/1n2OAIMoBHg+6uLyzfA1eePOlzFUAJJD2L+vp0jRCDs6IFa5vd
 a+RwoRBJveQW9h1K713b+iyEuQaIsPV8xL8sDwDapli/mRy9uSXJW3hpd8ACpO2P
 BHLSQYzHxojb3/Orp5mwloZUvuGEfabLMiBMXCKzcCzULN3C/f/zpDse4C06hIDD
 bO5wwJcmiasBNPsEOvIs/rtUKBksAvmiFyj8DfSNhdP6rxOcp/+X0jDVekLr08i5
 Ou/5SDmKiTH5JCM385QYgYBw7OZlGcG6q8ETZ6wpmwuvVx/Eb/FcM03O/Q2k49K2
 WbaMhbnQZHG9TMsLMLLzcBGixsnrau5Hl5KQW5OuGtSEk0ZD8VNuRE1GHhGm/yve
 LFNBurL3S7MRj2W18aCXEQin7Wk3iuH72gcQ2WV836JkVHAyEzD6ewbzsfL895/i
 7PfnXOgh09P/WnjpfpZGTlUD5vFEfLo6OcfUCDhF2fooozqih83tccRGEuF5Kam4
 53MMVSDws7zvVC+cYpUAupMJvTswH76+qTX4nYRvCI9R/UFJ3hXukBElsRFbhTaO
 fyJCtO/EFfzhvShADElEP5MAy0gtQdGYLzqoCQLXIAmfzPn089OZbnx7IeCao2ig
 SwXvhx56kGvGhn/l0VMfrw==
 =kBji
 -----END PGP SIGNATURE-----

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

l10n-2.23.0-rnd2
2019-08-16 10:22:51 -07:00
Elijah Newren acb7da05ac checkout: remove duplicate code
Both commit a7256debd4 ("checkout.txt: note about losing staged
changes with --merge", 2019-03-19) from nd/checkout-m-doc-update and
commit 6eff409e8a ("checkout: prevent losing staged changes with
--merge", 2019-03-22) from nd/checkout-m were included in git.git
despite the fact that the latter was meant to be v2 of the former.
The merge of these two topics resulted in a redundant chunk of code;
remove it.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-08-16 09:58:00 -07:00