HG(LOG)
β¨ NAME β¨
hg log β show revision history of entire repository or files π
(yes bestie, this is the HG(LOG) page from the Mercurial manual, we're doing this)
π SYNOPSIS π
hg log [OPTION]... [FILE]
π¦ DESCRIPTION π¦
okay so. hg log prints the revision history of the files you name, or of the entire project if you name none. That's it. That's the whole vibe. π
If no revision range is specified, the default is tip:0 β unless --follow is set. No cap.
File history is shown without following rename or copy history of files. So if you wanna follow history across renames and copies, use -f/--follow with a filename. And --follow with no filename? That only shows ancestors of the starting revisions. Where do those starting revisions come from? -r/--rev, which default to the working directory parent. iykyk.
By default this command prints revision number and changeset id, tags, non-trivial parents, user, date and time, and a summary for each commit. And when you bring in the -v/--verbose switch, the list of changed files and the full commit message show up too. literally the glow-up β¨
With --graph the revisions are shown as an ASCII art DAG with the most recent changeset at the top. Here's the legend so you can actually read it:
ois a changeset@is a working directory parent%is a changeset involved in an unresolved merge conflict_closes a branchxis obsolete*is unstable+represents a fork where the changeset from the lines below is a parent of theomerge on the same line
Paths in the DAG are represented with |, / and so forth. And a : in place of a | means one or more revisions in a path are omitted. noted. π
Use -L/--line-range FILE,M:N options to follow the history of lines from M to N in FILE. With -p/--patch only diff hunks affecting the specified line range will be shown. This option requires --follow; it can be specified multiple times. Currently, this option is not compatible with --graph. This option is experimental. π§ͺ
Note βhg log --patchmay generate unexpected diff output for merge changesets, as it will only compare the merge changeset against its first parent. Also, only files different from BOTH parents will appear infiles:. heads up bestie π
Note β For performance reasons,hg log FILEmay omit duplicate changes made on branches and will not show removals or mode changes. To see all such changes, use the--removedswitch.
Note β The history resulting from-L/--line-rangeoptions depends on diff options; for instance if white-spaces are ignored, respective changes with only white-spaces in specified line range will not be listed.
π Some examples π
- changesets with full descriptions and file lists:
hg log -v
- changesets ancestral to the working directory:
hg log -f
- last 10 commits on the current branch:
hg log -l 10 -b .
- changesets showing all modifications of a file, including removals:
hg log --removed file.c
- all changesets that touch a directory, with diffs, excluding merges:
hg log -Mp lib/
- all revision numbers that match a keyword:
hg log -k bug --template "{rev}\n"
- the full hash identifier of the working directory parent:
hg log -r . --template "{node}\n"
- list available log templates:
hg log -T list
- check if a given changeset is included in a tagged release:
hg log -r "a21ccf and ancestor(1.9)"
- find all changesets by some user in a date range:
hg log -k alice -d "may 2008 to jul 2008"
- summary of all changesets after the last tag:
hg log -r "last(tagged())::" --template "{desc|firstline}\n"
- changesets touching lines 13 to 23 for
file.c:
hg log -L file.c,13:23
- changesets touching lines 13 to 23 for
file.cand lines 2 to 6 ofmain.cwith patch:
hg log -L file.c,13:23 -L main.c,2:6 -p
See hg help dates for a list of formats valid for -d/--date.
See hg help revisions for more about specifying and ordering revisions.
See hg help templates for more about pre-packaged styles and specifying custom templates. The default template used by the log command can be customized via the command-templates.log configuration setting.
Returns 0 on success. π«Ά
π OPTIONS π
-f,--followβ follow changeset history, or file history across copies and renames--follow-firstβ only follow the first parent of merge changesets (DEPRECATED)-d,--date<DATE>β show revisions matching date spec-C,--copiesβ show copied files-k,--keyword<TEXT[+]>β do case-insensitive search for a given text-r,--rev<REV[+]>β revisions to select or follow from-L,--line-range<FILE,RANGE[+]>β follow line range of specified file (EXPERIMENTAL)--removedβ include revisions where files were removed-m,--only-mergesβ show only merges (DEPRECATED) (use-r "merge()"instead)-u,--user<USER[+]>β revisions committed by user--only-branch<BRANCH[+]>β show only changesets within the given named branch (DEPRECATED)-b,--branch<BRANCH[+]>β show changesets within the given named branch-B,--bookmark<BOOKMARK[+]>β show changesets within the given bookmark-P,--prune<REV[+]>β do not display revision or any of its ancestors-p,--patchβ show patch-g,--gitβ use git extended diff format-l,--limit<NUM>β limit number of changes displayed-M,--no-mergesβ do not show merges--statβ output diffstat-style summary of changes-G,--graphβ show the revision DAG--style<STYLE>β display using template map file (DEPRECATED)-T,--template<TEMPLATE>β display with template-I,--include<PATTERN[+]>β include names matching the given patterns-X,--exclude<PATTERN[+]>β exclude names matching the given patterns
[+] marked option can be specified multiple times
π ALIASES π
history
and that's the whole HG(LOG) page, bestie β no version or date stamped on it, the footer is literally just HG(LOG) and honestly? iconic. go log something. ππ¦
π¦ where this page comes from
- arch rolling: mercurial 7.2.4-1 Β· GPL
- fedora 43: mercurial 7.1.1-1.fc43 Β· GPL-2.0-or-later
- fedora 43: mercurial 7.1.1-2.fc43 Β· GPL-2.0-or-later
- fedora 44: mercurial 7.2-1.fc44 Β· GPL-2.0-or-later
- fedora 44: mercurial 7.2.4-1.fc44 Β· GPL-2.0-or-later
- nixos 26.05: mercurial 7.1.2
- nixos 26.05: mercurial-full 7.1.2
- nixpkgs unstable: mercurial 7.2.2
- nixpkgs unstable: mercurial-full 7.2.2
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mercurial 7.0.1-160000.2.2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms