HG(ANNOTATE)

πŸ’– hg annotate πŸ’–

okay bestie, welcome to the hg annotate page β€” yes it's from the HG(ANNOTATE) manual, and yes it's about to become your new obsession. it's literally the "who wrote this line and when" command. no cap. πŸ¦‹


✨ NAME ✨

hg annotate β€” show changeset information by line for each file πŸ‘‘


✨ SYNOPSIS ✨

hg annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...

✨ DESCRIPTION ✨

okay so here's the vibe: this command lists the changes in files, and it shows you the revision id responsible for each line. every single line gets a lil receipt of who's accountable for it. πŸ’…

it's useful for discovering when a change was made and by whom. detective mode: activated. πŸ”

if you include --file, --user, or --date, the revision number is suppressed unless you also include --number. so like, don't be shocked when the rev number ghosts you β€” you did that. 😭

without the -a/--text option, annotate will avoid processing files it detects as binary. with -a, annotate will annotate the file anyway β€” although the results will probably be neither useful nor desirable. so like... you can, but should you? 🫣

use -L/--line-range FILE,M:N options to filter the output to the lines from M to N in FILE. this option is incompatible with --no-follow and cannot be combined with file pattern arguments. when combined with --rev, the line ranges refer to the state of the file at the requested revision. noted, bestie. πŸ“

🌸 Template 🌸

the following keywords are supported in addition to the common template keywords and functions. see also hg help templates.

  • lines β€” list of lines with annotation data. πŸ“‹
  • path β€” String. Repository-absolute path of the specified file.

and each entry of {lines} provides the following sub-keywords in addition to {date}, {node}, {rev}, {user}, etc.

  • line β€” String. Line content.
  • lineno β€” Integer. Line number at that revision.
  • path β€” String. Repository-absolute path of the file at that revision.

see hg help templates.operators for the list expansion syntax. 🧚

returns 0 on success. slay. ✨


✨ OPTIONS ✨

  • -r, --rev <REV> β€” annotate the specified revision 🎯
  • --follow β€” follow copies/renames and list the filename (DEPRECATED) πŸ’€
  • --no-follow β€” don't follow copies and renames πŸ™…
  • -a, --text β€” treat all files as text πŸ“„
  • -u, --user β€” list the author (long with -v) πŸ§‘
  • -f, --file β€” list the filename πŸ“
  • -d, --date β€” list the date (short with -q) πŸ“…
  • -n, --number β€” list the revision number (default) πŸ”’
  • -c, --changeset β€” list the changeset πŸ“¦
  • -l, --line-number β€” show line number at the first appearance πŸ”Ž
  • --skip <REV[+]> β€” revset to not display (EXPERIMENTAL) πŸ§ͺ
  • -L, --line-range <FILE,RANGE[+]> β€” follow line range of specified file (EXPERIMENTAL) πŸ§ͺ
  • -w, --ignore-all-space β€” ignore white space when comparing lines πŸ«₯
  • -b, --ignore-space-change β€” ignore changes in the amount of white space πŸ«₯
  • -B, --ignore-blank-lines β€” ignore changes whose lines are all blank πŸ«₯
  • -Z, --ignore-space-at-eol β€” ignore changes in whitespace at EOL πŸ«₯
  • -I, --include <PATTERN[+]> β€” include names matching the given patterns βœ…
  • -X, --exclude <PATTERN[+]> β€” exclude names matching the given patterns ❌
  • -T, --template <TEMPLATE> β€” display with template 🎨

[+] marked option can be specified multiple times. yes queen, stack 'em. 🌈


✨ ALIASES ✨

blame β€” because sometimes you just gotta point fingers, and this command lets you do it with data. πŸ˜ŒπŸ’…


and that's the whole page, bestie!! πŸ’– thanks for reading the HG(ANNOTATE) manual with me β€” this was the hg annotate page, sourced from the HG(ANNOTATE) manual. go forth and annotate responsibly. mwah. πŸŽ€πŸ¦‹βœ¨