gitweb.git
conditional markdown preprocessing masterAndrew Lorimer Sat, 9 Sep 2023 02:44:23 +0000 (12:44 +1000)

conditional markdown preprocessing

general improvementsAndrew Lorimer Tue, 21 Jul 2020 08:50:49 +0000 (18:50 +1000)

general improvements

improve error page/httpd logging and file permissionsAndrew Lorimer Tue, 15 Oct 2019 11:22:54 +0000 (22:22 +1100)

improve error page/httpd logging and file permissions

general UI improvementsAndrew Lorimer Sun, 13 Oct 2019 10:59:07 +0000 (21:59 +1100)

general UI improvements

Fourth batch origin/masterJunio C Hamano Mon, 30 Sep 2019 04:30:46 +0000 (13:30 +0900)

Fourth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ds/commit-graph-on-fetch'Junio C Hamano Mon, 30 Sep 2019 04:19:32 +0000 (13:19 +0900)

Merge branch 'ds/commit-graph-on-fetch'

A configuration variable tells "git fetch" to write the commit
graph after finishing.

* ds/commit-graph-on-fetch:
fetch: add fetch.writeCommitGraph config setting

Merge branch 'bw/rebase-autostash-keep-current-branch'Junio C Hamano Mon, 30 Sep 2019 04:19:32 +0000 (13:19 +0900)

Merge branch 'bw/rebase-autostash-keep-current-branch'

"git rebase --autostash <upstream> <branch>", when <branch> is
different from the current branch, incorrectly moved the tip of the
current branch, which has been corrected.

* bw/rebase-autostash-keep-current-branch:
builtin/rebase.c: Remove pointless message
builtin/rebase.c: make sure the active branch isn't moved when autostashing

Merge branch 'ds/include-exclude'Junio C Hamano Mon, 30 Sep 2019 04:19:31 +0000 (13:19 +0900)

Merge branch 'ds/include-exclude'

The internal code originally invented for ".gitignore" processing
got reshuffled and renamed to make it less tied to "excluding" and
stress more that it is about "matching", as it has been reused for
things like sparse checkout specification that want to check if a
path is "included".

* ds/include-exclude:
unpack-trees: rename 'is_excluded_from_list()'
treewide: rename 'exclude' methods to 'pattern'
treewide: rename 'EXCL_FLAG_' to 'PATTERN_FLAG_'
treewide: rename 'struct exclude_list' to 'struct pattern_list'
treewide: rename 'struct exclude' to 'struct path_pattern'

Merge branch 'jh/trace2-pretty-output'Junio C Hamano Mon, 30 Sep 2019 04:19:31 +0000 (13:19 +0900)

Merge branch 'jh/trace2-pretty-output'

Output from trace2 subsystem is formatted more prettily now.

* jh/trace2-pretty-output:
trace2: cleanup whitespace in perf format
trace2: cleanup whitespace in normal format
quote: add sq_append_quote_argv_pretty()
trace2: trim trailing whitespace in normal format error message
trace2: remove dead code in maybe_add_string_va()
trace2: trim whitespace in region messages in perf target format
trace2: cleanup column alignment in perf target format

Merge branch 'dl/rebase-i-keep-base'Junio C Hamano Mon, 30 Sep 2019 04:19:31 +0000 (13:19 +0900)

Merge branch 'dl/rebase-i-keep-base'

"git rebase --keep-base <upstream>" tries to find the original base
of the topic being rebased and rebase on top of that same base,
which is useful when running the "git rebase -i" (and its limited
variant "git rebase -x").

The command also has learned to fast-forward in more cases where it
can instead of replaying to recreate identical commits.

* dl/rebase-i-keep-base:
rebase: teach rebase --keep-base
rebase tests: test linear branch topology
rebase: fast-forward --fork-point in more cases
rebase: fast-forward --onto in more cases
rebase: refactor can_fast_forward into goto tower
t3432: test for --no-ff's interaction with fast-forward
t3432: distinguish "noop-same" v.s. "work-same" in "same head" tests
t3432: test rebase fast-forward behavior
t3431: add rebase --fork-point tests

