]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
4 years agofast-export: allow user to request tags be marked with --mark-tags
Elijah Newren [Thu, 3 Oct 2019 20:27:07 +0000 (13:27 -0700)] 
fast-export: allow user to request tags be marked with --mark-tags

Add a new option, --mark-tags, which will output mark identifiers with
each tag object.  This improves the incremental export story with
--export-marks since it will allow us to record that annotated tags have
been exported, and it is also needed as a step towards supporting nested
tags.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agofast-export: add support for --import-marks-if-exists
Elijah Newren [Thu, 3 Oct 2019 20:27:06 +0000 (13:27 -0700)] 
fast-export: add support for --import-marks-if-exists

fast-import has support for both an --import-marks flag and an
--import-marks-if-exists flag; the latter of which will not die() if the
file does not exist.  fast-export only had support for an --import-marks
flag; add an --import-marks-if-exists flag for consistency.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agofast-import: add support for new 'alias' command
Elijah Newren [Thu, 3 Oct 2019 20:27:05 +0000 (13:27 -0700)] 
fast-import: add support for new 'alias' command

fast-export and fast-import have nice --import-marks flags which allow
for incremental migrations.  However, if there is a mark in
fast-export's file of marks without a corresponding mark in the one for
fast-import, then we run the risk that fast-export tries to send new
objects relative to the mark it knows which fast-import does not,
causing fast-import to fail.

This arises in practice when there is a filter of some sort running
between the fast-export and fast-import processes which prunes some
commits programmatically.  Provide such a filter with the ability to
alias pruned commits to their most recent non-pruned ancestor.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agofast-import: allow tags to be identified by mark labels
Elijah Newren [Thu, 3 Oct 2019 20:27:04 +0000 (13:27 -0700)] 
fast-import: allow tags to be identified by mark labels

Mark identifiers are used in fast-export and fast-import to provide a
label to refer to earlier content.  Blobs are given labels because they
need to be referenced in the commits where they first appear with a
given filename, and commits are given labels because they can be the
parents of other commits.  Tags were never given labels, probably
because they were viewed as unnecessary, but that presents two problems:

   1. It leaves us without a way of referring to previous tags if we
      want to create a tag of a tag (or higher nestings).
   2. It leaves us with no way of recording that a tag has already been
      imported when using --export-marks and --import-marks.

Fix these problems by allowing an optional mark label for tags.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agofast-import: fix handling of deleted tags
Elijah Newren [Thu, 3 Oct 2019 20:27:03 +0000 (13:27 -0700)] 
fast-import: fix handling of deleted tags

If our input stream includes a tag which is later deleted, we were not
properly deleting it.  We did have a step which would delete it, but we
left a tag in the tag list noting that it needed to be updated, and the
updating of annotated tags occurred AFTER ref deletion.  So, when we
record that a tag needs to be deleted, also remove it from the list of
annotated tags to update.

While this has likely been something that has not happened in practice,
it will come up more in order to support nested tags.  For nested tags,
we either need to give temporary names to the intermediate tags and then
delete them, or else we need to use the final name for the intermediate
tags.  If we use the final name for the intermediate tags, then in order
to keep the sanity check that someone doesn't try to update the same tag
twice, we need to delete the ref after creating the intermediate tag.
So, either way nested tags imply the need to delete temporary inner tag
references.

Helped-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agofast-export: fix exporting a tag and nothing else
Elijah Newren [Wed, 25 Sep 2019 01:39:58 +0000 (18:39 -0700)] 
fast-export: fix exporting a tag and nothing else

fast-export allows specifying revision ranges, which can be used to
export a tag without exporting the commit it tags.  fast-export handled
this rather poorly: it would emit a "from :0" directive.  Since marks
start at 1 and increase, this means it refers to an unknown commit and
fast-import will choke on the input.

When we are unable to look up a mark for the object being tagged, use a
"from $HASH" directive instead to fix this problem.

Note that this is quite similar to the behavior fast-export exhibits
with commits and parents when --reference-excluded-parents is passed
along with an excluded commit range.  For tags of excluded commits we do
not require the --reference-excluded-parents flag because we always have
to tag something.  By contrast, when dealing with commits, pruning a
parent is always a viable option, so we need the flag to specify that
parent pruning is not wanted.  (It is slightly weird that
--reference-excluded-parents isn't the default with a separate
--prune-excluded-parents flag, but backward compatibility concerns
resulted in the current defaults.)

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoThird batch
Junio C Hamano [Wed, 18 Sep 2019 18:55:13 +0000 (11:55 -0700)] 
Third batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'jt/avoid-ls-refs-with-http'
Junio C Hamano [Wed, 18 Sep 2019 18:50:10 +0000 (11:50 -0700)] 
Merge branch 'jt/avoid-ls-refs-with-http'

The http transport lacked some optimization the native transports
learned to avoid unnecessary ref advertisement, which has been
corrected.

* jt/avoid-ls-refs-with-http:
  transport: teach all vtables to allow fetch first
  transport-helper: skip ls-refs if unnecessary

4 years agoMerge branch 'md/list-objects-filter-combo'
Junio C Hamano [Wed, 18 Sep 2019 18:50:09 +0000 (11:50 -0700)] 
Merge branch 'md/list-objects-filter-combo'

The list-objects-filter API (used to create a sparse/lazy clone)
learned to take a combined filter specification.

* md/list-objects-filter-combo:
  list-objects-filter-options: make parser void
  list-objects-filter-options: clean up use of ALLOC_GROW
  list-objects-filter-options: allow mult. --filter
  strbuf: give URL-encoding API a char predicate fn
  list-objects-filter-options: make filter_spec a string_list
  list-objects-filter-options: move error check up
  list-objects-filter: implement composite filters
  list-objects-filter-options: always supply *errbuf
  list-objects-filter: put omits set in filter struct
  list-objects-filter: encapsulate filter components

4 years agoMerge branch 'cc/multi-promisor'
Junio C Hamano [Wed, 18 Sep 2019 18:50:09 +0000 (11:50 -0700)] 
Merge branch 'cc/multi-promisor'

Teach the lazy clone machinery that there can be more than one
promisor remote and consult them in order when downloading missing
objects on demand.

* cc/multi-promisor:
  Move core_partial_clone_filter_default to promisor-remote.c
  Move repository_format_partial_clone to promisor-remote.c
  Remove fetch-object.{c,h} in favor of promisor-remote.{c,h}
  remote: add promisor and partial clone config to the doc
  partial-clone: add multiple remotes in the doc
  t0410: test fetching from many promisor remotes
  builtin/fetch: remove unique promisor remote limitation
  promisor-remote: parse remote.*.partialclonefilter
  Use promisor_remote_get_direct() and has_promisor_remote()
  promisor-remote: use repository_format_partial_clone
  promisor-remote: add promisor_remote_reinit()
  promisor-remote: implement promisor_remote_get_direct()
  Add initial support for many promisor remotes
  fetch-object: make functions return an error code
  t0410: remove pipes after git commands

4 years agoMerge branch 'sg/line-log-tree-diff-optim'
Junio C Hamano [Wed, 18 Sep 2019 18:50:09 +0000 (11:50 -0700)] 
Merge branch 'sg/line-log-tree-diff-optim'

Optimize unnecessary full-tree diff away from "git log -L" machinery.

* sg/line-log-tree-diff-optim:
  line-log: avoid unnecessary full tree diffs
  line-log: extract pathspec parsing from line ranges into a helper function

4 years agoMerge branch 'sg/complete-configuration-variables'
Junio C Hamano [Wed, 18 Sep 2019 18:50:08 +0000 (11:50 -0700)] 
Merge branch 'sg/complete-configuration-variables'

Command line completion updates for "git -c var.name=val"

* sg/complete-configuration-variables:
  completion: complete config variables and values for 'git clone --config='
  completion: complete config variables names and values for 'git clone -c'
  completion: complete values of configuration variables after 'git -c var='
  completion: complete configuration sections and variable names for 'git -c'
  completion: split _git_config()
  completion: simplify inner 'case' pattern in __gitcomp()
  completion: use 'sort -u' to deduplicate config variable names
  completion: deduplicate configuration sections
  completion: add tests for 'git config' completion
  completion: complete more values of more 'color.*' configuration variables
  completion: fix a typo in a comment

4 years agoMerge branch 'js/pre-merge-commit-hook'
Junio C Hamano [Wed, 18 Sep 2019 18:50:08 +0000 (11:50 -0700)] 
Merge branch 'js/pre-merge-commit-hook'

A new "pre-merge-commit" hook has been introduced.

* js/pre-merge-commit-hook:
  merge: --no-verify to bypass pre-merge-commit hook
  git-merge: honor pre-merge-commit hook
  merge: do no-verify like commit
  t7503: verify proper hook execution

4 years agoMerge branch 'cb/curl-use-xmalloc'
Junio C Hamano [Wed, 18 Sep 2019 18:50:08 +0000 (11:50 -0700)] 
Merge branch 'cb/curl-use-xmalloc'

Tell cURL library to use the same malloc() implementation, with the
xmalloc() wrapper, as the rest of the system, for consistency.

* cb/curl-use-xmalloc:
  http: use xmalloc with cURL

4 years agoMerge branch 'jk/drop-release-pack-memory'
Junio C Hamano [Wed, 18 Sep 2019 18:50:07 +0000 (11:50 -0700)] 
Merge branch 'jk/drop-release-pack-memory'

xmalloc() used to have a mechanism to ditch memory and address
space resources as the last resort upon seeing an allocation
failure from the underlying malloc(), which made the code complex
and thread-unsafe with dubious benefit, as major memory resource
users already do limit their uses with various other mechanisms.
It has been simplified away.

* jk/drop-release-pack-memory:
  packfile: drop release_pack_memory()

4 years agoMerge branch 'js/rebase-r-strategy'
Junio C Hamano [Wed, 18 Sep 2019 18:50:07 +0000 (11:50 -0700)] 
Merge branch 'js/rebase-r-strategy'

"git rebase --rebase-merges" learned to drive different merge
strategies and pass strategy specific options to them.

* js/rebase-r-strategy:
  t3427: accelerate this test by using fast-export and fast-import
  rebase -r: do not (re-)generate root commits with `--root` *and* `--onto`
  t3418: test `rebase -r` with merge strategies
  t/lib-rebase: prepare for testing `git rebase --rebase-merges`
  rebase -r: support merge strategies other than `recursive`
  t3427: fix another incorrect assumption
  t3427: accommodate for the `rebase --merge` backend having been replaced
  t3427: fix erroneous assumption
  t3427: condense the unnecessarily repetitive test cases into three
  t3427: move the `filter-branch` invocation into the `setup` case
  t3427: simplify the `setup` test case significantly
  t3427: add a clarifying comment
  rebase: fold git-rebase--common into the -p backend
  sequencer: the `am` and `rebase--interactive` scripts are gone
  .gitignore: there is no longer a built-in `git-rebase--interactive`
  t3400: stop referring to the scripted rebase
  Drop unused git-rebase--am.sh

4 years agoMerge branch 'master' of https://github.com/prati0100/git-gui
Junio C Hamano [Wed, 18 Sep 2019 18:22:11 +0000 (11:22 -0700)] 
Merge branch 'master' of https://github.com/prati0100/git-gui

* 'master' of https://github.com/prati0100/git-gui:
  git-gui: add hotkey to toggle "Amend Last Commit"
  git-gui: add horizontal scrollbar to commit buffer
  git-gui: convert new/amend commit radiobutton to checkbutton
  git-gui: add hotkeys to set widget focus
  git-gui: allow undoing last revert
  git-gui: return early when patch fails to apply
  git-gui: allow reverting selected hunk
  git-gui: allow reverting selected lines

4 years agoMerge gitk to pick up emergency build fix
Junio C Hamano [Tue, 17 Sep 2019 21:59:18 +0000 (14:59 -0700)] 
Merge gitk to pick up emergency build fix

  gitk: rename zh_CN.po to zh_cn.po

4 years agogitk: rename zh_CN.po to zh_cn.po
Denton Liu [Tue, 17 Sep 2019 08:52:06 +0000 (01:52 -0700)] 
gitk: rename zh_CN.po to zh_cn.po

When running make from a clean environment, all of the *.po files should
be converted into *.msg files. After that, when make is run without any
changes, make should not do anything.

After beffae768a (gitk: Add Chinese (zh_CN) translation, 2017-03-11),
zh_CN.po was introduced. When make was run, a zh_cn.msg file was
generated (notice the lowercase). However, since make is case-sensitive,
it expects zh_CN.po to generate a zh_CN.msg file so make will keep
reattempting to generate a zh_CN.msg so successive make invocations
result in

    Generating catalog po/zh_cn.msg
    msgfmt --statistics --tcl po/zh_cn.po -l zh_cn -d po/
    317 translated messages.

happening continuously.

Rename zh_CN.po to zh_cn.po so that when make generates the zh_cn.msg
file, it will realize that it was successfully generated and only run
once.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'master' of git://ozlabs.org/~paulus/gitk
Junio C Hamano [Mon, 16 Sep 2019 17:25:08 +0000 (10:25 -0700)] 
Merge branch 'master' of git://ozlabs.org/~paulus/gitk

* 'master' of git://ozlabs.org/~paulus/gitk:
  gitk: Do not mistake unchanged lines for submodule changes
  gitk: Use right colour for remote refs in the "Tags and heads" dialog
  gitk: Add Chinese (zh_CN) translation
  gitk: Make web links clickable

4 years agoMerge branch 'bp/amend-toggle-bind'
Pratyush Yadav [Sat, 14 Sep 2019 17:53:12 +0000 (23:23 +0530)] 
Merge branch 'bp/amend-toggle-bind'

Toggle amend on and off with the keyboard shortcut "Ctrl+e".

* bp/amend-toggle-bind:
  git-gui: add hotkey to toggle "Amend Last Commit"

4 years agogit-gui: add hotkey to toggle "Amend Last Commit"
Birger Skogeng Pedersen [Sat, 14 Sep 2019 09:18:35 +0000 (11:18 +0200)] 
git-gui: add hotkey to toggle "Amend Last Commit"

Selecting whether to "Amend Last Commit" or not does not have a hotkey.

With this patch, the user may toggle between the two options with
CTRL/CMD+e.

Signed-off-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
Rebased-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogitk: Do not mistake unchanged lines for submodule changes
Gabriele Mazzotta [Sat, 23 Mar 2019 17:00:36 +0000 (18:00 +0100)] 
gitk: Do not mistake unchanged lines for submodule changes

Unchanged lines are prefixed with a white-space, thus unchanged lines
starting with either " <" or " >" are mistaken for submodule changes.
Check if a line starts with either "  <" or "  >" only if we are listing
the changes of a submodule.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
4 years agogitk: Use right colour for remote refs in the "Tags and heads" dialog
Paul Wise [Thu, 21 Mar 2019 07:05:32 +0000 (15:05 +0800)] 
gitk: Use right colour for remote refs in the "Tags and heads" dialog

Makes it easier to see which refs are local and which refs are remote.
Adds consistency with the remote background colour in the graph display.

Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
4 years agogitk: Add Chinese (zh_CN) translation
YanKe [Fri, 10 Mar 2017 19:00:00 +0000 (03:00 +0800)] 
gitk: Add Chinese (zh_CN) translation

Signed-off-by: YanKe <imyanke@163.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
4 years agoMerge branch 'bw/commit-scrollbuffer'
Pratyush Yadav [Fri, 13 Sep 2019 20:49:38 +0000 (02:19 +0530)] 
Merge branch 'bw/commit-scrollbuffer'

Add a scrollbar at the bottom of the commit message buffer.

* bw/commit-scrollbuffer:
  git-gui: add horizontal scrollbar to commit buffer

4 years agoMerge branch 'bw/amend-checkbutton'
Pratyush Yadav [Fri, 13 Sep 2019 20:48:27 +0000 (02:18 +0530)] 
Merge branch 'bw/amend-checkbutton'

Change the amend setting from two radio buttons ("New commit" and "Amend
commit") to a single checkbutton. The two radio buttons can never be
selected together because they are exactly the opposite of each other,
so it makes sense to change it to a single checkbutton.

* bw/amend-checkbutton:
  git-gui: convert new/amend commit radiobutton to checkbutton

4 years agogit-gui: add horizontal scrollbar to commit buffer
Bert Wesarg [Fri, 13 Sep 2019 20:16:28 +0000 (22:16 +0200)] 
git-gui: add horizontal scrollbar to commit buffer

While the commit message widget has a configurable fixed width, it
nevertheless allowed to write commit messages which exceeded this limit.
Though there is no visual clue, that there is scrolling going on. Now
there is a horizontal scrollbar.

There seems to be a bug in at least Tcl/Tk up to version 8.6.8, which
does not update the horizontal scrollbar if one removes the whole
content at once.

Suggested-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: convert new/amend commit radiobutton to checkbutton
Bert Wesarg [Fri, 13 Sep 2019 06:02:30 +0000 (08:02 +0200)] 
git-gui: convert new/amend commit radiobutton to checkbutton

Its a bi-state anyway and also saves one line in the menu.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agoMerge branch 'py/revert-hunks-lines'
Pratyush Yadav [Wed, 11 Sep 2019 21:11:12 +0000 (02:41 +0530)] 
Merge branch 'py/revert-hunks-lines'

git-gui learned to revert selected lines and hunks, just like it can
stage selected lines and hunks. To provide a safety net for accidental
revert, the most recent revert can be undone.

* py/revert-hunks-lines:
  git-gui: allow undoing last revert
  git-gui: return early when patch fails to apply
  git-gui: allow reverting selected hunk
  git-gui: allow reverting selected lines

4 years agoMerge branch 'bp/widget-focus-hotkeys'
Pratyush Yadav [Wed, 11 Sep 2019 21:10:24 +0000 (02:40 +0530)] 
Merge branch 'bp/widget-focus-hotkeys'

git-gui learned to switch focus between widgets "unstaged commits",
"staged commits", "diff", and "commit message" using the keyboard
shortcuts Alt+1, Alt+2, Alt+3, and Alt+4 respectively.

* bp/widget-focus-hotkeys:
  git-gui: add hotkeys to set widget focus

4 years agogit-gui: add hotkeys to set widget focus
Birger Skogeng Pedersen [Wed, 4 Sep 2019 14:30:55 +0000 (16:30 +0200)] 
git-gui: add hotkeys to set widget focus

The user cannot change focus between the list of files, the diff view and
the commit message widgets without using the mouse (clicking either of
the four widgets).

With this patch, the user may set ui focus to the previously selected path
in either the "Unstaged Changes" or "Staged Changes" widgets, using
ALT+1 or ALT+2.

The user may also set the ui focus to the diff view widget with
ALT+3, or to the commit message widget with ALT+4.

This enables the user to select/unselect files, view the diff and create a
commit in git-gui using keyboard-only.

Signed-off-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agoSecond batch
Junio C Hamano [Mon, 9 Sep 2019 19:31:27 +0000 (12:31 -0700)] 
Second batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'bc/reread-attributes-during-rebase'
Junio C Hamano [Mon, 9 Sep 2019 19:26:40 +0000 (12:26 -0700)] 
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

4 years agoMerge branch 'tg/t0021-racefix'
Junio C Hamano [Mon, 9 Sep 2019 19:26:40 +0000 (12:26 -0700)] 
Merge branch 'tg/t0021-racefix'

A test fix.

* tg/t0021-racefix:
  t0021: make sure clean filter runs

4 years agoMerge branch 'mp/for-each-ref-missing-name-or-email'
Junio C Hamano [Mon, 9 Sep 2019 19:26:39 +0000 (12:26 -0700)] 
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

4 years agoMerge branch 'sb/userdiff-dts'
Junio C Hamano [Mon, 9 Sep 2019 19:26:39 +0000 (12:26 -0700)] 
Merge branch 'sb/userdiff-dts'

Device-tree files learned their own userdiff patterns.

* sb/userdiff-dts:
  userdiff: add a builtin pattern for dts files

4 years agoMerge branch 'rs/sort-oid-array-thread-safe'
Junio C Hamano [Mon, 9 Sep 2019 19:26:39 +0000 (12:26 -0700)] 
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

4 years agoMerge branch 'nd/diff-parseopt'
Junio C Hamano [Mon, 9 Sep 2019 19:26:38 +0000 (12:26 -0700)] 
Merge branch 'nd/diff-parseopt'

Compilation fix.

* nd/diff-parseopt:
  parseopt: move definition of enum parse_opt_result up

4 years agoMerge branch 'jt/diff-lazy-fetch-submodule-fix'
Junio C Hamano [Mon, 9 Sep 2019 19:26:38 +0000 (12:26 -0700)] 
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

4 years agoMerge branch 'ds/midx-expire-repack'
Junio C Hamano [Mon, 9 Sep 2019 19:26:38 +0000 (12:26 -0700)] 
Merge branch 'ds/midx-expire-repack'

Code cleanup.

* ds/midx-expire-repack:
  packfile.h: drop extern from function declaration

4 years agoMerge branch 'cb/fetch-set-upstream'
Junio C Hamano [Mon, 9 Sep 2019 19:26:37 +0000 (12:26 -0700)] 
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

4 years agoMerge branch 'rs/pax-extended-header-length-fix'
Junio C Hamano [Mon, 9 Sep 2019 19:26:37 +0000 (12:26 -0700)] 
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

4 years agoMerge branch 'bm/repository-layout-typofix'
Junio C Hamano [Mon, 9 Sep 2019 19:26:37 +0000 (12:26 -0700)] 
Merge branch 'bm/repository-layout-typofix'

Typofix.

* bm/repository-layout-typofix:
  repository-layout.txt: correct pluralization of 'object'

4 years agoMerge branch 'en/checkout-mismerge-fix'
Junio C Hamano [Mon, 9 Sep 2019 19:26:36 +0000 (12:26 -0700)] 
Merge branch 'en/checkout-mismerge-fix'

Fix a mismerge that happened in 2.22 timeframe.

* en/checkout-mismerge-fix:
  checkout: remove duplicate code

4 years agoMerge branch 'sg/diff-indent-heuristic-non-experimental'
Junio C Hamano [Mon, 9 Sep 2019 19:26:36 +0000 (12:26 -0700)] 
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

4 years agoMerge branch 'ds/feature-macros'
Junio C Hamano [Mon, 9 Sep 2019 19:26:36 +0000 (12:26 -0700)] 
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

4 years agoMerge branch 'jk/eoo'
Junio C Hamano [Mon, 9 Sep 2019 19:26:35 +0000 (12:26 -0700)] 
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

4 years agoMerge branch 'jk/repo-init-cleanup'
Junio C Hamano [Mon, 9 Sep 2019 19:26:35 +0000 (12:26 -0700)] 
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

4 years agoMerge branch 'py/git-gui-do-quit'
Junio C Hamano [Mon, 9 Sep 2019 19:26:35 +0000 (12:26 -0700)] 
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

4 years agot3427: accelerate this test by using fast-export and fast-import
Elijah Newren [Wed, 4 Sep 2019 21:40:48 +0000 (14:40 -0700)] 
t3427: accelerate this test by using fast-export and fast-import

fast-export and fast-import can easily handle the simple rewrite that
was being done by filter-branch, and should be faster on systems with a
slow fork.  Measuring the overall time taken for all of t3427 (not just
the difference between filter-branch and fast-export/fast-import) shows
a speedup of about 5% on Linux and 11% on Mac.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoam: reload .gitattributes after patching it
brian m. carlson [Mon, 2 Sep 2019 22:39:44 +0000 (22:39 +0000)] 
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>
4 years agogitk: Make web links clickable
Paul Mackerras [Mon, 26 Aug 2019 22:12:34 +0000 (08:12 +1000)] 
gitk: Make web links clickable

This makes gitk look for http or https URLs in the commit description
and make the URLs clickable.  Clicking on them will invoke an external
web browser with the URL.

The web browser command is by default "xdg-open" on Linux, "open" on
MacOS, and "cmd /c start" on Windows.  The command can be changed in
the preferences window, and it can include parameters as well as the
command name.  If it is set to the empty string then URLs will no
longer be made clickable.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
4 years agogit-gui: allow undoing last revert
Pratyush Yadav [Sun, 25 Aug 2019 20:13:23 +0000 (01:43 +0530)] 
git-gui: allow undoing last revert

Accidental clicks on the revert hunk/lines buttons can cause loss of
work, and can be frustrating. So, allow undoing the last revert.

Right now, a stack or deque are not being used for the sake of
simplicity, so only one undo is possible. Any reverts before the
previous one are lost.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agopath: add a function to check for path suffix
brian m. carlson [Sun, 25 Aug 2019 23:33:39 +0000 (23:33 +0000)] 
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>
4 years agogit-gui: return early when patch fails to apply
Pratyush Yadav [Sun, 25 Aug 2019 22:53:13 +0000 (04:23 +0530)] 
git-gui: return early when patch fails to apply

In the procedure apply_or_revert_range_or_line, if the patch does not
apply successfully, a dialog is shown, but execution proceeds after
that. Instead, return early on error so the parts that come after this
don't work on top of an error state.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: allow reverting selected hunk
Pratyush Yadav [Sat, 17 Aug 2019 18:31:43 +0000 (00:01 +0530)] 
git-gui: allow reverting selected hunk

Just like the user can select a hunk to stage or unstage, add the
ability to revert hunks.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: allow reverting selected lines
Pratyush Yadav [Sun, 25 Aug 2019 20:05:27 +0000 (01:35 +0530)] 
git-gui: allow reverting selected lines

Just like the user can select lines to stage or unstage, add the
ability to revert selected lines.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agotransport: teach all vtables to allow fetch first
Jonathan Tan [Wed, 21 Aug 2019 22:20:10 +0000 (15:20 -0700)] 
transport: teach all vtables to allow fetch first

The only transport that does not allow fetch() to be called before
get_refs_list() is the bundle transport. Clean up the code by teaching
the bundle transport the ability to do this, and removing support for
transports that don't support this order of invocation.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agotransport-helper: skip ls-refs if unnecessary
Jonathan Tan [Wed, 21 Aug 2019 22:20:09 +0000 (15:20 -0700)] 
transport-helper: skip ls-refs if unnecessary

Commit e70a3030e7 ("fetch: do not list refs if fetching only hashes",
2018-10-07) and its ancestors taught Git, as an optimization, to skip
the ls-refs step when it is not necessary during a protocol v2 fetch
(for example, when lazy fetching a missing object in a partial clone, or
when running "git fetch --no-tags <remote> <SHA-1>"). But that was only
done for natively supported protocols; in particular, HTTP was not
supported.

Teach Git to skip ls-refs when using remote helpers that support connect
or stateless-connect. To do this, fetch() is made an acceptable entry
point. Because fetch() can now be the first function in the vtable
called, "get_helper(transport);" has to be added to the beginning of
that function to set the transport up (if not yet set up) before
process_connect() is invoked.

When fetch() is called, the transport could be taken over (this happens
if "connect" or "stateless-connect" is successfully run without any
"fallback" response), or not. If the transport is taken over, execution
continues like execution for natively supported protocols
(fetch_refs_via_pack() is executed, which will fetch refs using ls-refs
if needed). If not, the remote helper interface will invoke
get_refs_list() if it hasn't been invoked yet, preserving existing
behavior.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoFirst batch after Git 2.23
Junio C Hamano [Thu, 22 Aug 2019 19:41:04 +0000 (12:41 -0700)] 
First batch after Git 2.23

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'sg/worktree-remove-errormsg'
Junio C Hamano [Thu, 22 Aug 2019 19:34:12 +0000 (12:34 -0700)] 
Merge branch 'sg/worktree-remove-errormsg'

Error message update/clarification.

* sg/worktree-remove-errormsg:
  worktree remove: clarify error message on dirty worktree

4 years agoMerge branch 'en/fast-import-merge-doc'
Junio C Hamano [Thu, 22 Aug 2019 19:34:12 +0000 (12:34 -0700)] 
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

4 years agoMerge branch 'jk/perf-no-dups'
Junio C Hamano [Thu, 22 Aug 2019 19:34:11 +0000 (12:34 -0700)] 
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

4 years agoMerge branch 'rs/nedalloc-fixlets'
Junio C Hamano [Thu, 22 Aug 2019 19:34:11 +0000 (12:34 -0700)] 
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

4 years agoMerge branch 'sg/show-failed-test-names'
Junio C Hamano [Thu, 22 Aug 2019 19:34:11 +0000 (12:34 -0700)] 
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

4 years agoMerge branch 'sg/commit-graph-validate'
Junio C Hamano [Thu, 22 Aug 2019 19:34:11 +0000 (12:34 -0700)] 
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'

4 years agoMerge branch 'vn/restore-empty-ita-corner-case-fix'
Junio C Hamano [Thu, 22 Aug 2019 19:34:11 +0000 (12:34 -0700)] 
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

4 years agoMerge branch 'sc/pack-refs-deletion-racefix'
Junio C Hamano [Thu, 22 Aug 2019 19:34:10 +0000 (12:34 -0700)] 
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

4 years agoMerge branch 'sg/do-not-skip-non-httpd-tests'
Junio C Hamano [Thu, 22 Aug 2019 19:34:10 +0000 (12:34 -0700)] 
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'

4 years agoMerge branch 'jk/tree-walk-overflow'
Junio C Hamano [Thu, 22 Aug 2019 19:34:10 +0000 (12:34 -0700)] 
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

4 years agoMerge branch 'sg/t5510-test-i18ngrep-fix'
Junio C Hamano [Thu, 22 Aug 2019 19:34:10 +0000 (12:34 -0700)] 
Merge branch 'sg/t5510-test-i18ngrep-fix'

Test fix.

* sg/t5510-test-i18ngrep-fix:
  t5510-fetch: fix negated 'test_i18ngrep' invocation

4 years agoMerge branch 'mt/grep-submodules-working-tree'
Junio C Hamano [Thu, 22 Aug 2019 19:34:10 +0000 (12:34 -0700)] 
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

4 years agot0021: make sure clean filter runs
Thomas Gummerer [Thu, 22 Aug 2019 19:22:40 +0000 (20:22 +0100)] 
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>
4 years agoref-filter: initialize empty name or email fields
Mischa POSLAWSKY [Sat, 17 Aug 2019 21:51:07 +0000 (23:51 +0200)] 
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>
4 years agouserdiff: add a builtin pattern for dts files
Stephen Boyd [Mon, 19 Aug 2019 21:22:43 +0000 (14:22 -0700)] 
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>
4 years agoline-log: avoid unnecessary full tree diffs
SZEDER Gábor [Wed, 21 Aug 2019 11:04:24 +0000 (13:04 +0200)] 
line-log: avoid unnecessary full tree diffs

With rename detection enabled the line-level log is able to trace the
evolution of line ranges across whole-file renames [1].  Alas, to
achieve that it uses the diff machinery very inefficiently, making the
operation very slow [2].  And since rename detection is enabled by
default, the line-level log is very slow by default.

When the line-level log processes a commit with rename detection
enabled, it currently does the following (see queue_diffs()):

  1. Computes a full tree diff between the commit and (one of) its
     parent(s), i.e. invokes diff_tree_oid() with an empty
     'diffopt->pathspec'.
  2. Checks whether any paths in the line ranges were modified.
  3. Checks whether any modified paths in the line ranges are missing
     in the parent commit's tree.
  4. If there is such a missing path, then calls diffcore_std() to
     figure out whether the path was indeed renamed based on the
     previously computed full tree diff.
  5. Continues doing stuff that are unrelated to the slowness.

So basically the line-level log computes a full tree diff for each
commit-parent pair in step (1) to be used for rename detection in step
(4) in the off chance that an interesting path is missing from the
parent.

Avoid these expensive and mostly unnecessary full tree diffs by
limiting the diffs to paths in the line ranges.  This is much cheaper,
and makes step (2) unnecessary.  If it turns out that an interesting
path is missing from the parent, then fall back and compute a full
tree diff, so the rename detection will still work.

Care must be taken when to update the pathspec used to limit the diff
in case of renames.  A path might be renamed on one branch and
modified on several parallel running branches, and while processing
commits on these branches the line-level log might have to alternate
between looking at a path's new and old name.  However, at any one
time there is only a single 'diffopt->pathspec'.

So add a step (0) to the above to ensure that the paths in the
pathspec match the paths in the line ranges associated with the
currently processed commit, and re-parse the pathspec from the paths
in the line ranges if they differ.

The new test cases include a specially crafted piece of history with
two merged branches and two files, where each branch modifies both
files, renames on of them, and then modifies both again.  Then two
separate 'git log -L' invocations check the line-level log of each of
those two files, which ensures that at least one of those invocations
have to do that back-and-forth between the file's old and new name (no
matter which branch is traversed first).  't/t4211-line-log.sh'
already contains two tests involving renames, they don't don't trigger
this back-and-forth.

