Go to file
SZEDER Gábor 3cb9d2b6f9 line-log: more responsive, incremental 'git log -L'
The current line-level log implementation performs a preprocessing
step in prepare_revision_walk(), during which the line_log_filter()
function filters and rewrites history to keep only commits modifying
the given line range.  This preprocessing affects both responsiveness
and correctness:

  - Git doesn't produce any output during this preprocessing step.
    Checking whether a commit modified the given line range is
    somewhat expensive, so depending on the size of the given revision
    range this preprocessing can result in a significant delay before
    the first commit is shown.

  - Limiting the number of displayed commits (e.g. 'git log -3 -L...')
    doesn't limit the amount of work during preprocessing, because
    that limit is applied during history traversal.  Alas, by that
    point this expensive preprocessing step has already churned
    through the whole revision range to find all commits modifying the
    revision range, even though only a few of them need to be shown.

  - It rewrites parents, with no way to turn it off.  Without the user
    explicitly requesting parent rewriting any parent object ID shown
    should be that of the immediate parent, just like in case of a
    pathspec-limited history traversal without parent rewriting.

    However, after that preprocessing step rewrote history, the
    subsequent "regular" history traversal (i.e. get_revision() in a
    loop) only sees commits modifying the given line range.
    Consequently, it can only show the object ID of the last ancestor
    that modified the given line range (which might happen to be the
    immediate parent, but many-many times it isn't).

This patch addresses both the correctness and, at least for the common
case, the responsiveness issues by integrating line-level log
filtering into the regular revision walking machinery:

  - Make process_ranges_arbitrary_commit(), the static function in
    'line-log.c' deciding whether a commit modifies the given line
    range, public by removing the static keyword and adding the
    'line_log_' prefix, so it can be called from other parts of the
    revision walking machinery.

  - If the user didn't explicitly ask for parent rewriting (which, I
    believe, is the most common case):

    - Call this now-public function during regular history traversal,
      namely from get_commit_action() to ignore any commits not
      modifying the given line range.

      Note that while this check is relatively expensive, it must be
      performed before other, much cheaper conditions, because the
      tracked line range must be adjusted even when the commit will
      end up being ignored by other conditions.

    - Skip the line_log_filter() call, i.e. the expensive
      preprocessing step, in prepare_revision_walk(), because, thanks
      to the above points, the revision walking machinery is now able
      to filter out commits not modifying the given line range while
      traversing history.

      This way the regular history traversal sees the unmodified
      history, and is therefore able to print the object ids of the
      immediate parents of the listed commits.  The eliminated
      preprocessing step can greatly reduce the delay before the first
      commit is shown, see the numbers below.

  - However, if the user did explicitly ask for parent rewriting via
    '--parents' or a similar option, then stick with the current
    implementation for now, i.e. perform that expensive filtering and
    history rewriting in the preprocessing step just like we did
    before, leaving the initial delay as long as it was.

I tried to integrate line-level log filtering with parent rewriting
into the regular history traversal, but, unfortunately, several
subtleties resisted... :)  Maybe someday we'll figure out how to do
that, but until then at least the simple and common (i.e. without
parent rewriting) 'git log -L:func:file' commands can benefit from the
reduced delay.

This change makes the failing 'parent oids without parent rewriting'
test in 't4211-line-log.sh' succeed.

The reduced delay is most noticable when there's a commit modifying
the line range near the tip of a large-ish revision range:

  # no parent rewriting requested, no commit-graph present
  $ time git --no-pager log -L:read_alternate_refs:sha1-file.c -1 v2.23.0

  Before:

    real    0m9.570s
    user    0m9.494s
    sys     0m0.076s

  After:

    real    0m0.718s
    user    0m0.674s
    sys     0m0.044s

A significant part of the remaining delay is spent reading and parsing
commit objects in limit_list().  With the help of the commit-graph we
can eliminate most of that reading and parsing overhead, so here are
the timing results of the same command as above, but this time using
the commit-graph:

  Before:

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

  After:

    real    0m0.107s
    user    0m0.091s
    sys     0m0.013s

The next patch will further reduce the remaining delay.

To be clear: this patch doesn't actually optimize the line-level log,
but merely moves most of the work from the preprocessing step to the
history traversal, so the commits modifying the line range can be
shown as soon as they are processed, and the traversal can be
terminated as soon as the given number of commits are shown.
Consequently, listing the full history of a line range, potentially
all the way to the root commit, will take the same time as before (but
at least the user might start reading the output earlier).
Furthermore, if the most recent commit modifying the line range is far
away from the starting revision, then that initial delay will still be
significant.

Additional testing by Derrick Stolee: In the Linux kernel repository,
the MAINTAINERS file was changed ~3,500 times across the ~915,000
commits. In addition to that edit frequency, the file itself is quite
large (~18,700 lines). This means that a significant portion of the
computation is taken up by computing the patch-diff of the file. This
patch improves the real time it takes to output the first result quite
a bit:

Command: git log -L 100,200:MAINTAINERS -n 1 >/dev/null
 Before: 3.88 s
  After: 0.71 s

If we drop the "-n 1" in the command, then there is no change in
end-to-end process time. This is because the command still needs to
walk the entire commit history, which negates the point of this
patch. This is expected.

