Commit graph

57355 commits

Author SHA1 Message Date
Junio C Hamano 020011f2cb Merge branch 'tk/git-svn-trim-author-name'
The author names taken from SVN repositories may have extra leading
or trailing whitespaces, which are now munged away.

* tk/git-svn-trim-author-name:
  git-svn: trim leading and trailing whitespaces in author name
2019-10-11 14:24:46 +09:00
Junio C Hamano 676278f8ea Merge branch 'bc/object-id-part17'
Preparation for SHA-256 upgrade continues.

* bc/object-id-part17: (26 commits)
  midx: switch to using the_hash_algo
  builtin/show-index: replace sha1_to_hex
  rerere: replace sha1_to_hex
  builtin/receive-pack: replace sha1_to_hex
  builtin/index-pack: replace sha1_to_hex
  packfile: replace sha1_to_hex
  wt-status: convert struct wt_status to object_id
  cache: remove null_sha1
  builtin/worktree: switch null_sha1 to null_oid
  builtin/repack: write object IDs of the proper length
  pack-write: use hash_to_hex when writing checksums
  sequencer: convert to use the_hash_algo
  bisect: switch to using the_hash_algo
  sha1-lookup: switch hard-coded constants to the_hash_algo
  config: use the_hash_algo in abbrev comparison
  combine-diff: replace GIT_SHA1_HEXSZ with the_hash_algo
  bundle: switch to use the_hash_algo
  connected: switch GIT_SHA1_HEXSZ to the_hash_algo
  show-index: switch hard-coded constants to the_hash_algo
  blame: remove needless comparison with GIT_SHA1_HEXSZ
  ...
2019-10-11 14:24:46 +09:00
Junio C Hamano aafb75452b Merge branch 'en/clean-nested-with-ignored'
"git clean" fixes.

* en/clean-nested-with-ignored:
  dir: special case check for the possibility that pathspec is NULL
  clean: fix theoretical path corruption
  clean: rewrap overly long line
  clean: avoid removing untracked files in a nested git repository
  clean: disambiguate the definition of -d
  git-clean.txt: do not claim we will delete files with -n/--dry-run
  dir: add commentary explaining match_pathspec_item's return value
  dir: if our pathspec might match files under a dir, recurse into it
  dir: make the DO_MATCH_SUBMODULE code reusable for a non-submodule case
  dir: also check directories for matching pathspecs
  dir: fix off-by-one error in match_pathspec_item
  dir: fix typo in comment
  t7300: add testcases showing failure to clean specified pathspecs
2019-10-11 14:24:46 +09:00
Jeff King 3f9ef874a7 CODE_OF_CONDUCT: mention individual project-leader emails
It's possible that somebody on the project committee is the subject of a
complaint. In that case, it may be useful to be able to contact the
other members individually, so let's make it clear that's an option.

This also serves to enumerate the set of people on the committee. That
lets you easily _know_ if you're in the situation mentioned above. And
it's just convenient to list who's involved in the process, since the
project committee list is not anywhere else in the repository.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-10 10:41:46 +09:00
Jeff King 5cdf2301d4 add a Code of Conduct document
We've never had a formally written Code of Conduct document. Though it
has been discussed off and on over the years, for the most part the
behavior on the mailing list has been good enough that nobody felt the
need to push one forward.

However, even if there aren't specific problems now, it's a good idea to
have a document:

  - it puts everybody on the same page with respect to expectations.
    This might avoid poor behavior, but also makes it easier to handle
    it if it does happen.

  - it publicly advertises that good conduct is important to us and will
    be enforced, which may make some people more comfortable with
    joining our community

  - it may be a good time to cement our expectations when things are
    quiet, since it gives everybody some distance rather than focusing
    on a current contentious issue

This patch adapts the Contributor Covenant Code of Conduct. As opposed
to writing our own from scratch, this uses common and well-accepted
language, and strikes a good balance between illustrating expectations
and avoiding a laundry list of behaviors. It's also the same document
used by the Git for Windows project.

The text is taken mostly verbatim from:

  https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

I also stole a very nice introductory paragraph from the Git for Windows
version of the file.