Avoiding these unnecessary full tree diffs can have huge impact on
performance, especially in big repositories with big trees and mergy
history.  Tracing the evolution of a function through the whole
history:

  # git.git
  $ time git --no-pager log -L:read_alternate_refs:sha1-file.c v2.23.0

  Before:

    real    0m8.874s
    user    0m8.816s
    sys     0m0.057s

  After:

    real    0m2.516s
    user    0m2.456s
    sys     0m0.060s

  # linux.git
  $ time ~/src/git/git --no-pager log \
    -L:build_restore_work_registers:arch/mips/mm/tlbex.c v5.2

  Before:

    real    3m50.033s
    user    3m48.041s
    sys     0m0.300s

  After:

    real    0m2.599s
    user    0m2.466s
    sys     0m0.157s

That's just over 88x speedup.

[1] Line-level log's rename following is quite similar to 'git log
    --follow path', with the notable differences that it does handle
    multiple paths at once as well, and that it doesn't show the
    commit performing the rename if it's an exact rename.

[2] This slowness might not have been apparent initially, because back
    when the line-level log feature was introduced rename detection
    was not yet enabled by default; 12da1d1f6f (Implement line-history
    search (git log -L), 2013-03-28) and 5404c116aa (diff: activate
    diff.renames by default, 2016-02-25).

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoline-log: extract pathspec parsing from line ranges into a helper function
SZEDER Gábor [Wed, 21 Aug 2019 11:04:23 +0000 (13:04 +0200)] 
line-log: extract pathspec parsing from line ranges into a helper function

A helper function to parse the paths involved in the line ranges and
to turn them into a pathspec will be useful in the next patch.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodiff: skip GITLINK when lazy fetching missing objs
Jonathan Tan [Tue, 20 Aug 2019 20:53:20 +0000 (13:53 -0700)] 
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>
4 years agosha1-name: make sort_ambiguous_oid_array() thread-safe
René Scharfe [Tue, 20 Aug 2019 18:49:12 +0000 (20:49 +0200)] 
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>
4 years agoparseopt: move definition of enum parse_opt_result up
René Scharfe [Tue, 20 Aug 2019 18:49:07 +0000 (20:49 +0200)] 
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>
4 years agopackfile.h: drop extern from function declaration
Denton Liu [Mon, 19 Aug 2019 06:26:19 +0000 (02:26 -0400)] 
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>
4 years agorepository-layout.txt: correct pluralization of 'object'
Ben Milman [Mon, 19 Aug 2019 21:36:18 +0000 (14:36 -0700)] 
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>
4 years agopull, fetch: add --set-upstream option
Corentin BOMPARD [Mon, 19 Aug 2019 09:11:20 +0000 (11:11 +0200)] 
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>
4 years agoarchive-tar: turn length miscalculation warning into BUG
René Scharfe [Sat, 17 Aug 2019 16:24:23 +0000 (18:24 +0200)] 
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>
4 years agoarchive-tar: use size_t in strbuf_append_ext_header()
René Scharfe [Sat, 17 Aug 2019 16:24:13 +0000 (18:24 +0200)] 
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>
4 years agoarchive-tar: fix pax extended header length calculation
René Scharfe [Sat, 17 Aug 2019 16:24:01 +0000 (18:24 +0200)] 
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>
4 years agoarchive-tar: report wrong pax extended header length
René Scharfe [Sat, 17 Aug 2019 16:23:52 +0000 (18:23 +0200)] 
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>
4 years agoGit 2.23 v2.23.0
Junio C Hamano [Fri, 16 Aug 2019 17:28:23 +0000 (10:28 -0700)] 
Git 2.23

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge tag 'l10n-2.23.0-rnd2' of git://github.com/git-l10n/git-po
Junio C Hamano [Fri, 16 Aug 2019 17:22:51 +0000 (10:22 -0700)] 
Merge tag 'l10n-2.23.0-rnd2' of git://github.com/git-l10n/git-po