As a note for future reference, the ~4.3 seconds in the old code
spends ~2.6 seconds computing the patch-diffs, and the rest of the
time is spent walking commits and computing diffs for which paths
changed at each commit. The changed-path Bloom filters could improve
the end-to-end computation time (i.e. no "-n 1" in the command).

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-05-11 09:33:56 -07:00
.github point pull requesters to GitGitGadget 2019-03-13 11:07:50 +09:00
Documentation Documentation: changed-path Bloom filters use byte words 2020-05-11 09:33:56 -07:00
block-sha1
builtin blame: use changed-path Bloom filters 2020-04-16 15:38:06 -07:00
ci commit-graph: add GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS test flag 2020-04-06 11:08:37 -07:00
compat Merge branch 'js/mingw-open-in-gdb' into maint 2020-03-17 15:02:25 -07:00
contrib completion: offer '--(no-)patch' among 'git log' options 2020-05-11 09:33:56 -07:00
ewah Merge branch 'jk/object-filter-with-bitmap' 2020-03-02 15:07:18 -08:00
git-gui Merge https://github.com/prati0100/git-gui 2020-03-19 16:06:51 -07:00
gitk-git Merge gitk to pick up emergency build fix 2019-09-17 14:59:18 -07:00
gitweb Merge branch 'do/gitweb-typofix-in-comments' 2020-01-08 12:44:11 -08:00
mergetools mergetools: add support for smerge (Sublime Merge) 2019-04-04 18:21:25 +09:00
negotiator
perl Fix spelling errors in documentation outside of Documentation/ 2019-11-07 13:42:00 +09:00
po l10n: tr.po: change file mode to 644 2020-03-21 18:26:56 +08:00
ppc *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
refs C: use skip_prefix() to avoid hardcoded string length 2020-01-31 13:03:45 -08:00
sha1collisiondetection@855827c583 sha1dc: update from upstream 2019-05-14 16:45:01 +09:00
sha1dc Merge branch 'jk/lore-is-the-archive' 2019-12-06 15:09:23 -08:00
sha256 hash: implement and use a context cloning function 2020-02-24 09:33:21 -08:00
t line-log: more responsive, incremental 'git log -L' 2020-05-11 09:33:56 -07:00
templates Merge branch 'kw/fsmonitor-watchman-racefix' 2020-02-14 12:54:20 -08:00
trace2 Merge branch 'en/doc-typofix' 2019-12-01 09:04:35 -08:00
vcs-svn *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
xdiff Merge branch 'rs/xdiff-ignore-ws-w-func-context' 2019-12-16 13:08:32 -08:00
.cirrus.yml CI: add FreeBSD CI support via Cirrus-CI 2019-12-20 12:09:12 -08:00
.clang-format clang-format: use git grep to generate the ForEachMacros list 2019-06-04 14:50:40 -07:00
.editorconfig editorconfig: indent text files with tabs 2020-01-06 08:46:32 -08:00
.gitattributes Fix build with core.autocrlf=true 2019-09-24 19:48:27 +05:30
.gitignore stash: remove the stash.useBuiltin setting 2020-03-05 12:50:28 -08:00
.gitmodules
.mailmap Merge branch 'bc/wildcard-credential' 2020-03-05 10:43:02 -08:00
.travis.yml travis-ci: build with GCC 4.8 as well 2019-07-19 14:06:01 -07:00
.tsan-suppressions replace-object: make replace operations thread-safe 2020-01-17 13:52:14 -08:00
CODE_OF_CONDUCT.md CODE_OF_CONDUCT: mention individual project-leader emails 2019-10-10 10:41:46 +09:00
COPYING
GIT-VERSION-GEN The first batch post 2.26 cycle 2020-03-25 13:57:44 -07:00
INSTALL Merge branch 'ar/install-doc-update-cmds-needing-the-shell' 2019-12-01 09:04:41 -08:00
LGPL-2.1
Makefile bloom.c: add the murmur3 hash implementation 2020-03-30 09:59:53 -07:00
README.md doc: recommend lore.kernel.org over public-inbox.org 2019-11-30 09:12:04 -08:00
RelNotes The first batch post 2.26 cycle 2020-03-25 13:57:44 -07:00
abspath.c real_path_if_valid(): remove unsafe API 2020-03-10 11:41:40 -07:00
aclocal.m4
add-interactive.c Merge branch 'js/builtin-add-i-cmds' into maint 2020-03-17 15:02:20 -07:00
add-interactive.h built-in add -p: respect the `interactive.singlekey` config setting 2020-01-15 12:06:17 -08:00
add-patch.c built-in add -p: respect the `interactive.singlekey` config setting 2020-01-15 12:06:17 -08:00
advice.c Merge branch 'hw/advise-ng' 2020-03-25 13:57:41 -07:00
advice.h Merge branch 'hw/advise-ng' 2020-03-25 13:57:41 -07:00
alias.c alias.c: mark split_cmdline_strerror() strings for translation 2018-11-12 14:47:09 +09:00
alias.h headers: normalize the spelling of some header guards 2018-10-18 13:39:35 +09:00
alloc.c object_as_type: initialize commit-graph-related fields of 'struct commit' 2019-01-27 16:55:57 -08:00
alloc.h object_as_type: initialize commit-graph-related fields of 'struct commit' 2019-01-27 16:55:57 -08:00
apply.c convert: permit passing additional metadata to filter processes 2020-03-16 11:37:02 -07:00
apply.h apply.h: include missing header 2019-09-28 14:04:16 +09:00
archive-tar.c streaming: allow open_istream() to handle any repo 2020-01-31 10:45:39 -08:00
archive-zip.c streaming: allow open_istream() to handle any repo 2020-01-31 10:45:39 -08:00
archive.c convert: provide additional metadata to filters 2020-03-16 11:37:02 -07:00
archive.h convert: provide additional metadata to filters 2020-03-16 11:37:02 -07:00
argv-array.c argv-array: add space after `while` 2019-11-20 13:29:02 +09:00
argv-array.h argv-array: move doc to argv-array.h 2019-11-18 15:21:29 +09:00
attr.c attr: move doc to attr.h 2019-11-18 15:21:28 +09:00
attr.h attr: move doc to attr.h 2019-11-18 15:21:28 +09:00
azure-pipelines.yml Azure Pipeline: switch to the latest agent pools 2020-02-27 09:58:43 -08:00
banned.h banned.h: fix vsprintf()'s ban message 2019-08-26 10:32:45 -07:00
base85.c
bisect.c bisect: libify `bisect_next_all` 2020-02-19 09:37:15 -08:00
bisect.h bisect: libify `bisect_next_all` 2020-02-19 09:37:15 -08:00
blame.c blame: drop unused parameter from maybe_changed_path 2020-04-23 14:37:03 -07:00
blame.h blame: use changed-path Bloom filters 2020-04-16 15:38:06 -07:00
blob.c object: convert create_object() to use object_id 2019-06-20 10:20:51 -07:00
blob.h
bloom.c bloom: use num_changes not nr for limit detection 2020-05-11 09:33:56 -07:00
bloom.h bloom: fix whitespace around tab length 2020-05-01 11:41:21 -07:00
branch.c Merge branch 'nd/switch-and-restore' 2019-07-09 15:25:44 -07:00
branch.h Merge branch 'nd/switch-and-restore' 2019-07-09 15:25:44 -07:00
builtin.h sparse-checkout: create builtin with 'list' subcommand 2019-11-22 16:11:43 +09:00
bulk-checkin.c bulk-checkin: zero-initialize hashfile_checkpoint 2019-09-06 11:03:39 -07:00
bulk-checkin.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
bundle.c bundle-create: progress output control 2019-11-11 11:46:28 +09:00
bundle.h bundle-create: progress output control 2019-11-11 11:46:28 +09:00
cache-tree.c sha1-file: pass git_hash_algo to hash_object_file() 2020-01-31 10:45:39 -08:00
cache-tree.h cache-tree: share code between functions writing an index as a tree 2019-08-19 10:08:03 -07:00
cache.h Merge branch 'bc/filter-process' 2020-03-26 17:11:20 -07:00
chdir-notify.c
chdir-notify.h
check-builtins.sh
check_bindir
checkout.c
checkout.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
color.c color.c: alias RGB colors 8-15 to aixterm colors 2020-02-11 11:19:00 -08:00
color.h
column.c column: use utf8_strnwidth() to strip out ANSI color escapes 2019-10-15 10:54:15 +09:00
column.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
combine-diff.c combine-diff: replace GIT_SHA1_HEXSZ with the_hash_algo 2019-08-19 15:04:58 -07:00
command-list.txt Merge branch 'ds/sparse-cone' 2019-12-25 11:21:58 -08:00
commit-graph.c tests: write commit-graph with Bloom filters 2020-04-16 15:38:04 -07:00
commit-graph.h tests: write commit-graph with Bloom filters 2020-04-16 15:38:04 -07:00
commit-reach.c commit-graph: fix writing first commit-graph during fetch 2019-10-25 11:19:16 +09:00
commit-reach.h Merge branch 'sb/more-repo-in-api' 2019-02-05 14:26:09 -08:00
commit-slab-decl.h
commit-slab-impl.h commit-slabs: move MAYBE_UNUSED out 2018-10-24 14:52:50 +09:00
commit-slab.h commit-slab: clarify slabname##_peek()'s return value 2020-03-10 11:44:24 -07:00
commit.c Merge branch 'at/rebase-fork-point-regression-fix' 2020-03-26 17:11:21 -07:00
commit.h gpg-interface: add minTrustLevel as a configuration option 2020-01-15 14:06:06 -08:00
common-main.c common-main: delay trace2 initialization 2019-08-06 13:09:01 -07:00
config.c Merge branch 'bw/remote-rename-update-config' 2020-02-25 11:18:32 -08:00
config.h config: provide access to the current line number 2020-02-10 10:52:10 -08:00
config.mak.dev Merge branch 'bc/sha-256-part-1-of-4' 2020-03-26 17:11:20 -07:00
config.mak.in
config.mak.uname Sync with 2.23.1 2019-12-06 16:31:39 +01:00
configure.ac Merge branch 'dd/sequencer-utf8' 2019-12-01 09:04:36 -08:00
connect.c Sync with 2.23.1 2019-12-06 16:31:39 +01:00
connect.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
connected.c connected.c: reprepare packs for corner cases 2020-03-15 15:39:00 -07:00
connected.h connected: verify promisor-ness of partial clone 2020-01-30 10:55:31 -08:00
convert.c convert: provide additional metadata to filters 2020-03-16 11:37:02 -07:00
convert.h convert: provide additional metadata to filters 2020-03-16 11:37:02 -07:00
copy.c
credential-cache--daemon.c style: the opening '{' of a function is in a separate line 2018-12-10 15:41:09 +09:00
credential-cache.c
credential-store.c strbuf: give URL-encoding API a char predicate fn 2019-06-28 08:41:53 -07:00
credential.c credential: allow wildcard patterns when matching config 2020-02-20 13:05:43 -08:00
credential.h Merge branch 'bc/wildcard-credential' 2020-03-05 10:43:02 -08:00
csum-file.c hash: implement and use a context cloning function 2020-02-24 09:33:21 -08:00
csum-file.h csum-file: introduce hashfile_total() 2020-01-23 10:51:50 -08:00
ctype.c
daemon.c Fix spelling errors in code comments 2019-11-10 16:00:54 +09:00
date.c date.c: switch to reentrant {gm,local}time_r 2019-11-30 13:50:48 -08:00
decorate.c hashmap: convert sha1hash() to oidhash() 2019-06-20 10:44:22 -07:00
decorate.h *.[ch]: remove extern from function declarations using spatch 2019-05-05 15:20:06 +09:00
delta-islands.c Merge branch 'jk/oidhash' 2019-07-09 15:25:43 -07:00
delta-islands.h delta-islands: respect progress flag 2019-06-20 13:29:49 -07:00
delta.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
detect-compiler
diff-delta.c diff-delta: set size out-parameter to 0 for NULL delta 2019-09-06 11:03:39 -07:00
diff-lib.c mark_fsmonitor_valid(): mark the index as changed if needed 2019-05-28 12:43:43 -07:00
diff-no-index.c Merge branch 'nd/diff-parseopt-4' 2019-04-25 16:41:12 +09:00
diff.c convert: provide additional metadata to filters 2020-03-16 11:37:02 -07:00
diff.h diff: halt tree-diff early after max_changes 2020-03-30 09:59:53 -07:00
diffcore-break.c diffcore-break: use a goto instead of a redundant if statement 2019-10-02 15:04:21 +09:00
diffcore-delta.c
diffcore-order.c
diffcore-pickaxe.c Merge branch 'nd/the-index' into md/list-objects-filter-by-depth 2019-01-15 15:38:29 -08:00
diffcore-rename.c sha1-file: pass git_hash_algo to hash_object_file() 2020-01-31 10:45:39 -08:00
diffcore.h diff: move doc to diff.h and diffcore.h 2019-11-18 15:21:28 +09:00
dir-iterator.c dir-iterator: add flags parameter to dir_iterator_begin 2019-07-11 13:52:15 -07:00
dir-iterator.h dir-iterator: add flags parameter to dir_iterator_begin 2019-07-11 13:52:15 -07:00
dir.c Merge branch 'ds/sparse-add' 2020-03-05 10:43:02 -08:00
dir.h Merge branch 'ds/sparse-cone' 2019-12-25 11:21:58 -08:00
editor.c real_path: remove unsafe API 2020-03-10 11:41:40 -07:00
entry.c convert: provide additional metadata to filters 2020-03-16 11:37:02 -07:00
environment.c real_path: remove unsafe API 2020-03-10 11:41:40 -07:00
exec-cmd.c trace2: create new combined trace facility 2019-02-22 15:27:59 -08:00
exec-cmd.h *.[ch]: remove extern from function declarations using sed 2019-05-05 15:20:08 +09:00
fast-import.c fast-import: add options for rewriting submodules 2020-02-28 09:53:41 -08:00
fetch-negotiator.c repo-settings: create feature.experimental setting 2019-08-13 13:33:55 -07:00
fetch-negotiator.h repo-settings: create feature.experimental setting 2019-08-13 13:33:55 -07:00
fetch-pack.c Merge branch 'ec/fetch-mark-common-refs-trace2' 2019-12-05 12:52:44 -08:00
fetch-pack.h fetch_pack(): drop unused parameters 2019-03-20 18:34:09 +09:00
fmt-merge-msg.h *.[ch]: remove extern from function declarations using spatch 2019-05-05 15:20:06 +09:00
fsck.c Sync with Git 2.24.1 2019-12-09 22:17:55 -08:00
fsck.h fsck: only provide oid/type in fsck_error callback 2019-10-28 14:05:18 +09:00
fsmonitor.c fsmonitor: handle version 2 of the hooks that will use opaque token 2020-01-13 14:58:43 -08:00
fsmonitor.h mark_fsmonitor_valid(): mark the index as changed if needed 2019-05-28 12:43:43 -07:00
fuzz-commit-graph.c fuzz-commit-graph: initialize repo object 2019-02-07 13:02:26 -08:00
fuzz-pack-headers.c fuzz: add basic fuzz testing target. 2018-10-15 14:28:59 +09:00
fuzz-pack-idx.c fuzz: add fuzz testing for packfile indices. 2018-10-15 14:29:03 +09:00
generate-cmdlist.sh help -a: do not list commands that are excluded from the build 2019-04-19 14:03:24 +09:00
gettext.c Merge branch 'ab/test-env' 2019-07-25 13:59:20 -07:00
gettext.h *.[ch]: remove extern from function declarations using spatch 2019-05-05 15:20:06 +09:00
git-add--interactive.perl git add -p: use non-zero exit code when the diff generation failed 2019-12-06 08:57:34 -08:00
git-archimport.perl
git-bisect.sh bisect--helper: `bisect_start` shell function partially in C 2019-01-02 10:23:03 -08:00
git-compat-util.h Sync with Git 2.24.1 2019-12-09 22:17:55 -08:00
git-cvsexportcommit.perl cvsexportcommit: force crlf translation 2019-05-07 18:23:27 +09:00
git-cvsimport.perl Fix spelling errors in messages shown to users 2019-11-10 16:00:54 +09:00
git-cvsserver.perl
git-difftool--helper.sh mergetool: use get_merge_tool function 2019-05-13 23:11:59 +09:00
git-filter-branch.sh Recommend git-filter-repo instead of git-filter-branch 2019-09-05 13:01:48 -07:00
git-instaweb.sh git-instaweb: add Python builtin http.server support 2019-01-28 10:57:44 -08:00
git-merge-octopus.sh
git-merge-one-file.sh
git-merge-resolve.sh
git-mergetool--lib.sh Merge branch 'dl/difftool-mergetool' 2019-05-19 16:45:30 +09:00
git-mergetool.sh mergetool: use shell variable magic instead of `awk` 2019-06-12 13:20:56 -07:00
git-p4.py Merge branch 'yz/p4-py3' 2020-03-25 13:57:43 -07:00
git-parse-remote.sh
git-quiltimport.sh git-quiltimport: add --keep-non-patch option 2019-01-07 15:29:34 -08:00
git-rebase--preserve-merges.sh rebase: fold git-rebase--common into the -p backend 2019-07-31 12:24:06 -07:00
git-request-pull.sh request-pull: warn if the remote object is not the same as the local one 2019-05-28 13:06:25 -07:00
git-send-email.perl Fix spelling errors in code comments 2019-11-10 16:00:54 +09:00
git-sh-i18n.sh tests: make GIT_TEST_GETTEXT_POISON a boolean 2019-06-21 09:42:49 -07:00
git-sh-setup.sh stash: optionally use the scripted version again 2019-03-07 09:41:40 +09:00
git-submodule.sh Merge branch 'es/recursive-single-branch-clone' 2020-03-05 10:43:03 -08:00
git-svn.perl git svn: stop using `rebase --preserve-merges` 2019-11-23 09:49:23 +09:00
git-web--browse.sh
git.c stash: remove the stash.useBuiltin setting 2020-03-05 12:50:28 -08:00
git.rc mingw: embed a manifest to trick UAC into Doing The Right Thing 2019-06-27 12:55:45 -07:00
gpg-interface.c gpg-interface: prefer check_signature() for GPG verification 2020-03-15 09:46:28 -07:00
gpg-interface.h gpg-interface: prefer check_signature() for GPG verification 2020-03-15 09:46:28 -07:00
graph.c graph: fix collapse of multiple edges 2020-01-15 12:14:51 -08:00
graph.h graph: move doc to graph.h and graph.c 2019-11-18 15:21:28 +09:00
grep.c grep: replace grep_read_mutex by internal obj read lock 2020-01-17 13:52:14 -08:00
grep.h grep: replace grep_read_mutex by internal obj read lock 2020-01-17 13:52:14 -08:00
hash.h hash: implement and use a context cloning function 2020-02-24 09:33:21 -08:00
hashmap.c Fix spelling errors in code comments 2019-11-10 16:00:54 +09:00
hashmap.h Merge branch 'en/doc-typofix' 2019-12-01 09:04:35 -08:00
help.c Fix spelling errors in messages shown to users 2019-11-10 16:00:54 +09:00
help.h help: make help_unknown_ref() NORETURN 2019-08-30 10:22:42 -07:00
hex.c hex: add functions to parse hex object IDs in any algorithm 2020-02-24 09:33:21 -08:00
http-backend.c http-backend: allow 64-character hex names 2019-04-01 11:57:38 +09:00
http-fetch.c
http-push.c http-push: simplify deleting a list item 2019-10-15 10:53:50 +09:00
http-walker.c Merge branch 'bc/hash-transition-16' 2019-04-25 16:41:17 +09:00
http.c Merge branch 'js/https-proxy-config' 2020-03-25 13:57:42 -07:00
http.h http: use xmalloc with cURL 2019-08-15 12:37:10 -07:00
ident.c Merge branch 'ps/stash-in-c' 2019-04-22 11:14:43 +09:00
imap-send.c Merge branch 'nd/imap-send-typofix' 2019-02-12 09:00:25 -08:00
interdiff.c
interdiff.h
iterator.h
json-writer.c
json-writer.h
khash.h hashmap: convert sha1hash() to oidhash() 2019-06-20 10:44:22 -07:00
kwset.c Merge branch 'rs/copy-array' into maint 2019-07-29 12:38:15 -07:00
kwset.h kset.h, tar.h: add missing header guard to prevent multiple inclusion 2019-11-07 20:12:04 +09:00
levenshtein.c
levenshtein.h
line-log.c line-log: more responsive, incremental 'git log -L' 2020-05-11 09:33:56 -07:00
line-log.h line-log: more responsive, incremental 'git log -L' 2020-05-11 09:33:56 -07:00
line-range.c
line-range.h
linear-assignment.c
linear-assignment.h
list-objects-filter-options.c Merge branch 'jk/partial-clone-sparse-blob' 2019-10-07 11:32:54 +09:00
list-objects-filter-options.h Merge branch 'jk/partial-clone-sparse-blob' 2019-10-07 11:32:54 +09:00
list-objects-filter.c Merge branch 'jk/partial-clone-sparse-blob' 2019-10-07 11:32:54 +09:00
list-objects-filter.h list-objects-filter: implement composite filters 2019-06-28 08:41:53 -07:00
list-objects.c Merge branch 'jk/list-objects-optim-wo-trees' 2019-10-07 11:32:56 +09:00
list-objects.h list-objects: consume sparse tree walk 2019-01-17 13:44:39 -08:00
list.h
ll-merge.c am: reload .gitattributes after patching it 2019-09-03 15:16:18 -07:00
ll-merge.h merge: move doc to ll-merge.h 2019-11-18 15:21:28 +09:00
lockfile.c
lockfile.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
log-tree.c Merge branch 'hi/gpg-prefer-check-signature' 2020-03-26 17:11:20 -07:00
log-tree.h
ls-refs.c upload-pack: strip namespace from symref data 2019-05-28 10:02:00 -07:00
ls-refs.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
mailinfo.c Merge branch 'rs/micro-cleanups' 2020-03-02 15:07:20 -08:00
mailinfo.h *.[ch]: remove extern from function declarations using spatch 2019-05-05 15:20:06 +09:00
mailmap.c
mailmap.h
match-trees.c match-trees.c: remove the_repo from shift_tree*() 2019-06-27 12:45:17 -07:00
mem-pool.c
mem-pool.h
merge-blobs.c
merge-blobs.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
merge-recursive.c Merge branch 'en/t3433-rebase-stat-dirty-failure' into maint 2020-03-17 15:02:23 -07:00
merge-recursive.h hashmap_entry: remove first member requirement from docs 2019-10-07 10:20:12 +09:00
merge.c builtin/checkout: compute checkout metadata for checkouts 2020-03-16 11:37:02 -07:00
mergesort.c
mergesort.h
midx.c nth_packed_object_oid(): use customary integer return 2020-02-24 12:55:42 -08:00
midx.h midx: add MIDX_PROGRESS flag 2019-10-23 12:05:05 +09:00
name-hash.c Merge branch 'en/doc-typofix' 2019-12-01 09:04:35 -08:00
notes-cache.c notes-cache.c: remove the_repository references 2018-11-12 14:50:06 +09:00
notes-cache.h notes-cache.c: remove the_repository references 2018-11-12 14:50:06 +09:00
notes-merge.c notes-merge: switch to use the_hash_algo 2019-04-01 11:57:37 +09:00
notes-merge.h notes-merge.c: remove implicit dependency on the_index 2018-11-12 14:50:05 +09:00
notes-utils.c strbuf: add and use strbuf_insertstr() 2020-02-10 09:04:45 -08:00
notes-utils.h notes-utils.c: remove the_repository references 2019-01-14 12:13:04 -08:00
notes.c Merge branch 'jh/notes-fanout-fix' into maint 2020-03-17 15:02:22 -07:00
notes.h Merge branch 'dl/format-patch-notes-config-fixup' 2019-12-25 11:21:58 -08:00
object-store.h packed_object_info(): use object_id for returning delta base 2020-02-24 12:55:53 -08:00
object.c Merge branch 'jk/object-filter-with-bitmap' 2020-03-02 15:07:18 -08:00
object.h pack-bitmap: fix leak of haves/wants object lists 2020-02-13 09:08:58 -08:00
oidmap.c hashmap: introduce hashmap_free_entries 2019-10-07 10:20:11 +09:00
oidmap.h hashmap: use *_entry APIs for iteration 2019-10-07 10:20:11 +09:00
oidset.c Merge branch 'br/blame-ignore' 2019-07-19 11:30:20 -07:00
oidset.h Merge branch 'en/oidset-uninclude-hashmap' 2020-03-25 13:57:44 -07:00
pack-bitmap-write.c pack-objects: drop packlist index_pos optimization 2019-09-06 11:03:42 -07:00
pack-bitmap.c Merge branch 'jk/nth-packed-object-id' 2020-03-05 10:43:03 -08:00
pack-bitmap.h Merge branch 'jk/object-filter-with-bitmap' 2020-03-02 15:07:18 -08:00
pack-check.c pack-check: push oid lookup into loop 2020-02-24 12:55:53 -08:00
pack-objects.c pack-objects: convert oe_set_delta_ext() to use object_id 2020-02-24 12:55:52 -08:00
pack-objects.h pack-objects: convert oe_set_delta_ext() to use object_id 2020-02-24 12:55:52 -08:00
pack-revindex.c pack-revindex: open index if necessary 2019-04-16 16:58:21 +09:00
pack-revindex.h pack-revindex: open index if necessary 2019-04-16 16:58:21 +09:00
pack-write.c pack-write: use hash_to_hex when writing checksums 2019-08-19 15:04:58 -07:00
pack.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
packfile.c packfile: drop nth_packed_object_sha1() 2020-02-24 12:55:53 -08:00
packfile.h packfile: drop nth_packed_object_sha1() 2020-02-24 12:55:53 -08:00
pager.c pager: add a helper function to clear the last line in the terminal 2019-06-24 13:38:46 -07:00
parse-options-cb.c parse-options: simplify parse_options_dup() 2020-02-10 09:45:49 -08:00
parse-options.c Merge branch 'pb/am-show-current-patch' 2020-03-09 11:21:19 -07:00
parse-options.h Merge branch 'pb/am-show-current-patch' 2020-03-09 11:21:19 -07:00
patch-delta.c
patch-ids.c hashmap: remove type arg from hashmap_{get,put,remove}_entry 2019-10-07 10:20:12 +09:00
patch-ids.h format-patch: make --base patch-id output stable 2019-05-08 19:27:43 +09:00
path.c Merge branch 'bc/sha-256-part-1-of-4' 2020-03-26 17:11:20 -07:00
path.h path: add a function to check for path suffix 2019-08-26 10:36:13 -07:00
pathspec.c prefix_path: show gitdir if worktree unavailable 2020-03-15 09:35:46 -07:00
pathspec.h Merge branch 'hw/doc-in-header' 2019-12-16 13:08:39 -08:00
pkt-line.c pkt-line: drop 'const'-ness of a param to set_packet_header() 2019-05-16 13:29:06 +09:00
pkt-line.h pkt-line: fix a typo 2019-12-02 08:48:56 -08:00
preload-index.c mark_fsmonitor_valid(): mark the index as changed if needed 2019-05-28 12:43:43 -07:00
pretty.c Merge branch 'rs/strbuf-insertstr' 2020-02-17 13:22:17 -08:00
pretty.h Merge branch 'sb/more-repo-in-api' 2019-02-05 14:26:09 -08:00
prio-queue.c prio-queue: add 'peek' operation 2018-11-02 12:14:21 +09:00
prio-queue.h *.[ch]: remove extern from function declarations using spatch 2019-05-05 15:20:06 +09:00
progress.c progress: create GIT_PROGRESS_DELAY 2019-11-27 10:57:10 +09:00
progress.h Merge branch 'sg/overlong-progress-fix' 2019-04-25 16:41:19 +09:00
promisor-remote.c promisor-remote: remove fetch_if_missing=0 2019-11-13 11:50:58 +09:00
promisor-remote.h Merge branch 'dl/honor-cflags-in-hdr-check' 2019-10-07 11:33:02 +09:00
prompt.c
prompt.h
protocol.c fetch: default to protocol version 2 2020-01-15 14:03:55 -08:00
protocol.h *.[ch]: remove extern from function declarations using spatch 2019-05-05 15:20:06 +09:00
quote.c quote: use isalnum() to check for alphanumeric characters 2020-02-24 09:30:29 -08:00
quote.h quote: add sq_append_quote_argv_pretty() 2019-08-09 10:48:02 -07:00
range-diff.c range-diff: mark pointers as const 2019-12-06 12:34:49 -08:00
range-diff.h Merge branch 'dl/range-diff-with-notes' 2019-12-16 13:08:46 -08:00
reachable.c pack-bitmap: basic noop bitmap filter infrastructure 2020-02-14 10:46:22 -08:00
reachable.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
read-cache.c Merge branch 'js/mingw-loosen-overstrict-tree-entry-checks' 2020-01-10 14:45:27 -08:00
rebase-interactive.c Merge branch 'rt/format-zero-length-fix' 2020-03-09 11:21:21 -07:00
rebase-interactive.h Merge branch 'en/rebase-backend' 2020-03-02 15:07:19 -08:00
rebase.c pull --rebase/remote rename: document and honor single-letter abbreviations rebase types 2020-02-10 10:52:10 -08:00
rebase.h pull --rebase/remote rename: document and honor single-letter abbreviations rebase types 2020-02-10 10:52:10 -08:00
ref-filter.c Merge branch 'dr/push-remote-ref-update' 2020-03-11 10:58:16 -07:00
ref-filter.h parse_opt_ref_sorting: always use with NONEG flag 2019-03-21 12:03:35 +09:00
reflog-walk.c
reflog-walk.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
refs.c hashmap_entry: remove first member requirement from docs 2019-10-07 10:20:12 +09:00
refs.h refs: move doc to refs.h 2019-11-18 15:21:28 +09:00
refspec.c refspec: make hash size independent 2019-04-01 11:57:39 +09:00
refspec.h remote: move doc to remote.h and refspec.h 2019-11-18 15:21:28 +09:00
remote-curl.c Merge branch 'rs/show-progress-in-dumb-http-fetch' 2020-03-09 11:21:21 -07:00
remote-testsvn.c
remote.c remote: drop "explicit" parameter from remote_ref_for_branch() 2020-03-03 14:56:05 -08:00
remote.h remote: drop "explicit" parameter from remote_ref_for_branch() 2020-03-03 14:56:05 -08:00
replace-object.c replace-object: make replace operations thread-safe 2020-01-17 13:52:14 -08:00
replace-object.h replace-object: make replace operations thread-safe 2020-01-17 13:52:14 -08:00
repo-settings.c config: set pack.useSparse=true by default 2020-03-20 14:22:31 -07:00
repository.c repository: require a build flag to use SHA-256 2020-02-24 09:33:21 -08:00
repository.h Fix spelling errors in code comments 2019-11-10 16:00:54 +09:00
rerere.c Fix spelling errors in code comments 2019-11-10 16:00:54 +09:00
rerere.h rerere.c: remove the_repository references 2018-11-12 14:50:06 +09:00
resolve-undo.c
resolve-undo.h *.[ch]: remove extern from function declarations using spatch 2019-05-05 15:20:06 +09:00
revision.c line-log: more responsive, incremental 'git log -L' 2020-05-11 09:33:56 -07:00
revision.h revision.c: use Bloom filters to speed up path based revision walks 2020-04-06 11:08:37 -07:00
run-command.c Merge branch 'bc/run-command-nullness-after-free-fix' into maint 2020-02-14 12:42:27 -08:00
run-command.h run-command.h: fix mis-indented struct member 2020-02-22 09:05:34 -08:00
send-pack.c Merge branch 'jk/send-pack-check-negative-with-quick' 2019-12-06 15:09:22 -08:00
send-pack.h
sequencer.c Merge branch 'bc/filter-process' 2020-03-26 17:11:20 -07:00
sequencer.h Merge branch 'pw/advise-rebase-skip' 2020-03-25 13:57:43 -07:00
serve.c pack-protocol.txt: accept error packets in any context 2019-01-02 13:05:30 -08:00
serve.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
server-info.c Fix spelling errors in code comments 2019-11-10 16:00:54 +09:00
setup.c Merge branch 'bc/sha-256-part-1-of-4' 2020-03-26 17:11:20 -07:00
sh-i18n--envsubst.c cleanup: fix possible overflow errors in binary search, part 2 2019-06-13 11:28:53 -07:00
sha1-array.c sha1-array: move doc to sha1-array.h 2019-11-18 15:21:28 +09:00
sha1-array.h sha1-array: move doc to sha1-array.h 2019-11-18 15:21:28 +09:00
sha1-file.c Merge branch 'bc/sha-256-part-1-of-4' 2020-03-26 17:11:20 -07:00
sha1-lookup.c Merge branch 'js/azure-pipelines-msvc' 2019-10-15 13:48:00 +09:00
sha1-lookup.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
sha1-name.c nth_packed_object_oid(): use customary integer return 2020-02-24 12:55:42 -08:00
sha1dc_git.c hex: drop sha1_to_hex() 2019-11-13 10:09:10 +09:00
sha1dc_git.h
shallow.c Merge branch 'rs/dedup-includes' 2019-10-11 14:24:48 +09:00
shell.c shell: use skip_prefix() instead of starts_with() 2019-11-27 11:18:24 +09:00
shortlog.h
sideband.c Merge branch 'jt/fetch-v2-sideband' 2019-02-05 14:26:11 -08:00
sideband.h {fetch,upload}-pack: sideband v2 fetch response 2019-01-17 11:25:07 -08:00
sigchain.c
sigchain.h sigchain: move doc to sigchain.h 2019-11-18 15:21:29 +09:00
split-index.c Merge branch 'nd/split-index-null-base-fix' 2019-03-07 09:59:56 +09:00
split-index.h
stable-qsort.c Move git_sort(), a stable sort, into into libgit.a 2019-10-02 14:44:51 +09:00
strbuf.c credential: allow wildcard patterns when matching config 2020-02-20 13:05:43 -08:00
strbuf.h Merge branch 'bc/wildcard-credential' 2020-03-05 10:43:02 -08:00
streaming.c streaming: allow open_istream() to handle any repo 2020-01-31 10:45:39 -08:00
streaming.h streaming: allow open_istream() to handle any repo 2020-01-31 10:45:39 -08:00
string-list.c style: the opening '{' of a function is in a separate line 2018-12-10 15:41:09 +09:00
string-list.h Merge branch 'en/string-list-can-be-custom-sorted' into maint 2020-02-14 12:42:27 -08:00
sub-process.c hashmap: remove type arg from hashmap_{get,put,remove}_entry 2019-10-07 10:20:12 +09:00
sub-process.h hashmap_entry: remove first member requirement from docs 2019-10-07 10:20:12 +09:00
submodule-config.c Merge branch 'mr/show-config-scope' 2020-02-17 13:22:17 -08:00
submodule-config.h submodule-config: add skip_if_read option to repo_read_gitmodules() 2020-01-17 13:52:14 -08:00
submodule.c Merge branch 'dt/submodule-rm-with-stale-cache' into maint 2020-03-17 15:02:21 -07:00
submodule.h get_superproject_working_tree(): return strbuf 2020-03-10 11:41:40 -07:00
symlinks.c Indent code with TABs 2018-12-09 12:37:32 +09:00
tag.c commit, tag: don't set parsed bit for parse failures 2019-10-28 14:04:49 +09:00
tag.h tag: factor out get_tagged_oid() 2019-09-05 14:10:18 -07:00
tar.h kset.h, tar.h: add missing header guard to prevent multiple inclusion 2019-11-07 20:12:04 +09:00
tempfile.c
tempfile.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
thread-utils.c thread-utils: macros to unconditionally compile pthreads API 2018-10-29 11:22:48 +09:00
thread-utils.h thread-utils: macros to unconditionally compile pthreads API 2018-10-29 11:22:48 +09:00
tmp-objdir.c
tmp-objdir.h
trace.c packfile: drop release_pack_memory() 2019-08-13 12:21:33 -07:00
trace.h trace: move doc to trace.h 2019-11-18 15:21:29 +09:00
trace2.c Merge branch 'jh/trace2' 2019-05-13 23:50:35 +09:00
trace2.h trace2: move doc to trace2.h 2019-11-18 15:21:29 +09:00
trailer.c pretty: add support for separator option in %(trailers) 2019-01-29 10:03:32 -08:00
trailer.h pretty: add support for separator option in %(trailers) 2019-01-29 10:03:32 -08:00
transport-helper.c C: use skip_prefix() to avoid hardcoded string length 2020-01-31 13:03:45 -08:00
transport-internal.h transport: teach all vtables to allow fetch first 2019-08-22 14:20:39 -07:00
transport.c Merge branch 'jk/no-flush-upon-disconnecting-slrpc-transport' into maint 2020-02-14 12:42:28 -08:00
transport.h remote-curl: pass on atomic capability to remote side 2019-10-17 16:08:22 +09:00
tree-diff.c diff: halt tree-diff early after max_changes 2020-03-30 09:59:53 -07:00
tree-walk.c tree-walk.c: break circular dependency with unpack-trees 2020-02-04 10:32:15 -08:00
tree-walk.h tree-walk.c: break circular dependency with unpack-trees 2020-02-04 10:32:15 -08:00
tree.c tree: simplify parse_tree_indirect() 2019-09-03 15:10:53 -07:00
tree.h tree.c: make read_tree*() take 'struct repository *' 2018-11-19 10:50:33 +09:00
unicode-width.h unicode: update the width tables to Unicode 13.0 2020-03-17 15:06:37 -07:00
unimplemented.sh
unix-socket.c
unix-socket.h
unpack-trees.c Merge branch 'bc/filter-process' 2020-03-26 17:11:20 -07:00
unpack-trees.h builtin/checkout: compute checkout metadata for checkouts 2020-03-16 11:37:02 -07:00
upload-pack.c config: split repo scope to local and worktree 2020-02-10 10:32:20 -08:00
upload-pack.h *.[ch]: manually align parameter lists 2019-05-05 15:20:10 +09:00
url.c Fix spelling errors in code comments 2019-11-10 16:00:54 +09:00
url.h list-objects-filter: implement composite filters 2019-06-28 08:41:53 -07:00
urlmatch.c credential: allow wildcard patterns when matching config 2020-02-20 13:05:43 -08:00
urlmatch.h credential: allow wildcard patterns when matching config 2020-02-20 13:05:43 -08:00
usage.c vreportf(): avoid relying on stdio buffering 2019-11-02 15:20:21 +09:00
userdiff.c Merge branch 'ln/userdiff-elixir' 2019-12-25 11:21:59 -08:00
userdiff.h notes-cache.c: remove the_repository references 2018-11-12 14:50:06 +09:00
utf8.c utf8: use skip_iprefix() in same_utf_encoding() 2019-11-10 16:04:36 +09:00
utf8.h *.[ch]: remove extern from function declarations using spatch 2019-05-05 15:20:06 +09:00
varint.c
varint.h *.[ch]: remove extern from function declarations using spatch 2019-05-05 15:20:06 +09:00
version.c
version.h
versioncmp.c
walker.c Merge branch 'rs/show-progress-in-dumb-http-fetch' 2020-03-09 11:21:21 -07:00
walker.h remote-curl: show progress for fetches over dumb HTTP 2020-03-03 13:15:40 -08:00
wildmatch.c wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode 2018-10-29 13:19:22 +09:00
wildmatch.h wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode 2018-10-29 13:19:22 +09:00
worktree.c Merge branch 'bc/sha-256-part-1-of-4' 2020-03-26 17:11:20 -07:00
worktree.h worktree: add utility to find worktree by pathname 2020-02-24 13:04:30 -08:00
wrap-for-bin.sh
wrapper.c Merge branch 'ah/cleanups' 2019-10-09 14:01:00 +09:00
write-or-die.c
ws.c Merge branch 'nd/the-index' 2018-10-19 13:34:02 +09:00
wt-status.c Merge branch 'bc/object-id-part17' 2019-10-11 14:24:46 +09:00
wt-status.h commit: give correct advice for empty commit during a rebase 2019-12-06 09:32:02 -08:00
xdiff-interface.c xdiff: avoid computing non-zero offset from NULL pointer 2020-01-28 23:13:25 -08:00
xdiff-interface.h Fix spelling errors in code comments 2019-11-10 16:00:54 +09:00
zlib.c

