log-tree: make ref_filter_match() a helper method

The ref_filter_match() method is defined in refs.h and implemented
in refs.c, but is only used by add_ref_decoration() in log-tree.c.
Move it into that file as a static helper method. The
match_ref_pattern() comes along for the ride.

While moving the code, also make a slight adjustment to have
ref_filter_match() take a struct decoration_filter pointer instead
of multiple string lists. This is non-functional, but will make a
later change be much cleaner.

The diff is easier to parse when using the --color-moved option.

Reported-by: Junio C Hamano <gister@pobox.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 files changed
tree: e9767ae9828ed510bb28a36be8444a87e7969ebf
  1. .github/
  2. block-sha1/
  3. builtin/
  4. ci/
  5. compat/
  6. contrib/
  7. Documentation/
  8. ewah/
  9. git-gui/
  10. gitk-git/
  11. gitweb/
  12. mergetools/
  13. negotiator/
  14. perl/
  15. po/
  16. ppc/
  17. refs/
  18. sha1dc/
  19. sha256/
  20. t/
  21. templates/
  22. trace2/
  23. vcs-svn/
  24. xdiff/
  25. .cirrus.yml
  26. .clang-format
  27. .editorconfig
  28. .gitattributes
  29. .gitignore
  30. .gitmodules
  31. .mailmap
  32. .travis.yml
  33. .tsan-suppressions
  34. abspath.c
  35. aclocal.m4
  36. add-interactive.c
  37. add-interactive.h
  38. add-patch.c
  39. advice.c
  40. advice.h
  41. alias.c
  42. alias.h
  43. alloc.c
  44. alloc.h
  45. apply.c
  46. apply.h
  47. archive-tar.c
  48. archive-zip.c
  49. archive.c
  50. archive.h
  51. argv-array.c
  52. argv-array.h
  53. attr.c
  54. attr.h
  55. azure-pipelines.yml
  56. banned.h
  57. base85.c
  58. bisect.c
  59. bisect.h
  60. blame.c
  61. blame.h
  62. blob.c
  63. blob.h
  64. branch.c
  65. branch.h
  66. builtin.h
  67. bulk-checkin.c
  68. bulk-checkin.h
  69. bundle.c
  70. bundle.h
  71. cache-tree.c
  72. cache-tree.h
  73. cache.h
  74. chdir-notify.c
  75. chdir-notify.h
  76. check-builtins.sh
  77. check_bindir
  78. checkout.c
  79. checkout.h
  80. CODE_OF_CONDUCT.md
  81. color.c
  82. color.h
  83. column.c
  84. column.h
  85. combine-diff.c
  86. command-list.txt
  87. commit-graph.c
  88. commit-graph.h
  89. commit-reach.c
  90. commit-reach.h
  91. commit-slab-decl.h
  92. commit-slab-impl.h
  93. commit-slab.h
  94. commit.c
  95. commit.h
  96. common-main.c
  97. config.c
  98. config.h
  99. config.mak.dev
  100. config.mak.in
  101. config.mak.uname
  102. configure.ac
  103. connect.c
  104. connect.h
  105. connected.c
  106. connected.h
  107. convert.c
  108. convert.h
  109. copy.c
  110. COPYING
  111. credential-cache--daemon.c
  112. credential-cache.c
  113. credential-store.c
  114. credential.c
  115. credential.h
  116. csum-file.c
  117. csum-file.h
  118. ctype.c
  119. daemon.c
  120. date.c
  121. decorate.c
  122. decorate.h
  123. delta-islands.c
  124. delta-islands.h
  125. delta.h
  126. detect-compiler
  127. diff-delta.c
  128. diff-lib.c
  129. diff-no-index.c
  130. diff.c
  131. diff.h
  132. diffcore-break.c
  133. diffcore-delta.c
  134. diffcore-order.c
  135. diffcore-pickaxe.c
  136. diffcore-rename.c
  137. diffcore.h
  138. dir-iterator.c
  139. dir-iterator.h
  140. dir.c
  141. dir.h
  142. editor.c
  143. entry.c
  144. environment.c
  145. exec-cmd.c
  146. exec-cmd.h
  147. fast-import.c
  148. fetch-negotiator.c
  149. fetch-negotiator.h
  150. fetch-pack.c
  151. fetch-pack.h
  152. fmt-merge-msg.h
  153. fsck.c
  154. fsck.h
  155. fsmonitor.c
  156. fsmonitor.h
  157. fuzz-commit-graph.c
  158. fuzz-pack-headers.c
  159. fuzz-pack-idx.c
  160. generate-cmdlist.sh
  161. gettext.c
  162. gettext.h
  163. git-add--interactive.perl
  164. git-archimport.perl
  165. git-bisect.sh
  166. git-compat-util.h
  167. git-cvsexportcommit.perl
  168. git-cvsimport.perl
  169. git-cvsserver.perl
  170. git-difftool--helper.sh
  171. git-filter-branch.sh
  172. git-instaweb.sh
  173. git-merge-octopus.sh
  174. git-merge-one-file.sh
  175. git-merge-resolve.sh
  176. git-mergetool--lib.sh
  177. git-mergetool.sh
  178. git-p4.py
  179. git-parse-remote.sh
  180. git-quiltimport.sh
  181. git-rebase--preserve-merges.sh
  182. git-request-pull.sh
  183. git-send-email.perl
  184. git-sh-i18n.sh
  185. git-sh-setup.sh
  186. git-submodule.sh
  187. git-svn.perl
  188. GIT-VERSION-GEN
  189. git-web--browse.sh
  190. git.c
  191. git.rc
  192. gpg-interface.c
  193. gpg-interface.h
  194. graph.c
  195. graph.h
  196. grep.c
  197. grep.h
  198. hash.h
  199. hashmap.c
  200. hashmap.h
  201. help.c
  202. help.h
  203. hex.c
  204. http-backend.c
  205. http-fetch.c
  206. http-push.c
  207. http-walker.c
  208. http.c
  209. http.h
  210. ident.c
  211. imap-send.c
  212. INSTALL
  213. interdiff.c
  214. interdiff.h
  215. iterator.h
  216. json-writer.c
  217. json-writer.h
  218. khash.h
  219. kwset.c
  220. kwset.h
  221. levenshtein.c
  222. levenshtein.h
  223. LGPL-2.1
  224. line-log.c
  225. line-log.h
  226. line-range.c
  227. line-range.h
  228. linear-assignment.c
  229. linear-assignment.h
  230. list-objects-filter-options.c
  231. list-objects-filter-options.h
  232. list-objects-filter.c
  233. list-objects-filter.h
  234. list-objects.c
  235. list-objects.h
  236. list.h
  237. ll-merge.c
  238. ll-merge.h
  239. lockfile.c
  240. lockfile.h
  241. log-tree.c
  242. log-tree.h
  243. ls-refs.c
  244. ls-refs.h
  245. mailinfo.c
  246. mailinfo.h
  247. mailmap.c
  248. mailmap.h
  249. Makefile
  250. match-trees.c
  251. mem-pool.c
  252. mem-pool.h
  253. merge-blobs.c
  254. merge-blobs.h
  255. merge-recursive.c
  256. merge-recursive.h
  257. merge.c
  258. mergesort.c
  259. mergesort.h
  260. midx.c
  261. midx.h
  262. name-hash.c
  263. notes-cache.c
  264. notes-cache.h
  265. notes-merge.c
  266. notes-merge.h
  267. notes-utils.c
  268. notes-utils.h
  269. notes.c
  270. notes.h
  271. object-store.h
  272. object.c
  273. object.h
  274. oidmap.c
  275. oidmap.h
  276. oidset.c
  277. oidset.h
  278. pack-bitmap-write.c
  279. pack-bitmap.c
  280. pack-bitmap.h
  281. pack-check.c
  282. pack-objects.c
  283. pack-objects.h
  284. pack-revindex.c
  285. pack-revindex.h
  286. pack-write.c
  287. pack.h
  288. packfile.c
  289. packfile.h
  290. pager.c
  291. parse-options-cb.c
  292. parse-options.c
  293. parse-options.h
  294. patch-delta.c
  295. patch-ids.c
  296. patch-ids.h
  297. path.c
  298. path.h
  299. pathspec.c
  300. pathspec.h
  301. pkt-line.c
  302. pkt-line.h
  303. preload-index.c
  304. pretty.c
  305. pretty.h
  306. prio-queue.c
  307. prio-queue.h
  308. progress.c
  309. progress.h
  310. promisor-remote.c
  311. promisor-remote.h
  312. prompt.c
  313. prompt.h
  314. protocol.c
  315. protocol.h
  316. quote.c
  317. quote.h
  318. range-diff.c
  319. range-diff.h
  320. reachable.c
  321. reachable.h
  322. read-cache.c
  323. README.md
  324. rebase-interactive.c
  325. rebase-interactive.h
  326. rebase.c
  327. rebase.h
  328. ref-filter.c
  329. ref-filter.h
  330. reflog-walk.c
  331. reflog-walk.h
  332. refs.c
  333. refs.h
  334. refspec.c
  335. refspec.h
  336. remote-curl.c
  337. remote-testsvn.c
  338. remote.c
  339. remote.h
  340. replace-object.c
  341. replace-object.h
  342. repo-settings.c
  343. repository.c
  344. repository.h
  345. rerere.c
  346. rerere.h
  347. resolve-undo.c
  348. resolve-undo.h
  349. revision.c
  350. revision.h
  351. run-command.c
  352. run-command.h
  353. send-pack.c
  354. send-pack.h
  355. sequencer.c
  356. sequencer.h
  357. serve.c
  358. serve.h
  359. server-info.c
  360. setup.c
  361. sh-i18n--envsubst.c
  362. sha1-array.c
  363. sha1-array.h
  364. sha1-file.c
  365. sha1-lookup.c
  366. sha1-lookup.h
  367. sha1-name.c
  368. sha1dc_git.c
  369. sha1dc_git.h
  370. shallow.c
  371. shell.c
  372. shortlog.h
  373. sideband.c
  374. sideband.h
  375. sigchain.c
  376. sigchain.h
  377. split-index.c
  378. split-index.h
  379. stable-qsort.c
  380. strbuf.c
  381. strbuf.h
  382. streaming.c
  383. streaming.h
  384. string-list.c
  385. string-list.h
  386. sub-process.c
  387. sub-process.h
  388. submodule-config.c
  389. submodule-config.h
  390. submodule.c
  391. submodule.h
  392. symlinks.c
  393. tag.c
  394. tag.h
  395. tar.h
  396. tempfile.c
  397. tempfile.h
  398. thread-utils.c
  399. thread-utils.h
  400. tmp-objdir.c
  401. tmp-objdir.h
  402. trace.c
  403. trace.h
  404. trace2.c
  405. trace2.h
  406. trailer.c
  407. trailer.h
  408. transport-helper.c
  409. transport-internal.h
  410. transport.c
  411. transport.h
  412. tree-diff.c
  413. tree-walk.c
  414. tree-walk.h
  415. tree.c
  416. tree.h
  417. unicode-width.h
  418. unimplemented.sh
  419. unix-socket.c
  420. unix-socket.h
  421. unpack-trees.c
  422. unpack-trees.h
  423. upload-pack.c
  424. upload-pack.h
  425. url.c
  426. url.h
  427. urlmatch.c
  428. urlmatch.h
  429. usage.c
  430. userdiff.c
  431. userdiff.h
  432. utf8.c
  433. utf8.h
  434. varint.c
  435. varint.h
  436. version.c
  437. version.h
  438. versioncmp.c
  439. walker.c
  440. walker.h
  441. wildmatch.c
  442. wildmatch.h
  443. worktree.c
  444. worktree.h
  445. wrap-for-bin.sh
  446. wrapper.c
  447. write-or-die.c
  448. ws.c
  449. wt-status.c
  450. wt-status.h
  451. xdiff-interface.c
  452. xdiff-interface.h
  453. 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