Merge branch 'sg/clean-nested-repo-with-ignored'Junio C Hamano Mon, 30 Sep 2019 04:19:31 +0000 (13:19 +0900)

Merge branch 'sg/clean-nested-repo-with-ignored'

A bug documentation.

* sg/clean-nested-repo-with-ignored:
t7300-clean: demonstrate deleting nested repo with an ignored file breakage

Merge branch 'dl/complete-cherry-pick-revert-skip'Junio C Hamano Mon, 30 Sep 2019 04:19:30 +0000 (13:19 +0900)

Merge branch 'dl/complete-cherry-pick-revert-skip'

The command line completion support (in contrib/) learned about the
"--skip" option of "git revert" and "git cherry-pick".

* dl/complete-cherry-pick-revert-skip:
status: mention --skip for revert and cherry-pick
completion: add --skip for cherry-pick and revert
completion: merge options for cherry-pick and revert

Merge branch 'dl/use-sq-from-test-lib'Junio C Hamano Mon, 30 Sep 2019 04:19:30 +0000 (13:19 +0900)

Merge branch 'dl/use-sq-from-test-lib'

Code cleanup.

* dl/use-sq-from-test-lib:
t: use common $SQ variable

Merge branch 'jk/misc-uninitialized-fixes'Junio C Hamano Mon, 30 Sep 2019 04:19:30 +0000 (13:19 +0900)

Merge branch 'jk/misc-uninitialized-fixes'

Various fixes to codepaths gcc 9 had trouble following dataflow.

* jk/misc-uninitialized-fixes:
pack-objects: drop packlist index_pos optimization
test-read-cache: drop namelen variable
diff-delta: set size out-parameter to 0 for NULL delta
bulk-checkin: zero-initialize hashfile_checkpoint
pack-objects: use object_id in packlist_alloc()
git-am: handle missing "author" when parsing commit

Merge branch 'sg/git-test-boolean'Junio C Hamano Mon, 30 Sep 2019 04:19:29 +0000 (13:19 +0900)

Merge branch 'sg/git-test-boolean'

Fix an earlier regression in the test suite, which mistakenly
stopped running HTTPD tests.

* sg/git-test-boolean:
ci: restore running httpd tests
t/lib-git-svn.sh: check GIT_TEST_SVN_HTTPD when running SVN HTTP tests

Merge branch 'rs/get-tagged-oid'Junio C Hamano Mon, 30 Sep 2019 04:19:29 +0000 (13:19 +0900)

Merge branch 'rs/get-tagged-oid'

Code cleanup.

* rs/get-tagged-oid:
use get_tagged_oid()
tag: factor out get_tagged_oid()

Merge branch 'en/filter-branch-deprecation'Junio C Hamano Mon, 30 Sep 2019 04:19:29 +0000 (13:19 +0900)

Merge branch 'en/filter-branch-deprecation'

Start discouraging the use of "git filter-branch".

* en/filter-branch-deprecation:
t9902: use a non-deprecated command for testing
Recommend git-filter-repo instead of git-filter-branch
t6006: simplify, fix, and optimize empty message test

Merge branch 'en/merge-options-ff-and-friends'Junio C Hamano Mon, 30 Sep 2019 04:19:28 +0000 (13:19 +0900)

Merge branch 'en/merge-options-ff-and-friends'

Doc update.

* en/merge-options-ff-and-friends:
merge-options.txt: clarify meaning of various ff-related options

Merge branch 'tg/push-all-in-mirror-forbidden'Junio C Hamano Mon, 30 Sep 2019 04:19:28 +0000 (13:19 +0900)

Merge branch 'tg/push-all-in-mirror-forbidden'

Fix an earlier regression to "git push --all" which should have
been forbidden when the target remote repository is set to be a
mirror.

* tg/push-all-in-mirror-forbidden:
push: disallow --all and refspecs when remote.<name>.mirror is set

Merge branch 'dt/remote-helper-doc-re-lock-option'Junio C Hamano Mon, 30 Sep 2019 04:19:28 +0000 (13:19 +0900)

Merge branch 'dt/remote-helper-doc-re-lock-option'

Doc update.

* dt/remote-helper-doc-re-lock-option:
clarify documentation for remote helpers

Merge branch 'rs/help-unknown-ref-does-not-return'Junio C Hamano Mon, 30 Sep 2019 04:19:27 +0000 (13:19 +0900)

Merge branch 'rs/help-unknown-ref-does-not-return'

Code cleanup.

* rs/help-unknown-ref-does-not-return:
help: make help_unknown_ref() NORETURN

Merge branch 'nd/switch-and-restore'Junio C Hamano Mon, 30 Sep 2019 04:19:27 +0000 (13:19 +0900)

Merge branch 'nd/switch-and-restore'

Resurrect a performance hack.

* nd/switch-and-restore:
checkout: add simple check for 'git checkout -b'

Merge branch 'tb/file-url-to-unc-path'Junio C Hamano Mon, 30 Sep 2019 04:19:27 +0000 (13:19 +0900)

Merge branch 'tb/file-url-to-unc-path'

Windows update.

* tb/file-url-to-unc-path:
mingw: support UNC in git clone file://server/share/repo

Merge branch 'js/gitdir-at-unc-root'Junio C Hamano Mon, 30 Sep 2019 04:19:26 +0000 (13:19 +0900)

Merge branch 'js/gitdir-at-unc-root'

On Windows, the root level of UNC share is now allowed to be used
just like any other directory.

* js/gitdir-at-unc-root:
setup_git_directory(): handle UNC root paths correctly
Fix .git/ discovery at the root of UNC shares
setup_git_directory(): handle UNC paths correctly

Merge branch 'ar/mingw-run-external-with-non-ascii... Junio C Hamano Mon, 30 Sep 2019 04:19:26 +0000 (13:19 +0900)

Merge branch 'ar/mingw-run-external-with-non-ascii-path'

Windows update.

* ar/mingw-run-external-with-non-ascii-path:
mingw: fix launching of externals from Unicode paths

Merge branch 'rs/parse-tree-indirect'Junio C Hamano Mon, 30 Sep 2019 04:19:26 +0000 (13:19 +0900)

Merge branch 'rs/parse-tree-indirect'

Code cleanup.

* rs/parse-tree-indirect:
tree: simplify parse_tree_indirect()

Merge branch 'jk/fast-import-history-bugfix'Junio C Hamano Mon, 30 Sep 2019 04:19:25 +0000 (13:19 +0900)

Merge branch 'jk/fast-import-history-bugfix'

The memory ownership model of the "git fast-import" got
straightened out.

* jk/fast-import-history-bugfix:
fast-import: duplicate into history rather than passing ownership
fast-import: duplicate parsed encoding string

Merge branch 'mh/notes-duplicate-entries'Junio C Hamano Mon, 30 Sep 2019 04:19:25 +0000 (13:19 +0900)

Merge branch 'mh/notes-duplicate-entries'

A few implementation fixes in the notes API.

* mh/notes-duplicate-entries:
notes: avoid potential use-after-free during insertion
notes: avoid leaking duplicate entries

Merge branch 'tb/banned-vsprintf-namefix'Junio C Hamano Mon, 30 Sep 2019 04:19:25 +0000 (13:19 +0900)

Merge branch 'tb/banned-vsprintf-namefix'

Error message fix.

* tb/banned-vsprintf-namefix:
banned.h: fix vsprintf()'s ban message

Merge branch 'mh/release-commit-memory-fix'Junio C Hamano Mon, 30 Sep 2019 04:19:25 +0000 (13:19 +0900)

Merge branch 'mh/release-commit-memory-fix'

Leakfix.

* mh/release-commit-memory-fix:
commit: free the right buffer in release_commit_memory

Merge branch 'mh/http-urlmatch-cleanup'Junio C Hamano Mon, 30 Sep 2019 04:19:24 +0000 (13:19 +0900)

