diff: --{rotate,skip}-to=<path>

In the implementation of "git difftool", there is a case where the
user wants to start viewing the diffs at a specific path and
continue on to the rest, optionally wrapping around to the
beginning.  Since it is somewhat cumbersome to implement such a
feature as a post-processing step of "git diff" output, let's
support it internally with two new options.

 - "git diff --rotate-to=C", when the resulting patch would show
   paths A B C D E without the option, would "rotate" the paths to
   shows patch to C D E A B instead.  It is an error when there is
   no patch for C is shown.

 - "git diff --skip-to=C" would instead "skip" the paths before C,
   and shows patch to C D E.  Again, it is an error when there is no
   patch for C is shown.

 - "git log [-p]" also accepts these two options, but it is not an
   error if there is no change to the specified path.  Instead, the
   set of output paths are rotated or skipped to the specified path
   or the first path that sorts after the specified path.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 files changed
tree: 7a8abfa8d2beabee2f3260c001eff7a7335c5166
  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. attr.c
  52. attr.h
  53. banned.h
  54. base85.c
  55. bisect.c
  56. bisect.h
  57. blame.c
  58. blame.h
  59. blob.c
  60. blob.h
  61. bloom.c
  62. bloom.h
  63. branch.c
  64. branch.h
  65. builtin.h
  66. bulk-checkin.c
  67. bulk-checkin.h
  68. bundle.c
  69. bundle.h
  70. cache-tree.c
  71. cache-tree.h
  72. cache.h
  73. chdir-notify.c
  74. chdir-notify.h
  75. check-builtins.sh
  76. check_bindir
  77. checkout.c
  78. checkout.h
  79. CODE_OF_CONDUCT.md
  80. color.c
  81. color.h
  82. column.c
  83. column.h
  84. combine-diff.c
  85. command-list.txt
  86. commit-graph.c
  87. commit-graph.h
  88. commit-reach.c
  89. commit-reach.h
  90. commit-slab-decl.h
  91. commit-slab-impl.h
  92. commit-slab.h
  93. commit.c
  94. commit.h
  95. common-main.c
  96. config.c
  97. config.h
  98. config.mak.dev
  99. config.mak.in
  100. config.mak.uname
  101. configure.ac
  102. connect.c
  103. connect.h
  104. connected.c
  105. connected.h
  106. convert.c
  107. convert.h
  108. copy.c
  109. COPYING
  110. credential.c
  111. credential.h
  112. csum-file.c
  113. csum-file.h
  114. ctype.c
  115. daemon.c
  116. date.c
  117. decorate.c
  118. decorate.h
  119. delta-islands.c
  120. delta-islands.h
  121. delta.h
  122. detect-compiler
  123. diff-delta.c
  124. diff-lib.c
  125. diff-merges.c
  126. diff-merges.h
  127. diff-no-index.c
  128. diff.c
  129. diff.h
  130. diffcore-break.c
  131. diffcore-delta.c
  132. diffcore-order.c
  133. diffcore-pickaxe.c
  134. diffcore-rename.c
  135. diffcore-rotate.c
  136. diffcore.h
  137. dir-iterator.c
  138. dir-iterator.h
  139. dir.c
  140. dir.h
  141. editor.c
  142. entry.c
  143. environment.c
  144. environment.h
  145. exec-cmd.c
  146. exec-cmd.h
  147. fetch-negotiator.c
  148. fetch-negotiator.h
  149. fetch-pack.c
  150. fetch-pack.h
  151. fmt-merge-msg.c
  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. generate-configlist.sh
  162. gettext.c
  163. gettext.h
  164. git-add--interactive.perl
  165. git-archimport.perl
  166. git-bisect.sh
  167. git-compat-util.h
  168. git-cvsexportcommit.perl
  169. git-cvsimport.perl
  170. git-cvsserver.perl
  171. git-difftool--helper.sh
  172. git-filter-branch.sh
  173. git-instaweb.sh
  174. git-merge-octopus.sh
  175. git-merge-one-file.sh
  176. git-merge-resolve.sh
  177. git-mergetool--lib.sh
  178. git-mergetool.sh
  179. git-p4.py
  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-lookup.c
  199. hash-lookup.h
  200. hash.h
  201. hashmap.c
  202. hashmap.h
  203. help.c
  204. help.h
  205. hex.c
  206. http-backend.c
  207. http-fetch.c
  208. http-push.c
  209. http-walker.c
  210. http.c
  211. http.h
  212. ident.c
  213. imap-send.c
  214. INSTALL
  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-ort-wrappers.c
  256. merge-ort-wrappers.h
  257. merge-ort.c
  258. merge-ort.h
  259. merge-recursive.c
  260. merge-recursive.h
  261. merge.c
  262. mergesort.c
  263. mergesort.h
  264. midx.c
  265. midx.h
  266. name-hash.c
  267. notes-cache.c
  268. notes-cache.h
  269. notes-merge.c
  270. notes-merge.h
  271. notes-utils.c
  272. notes-utils.h
  273. notes.c
  274. notes.h
  275. object-file.c
  276. object-name.c
  277. object-store.h
  278. object.c
  279. object.h
  280. oid-array.c
  281. oid-array.h
  282. oidmap.c
  283. oidmap.h
  284. oidset.c
  285. oidset.h
  286. pack-bitmap-write.c
  287. pack-bitmap.c
  288. pack-bitmap.h
  289. pack-check.c
  290. pack-objects.c
  291. pack-objects.h
  292. pack-revindex.c
  293. pack-revindex.h
  294. pack-write.c
  295. pack.h
  296. packfile.c
  297. packfile.h
  298. pager.c
  299. parse-options-cb.c
  300. parse-options.c
  301. parse-options.h
  302. patch-delta.c
  303. patch-ids.c
  304. patch-ids.h
  305. path.c
  306. path.h
  307. pathspec.c
  308. pathspec.h
  309. pkt-line.c
  310. pkt-line.h
  311. preload-index.c
  312. pretty.c
  313. pretty.h
  314. prio-queue.c
  315. prio-queue.h
  316. progress.c
  317. progress.h
  318. promisor-remote.c
  319. promisor-remote.h
  320. prompt.c
  321. prompt.h
  322. protocol.c
  323. protocol.h
  324. prune-packed.c
  325. prune-packed.h
  326. quote.c
  327. quote.h
  328. range-diff.c
  329. range-diff.h
  330. reachable.c
  331. reachable.h
  332. read-cache.c
  333. README.md
  334. rebase-interactive.c
  335. rebase-interactive.h
  336. rebase.c
  337. rebase.h
  338. ref-filter.c
  339. ref-filter.h
  340. reflog-walk.c
  341. reflog-walk.h
  342. refs.c
  343. refs.h
  344. refspec.c
  345. refspec.h
  346. remote-curl.c
  347. remote.c
  348. remote.h
  349. replace-object.c
  350. replace-object.h
  351. repo-settings.c
  352. repository.c
  353. repository.h
  354. rerere.c
  355. rerere.h
  356. reset.c
  357. reset.h
  358. resolve-undo.c
  359. resolve-undo.h
  360. revision.c
  361. revision.h
  362. run-command.c
  363. run-command.h
  364. send-pack.c
  365. send-pack.h
  366. sequencer.c
  367. sequencer.h
  368. serve.c
  369. serve.h
  370. server-info.c
  371. setup.c
  372. sh-i18n--envsubst.c
  373. sha1dc_git.c
  374. sha1dc_git.h
  375. shallow.c
  376. shallow.h
  377. shell.c
  378. shortlog.h
  379. sideband.c
  380. sideband.h
  381. sigchain.c
  382. sigchain.h
  383. split-index.c
  384. split-index.h
  385. stable-qsort.c
  386. strbuf.c
  387. strbuf.h
  388. streaming.c
  389. streaming.h
  390. string-list.c
  391. string-list.h
  392. strmap.c
  393. strmap.h
  394. strvec.c
  395. strvec.h
  396. sub-process.c
  397. sub-process.h
  398. submodule-config.c
  399. submodule-config.h
  400. submodule.c
  401. submodule.h
  402. symlinks.c
  403. tag.c
  404. tag.h
  405. tar.h
  406. tempfile.c
  407. tempfile.h
  408. thread-utils.c
  409. thread-utils.h
  410. tmp-objdir.c
  411. tmp-objdir.h
  412. trace.c
  413. trace.h
  414. trace2.c
  415. trace2.h
  416. trailer.c
  417. trailer.h
  418. transport-helper.c
  419. transport-internal.h
  420. transport.c
  421. transport.h
  422. tree-diff.c
  423. tree-walk.c
  424. tree-walk.h
  425. tree.c
  426. tree.h
  427. unicode-width.h
  428. unimplemented.sh
  429. unix-socket.c
  430. unix-socket.h
  431. unpack-trees.c
  432. unpack-trees.h
  433. upload-pack.c
  434. upload-pack.h
  435. url.c
  436. url.h
  437. urlmatch.c
  438. urlmatch.h
  439. usage.c
  440. userdiff.c
  441. userdiff.h
  442. utf8.c
  443. utf8.h
  444. varint.c
  445. varint.h
  446. version.c
  447. version.h
  448. versioncmp.c
  449. walker.c
  450. walker.h
  451. wildmatch.c
  452. wildmatch.h
  453. worktree.c
  454. worktree.h
  455. wrap-for-bin.sh
  456. wrapper.c
  457. write-or-die.c
  458. ws.c
  459. wt-status.c
  460. wt-status.h
  461. xdiff-interface.c
  462. xdiff-interface.h
  463. 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