README.md

Build Status

Git - fast, scalable, distributed revision control system

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.

Git is an Open Source project covered by the GNU General Public License version 2 (some parts of it are under different licenses, compatible with the GPLv2). It was originally written by Linus Torvalds with help of a group of hackers around the net.

Please read the file INSTALL for installation instructions.

Many Git online resources are accessible from https://git-scm.com/ including full documentation and Git related tools.

See Documentation/gittutorial.txt to get started, then see Documentation/giteveryday.txt for a useful minimum set of commands, and Documentation/git-<commandname>.txt for documentation of each command. If git has been correctly installed, then the tutorial can also be read with man gittutorial or git help tutorial, and the documentation of each command with man git-<commandname> or git help <commandname>.

CVS users may also want to read Documentation/gitcvs-migration.txt (man gitcvs-migration or git help cvs-migration if git is installed).

The user discussion and development of Git take place on the Git mailing list -- everyone is welcome to post bug reports, feature requests, comments and patches to git@vger.kernel.org (read Documentation/SubmittingPatches for instructions on patch submission). To subscribe to the list, send an email with just "subscribe git" in the body to majordomo@vger.kernel.org. The mailing list archives are available at https://lore.kernel.org/git/, http://marc.info/?l=git and other archival sites.

Issues which are security relevant should be disclosed privately to the Git Security mailing list git-security@googlegroups.com.

The maintainer frequently sends the "What's cooking" reports that list the current status of various development topics to the mailing list. The discussion following them give a good reference for project status, development direction and remaining tasks.

The name "git" was given by Linus Torvalds when he wrote the very first version. He described the tool as "the stupid content tracker" and the name as (depending on your mood):

  • random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of "get" may or may not be relevant.
  • stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
  • "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
  • "goddamn idiotic truckload of sh*t": when it breaks