l10n-2.23.0-rnd2

4 years agocheckout: remove duplicate code
Elijah Newren [Thu, 15 Aug 2019 22:03:03 +0000 (15:03 -0700)] 
checkout: remove duplicate code

Both commit a7256debd4b6 ("checkout.txt: note about losing staged
changes with --merge", 2019-03-19) from nd/checkout-m-doc-update and
commit 6eff409e8a76 ("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>
4 years agol10n: zh_CN: for git v2.23.0 l10n round 1~2
Jiang Xin [Tue, 30 Jul 2019 02:02:22 +0000 (10:02 +0800)] 
l10n: zh_CN: for git v2.23.0 l10n round 1~2

Translate 128 new messages (4674t0f0u) for git 2.23.0.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agohttp: use xmalloc with cURL
Carlo Marcelo Arenas Belón [Thu, 15 Aug 2019 19:13:14 +0000 (12:13 -0700)] 
http: use xmalloc with cURL

f0ed8226c9 (Add custom memory allocator to MinGW and MacOS builds, 2009-05-31)
never told cURL about it.

Correct that by using the cURL initializer available since version 7.12 to
point to xmalloc and friends for consistency which then will pass the
allocation requests along when USE_NED_ALLOCATOR=YesPlease is used (most
likely in Windows)

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodiff: 'diff.indentHeuristic' is no longer experimental
SZEDER Gábor [Thu, 15 Aug 2019 09:12:45 +0000 (11:12 +0200)] 
diff: 'diff.indentHeuristic' is no longer experimental

The indent heuristic started out as experimental, but it's now our
default diff heuristic since 33de716387 (diff: enable indent heuristic
by default, 2017-05-08).  Alas, that commit didn't update the
documentation, and the description of the 'diff.indentHeuristic'
configuration variable still implies that it's experimental and not
the default.

Update the description of 'diff.indentHeuristic' to make it clear that
it's the default diff heuristic.

The description of the related '--indent-heuristic' option has already
been updated in bab76141da (diff: --indent-heuristic is no
longer experimental, 2017-10-29).

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorepo-settings: create feature.experimental setting
Derrick Stolee [Tue, 13 Aug 2019 18:37:48 +0000 (11:37 -0700)] 
repo-settings: create feature.experimental setting

The 'feature.experimental' setting includes config options that are
not committed to become defaults, but could use additional testing.

Update the following config settings to take new defaults, and to
use the repo_settings struct if not already using them:

* 'pack.useSparse=true'

* 'fetch.negotiationAlgorithm=skipping'

In the case of fetch.negotiationAlgorithm, the existing logic
would load the config option only when about to use the setting,
so had a die() statement on an unknown string value. This is
removed as now the config is parsed under prepare_repo_settings().
In general, this die() is probably misplaced and not valuable.
A test was removed that checked this die() statement executed.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorepo-settings: create feature.manyFiles setting
Derrick Stolee [Tue, 13 Aug 2019 18:37:47 +0000 (11:37 -0700)] 
repo-settings: create feature.manyFiles setting

The feature.manyFiles setting is suitable for repos with many
files in the working directory. By setting index.version=4 and
core.untrackedCache=true, commands such as 'git status' should
improve.

While adding this setting, modify the index version precedence
tests to check how this setting overrides the default for
index.version is unset.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorepo-settings: parse core.untrackedCache
Derrick Stolee [Tue, 13 Aug 2019 18:37:46 +0000 (11:37 -0700)] 
repo-settings: parse core.untrackedCache

The core.untrackedCache config setting is slightly complicated,
so clarify its use and centralize its parsing into the repo
settings.

The default value is "keep" (returned as -1), which persists the
untracked cache if it exists.

If the value is set as "false" (returned as 0), then remove the
untracked cache if it exists.

If the value is set as "true" (returned as 1), then write the
untracked cache and persist it.

Instead of relying on magic values of -1, 0, and 1, split these
options into an enum. This allows the use of "-1" as a
default value. After parsing the config options, if the value is
unset we can initialize it to UNTRACKED_CACHE_KEEP.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: turn on commit-graph by default
Derrick Stolee [Tue, 13 Aug 2019 18:37:45 +0000 (11:37 -0700)] 
commit-graph: turn on commit-graph by default

The commit-graph feature has seen a lot of activity in the past
year or so since it was introduced. The feature is a critical
performance enhancement for medium- to large-sized repos, and
does not significantly hurt small repos.

Change the defaults for core.commitGraph and gc.writeCommitGraph
to true so users benefit from this feature by default.

There are several places in the test suite where the environment
variable GIT_TEST_COMMIT_GRAPH is disabled to avoid reading a
commit-graph, if it exists. The config option overrides the
environment, so swap these. Some GIT_TEST_COMMIT_GRAPH assignments
remain, and those are to avoid writing a commit-graph when a new
commit is created.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot6501: use 'git gc' in quiet mode
Derrick Stolee [Tue, 13 Aug 2019 18:37:45 +0000 (11:37 -0700)] 
t6501: use 'git gc' in quiet mode

t6501-freshen-objects.sh sends the standard error from
'git gc' to a file and verifies that it is empty. This
is intended as a way to ensure no warnings are written
during the operation. However, as the commit-graph is
added as a step to 'git gc', its progress will appear
in the output.

Pass the '-q' argument to avoid a failing test case
when progress is written.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorepo-settings: consolidate some config settings
Derrick Stolee [Tue, 13 Aug 2019 18:37:43 +0000 (11:37 -0700)] 
repo-settings: consolidate some config settings

There are a few important config settings that are not loaded
during git_default_config. These are instead loaded on-demand.

Centralize these config options to a single scan, and store
all of the values in a repo_settings struct. The values for
each setting are initialized as negative to indicate "unset".

This centralization will be particularly important in a later
change to introduce "meta" config settings that change the
defaults for these config settings.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>