There are a few subtle points, though:

  - the document refers to "the project maintainers". For the code, we
    generally only consider there to be one maintainer: Junio C Hamano.
    But for dealing with community issues, it makes sense to involve
    more people to spread the responsibility. I've listed the project
    committee address of git@sfconservancy.org as the contact point.

  - the document mentions banning from the community, both in the intro
    paragraph and in "Our Responsibilities". The exact mechanism here is
    left vague. I can imagine it might start with social enforcement
    (not accepting patches, ignoring emails) and could escalate to
    technical measures if necessary (asking vger admins to block an
    address). It probably make sense _not_ to get too specific at this
    point, and deal with specifics as they come up.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: CB Bailey <cb@hashpling.org>
Acked-by: Christian Couder <chriscool@tuxfamily.org>
Acked-by: Emily Shaffer <emilyshaffer@google.com>
Acked-by: Garima Singh <garimasigit@gmail.com>
Acked-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Jonathan Tan <jonathantanmy@google.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Taylor Blau <me@ttaylorr.com>
Acked-by: Elijah Newren <newren@gmail.com>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Acked-by: brian m. carlson <sandals@crustytoothpaste.net>
Acked-by: Derrick Stolee <stolee@gmail.com>
Acked-by: Thomas Gummerer <t.gummerer@gmail.com>
Acked-by: William Baker <williamtbakeremail@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-10 10:39:23 +09:00
Junio C Hamano 70bf0b755a Seventh batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-09 14:02:58 +09:00
Junio C Hamano 9b3995cee0 Merge branch 'rs/test-remove-useless-debugging-cat'
Code cleanup.

* rs/test-remove-useless-debugging-cat:
  tests: remove "cat foo" before "test_i18ngrep bar foo"
2019-10-09 14:01:01 +09:00
Junio C Hamano 2e956f7fb3 Merge branch 'pm/p4-auto-delete-named-temporary'
* pm/p4-auto-delete-named-temporary:
  git-p4: auto-delete named temporary file
2019-10-09 14:01:00 +09:00
Junio C Hamano d17f54947d Merge branch 'rs/convert-fix-utf-without-dash'
The code to skip "UTF" and "UTF-" prefix, when computing an advice
message, did not work correctly when the prefix was "UTF", which
has been fixed.

* rs/convert-fix-utf-without-dash:
  convert: fix handling of dashless UTF prefix in validate_encoding()
2019-10-09 14:01:00 +09:00
Junio C Hamano 82c80f98e6 Merge branch 'py/git-gui-has-maintainer'
Doc update.

* py/git-gui-has-maintainer:
  Documentation: update the location of the git-gui repo
2019-10-09 14:01:00 +09:00
Junio C Hamano 6e12570822 Merge branch 'ah/cleanups'
Miscellaneous code clean-ups.

* ah/cleanups:
  git_mkstemps_mode(): replace magic numbers with computed value
  wrapper: use a loop instead of repetitive statements
  diffcore-break: use a goto instead of a redundant if statement
  commit-graph: remove a duplicate assignment
2019-10-09 14:01:00 +09:00
Junio C Hamano 772cad0afb Merge branch 'js/diff-rename-force-stable-sort'
The rename detection logic sorts a list of rename source candidates
by similarity to pick the best candidate, which means that a tie
between sources with the same similarity is broken by the original
location in the original candidate list (which is sorted by path).
Force the sorting by similarity done with a stable sort, which is
not promised by system supplied qsort(3), to ensure consistent
results across platforms.

* js/diff-rename-force-stable-sort:
  diffcore_rename(): use a stable sort
  Move git_sort(), a stable sort, into into libgit.a
2019-10-09 14:00:59 +09:00
Junio C Hamano 424663d9c8 Merge branch 'js/mingw-spawn-with-spaces-in-path'
Test fix.

* js/mingw-spawn-with-spaces-in-path:
  t0061: fix test for argv[0] with spaces (MINGW only)
2019-10-09 14:00:59 +09:00
Junio C Hamano 678a9ca629 Merge branch 'as/shallow-slab-use-fix'
Correct code that tried to reference all entries in a sparse array
of pointers by mistake.

* as/shallow-slab-use-fix:
  shallow.c: don't free unallocated slabs
2019-10-09 14:00:59 +09:00
Junio C Hamano 0b4fae553c Merge branch 'sg/name-rev-cutoff-underflow-fix'
Integer arithmetic fix.

* sg/name-rev-cutoff-underflow-fix:
  name-rev: avoid cutoff timestamp underflow
2019-10-09 14:00:58 +09:00
Junio C Hamano 042a54d251 Merge branch 'am/visual-studio-config-fix'
Dev support.

* am/visual-studio-config-fix:
  contrib/buildsystems: fix Visual Studio Debug configuration
