Commit graph

55939 commits

Author SHA1 Message Date
Matthew DeVore c2694952e3 strbuf: give URL-encoding API a char predicate fn
Allow callers to specify exactly what characters need to be URL-encoded
and which do not. This new API will be taken advantage of in a patch
later in this set.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-28 08:41:53 -07:00
Matthew DeVore cf9ceb5a12 list-objects-filter-options: make filter_spec a string_list
Make the filter_spec string a string_list rather than a raw C string.
The list of strings must be concatted together to make a complete
filter_spec. A future patch will use this capability to build "combine:"
filter specs gradually.

A strbuf would seem to be a more natural choice for this object, but it
unfortunately requires initialization besides just zero'ing out the
memory.  This results in all container structs, and all containers of
those structs, etc., to also require initialization. Initializing them
all would be more cumbersome that simply using a string_list, which
behaves properly when its contents are zero'd.

For the purposes of code simplification, change behavior in how filter
specs are conveyed over the protocol: do not normalize the tree:<depth>
filter specs since there should be no server in existence that supports
tree:# but not tree:#k etc.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-28 08:41:53 -07:00
Matthew DeVore f56f764279 list-objects-filter-options: move error check up
Move the check that filter_options->choice is set to higher in the call
stack. This can only be set when the gentle parse function is called
from one of the two call sites.

This is important because in an upcoming patch this may or may not be an
error, and whether it is an error is only known to the
parse_list_objects_filter function.

Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-28 08:41:53 -07:00
Matthew DeVore e987df5fe6 list-objects-filter: implement composite filters
Allow combining filters such that only objects accepted by all filters
are shown. The motivation for this is to allow getting directory
listings without also fetching blobs. This can be done by combining
blob:none with tree:<depth>. There are massive repositories that have
larger-than-expected trees - even if you include only a single commit.

A combined filter supports any number of subfilters, and is written in
the following form:

	combine:<filter 1>+<filter 2>+<filter 3>

Certain non-alphanumeric characters in each filter must be
URL-encoded.

For now, combined filters must be specified in this form. In a
subsequent commit, rev-list will support multiple --filter arguments
which will have the same effect as specifying one filter argument
starting with "combine:". The documentation will be updated in that
commit, as the URL-encoding scheme is in general not meant to be used
directly by the user, and it is better to describe the URL-encoding
feature in terms of the repeated flag.

Helped-by: Emily Shaffer <emilyshaffer@google.com>
Helped-by: Jeff Hostetler <git@jeffhostetler.com>
Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Helped-by: Jonathan Tan <jonathantanmy@google.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-28 08:41:53 -07:00
Matthew DeVore 842b00516a list-objects-filter-options: always supply *errbuf
Making errbuf an optional argument complicates error reporting. Fix this
by making all callers supply an errbuf, even if they may ignore it. This
will be important in follow-up patches where the filter-spec parsing has
more pitfalls and possible errors.

Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-28 08:41:53 -07:00
Matthew DeVore 7a7c7f4a6d list-objects-filter: put omits set in filter struct
The oidset *omits pointer must be accessed by the combine filter in a
type-agnostic way once the graph traversal is over. Store that pointer
in the general `filter` struct. This will be used in a follow-up patch
to implement the combine filter.

Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-28 08:41:53 -07:00
Matthew DeVore 9430147ca0 list-objects-filter: encapsulate filter components
Encapsulate filter_fn, filter_free_fn, and filter_data into their own
opaque struct.

Due to opaqueness, filter_fn and filter_free_fn can no longer be
accessed directly by users. Currently, all usages of filter_fn are
guarded by a necessary check:

	(obj->flags & NOT_USER_GIVEN) && filter_fn

Take the opportunity to include this check into the new function
list_objects_filter__filter_object(), so that we no longer need to write
this check at every caller of the filter function.

Also, the init functions in list-objects-filter.c no longer need to
confusingly return the filter constituents in various places (filter_fn
and filter_free_fn as out parameters, and filter_data as the function's
return value); they can just initialize the "struct filter" passed in.

Helped-by: Jeff Hostetler <git@jeffhostetler.com>
Helped-by: Jonathan Tan <jonathantanmy@google.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-28 08:41:53 -07:00
Junio C Hamano 8dca754b1e The third batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-21 11:26:11 -07:00
Junio C Hamano 90d79d7191 Merge branch 'mo/clang-format-for-each-update'
The list of for-each like macros used by clang-format has been
updated.

* mo/clang-format-for-each-update:
  clang-format: use git grep to generate the ForEachMacros list
2019-06-21 11:24:12 -07:00
Junio C Hamano f9089e8491 Merge branch 'md/url-parse-harden'
The URL decoding code has been updated to avoid going past the end
of the string while parsing %-<hex>-<hex> sequence.