Merge branch 'mh/http-urlmatch-cleanup'

Leakfix.

* mh/http-urlmatch-cleanup:
http: don't leak urlmatch_config.vars

Merge branch 'rs/strbuf-detach'Junio C Hamano Mon, 30 Sep 2019 04:19:24 +0000 (13:19 +0900)

Merge branch 'rs/strbuf-detach'

Straighten out the use of strbuf_detach() API function.

* rs/strbuf-detach:
grep: use return value of strbuf_detach()
log-tree: always use return value of strbuf_detach()

Merge branch 'rs/trace2-dst-warning'Junio C Hamano Mon, 30 Sep 2019 04:19:24 +0000 (13:19 +0900)

Merge branch 'rs/trace2-dst-warning'

Code cleanup.

* rs/trace2-dst-warning:
trace2: use warning() directly in tr2_dst_malformed_warning()

Merge branch 'dl/format-patch-doc-test-cleanup'Junio C Hamano Mon, 30 Sep 2019 04:19:23 +0000 (13:19 +0900)

Merge branch 'dl/format-patch-doc-test-cleanup'

The documentation and tests for "git format-patch" have been
cleaned up.

* dl/format-patch-doc-test-cleanup:
config/format.txt: specify default value of format.coverLetter
Doc: add more detail for git-format-patch
t4014: stop losing return codes of git commands
t4014: remove confusing pipe in check_threading()
t4014: use test_line_count() where possible
t4014: let sed open its own files
t4014: drop redirections to /dev/null
t4014: use indentable here-docs
t4014: remove spaces after redirect operators
t4014: use sq for test case names
t4014: move closing sq onto its own line
t4014: s/expected/expect/
t4014: drop unnecessary blank lines from test cases

Merge branch 'bc/hash-independent-tests-part-5'Junio C Hamano Mon, 30 Sep 2019 04:19:23 +0000 (13:19 +0900)

Merge branch 'bc/hash-independent-tests-part-5'

Preparation for SHA-256 upgrade continues in the test department.

* bc/hash-independent-tests-part-5:
t4009: make hash size independent
t4002: make hash independent
t4000: make hash size independent
t3903: abstract away SHA-1-specific constants
t3800: make hash-size independent
t3600: make hash size independent
t3506: make hash independent
t3430: avoid hard-coded object IDs
t3404: abstract away SHA-1-specific constants
t3306: abstract away SHA-1-specific constants
t3305: make hash size independent
t3301: abstract away SHA-1-specific constants
t3206: abstract away hash size constants
t3201: abstract away SHA-1-specific constants

Merge branch 'jc/test-cleanup'Junio C Hamano Mon, 30 Sep 2019 04:19:23 +0000 (13:19 +0900)

Merge branch 'jc/test-cleanup'

Code cleanup.

* jc/test-cleanup:
t3005: remove unused variable
t: use LF variable defined in the test harness

Merge branch 'dl/compat-cleanup'Junio C Hamano Mon, 30 Sep 2019 04:19:23 +0000 (13:19 +0900)

Merge branch 'dl/compat-cleanup'

Code cleanup.

* dl/compat-cleanup:
compat/*.[ch]: remove extern from function declarations using spatch
mingw: apply array.cocci rule

Merge branch 'js/visual-studio'Junio C Hamano Mon, 30 Sep 2019 04:19:22 +0000 (13:19 +0900)

Merge branch 'js/visual-studio'

Adjust .gitignore to unignore a path that we started to track.

* js/visual-studio:
.gitignore: stop ignoring `.manifest` files

Third batchJunio C Hamano Wed, 18 Sep 2019 18:55:13 +0000 (11:55 -0700)

Third batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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()

Merge 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

Merge branch 'master' of https://github.com/prati0100... 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

Merge gitk to pick up emergency build fixJunio 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

gitk: rename zh_CN.po to zh_cn.poDenton 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>

Merge branch 'master' of git://ozlabs.org/~paulus/gitkJunio 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

Merge 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"

git-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>

gitk: Do not mistake unchanged lines for submodule... 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>

gitk: Use right colour for remote refs in the "Tags... 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>

gitk: Add Chinese (zh_CN) translationYanKe 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>

Merge 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

Merge 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

git-gui: add horizontal scrollbar to commit bufferBert 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>

git-gui: convert new/amend commit radiobutton to checkb... 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>

Merge 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

Merge 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

git-gui: add hotkeys to set widget focusBirger 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>

Second batchJunio C Hamano Mon, 9 Sep 2019 19:31:27 +0000 (12:31 -0700)

Second batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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'

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

builtin/rebase.c: Remove pointless messageBen Wijen Fri, 30 Aug 2019 15:16:06 +0000 (17:16 +0200)

builtin/rebase.c: Remove pointless message

When doing 'git rebase --autostash <upstream> <master>' with a dirty worktree
a 'HEAD is now at ...' message is emitted, which is pointless as it refers to
the old active branch which isn't actually moved.

This commit removes the 'HEAD is now at...' message.

Signed-off-by: Ben Wijen <ben@wijen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/rebase.c: make sure the active branch isn't... Ben Wijen Fri, 30 Aug 2019 15:16:05 +0000 (17:16 +0200)

builtin/rebase.c: make sure the active branch isn't moved when autostashing

Consider the following scenario:
git checkout not-the-master
work work work
git rebase --autostash upstream master

Here 'rebase --autostash <upstream> <branch>' incorrectly moves the
active branch (not-the-master) to master (before the rebase).

The expected behavior: (58794775:/git-rebase.sh:526)
AUTOSTASH=$(git stash create autostash)
git reset --hard
git checkout master
git rebase upstream
git stash apply $AUTOSTASH

The actual behavior: (6defce2b:/builtin/rebase.c:1062)
AUTOSTASH=$(git stash create autostash)
git reset --hard master
git checkout master
git rebase upstream
git stash apply $AUTOSTASH

This commit reinstates the 'legacy script' behavior as introduced with
58794775: rebase: implement --[no-]autostash and rebase.autostash

Signed-off-by: Ben Wijen <ben@wijen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t: use common $SQ variableDenton Liu Thu, 5 Sep 2019 22:10:05 +0000 (15:10 -0700)

t: use common $SQ variable

In many test scripts, there are bespoke definitions of the single quote
that are some variation of this:

SQ="'"

Define a common $SQ variable in test-lib.sh and replace all usages of
these bespoke variables with the common one.

This change was done by running `git grep =\"\'\" t/` and
`git grep =\\\\\'` and manually changing the resulting definitions and
corresponding usages.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: drop packlist index_pos optimizationJeff King Fri, 6 Sep 2019 01:36:05 +0000 (21:36 -0400)

pack-objects: drop packlist index_pos optimization

Once upon a time, the code to add an object to our packing list in
pack-objects all lived in a single function. It computed the position
within the hash table once, then used it to check if the object was
already present, and if not, to add it.

Later, in 2834bc27c1 (pack-objects: refactor the packing list,
2013-10-24), this was split into two functions: packlist_find() and
packlist_alloc(). We ended up with an "index_pos" variable that gets
passed through several functions to make it from one to the other.

The resulting code is rather confusing to follow. The "index_pos"
variable is sometimes undefined, if we don't yet have a hash table. This
works out in practice because in that case packlist_alloc() won't use it
at all, since it will have to create/grow the hash table. But it's hard
to verify that, and it does cause gcc 9.2.1's -Wmaybe-uninitialized to
complain when compiled with "-flto -O3" (rightfully, since we do pass
the uninitialized value as a function parameter, even if nobody ends up
using it).

All of this is to save computing the hash index again when we're
inserting into the hash table, which I found doesn't make a measurable
difference in the program runtime (which is not surprising, since we're
doing all kinds of other heavyweight things for each object).

Let's just drop this index_pos variable entirely, simplifying the code
(and pleasing the compiler).

We might be better still refactoring this custom hash table to use one
of our existing implementations (an oidmap, or a kh_oid_map). I stopped
short of that here, but this would be the likely first step towards that
anyway.

Reported-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-read-cache: drop namelen variableJeff King Thu, 5 Sep 2019 22:54:31 +0000 (18:54 -0400)

test-read-cache: drop namelen variable

Early in the function we set "namelen = strlen(name)" if "name" is
non-NULL. Later, we use "namelen" only if "name" is non-NULL. However,
it's hard to immediately see this, and it seems to confuse gcc 9.2.1
(with "-flto" interestingly, though all of the involved logic is in
inline functions; it also triggers when building with ASan).

Let's simplify the code and remove the variable entirely. There's only
one use of namelen anyway, so we can just call strlen() then. It's true
this is in a loop, so we might execute strlen() more often. But:

- this is test code that only ever loops twice in our test suite (we
do loop 1000 times in a t/perf test, but without using this option).

- a decent compiler ought to be able to hoist that out of the loop
anyway (though I wouldn't count on gcc 9.2.1 doing so!)

Reported-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-delta: set size out-parameter to 0 for NULL deltaJeff King Thu, 5 Sep 2019 22:53:37 +0000 (18:53 -0400)

diff-delta: set size out-parameter to 0 for NULL delta

When we cannot generate a delta, we return NULL but leave delta_size
untouched. This is generally OK, as callers rely on NULL to decide if
the output is usable or not. But it can confuse compilers; in
particular, gcc 9.2.1 with "-flto -O3" complains in fast-import's
store_object() that delta_len may be used uninitialized.

Let's change the diff-delta code to set the size explicitly to 0 for a
NULL return. That silences the compiler and makes it easier to reason
about the result.

Reported-by: Stephan Beyer <s-beyer@gmx.net>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bulk-checkin: zero-initialize hashfile_checkpointJeff King Thu, 5 Sep 2019 22:52:49 +0000 (18:52 -0400)

bulk-checkin: zero-initialize hashfile_checkpoint

We declare a "struct hashfile_checkpoint" but only sometimes actually
call hashfile_checkpoint() on it. That makes it not immediately obvious
that it's valid when we later access its members.

In fact, the code is fine: we fill it in unconditionally in the while(1)
loop as long as "idx" is non-NULL. And then if "idx" is NULL, we exit
early from the function (because we're just computing the hash, not
actually writing), before we look at the struct.

However, this does seem to confuse gcc 9.2.1's -Wmaybe-uninitialized
when compiled with "-flto -O2" (probably because with LTO it can now
realize that our call to hashfile_truncate() does not set the members
either). Let's zero-initialize the struct to tell the compiler, as well
as any readers of the code, that all is well.

Reported-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: use object_id in packlist_alloc()Jeff King Thu, 5 Sep 2019 22:52:25 +0000 (18:52 -0400)

pack-objects: use object_id in packlist_alloc()

The only caller of packlist_alloc() already has a "struct object_id",
and we immediately copy the hash they pass us into our own object_id.
Let's avoid the unnecessary round-trip to a raw sha1 pointer.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-am: handle missing "author" when parsing commitJeff King Thu, 5 Sep 2019 22:50:31 +0000 (18:50 -0400)

git-am: handle missing "author" when parsing commit

We try to parse the "author" line out of a commit buffer. We handle the
case that split_ident_line() doesn't work, but we don't do any error
checking that we found an "author" line in the first place! This would
cause us to segfault on such a corrupt object.

Let's put in an explicit NULL check (we can just die(), which is what a
bogus split would do, too). As a bonus, this silences a warning when
compiling with gcc 9.2.1 using "-flto -O3", which claims that ident_len
may be uninitialized (it would only be if we had a NULL here).

Reported-by: Stephan Beyer <s-beyer@gmx.net>
Helped-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ci: restore running httpd testsSZEDER Gábor Fri, 6 Sep 2019 12:13:26 +0000 (14:13 +0200)

ci: restore running httpd tests

Once upon a time GIT_TEST_HTTPD was a tristate variable and we
exported 'GIT_TEST_HTTPD=YesPlease' in our CI scripts to make sure
that we run the httpd tests in the Linux Clang and GCC build jobs, or
error out if they can't be run for any reason [1].

Then 3b072c577b (tests: replace test_tristate with "git env--helper",
2019-06-21) came along, turned GIT_TEST_HTTPD into a bool, but forgot
to update our CI scripts accordingly. So, since GIT_TEST_HTTPD is set
explicitly, but its value is not one of the standardized true values,
our CI jobs have been simply skipping the httpd tests in the last
couple of weeks.

Set 'GIT_TEST_HTTPD=true' to restore running httpd tests in our CI
jobs.

[1] a1157b76eb (travis-ci: set GIT_TEST_HTTPD in 'ci/lib-travisci.sh',
2017-12-12)

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/lib-git-svn.sh: check GIT_TEST_SVN_HTTPD when running... SZEDER Gábor Fri, 6 Sep 2019 12:13:25 +0000 (14:13 +0200)

t/lib-git-svn.sh: check GIT_TEST_SVN_HTTPD when running SVN HTTP tests

Once upon a time the GIT_SVN_TEST_HTTPD environment variable needed to
be set to enable SVN HTTP tests [1].

Then 3b072c577b (tests: replace test_tristate with "git env--helper",
2019-06-21) came along, and attempted to turn GIT_SVN_TEST_HTTPD into
a bool, but while doing so it mistyped the variable name, and started
to check GIT_TEST_HTTPD instead. Consequently, if someone explicitly
set GIT_TEST_HTTPD to true and has only the general 'git-svn'
dependencies installed but not the Subversion server modules for
Apache (libapache2-mod-svn), then a couple of 'git-svn' tests fail,
because they can't start httpd due to the missing module.

We could simply fix this by checking the GIT_SVN_TEST_HTTPD
variablewith 'git env--helper', but notice that the name of this
variable doesn't conform to our usual GIT_TEST_* convention.

So let's check the GIT_TEST_SVN_HTTPD instead.

[1] a8a5d25118 (git svn: migrate tests to use lib-httpd, 2016-07-23)

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

use get_tagged_oid()René Scharfe Thu, 5 Sep 2019 19:59:42 +0000 (21:59 +0200)

use get_tagged_oid()

Avoid derefencing ->tagged without checking for NULL by using the
convenience wrapper for getting the ID of the tagged object. It die()s
when encountering a broken tag instead of segfaulting.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tag: factor out get_tagged_oid()René Scharfe Thu, 5 Sep 2019 19:55:55 +0000 (21:55 +0200)

tag: factor out get_tagged_oid()

Add a function for accessing the ID of the object referenced by a tag
safely, i.e. without causing a segfault when encountering a broken tag
where ->tagged is NULL.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

unpack-trees: rename 'is_excluded_from_list()'Derrick Stolee Tue, 3 Sep 2019 18:04:58 +0000 (11:04 -0700)

unpack-trees: rename 'is_excluded_from_list()'

The first consumer of pattern-matching filenames was the
.gitignore feature. In that context, storing a list of patterns
as a 'struct exclude_list' makes sense. However, the
sparse-checkout feature then adopted these structures and methods,
but with the opposite meaning: these patterns match the files
that should be included!

Now that this library is renamed to use 'struct pattern_list'
and 'struct pattern', we can now rename the method used by
the sparse-checkout feature to determine which paths should
appear in the working directory.

The method is_excluded_from_list() is only used by the
sparse-checkout logic in unpack-trees and list-objects-filter.
The confusing part is that it returned 1 for "excluded" (i.e.
it matches the list of exclusions) but that really manes that
the path matched the list of patterns for _inclusion_ in the
working directory.

Rename the method to be path_matches_pattern_list() and have
it return an explicit 'enum pattern_match_result'. Here, the
values MATCHED = 1, UNMATCHED = 0, and UNDECIDED = -1 agree
with the previous integer values. This shift allows future
consumers to better understand what the retur values mean,
and provides more type checking for handling those values.

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

treewide: rename 'exclude' methods to 'pattern'Derrick Stolee Tue, 3 Sep 2019 18:04:57 +0000 (11:04 -0700)

treewide: rename 'exclude' methods to 'pattern'

The first consumer of pattern-matching filenames was the
.gitignore feature. In that context, storing a list of patterns
as a 'struct exclude_list' makes sense. However, the
sparse-checkout feature then adopted these structures and methods,
but with the opposite meaning: these patterns match the files
that should be included!

It would be clearer to rename this entire library as a "pattern
matching" library, and the callers apply exclusion/inclusion
logic accordingly based on their needs.

This commit renames several methods defined in dir.h to make
more sense with the renamed 'struct exclude_list' to 'struct
pattern_list' and 'struct exclude' to 'struct path_pattern':

* last_exclude_matching() -> last_matching_pattern()
* parse_exclude() -> parse_path_pattern()

In addition, the word 'exclude' was replaced with 'pattern'
in the methods below:

* add_exclude_list()
* add_excludes_from_file_to_list()
* add_excludes_from_file()
* add_excludes_from_blob_to_list()
* add_exclude()
* clear_exclude_list()

A few methods with the word "exclude" remain. These will
be handled seperately. In particular, the method
"is_excluded()" is concretely about the .gitignore file
relative to a specific directory. This is the important
boundary between library and consumer: is_excluded() cares
about .gitignore, but is_excluded() calls
last_matching_pattern() to make that decision.

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

treewide: rename 'EXCL_FLAG_' to 'PATTERN_FLAG_'Derrick Stolee Tue, 3 Sep 2019 18:04:56 +0000 (11:04 -0700)

treewide: rename 'EXCL_FLAG_' to 'PATTERN_FLAG_'

The first consumer of pattern-matching filenames was the
.gitignore feature. In that context, storing a list of patterns
as a 'struct exclude_list' makes sense. However, the
sparse-checkout feature then adopted these structures and methods,
but with the opposite meaning: these patterns match the files
that should be included!

It would be clearer to rename this entire library as a "pattern
matching" library, and the callers apply exclusion/inclusion
logic accordingly based on their needs.

This commit replaces 'EXCL_FLAG_' to 'PATTERN_FLAG_' in the
names of the flags used on 'struct path_pattern'.

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

treewide: rename 'struct exclude_list' to 'struct patte... Derrick Stolee Tue, 3 Sep 2019 18:04:56 +0000 (11:04 -0700)

treewide: rename 'struct exclude_list' to 'struct pattern_list'

The first consumer of pattern-matching filenames was the
.gitignore feature. In that context, storing a list of patterns
as a 'struct exclude_list' makes sense. However, the
sparse-checkout feature then adopted these structures and methods,
but with the opposite meaning: these patterns match the files
that should be included!

It would be clearer to rename this entire library as a "pattern
matching" library, and the callers apply exclusion/inclusion
logic accordingly based on their needs.

This commit renames 'struct exclude_list' to 'struct pattern_list'
and renames several variables called 'el' to 'pl'.

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

treewide: rename 'struct exclude' to 'struct path_pattern'Derrick Stolee Tue, 3 Sep 2019 18:04:55 +0000 (11:04 -0700)

treewide: rename 'struct exclude' to 'struct path_pattern'

The first consumer of pattern-matching filenames was the
.gitignore feature. In that context, storing a list of patterns
as a list of 'struct exclude' items makes sense. However, the
sparse-checkout feature then adopted these structures and methods,
but with the opposite meaning: these patterns match the files
that should be included!

It would be clearer to rename this entire library as a "pattern
matching" library, and the callers apply exclusion/inclusion
logic accordingly based on their needs.

This commit renames 'struct exclude' to 'struct path_pattern'
and renames several variable names to match. 'struct pattern'
was already taken by attr.c, and this more completely describes
that the patterns are specific to file paths.

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