2019-10-09 14:00:58 +09:00
Johannes Schindelin 03d3b1297c xdiffi: fix typos and touch up comments
Inspired by the thoroughly stale https://github.com/git/git/pull/159,
this patch fixes a couple of typos, rewraps and clarifies some comments.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-09 10:58:34 +09:00
Denton Liu b05b40930e t0000: cover GIT_SKIP_TESTS blindspots
Currently, the tests for GIT_SKIP_TESTS do not cover the situation where
we skip an entire test suite. The tests also do not cover the situation
where we have GIT_SKIP_TESTS defined but the test suite does not match.

Add two test cases so we cover this blindspot.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-09 10:47:08 +09:00
Jonathan Tan d8bc1a518a send-pack: never fetch when checking exclusions
When building the packfile to be sent, send_pack() is given a list of
remote refs to be used as exclusions. For each ref, it first checks if
the ref exists locally, and if it does, passes it with a "^" prefix to
pack-objects. However, in a partial clone, the check may trigger a lazy
fetch.

The additional commit ancestry information obtained during such fetches
may show that certain objects that would have been sent are already
known to the server, resulting in a smaller pack being sent. But this is
at the cost of fetching from many possibly unrelated refs, and the lazy
fetches do not help at all in the typical case where the client is
up-to-date with the upstream of the branch being pushed.

Ensure that these lazy fetches do not occur.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-09 10:46:41 +09:00
Denton Liu 756fb0dedb t4014: treat rev-list output as the expected value
In 6bd26f58ea (t4014: use test_line_count() where possible, 2019-08-27),
we converted many test cases to take advantage of the test_line_count()
function. In one conversion, we inverted the expected and actual value
as tested by test_line_count(). Although functionally correct, if
format-patch ever produced incorrect output, the debugging output would
be a bunch of hashes which would be difficult to debug.

Invert the expected and actual values provided to test_line_count() so
that if format-patch produces incorrect output, the debugging output
will be a list of human-readable files instead.

Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-09 10:44:40 +09:00
Thomas Gummerer 2b6a9b13ca range-diff: don't segfault with mode-only changes
In ef283b3699 ("apply: make parse_git_diff_header public", 2019-07-11)
the 'parse_git_diff_header' function was made public and useable by
callers outside of apply.c.

However it was missed that its (then) only caller, 'find_header' did
some error handling, and completing 'struct patch' appropriately.

range-diff then started using this function, and tried to handle this
appropriately itself, but fell short in some cases.  This in turn
would lead to range-diff segfaulting when there are mode-only changes
in a range.

Move the error handling and completing of the struct into the
'parse_git_diff_header' function, so other callers can take advantage
of it.  This fixes the segfault in 'git range-diff'.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-09 10:41:11 +09:00
Junio C Hamano 360c7ba330 transport: push codepath can take arbitrary repository
The previous step added annotations with "the_repository" to various
functions in the push codepath in the transport layer, but they all
can take arbitrary repository pointer, and may be working on a
repository that is not the_repository.  Fix them.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-08 13:20:01 +09:00
Garima Singh ce2d7ed2fd sq_quote_buf_pretty: don't drop empty arguments
Empty arguments passed on the command line can be represented by
a '', however sq_quote_buf_pretty was incorrectly dropping these
arguments altogether. Fix this problem by ensuring that such
arguments are emitted as '' instead.

