summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-01-15git-p4: simplify regex pattern generation for parsing diff-treeLibravatar Yang Zhao1-7/+6
It is not clear why a generator was used to create the regex used to parse git-diff-tree output; I assume an early implementation required it, but is not part of the mainline change. Simply use a lazily initialized global instead. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Reviewed-by: Ben Keene <seraphire@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-15git-p4: use dict.items() iteration for python3 compatibilityLibravatar Yang Zhao1-1/+1
Python3 uses dict.items() instead of .iteritems() to provide iteratoration over dict. Although items() is technically less efficient for python2.7 (allocates a new list instead of simply iterating), the amount of data involved is very small and the penalty negligible. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Reviewed-by: Ben Keene <seraphire@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-15git-p4: use functools.reduce instead of reduceLibravatar Yang Zhao1-1/+2
For python3, reduce() has been moved to functools.reduce(). This is also available in python2.7. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-15git-p4: fix freezing while waiting for fast-import progressLibravatar Yang Zhao1-0/+1
As part of its importing process, git-p4 sends a `checkpoint` followed immediately by `progress` to fast-import to force synchronization. Due to buffering, it is possible for the `progress` command to not be flushed before git-p4 begins to wait for the corresponding response. This causes the script to freeze completely, and is consistently observable at least on python-3.6.9. Make sure this command sequence is completely flushed before waiting. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Reviewed-by: Ben Keene <seraphire@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-15git-p4: use marshal format version 2 when sending to p4Libravatar Yang Zhao1-1/+2
p4 does not appear to understand marshal format version 3 and above. Version 2 was the latest supported by python-2.7. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Reviewed-by: Ben Keene <seraphire@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-15git-p4: open .gitp4-usercache.txt in text modeLibravatar Yang Zhao1-2/+2
Opening .gitp4-usercache.txt in text mode makes python 3 happy without explicitly adding encoding and decoding. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Reviewed-by: Ben Keene <seraphire@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-15git-p4: convert path to unicode before processing themLibravatar Yang Zhao1-25/+44
P4 allows essentially arbitrary encoding for path data while we would perfer to be dealing only with unicode strings. Since path data need to survive round-trip back to p4, this patch implements the general policy that we store path data as-is, but decode them to unicode before doing any non-trivial processing. A new `decode_path()` method is provided that generally does the correct conversion, taking into account `git-p4.pathEncoding` configuration. For python2.7, path strings will be left as-is if it only contains ASCII characters. For python3, decoding is always done so that we have str objects. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Reviewed-by: Ben Keene <seraphire@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-15git-p4: encode/decode communication with git for python3Libravatar Yang Zhao1-4/+17
Under python3, calls to write() on the stream to `git fast-import` must be encoded. This patch wraps the IO object such that this encoding is done transparently. Conversely, any text data read from subprocesses must also be decoded before running through the rest of the pipeline. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Reviewed-by: Ben Keene <seraphire@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-15git-p4: encode/decode communication with p4 for python3Libravatar Yang Zhao1-13/+46
The marshalled dict in the response given on STDOUT by p4 uses `str` for keys and string values. When run using python3, these values are deserialized as `bytes`, leading to a whole host of problems as the rest of the code assumes `str` is used throughout. This patch changes the deserialization behaviour such that, as much as possible, text output from p4 is decoded to native unicode strings. Exceptions are made for the field `data` as it is usually arbitrary binary data. `depotFile[0-9]*`, `path`, and `clientFile` are also exempt as they contain path strings not encoded with UTF-8, and must survive round-trip back to p4. Conversely, text data being piped to p4 must always be encoded when running under python3. encode_text_stream() and decode_text_stream() were added to make these transformations more convenient. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-15git-p4: remove string type aliasingLibravatar Yang Zhao1-16/+0
Now that python2.7 is the minimum required version and we no longer use the basestring type, it is not necessary to use type aliasing to ensure python3 compatibility. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-15git-p4: change the expansion test from basestring to listLibravatar Ben Keene1-9/+9
Python 3 handles strings differently than Python 2.7. Since Python 2 is reaching it's end of life, a series of changes are being submitted to enable python 3.5 and following support. The current code fails basic tests under python 3.5. Some codepaths can represent a command line the program internally prepares to execute either as a single string (i.e. each token properly quoted, concatenated with $IFS) or as a list of argv[] elements, and there are 9 places where we say "if X is isinstance(_, basestring), then do this thing to handle X as a command line in a single string; if not, X is a command line in a list form". This does not work well with Python 3, as there is no basestring (everything is Unicode now), and even with Python 2, it was not an ideal way to tell the two cases apart, because an internally formed command line could have been in a single Unicode string. Flip the check to say "if X is not a list, then handle X as a command line in a single string; otherwise treat it as a command line in a list form". This will get rid of references to 'basestring', to migrate the code ready for Python 3. Thanks-to: Junio C Hamano <gitster@pobox.com> Signed-off-by: Ben Keene <seraphire@gmail.com> Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-15git-p4: make python2.7 the oldest supported versionLibravatar Yang Zhao1-18/+2
Python2.6 and earlier have been end-of-life'd for many years now, and we actually already use 2.7-only features in the code. Make the version check reflect current realities. This also removes the need to explicitly define CalledProcessError if it's not available. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-06The fourth batchLibravatar Junio C Hamano1-0/+18
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-06Merge branch 'dl/lore-is-the-archive'Libravatar Junio C Hamano14-17/+18
Publicize lore.kernel.org mailing list archive and use URLs pointing into it to refer to notable messages in the documentation. * dl/lore-is-the-archive: doc: replace LKML link with lore.kernel.org RelNotes: replace Gmane with real Message-IDs doc: replace MARC links with lore.kernel.org
2019-12-06Merge branch 'jk/lore-is-the-archive'Libravatar Junio C Hamano13-30/+30
Doc update for the mailing list archiving and nntp service. * jk/lore-is-the-archive: doc: replace public-inbox links with lore.kernel.org doc: recommend lore.kernel.org over public-inbox.org
2019-12-06Merge branch 'tg/perf-remove-stale-result'Libravatar Junio C Hamano2-11/+5
PerfTest fix to avoid stale result mixed up with the latest round of test results. * tg/perf-remove-stale-result: perf-lib: use a single filename for all measurement types
2019-12-06Merge branch 'jk/send-pack-check-negative-with-quick'Libravatar Junio C Hamano1-1/+3
Performance tweak on "git push" into a repository with many refs that point at objects we have never heard of. * jk/send-pack-check-negative-with-quick: send-pack: use OBJECT_INFO_QUICK to check negative objects
2019-12-06Merge branch 'hi/grep-do-not-return-void'Libravatar Junio C Hamano1-1/+1
Code cleanup. * hi/grep-do-not-return-void: grep: don't return an expression from pcre2_free()
2019-12-06Merge branch 'rs/use-skip-prefix-more'Libravatar Junio C Hamano5-22/+16
Code cleanup. * rs/use-skip-prefix-more: name-rev: use skip_prefix() instead of starts_with() push: use skip_prefix() instead of starts_with() shell: use skip_prefix() instead of starts_with() fmt-merge-msg: use skip_prefix() instead of starts_with() fetch: use skip_prefix() instead of starts_with()
2019-12-06Merge branch 'rs/simplify-prepare-cmd'Libravatar Junio C Hamano1-2/+1
Code cleanup. * rs/simplify-prepare-cmd: run-command: use prepare_git_cmd() in prepare_cmd()
2019-12-06Merge branch 'rs/test-cleanup'Libravatar Junio C Hamano10-23/+16
Test cleanup. * rs/test-cleanup: t7811: don't create unused file t9300: don't create unused file test: use test_must_be_empty F instead of test_cmp empty F test: use test_must_be_empty F instead of test -z $(cat F) t1400: use test_must_be_empty t1410: use test_line_count t1512: use test_line_count
2019-12-06Merge branch 'sg/assume-no-todo-update-in-cherry-pick'Libravatar Junio C Hamano2-1/+31
While running "revert" or "cherry-pick --edit" for multiple commits, a recent regression incorrectly detected "nothing to commit, working tree clean", instead of replaying the commits, which has been corrected. * sg/assume-no-todo-update-in-cherry-pick: sequencer: don't re-read todo for revert and cherry-pick
2019-12-06Merge branch 'sg/osx-force-gcc-9'Libravatar Junio C Hamano2-4/+5
TravisCI update. * sg/osx-force-gcc-9: ci: build Git with GCC 9 in the 'osx-gcc' build job
2019-12-05The third batchLibravatar Junio C Hamano1-0/+81
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-05Merge branch 'js/pkt-line-h-typofix'Libravatar Junio C Hamano1-1/+1
Typofix. * js/pkt-line-h-typofix: pkt-line: fix a typo
2019-12-05Merge branch 'us/unpack-trees-fsmonitor'Libravatar Junio C Hamano3-9/+29
Users of oneway_merge() (like "reset --hard") learned to take advantage of fsmonitor to avoid unnecessary lstat(2) calls. * us/unpack-trees-fsmonitor: unpack-trees: skip stat on fsmonitor-valid files
2019-12-05Merge branch 'sg/test-bool-env'Libravatar Junio C Hamano10-13/+84
Recently we have declared that GIT_TEST_* variables take the usual boolean values (it used to be that some used "non-empty means true" and taking GIT_TEST_VAR=YesPlease as true); make sure we notice and fail when non-bool strings are given to these variables. * sg/test-bool-env: t5608-clone-2gb.sh: turn GIT_TEST_CLONE_2GB into a bool tests: add 'test_bool_env' to catch non-bool GIT_TEST_* values
2019-12-05Merge branch 'mh/clear-topo-walk-upon-reset'Libravatar Junio C Hamano1-1/+17
The revision walking machinery uses resources like per-object flag bits that need to be reset before a new iteration of walking begins, but the resources related to topological walk were not cleared correctly, which has been corrected. * mh/clear-topo-walk-upon-reset: revision: free topo_walk_info before creating a new one in init_topo_walk revision: clear the topo-walk flags in reset_revision_walk
2019-12-05Merge branch 'hv/assume-priumax-is-available-anywhere'Libravatar Junio C Hamano1-20/+0
We have had compatibility fallback macro definitions for "PRIuMAX", "PRIu32", etc. but did not for "PRIdMAX", while the code used the last one apparently without any hiccup reported recently. The fallback macro definitions for these <inttypes.h> macros that must appear in C99 systems have been removed. * hv/assume-priumax-is-available-anywhere: git-compat-util.h: drop the `PRIuMAX` and other fallback definitions
2019-12-05Merge branch 'mg/submodule-status-from-a-subdirectory'Libravatar Junio C Hamano2-1/+24
"git submodule status" that is run from a subdirectory of the superproject did not work well, which has been corrected. * mg/submodule-status-from-a-subdirectory: submodule: fix 'submodule status' when called from a subdirectory
2019-12-05Merge branch 'dl/t5520-cleanup'Libravatar Junio C Hamano10-159/+238
Test cleanup. * dl/t5520-cleanup: t5520: replace `! git` with `test_must_fail git` t5520: remove redundant lines in test cases t5520: replace $(cat ...) comparison with test_cmp t5520: don't put git in upstream of pipe t5520: test single-line files by git with test_cmp t5520: use test_cmp_rev where possible t5520: replace test -{n,z} with test-lib functions t5520: use test_line_count where possible t5520: remove spaces after redirect operator t5520: replace test -f with test-lib functions t5520: let sed open its own input t5520: use sq for test case names t5520: improve test style t: teach test_cmp_rev to accept ! for not-equals t0000: test multiple local assignment
2019-12-05Merge branch 'nl/reset-patch-takes-a-tree'Libravatar Junio C Hamano2-1/+22
"git reset --patch $object" without any pathspec should allow a tree object to be given, but incorrectly required a committish, which has been corrected. * nl/reset-patch-takes-a-tree: reset: parse rev as tree-ish in patch mode
2019-12-05Merge branch 'mg/doc-submodule-status-cached'Libravatar Junio C Hamano1-0/+3
"git submodule status" and "git submodule status --cached" show different things, but the documentation did not cover them correctly, which has been corrected. * mg/doc-submodule-status-cached: doc: document 'git submodule status --cached'
2019-12-05Merge branch 'js/git-svn-use-rebase-merges'Libravatar Junio C Hamano2-5/+7
Prepare further for "rebase --preserve-merges" deprecation. * js/git-svn-use-rebase-merges: git svn: stop using `rebase --preserve-merges`
2019-12-05Merge branch 'hi/gpg-optional-pkfp-fix'Libravatar Junio C Hamano2-12/+52
The code to parse GPG output used to assume incorrectly that the finterprint for the primary key would always be present for a valid signature, which has been corrected. * hi/gpg-optional-pkfp-fix: gpg-interface: limit search for primary key fingerprint gpg-interface: refactor the free-and-xmemdupz pattern
2019-12-05Merge branch 'pw/sequencer-compare-with-right-parent-to-check-empty-commits'Libravatar Junio C Hamano2-5/+53
The sequencer machinery compared the HEAD and the state it is attempting to commit to decide if the result would be a no-op commit, even when amending a commit, which was incorrect, and has been corrected. * pw/sequencer-compare-with-right-parent-to-check-empty-commits: sequencer: fix empty commit check when amending
2019-12-05Merge branch 'jk/fail-show-toplevel-outside-working-tree'Libravatar Junio C Hamano3-1/+14
"git rev-parse --show-toplevel" run outside of any working tree did not error out, which has been corrected. * jk/fail-show-toplevel-outside-working-tree: rev-parse: make --show-toplevel without a worktree an error
2019-12-05Merge branch 'sg/unpack-progress-throughput'Libravatar Junio C Hamano1-1/+2
"git unpack-objects" used to show progress based only on the number of received and unpacked objects, which stalled when it has to handle an unusually large object. It now shows the throughput as well. * sg/unpack-progress-throughput: builtin/unpack-objects.c: show throughput progress
2019-12-05Merge branch 'pb/submodule-update-fetches'Libravatar Junio C Hamano1-1/+2
Doc update. * pb/submodule-update-fetches: doc: mention that 'git submodule update' fetches missing commits
2019-12-05Merge branch 'jc/azure-ci-osx-fix-fix'Libravatar Junio C Hamano1-1/+2
CI jobs for macOS has been made less chatty when updating perforce package used during testing. * jc/azure-ci-osx-fix-fix: ci(osx): update homebrew-cask repository with less noise
2019-12-05Merge branch 'dl/range-diff-with-notes'Libravatar Junio C Hamano10-50/+291
"git range-diff" learned to take the "--notes=<ref>" and the "--no-notes" options to control the commit notes included in the log message that gets compared. * dl/range-diff-with-notes: format-patch: pass notes configuration to range-diff range-diff: pass through --notes to `git log` range-diff: output `## Notes ##` header t3206: range-diff compares logs with commit notes t3206: s/expected/expect/ t3206: disable parameter substitution in heredoc t3206: remove spaces after redirect operators pretty-options.txt: --notes accepts a ref instead of treeish rev-list-options.txt: remove reference to --show-notes argv-array: add space after `while`
2019-12-05Merge branch 'jh/userdiff-python-async'Libravatar Junio C Hamano7-1/+32
The userdiff machinery has been taught that "async def" is another way to begin a "function" in Python. * jh/userdiff-python-async: userdiff: support Python async functions
2019-12-05Merge branch 'ec/fetch-mark-common-refs-trace2'Libravatar Junio C Hamano1-1/+12
Trace2 annotation. * ec/fetch-mark-common-refs-trace2: fetch: add trace2 instrumentation
2019-12-05Merge branch 'dd/rebase-merge-reserves-onto-label'Libravatar Junio C Hamano2-0/+26
The logic to avoid duplicate label names generated by "git rebase --rebase-merges" forgot that the machinery itself uses "onto" as a label name, which must be avoided by auto-generated labels, which has been corrected. * dd/rebase-merge-reserves-onto-label: sequencer: handle rebase-merges for "onto" message
2019-12-05Merge branch 'js/builtin-add-i'Libravatar Junio C Hamano9-23/+743
The beginning of rewriting "git add -i" in C. * js/builtin-add-i: built-in add -i: implement the `help` command built-in add -i: use color in the main loop built-in add -i: support `?` (prompt help) built-in add -i: show unique prefixes of the commands built-in add -i: implement the main loop built-in add -i: color the header in the `status` command built-in add -i: implement the `status` command diff: export diffstat interface Start to implement a built-in version of `git add --interactive`
2019-12-05Merge branch 'js/rebase-r-safer-label'Libravatar Junio C Hamano2-27/+51
A label used in the todo list that are generated by "git rebase --rebase-merges" is used as a part of a refname; the logic to come up with the label has been tightened to avoid names that cannot be used as such. * js/rebase-r-safer-label: rebase -r: let `label` generate safer labels rebase-merges: move labels' whitespace mangling into `label_oid()`
2019-12-05Merge branch 'ep/guard-kset-tar-headers'Libravatar Junio C Hamano2-0/+9
Code clean-up. * ep/guard-kset-tar-headers: kset.h, tar.h: add missing header guard to prevent multiple inclusion
2019-12-04doc: replace LKML link with lore.kernel.orgLibravatar Denton Liu1-1/+1
Since we're now recommending lore.kernel.org, replace LKML link with lore.kernel.org. Although LKML has been around for a long time, nothing lasts forever (see Gmane). Since LKML uses opaque message identifiers, switching to lore.kernel.org should be a strict improvement since, even if lore.kernel.org goes down, the Message-ID will allow future readers to look up the referenced messages on any other archive. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-04RelNotes: replace Gmane with real Message-IDsLibravatar Denton Liu9-10/+11
The only references to Gmane that remain are in RelNotes. Although these are definitely not in active use, they might be of historical interest for future readers so let's ensure that mail references are more robust. Replace links to Gmane with links to lore.kernel.org (which is our new preferred mailing list archive and has the Message-ID in the URL) and bare Gmane ID references with Message-IDs. The Message-IDs were found by searching for "gmane:<id>" on https://public-inbox.org/git/ and taking the resulting message. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-04doc: replace MARC links with lore.kernel.orgLibravatar Denton Liu4-6/+6
Since we're now recommending lore.kernel.org, replace marc.info links with lore.kernel.org. Although MARC has been around for a long time, nothing lasts forever (see Gmane). Since MARC uses opaque message identifiers, switching to lore.kernel.org should be a strict improvement since, even if lore.kernel.org goes down, the Message-ID will allow future readers to look up the referenced messages on any other archive. We leave behind one reference to MARC in the README.md since it's a perfectly fine mail archive for personal reading, just not for linking messages for the future. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>