* md/url-parse-harden:
  url: do not allow %00 to represent NUL in URLs
  url: do not read past end of buffer
2019-06-21 11:24:12 -07:00
Junio C Hamano e694ea5e04 Merge branch 'an/ignore-doc-update'
The description about slashes in gitignore patterns (used to
indicate things like "anchored to this level only" and "only
matches directories") has been revamped.

* an/ignore-doc-update:
  gitignore.txt: make slash-rules more readable
2019-06-21 11:24:11 -07:00
Junio C Hamano 755793bf57 Merge branch 'ab/hash-object-doc'
Doc update.

* ab/hash-object-doc:
  hash-object doc: stop mentioning git-cvsimport
2019-06-21 11:24:11 -07:00
Junio C Hamano 88542ef306 Merge branch 'cm/send-email-document-req-modules'
A doc update.

* cm/send-email-document-req-modules:
  send-email: update documentation of required Perl modules
2019-06-21 11:24:10 -07:00
Junio C Hamano ca02d3669f Merge branch 'md/list-objects-filter-parse-msgfix'
Make an end-user facing message localizable.

* md/list-objects-filter-parse-msgfix:
  list-objects-filter-options: error is localizeable
2019-06-21 11:24:10 -07:00
Junio C Hamano 34032c4f8f Merge branch 'md/list-objects-filter-memfix'
The filter_data used in the list-objects-filter (which manages a
lazily sparse clone repository) did not use the dynamic array API
correctly---'nr' is supposed to point at one past the last element
of the array in use.  This has been corrected.

* md/list-objects-filter-memfix:
  list-objects-filter: correct usage of ALLOC_GROW
2019-06-21 11:24:09 -07:00
Junio C Hamano 8867aa855e Merge branch 'jt/partial-clone-missing-ref-delta-base'
"git fetch" into a lazy clone forgot to fetch base objects that are
necessary to complete delta in a thin packfile, which has been
corrected.

* jt/partial-clone-missing-ref-delta-base:
  t5616: cover case of client having delta base
  t5616: use correct flag to check object is missing
  index-pack: prefetch missing REF_DELTA bases
  t5616: refactor packfile replacement
2019-06-21 11:24:09 -07:00
Junio C Hamano a41dad4330 Merge branch 'ml/userdiff-rust'
The pattern "git diff/grep" use to extract funcname and words
boundary for Rust has been added.

* ml/userdiff-rust:
  userdiff: two simplifications of patterns for rust
  userdiff: add built-in pattern for rust
2019-06-21 11:24:08 -07:00
Junio C Hamano a6a95cd1b4 The second batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-17 10:16:10 -07:00
Junio C Hamano 14f49b2058 Merge branch 'xl/record-partial-clone-origin'
When creating a partial clone, the object filtering criteria is
recorded for the origin of the clone, but this incorrectly used a
hardcoded name "origin" to name that remote; it has been corrected
to honor the "--origin <name>" option.

* xl/record-partial-clone-origin:
  clone: respect user supplied origin name when setting up partial clone
2019-06-17 10:15:20 -07:00
Junio C Hamano dedc046421 Merge branch 'pb/request-pull-verify-remote-ref'
"git request-pull" learned to warn when the ref we ask them to pull
from in the local repository and in the published repository are
different.

* pb/request-pull-verify-remote-ref:
  request-pull: warn if the remote object is not the same as the local one
  request-pull: quote regex metacharacters in local ref
2019-06-17 10:15:20 -07:00
Junio C Hamano add59c4708 Merge branch 'mm/p4-unshelve-windows-fix'
The command line to invoke a "git cat-file" command from inside
"git p4" was not properly quoted to protect a caret and running a
broken command on Windows, which has been corrected.

* mm/p4-unshelve-windows-fix:
  p4 unshelve: fix "Not a valid object name HEAD0" on Windows
2019-06-17 10:15:19 -07:00
Junio C Hamano d4fdeed006 Merge branch 'po/git-help-on-git-itself'
"git help git" was hard to discover (well, at least for some
people).

* po/git-help-on-git-itself:
  Doc: git.txt: remove backticks from link and add git-scm.com/docs
  git.c: show usage for accessing the git(1) help page
2019-06-17 10:15:19 -07:00
Junio C Hamano 55b34f30c2 Merge branch 'es/first-contrib-tutorial'
A new tutorial targetting specifically aspiring git-core
developers.

* es/first-contrib-tutorial:
  doc: add some nit fixes to MyFirstContribution
  documentation: add anchors to MyFirstContribution
  documentation: add tutorial for first contribution
2019-06-17 10:15:19 -07:00
Junio C Hamano 3dc47c4288 Merge branch 'bb/unicode-12.1-reiwa'
Update to Unicode 12.1 width table.

* bb/unicode-12.1-reiwa:
  unicode: update the width tables to Unicode 12.1
2019-06-17 10:15:18 -07:00
Junio C Hamano e7ef93ba7a Merge branch 'sw/git-p4-unshelve-branched-files'
"git p4" update.

* sw/git-p4-unshelve-branched-files:
  git-p4: allow unshelving of branched files
2019-06-17 10:15:18 -07:00
Junio C Hamano a3e6b426b9 Merge branch 'js/fsmonitor-unflake'
The data collected by fsmonitor was not properly written back to
the on-disk index file, breaking t7519 tests occasionally, which
has been corrected.

* js/fsmonitor-unflake:
  mark_fsmonitor_valid(): mark the index as changed if needed
  fill_stat_cache_info(): prepare for an fsmonitor fix
2019-06-17 10:15:18 -07:00
Junio C Hamano bdc81d15a2 Merge branch 'ds/topo-traversal-using-commit-graph'
Prepare use of reachability index in topological walker that works
on a range (A..B).

* ds/topo-traversal-using-commit-graph:
  revision: keep topo-walk free of unintersting commits
  revision: use generation for A..B --topo-order queries
2019-06-17 10:15:17 -07:00
Junio C Hamano 2f475317f2 Merge branch 'bl/userdiff-octave'
The pattern "git diff/grep" use to extract funcname and words
boundary for Matlab has been extend to cover Octave, which is more
or less equivalent.

* bl/userdiff-octave:
  userdiff: fix grammar and style issues
  userdiff: add Octave
2019-06-17 10:15:17 -07:00
Junio C Hamano 94760948f1 Merge branch 'ba/clone-remote-submodules'
"git clone --recurse-submodules" learned to set up the submodules
to ignore commit object names recorded in the superproject gitlink
and instead use the commits that happen to be at the tip of the
remote-tracking branches from the get-go, by passing the new
"--remote-submodules" option.

* ba/clone-remote-submodules:
  clone: add `--remote-submodules` flag
2019-06-17 10:15:17 -07:00
Junio C Hamano 6e0b1c60ad Merge branch 'vv/merge-squash-with-explicit-commit'
"git merge --squash" is designed to update the working tree and the
index without creating the commit, and this cannot be countermanded
by adding the "--commit" option; the command now refuses to work
when both options are given.

* vv/merge-squash-with-explicit-commit:
  merge: refuse --commit with --squash
2019-06-17 10:15:17 -07:00
Junio C Hamano 3a54d80ac8 Merge branch 'js/bundle-verify-require-object-store'
"git bundle verify" needs to see if prerequisite objects exist in
the receiving repository, but the command did not check if we are
in a repository upfront, which has been corrected.

* js/bundle-verify-require-object-store:
  bundle verify: error out if called without an object database
2019-06-17 10:15:16 -07:00
Junio C Hamano 5b476dc2f1 Merge branch 'js/bisect-helper-check-get-oid-return-value'
Code cleanup.

* js/bisect-helper-check-get-oid-return-value:
  bisect--helper: verify HEAD could be parsed before continuing
2019-06-17 10:15:16 -07:00
Junio C Hamano 9b3897ab06 Merge branch 'jk/am-i-resolved-fix'
"git am -i --resolved" segfaulted after trying to see a commit as
if it were a tree, which has been corrected.

* jk/am-i-resolved-fix:
  am: fix --interactive HEAD tree resolution
  am: drop tty requirement for --interactive
  am: read interactive input from stdin
  am: simplify prompt response handling
2019-06-17 10:15:15 -07:00
Junio C Hamano 86d87307c1 Merge branch 'jk/HEAD-symref-in-xfer-namespaces'
The server side support for "git fetch" used to show incorrect
value for the HEAD symbolic ref when the namespace feature is in
use, which has been corrected.

* jk/HEAD-symref-in-xfer-namespaces:
  upload-pack: strip namespace from symref data
2019-06-17 10:15:15 -07:00
Junio C Hamano 63b6b4b7e1 Merge branch 'ew/server-info-remove-crufts'
"git update-server-info" used to leave stale packfiles in its
output, which has been corrected.

* ew/server-info-remove-crufts:
  server-info: do not list unlinked packs
2019-06-17 10:15:15 -07:00
Junio C Hamano ac97dc4fa9 Merge branch 'es/grep-require-name-when-needed'
More parameter validation.

* es/grep-require-name-when-needed:
  grep: fail if call could output and name is null
2019-06-17 10:15:14 -07:00
Junio C Hamano 7df94cd1f6 Merge branch 'es/git-debugger-doc'
Doc update.

* es/git-debugger-doc:
  doc: hint about GIT_DEBUGGER in CodingGuidelines
2019-06-17 10:15:14 -07:00
Junio C Hamano 5d5c46b28c Merge branch 'ds/object-info-for-prefetch-fix'
Code cleanup and futureproof.

* ds/object-info-for-prefetch-fix:
  sha1-file: split OBJECT_INFO_FOR_PREFETCH
2019-06-17 10:15:14 -07:00
Junio C Hamano 0aae918dd9 The first batch after 2.22
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-13 13:23:03 -07:00
Junio C Hamano c510261154 Merge branch 'pw/rebase-edit-message-for-replayed-merge'
A "merge -c" instruction during "git rebase --rebase-merges" should
give the user a chance to edit the log message, even when there is
otherwise no need to create a new merge and replace the existing
one (i.e. fast-forward instead), but did not.  Which has been
corrected.

* pw/rebase-edit-message-for-replayed-merge:
  rebase -r: always reword merge -c
2019-06-13 13:19:43 -07:00
Junio C Hamano 51d6c0f015 Merge branch 'ab/deprecate-R-for-dynpath'
The way of specifying the path to find dynamic libraries at runtime
has been simplified.  The old default to pass -R/path/to/dir has been
replaced with the new default to pass -Wl,-rpath,/path/to/dir,
which is the more recent GCC uses.  Those who need to build with an
old GCC can still use "CC_LD_DYNPATH=-R"

* ab/deprecate-R-for-dynpath:
  Makefile: remove the NO_R_TO_GCC_LINKER flag
2019-06-13 13:19:43 -07:00
Junio C Hamano 2a983b227d Merge branch 'mh/import-transport-fd-fix'
The ownership rule for the file descriptor to fast-import remote
backend was mixed up, leading to unrelated file descriptor getting
closed, which has been fixed.

* mh/import-transport-fd-fix:
  Use xmmap_gently instead of xmmap in use_pack
  dup() the input fd for fast-import used for remote helpers
2019-06-13 13:19:43 -07:00
Junio C Hamano 813a3a2ab7 Merge branch 'ew/update-server-info'
"git update-server-info" learned not to rewrite the file with the
same contents.

* ew/update-server-info:
  update-server-info: avoid needless overwrites
2019-06-13 13:19:42 -07:00
Junio C Hamano 8d32d2552e Merge branch 'jk/help-unknown-ref-fix'
Improve the code to show args with potential typo that cannot be
interpreted as a commit-ish.

* jk/help-unknown-ref-fix:
  help_unknown_ref(): check for refname ambiguity
  help_unknown_ref(): duplicate collected refnames
2019-06-13 13:19:42 -07:00
Junio C Hamano e91f65d0e2 Merge branch 'dl/format-patch-notes-config'
"git format-patch" learns a configuration to set the default for
its --notes=<ref> option.

* dl/format-patch-notes-config:
  format-patch: teach format.notes config option
  git-format-patch.txt: document --no-notes option
2019-06-13 13:19:42 -07:00
Junio C Hamano c4a38d161c Merge branch 'nd/merge-quit'
"git merge" learned "--quit" option that cleans up the in-progress
merge while leaving the working tree and the index still in a mess.

* nd/merge-quit:
  merge: add --quit
  merge: remove drop_save() in favor of remove_merge_branch_state()
2019-06-13 13:19:41 -07:00
Junio C Hamano 89d1b573d7 Merge branch 'ab/fail-prereqs-in-test'
Developer support to emulate unsatisfied prerequisites in tests to
ensure that the remainer of the tests still succeeds when tests
with prerequisites are skipped.

* ab/fail-prereqs-in-test:
  tests: add a special setup where prerequisites fail
2019-06-13 13:19:41 -07:00
Junio C Hamano 000bce0ee4 Merge branch 'nd/corrupt-worktrees'
"git worktree add" used to fail when another worktree connected to
the same repository was corrupt, which has been corrected.

* nd/corrupt-worktrees:
  worktree add: be tolerant of corrupt worktrees
2019-06-13 13:19:41 -07:00
Junio C Hamano ed7f8acbaa Merge branch 'js/rebase-cleanup'
Update supporting parts of "git rebase" to remove code that should
no longer be used.

* js/rebase-cleanup:
  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
2019-06-13 13:19:40 -07:00
Junio C Hamano 0d107b1989 Merge branch 'nd/worktree-name-sanitization'
In recent versions of Git, per-worktree refs are exposed in
refs/worktrees/<wtname>/ hierarchy, which means that worktree names
must be a valid refname component.  The code now sanitizes the names
given to worktrees, to make sure these refs are well-formed.

* nd/worktree-name-sanitization:
  worktree add: sanitize worktree names
2019-06-13 13:19:40 -07:00