Signed-off-by: Garima Singh <garima.singh@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-08 12:59:29 +09:00
Elijah Newren b657047719 merge-recursive: fix the fix to the diff3 common ancestor label
In commit 8e4ec337 ("merge-recursive: fix the diff3 common ancestor
label for virtual commits", 2019-10-01), which was a fix to commit
743474cbfa ("merge-recursive: provide a better label for diff3
common ancestor", 2019-08-17), the label for the common ancestor was
changed from always being

         "merged common ancestors"

to instead be based on the number of merge bases and whether the merge
base was a real commit or a virtual one:

    >=2: "merged common ancestors"
      1, via merge_recursive_generic: "constructed merge base"
      1, otherwise: <abbreviated commit hash>
      0: "<empty tree>"

The handling for "constructed merge base" worked by allowing
opt->ancestor to be set in merge_recursive_generic(), so we paid
attention to the setting of that variable in merge_recursive_internal().
Now, for the outer merge, the code flow was simply the following:

	ancestor_name = "merged merge bases"
	loop over merge_bases: merge_recursive_internal()

The first merge base not needing recursion would determine its own
ancestor_name however necessary and thus run

	ancestor_name = $SOMETHING
	empty loop over merge_bases...
	opt->ancestor = ancestor_name
        merge_trees_internal()

Now, the next set of merge_bases that would need to be merged after this
particular merge had completed would note that opt->ancestor has been
set to something (to a local ancestor_name variable that has since been
popped off the stack), and thus it would run:

	... else if (opt->ancestor) {
		ancestor_name = opt->ancestor;  /* OOPS! */
        loop over merge_bases: merge_recursive_internal()
        opt->ancestor = ancestor_name
        merge_trees_internal()

This resulted in garbage strings being printed for the virtual merge
bases, which was visible in git.git by just merging commit b744c3af07
into commit 6d8cb22a4f.  There are two ways to fix this: set
opt->ancestor to NULL after using it to avoid re-use, or add a
!opt->priv->call_depth check to the if block for using a pre-defined
opt->ancestor.  Apply both fixes.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-08 11:36:27 +09:00
Junio C Hamano b744c3af07 Sixth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-07 11:33:44 +09:00
Junio C Hamano 417056578a Merge branch 'bw/submodule-helper-usage-fix'
Typofix.

* bw/submodule-helper-usage-fix:
  builtin/submodule--helper: fix usage string for 'update-clone'
2019-10-07 11:33:03 +09:00
Junio C Hamano 9728ab488a Merge branch 'dl/honor-cflags-in-hdr-check'
Dev support.

* dl/honor-cflags-in-hdr-check:
  ci: run `hdr-check` as part of the `Static Analysis` job
  Makefile: emulate compile in $(HCO) target better
  pack-bitmap.h: remove magic number
  promisor-remote.h: include missing header
  apply.h: include missing header
2019-10-07 11:33:02 +09:00
Junio C Hamano 1f314d5223 Merge branch 'cb/do-not-use-test-cmp-with-a'
Test portability fix.

* cb/do-not-use-test-cmp-with-a:
  t4038: Remove non-portable '-a' option passed to test_cmp
2019-10-07 11:33:02 +09:00
Junio C Hamano 59b19bcd9f Merge branch 'cc/multi-promisor'
Cleanup.

* cc/multi-promisor:
  promisor-remote: skip move_to_tail when no-op
  promisor-remote.h: drop extern from function declaration
2019-10-07 11:33:02 +09:00
Junio C Hamano 1f4485b219 Merge branch 'jt/merge-recursive-symlink-is-not-a-dir-in-way'
A bug in merge-recursive code that triggers when a branch with a
symbolic link is merged with a branch that replaces it with a
directory has been fixed.

* jt/merge-recursive-symlink-is-not-a-dir-in-way:
  merge-recursive: symlink's descendants not in way
2019-10-07 11:33:02 +09:00
Junio C Hamano 5ecdbfafd6 Merge branch 'ps/my-first-contribution-alphasort'
Docfix.

* ps/my-first-contribution-alphasort:
  doc: MyFirstContribution: fix cmd placement instructions
2019-10-07 11:33:01 +09:00
Junio C Hamano eb35c18e42 Merge branch 'sg/travis-help-debug'
Dev support update.

* sg/travis-help-debug:
  travis-ci: do not skip successfully tested trees in debug mode
2019-10-07 11:33:01 +09:00
Junio C Hamano cabb145fe3 Merge branch 'rs/alias-use-copy-array'
Code cleanup.

* rs/alias-use-copy-array:
  git: use COPY_ARRAY and MOVE_ARRAY in handle_alias()
2019-10-07 11:33:01 +09:00
Junio C Hamano 56c7ab0f4e Merge branch 'sg/t-helper-gitignore'
Update the way build artifacts in t/helper/ directory are ignored.

* sg/t-helper-gitignore:
  t/helper: ignore only executable files
2019-10-07 11:33:01 +09:00
Junio C Hamano e5ce62b1ac Merge branch 'cc/svn-fe-py-shebang'
* cc/svn-fe-py-shebang:
  contrib/svn-fe: fix shebang for svnrdump_sim.py
2019-10-07 11:33:00 +09:00
Junio C Hamano 583cf6232a Merge branch 'ah/doc-submodule-ignore-submodules'
Docfix.

* ah/doc-submodule-ignore-submodules:
  doc: fix reference to --ignore-submodules
2019-10-07 11:33:00 +09:00
Junio C Hamano 337e3f2b49 Merge branch 'rs/nth-switch-code-simplification'
Code simplification.

* rs/nth-switch-code-simplification:
  sha1_name: simplify strbuf handling in interpret_nth_prior_checkout()
2019-10-07 11:33:00 +09:00
Junio C Hamano 8f53fe1733 Merge branch 'hb/hg-to-git-py3'
The hg-to-git script (in contrib/) has been updated to work with
Python 3.

* hb/hg-to-git-py3:
  hg-to-git: make it compatible with both python3 and python2
2019-10-07 11:32:59 +09:00
Junio C Hamano ef93bfbd45 Merge branch 'sg/progress-fix'
Regression fix for progress output.

* sg/progress-fix:
  Test the progress display
  Revert "progress: use term_clear_line()"
2019-10-07 11:32:59 +09:00
Junio C Hamano 980351d1ac Merge branch 'js/doc-patch-text'
Docfix.

* js/doc-patch-text:
  diff, log doc: small grammer, format, and language fixes
  diff, log doc: say "patch text" instead of "patches"
2019-10-07 11:32:59 +09:00
Junio C Hamano 80693e3f09 Merge branch 'tb/commit-graph-harden'
The code to parse and use the commit-graph file has been made more
robust against corrupted input.

* tb/commit-graph-harden:
  commit-graph.c: handle corrupt/missing trees
  commit-graph.c: handle commit parsing errors
  t/t5318: introduce failing 'git commit-graph write' tests
2019-10-07 11:32:58 +09:00
Junio C Hamano ae203ba414 Merge branch 'jt/cache-tree-avoid-lazy-fetch-during-merge'
The cache-tree code has been taught to be less aggressive in
attempting to see if a tree object it computed already exists in
the repository.

* jt/cache-tree-avoid-lazy-fetch-during-merge:
  cache-tree: do not lazy-fetch tentative tree
2019-10-07 11:32:58 +09:00
Junio C Hamano 3f84633563 Merge branch 'dl/cocci-everywhere'
Coccinelle checks are done on more source files than before now.

* dl/cocci-everywhere:
  Makefile: run coccicheck on more source files
  Makefile: strip leading ./ in $(FIND_SOURCE_FILES)
  Makefile: define THIRD_PARTY_SOURCES
  Makefile: strip leading ./ in $(LIB_H)
2019-10-07 11:32:58 +09:00
Junio C Hamano caf150ce7d Merge branch 'gs/commit-graph-progress'
* gs/commit-graph-progress:
  commit-graph: add --[no-]progress to write and verify
2019-10-07 11:32:57 +09:00
Junio C Hamano 1d8b0dfa8a Merge branch 'ms/fetch-follow-tag-optim'
The code used in following tags in "git fetch" has been optimized.

* ms/fetch-follow-tag-optim:
  fetch: use oidset to keep the want OIDs for faster lookup
2019-10-07 11:32:57 +09:00
Junio C Hamano 1398171378 Merge branch 'rs/commit-graph-use-list-count'
Code cleanup.

* rs/commit-graph-use-list-count:
  commit-graph: use commit_list_count()
2019-10-07 11:32:57 +09:00
Junio C Hamano 773521df26 Merge branch 'rs/nth-parent-parse'
The object name parser for "Nth parent" syntax has been made more
robust against integer overflows.

* rs/nth-parent-parse:
  sha1-name: check for overflow of N in "foo^N" and "foo~N"
  rev-parse: demonstrate overflow of N for "foo^N" and "foo~N"
2019-10-07 11:32:57 +09:00
Junio C Hamano 7f17913161 Merge branch 'dl/submodule-set-branch'
Docfix.

* dl/submodule-set-branch:
  git-submodule.txt: fix AsciiDoc formatting error
2019-10-07 11:32:56 +09:00
Junio C Hamano cb3ec6f4ef Merge branch 'cs/pretty-formats-doc-typofix'
Doc fix.

* cs/pretty-formats-doc-typofix:
  doc: minor formatting fix
2019-10-07 11:32:56 +09:00
Junio C Hamano bbfe5f2241 Merge branch 'jk/list-objects-optim-wo-trees'
The object traversal machinery has been optimized not to load tree
objects when we are only interested in commit history.

* jk/list-objects-optim-wo-trees:
  list-objects: don't queue root trees unless revs->tree_objects is set
2019-10-07 11:32:56 +09:00