Skip to content

Commit 1f1c0e4

Browse files
committed
Merge branch 'tc/last-modified' into seen
A new command "git last-modified" is proposed to show the closest ancestor commit that touched each path. * tc/last-modified: fixup! last-modified: new subcommand to show when files were last modified last-modified: use Bloom filters when available t/perf: add last-modified perf script last-modified: new subcommand to show when files were last modified
2 parents 82e0388 + 8ca271d commit 1f1c0e4

13 files changed

+627
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
/git-init-db
8888
/git-interpret-trailers
8989
/git-instaweb
90+
/git-last-modified
9091
/git-log
9192
/git-ls-files
9293
/git-ls-remote

Documentation/git-last-modified.adoc

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
git-last-modified(1)
2+
====================
3+
4+
NAME
5+
----
6+
git-last-modified - EXPERIMENTAL: Show when files were last modified
7+
8+
9+
SYNOPSIS
10+
--------
11+
[synopsis]
12+
git last-modified [--recursive] [--show-trees] [<revision-range>] [[--] <path>...]
13+
14+
DESCRIPTION
15+
-----------
16+
17+
Shows which commit last modified each of the relevant files and subdirectories.
18+
A commit renaming a path, or changing it's mode is also taken into account.
19+
20+
THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
21+
22+
OPTIONS
23+
-------
24+
25+
`-r`::
26+
`--recursive`::
27+
Instead of showing tree entries, step into subtrees and show all entries
28+
inside them recursively.
29+
30+
`-t`::
31+
`--show-trees`::
32+
Show tree entries even when recursing into them. It has no effect
33+
without `--recursive`.
34+
35+
`<revision-range>`::
36+
Only traverse commits in the specified revision range. When no
37+
`<revision-range>` is specified, it defaults to `HEAD` (i.e. the whole
38+
history leading to the current commit). For a complete list of ways to
39+
spell `<revision-range>`, see the 'Specifying Ranges' section of
40+
linkgit:gitrevisions[7].
41+
42+
`[--] <path>...`::
43+
For each _<path>_ given, the commit which last modified it is returned.
44+
Without an optional path parameter, all files and subdirectories
45+
in path traversal the are included in the output.
46+
47+
SEE ALSO
48+
--------
49+
linkgit:git-blame[1],
50+
linkgit:git-log[1].
51+
52+
GIT
53+
---
54+
Part of the linkgit:git[1] suite

Documentation/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ manpages = {
7474
'git-init.adoc' : 1,
7575
'git-instaweb.adoc' : 1,
7676
'git-interpret-trailers.adoc' : 1,
77+
'git-last-modified.adoc' : 1,
7778
'git-log.adoc' : 1,
7879
'git-ls-files.adoc' : 1,
7980
'git-ls-remote.adoc' : 1,

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,7 @@ BUILTIN_OBJS += builtin/hook.o
12651265
BUILTIN_OBJS += builtin/index-pack.o
12661266
BUILTIN_OBJS += builtin/init-db.o
12671267
BUILTIN_OBJS += builtin/interpret-trailers.o
1268+
BUILTIN_OBJS += builtin/last-modified.o
12681269
BUILTIN_OBJS += builtin/log.o
12691270
BUILTIN_OBJS += builtin/ls-files.o
12701271
BUILTIN_OBJS += builtin/ls-remote.o

builtin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ int cmd_hook(int argc, const char **argv, const char *prefix, struct repository
176176
int cmd_index_pack(int argc, const char **argv, const char *prefix, struct repository *repo);
177177
int cmd_init_db(int argc, const char **argv, const char *prefix, struct repository *repo);
178178
int cmd_interpret_trailers(int argc, const char **argv, const char *prefix, struct repository *repo);
179+
int cmd_last_modified(int argc, const char **argv, const char *prefix, struct repository *repo);
179180
int cmd_log_reflog(int argc, const char **argv, const char *prefix, struct repository *repo);
180181
int cmd_log(int argc, const char **argv, const char *prefix, struct repository *repo);
181182
int cmd_ls_files(int argc, const char **argv, const char *prefix, struct repository *repo);

0 commit comments

Comments
 (0)