Message ID | 8fec37ee17481039998af65ce1abec753cf30897.1731343985.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | doc: git diff reformatting | expand |
Am 11.11.24 um 17:53 schrieb Jean-Noël Avila via GitGitGadget: > -The raw output format from "git-diff-index", "git-diff-tree", > -"git-diff-files" and "git diff --raw" are very similar. > +The raw output format from `git-diff-index`, `git-diff-tree`, > +`git-diff-files` and `git diff --raw` are very similar. Throughout this document we see a lot of commands with dashes `git-foo`. Does this have any significance, or should they be corrected to the dashless form `git foo`? It could even be a "while at it"-change as you are touching every instance anyway. > > These commands all compare two sets of things; what is > compared differs: > > -git-diff-index <tree-ish>:: > - compares the <tree-ish> and the files on the filesystem. > +`git-diff-index <tree-ish>`:: > + compares the _<tree-ish>_ and the files on the filesystem. Now that the backtick formats the content as in the synopsis, why is it written _<tree-ish>_ and not `<tree-ish>` in the running text? -- Hannes
Johannes Sixt <j6t@kdbg.org> writes: > Am 11.11.24 um 17:53 schrieb Jean-Noël Avila via GitGitGadget: >> -The raw output format from "git-diff-index", "git-diff-tree", >> -"git-diff-files" and "git diff --raw" are very similar. >> +The raw output format from `git-diff-index`, `git-diff-tree`, >> +`git-diff-files` and `git diff --raw` are very similar. > > Throughout this document we see a lot of commands with dashes `git-foo`. > Does this have any significance, or should they be corrected to the > dashless form `git foo`? It could even be a "while at it"-change as you > are touching every instance anyway. Yup, these "git-foo" are historical wart from pre Git 1.6 days. >> These commands all compare two sets of things; what is >> compared differs: >> >> -git-diff-index <tree-ish>:: >> - compares the <tree-ish> and the files on the filesystem. >> +`git-diff-index <tree-ish>`:: >> + compares the _<tree-ish>_ and the files on the filesystem. > > Now that the backtick formats the content as in the synopsis, why is it > written _<tree-ish>_ and not `<tree-ish>` in the running text? Perhaps that is because the body text does want to show the placeholder in _italics_ but not as a `literal` string?
Am 13.11.24 um 00:03 schrieb Junio C Hamano: > Johannes Sixt <j6t@kdbg.org> writes: >> Now that the backtick formats the content as in the synopsis, why is it >> written _<tree-ish>_ and not `<tree-ish>` in the running text? > > Perhaps that is because the body text does want to show the > placeholder in _italics_ but not as a `literal` string? OK, I can agree with that. -- Hannes
Le 12/11/2024 à 19:51, Johannes Sixt a écrit : > Am 11.11.24 um 17:53 schrieb Jean-Noël Avila via GitGitGadget: >> -The raw output format from "git-diff-index", "git-diff-tree", >> -"git-diff-files" and "git diff --raw" are very similar. >> +The raw output format from `git-diff-index`, `git-diff-tree`, >> +`git-diff-files` and `git diff --raw` are very similar. > > Throughout this document we see a lot of commands with dashes `git-foo`. > Does this have any significance, or should they be corrected to the > dashless form `git foo`? It could even be a "while at it"-change as you > are touching every instance anyway. > OK. I didn't pay attention to these points until now. >> >> These commands all compare two sets of things; what is >> compared differs: >> >> -git-diff-index <tree-ish>:: >> - compares the <tree-ish> and the files on the filesystem. >> +`git-diff-index <tree-ish>`:: >> + compares the _<tree-ish>_ and the files on the filesystem. > > Now that the backtick formats the content as in the synopsis, why is it > written _<tree-ish>_ and not `<tree-ish>` in the running text? > With the new processing in place, this is identical in the result. But for the writers, I would still push so that the form _<placeholder>_ be used to remind them that keywords and placeholders need to be differentiated. Moreover, in case the special processing macro is not applied, the markup is still correct pure asciidoc, while generating a "not so bad" output.
diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt index a3ae8747a22..c72fb379867 100644 --- a/Documentation/diff-format.txt +++ b/Documentation/diff-format.txt @@ -1,25 +1,25 @@ Raw output format ----------------- -The raw output format from "git-diff-index", "git-diff-tree", -"git-diff-files" and "git diff --raw" are very similar. +The raw output format from `git-diff-index`, `git-diff-tree`, +`git-diff-files` and `git diff --raw` are very similar. These commands all compare two sets of things; what is compared differs: -git-diff-index <tree-ish>:: - compares the <tree-ish> and the files on the filesystem. +`git-diff-index <tree-ish>`:: + compares the _<tree-ish>_ and the files on the filesystem. -git-diff-index --cached <tree-ish>:: - compares the <tree-ish> and the index. +`git-diff-index --cached <tree-ish>`:: + compares the _<tree-ish>_ and the index. -git-diff-tree [-r] <tree-ish-1> <tree-ish-2> [<pattern>...]:: +`git-diff-tree [-r] <tree-ish-1> <tree-ish-2> [<pattern>...]`:: compares the trees named by the two arguments. -git-diff-files [<pattern>...]:: +`git-diff-files [<pattern>...]`:: compares the index and the files on the filesystem. -The "git-diff-tree" command begins its output by printing the hash of +The `git-diff-tree` command begins its output by printing the hash of what is being compared. After that, all the commands print one output line per changed file. @@ -54,19 +54,19 @@ That is, from the left to the right: Possible status letters are: -- A: addition of a file -- C: copy of a file into a new one -- D: deletion of a file -- M: modification of the contents or mode of a file -- R: renaming of a file -- T: change in the type of the file (regular file, symbolic link or submodule) -- U: file is unmerged (you must complete the merge before it can +- `A`: addition of a file +- `C`: copy of a file into a new one +- `D`: deletion of a file +- `M`: modification of the contents or mode of a file +- `R`: renaming of a file +- `T`: change in the type of the file (regular file, symbolic link or submodule) +- `U`: file is unmerged (you must complete the merge before it can be committed) -- X: "unknown" change type (most probably a bug, please report it) +- `X`: "unknown" change type (most probably a bug, please report it) -Status letters C and R are always followed by a score (denoting the +Status letters `C` and `R` are always followed by a score (denoting the percentage of similarity between the source and target of the move or -copy). Status letter M may be followed by a score (denoting the +copy). Status letter `M` may be followed by a score (denoting the percentage of dissimilarity) for file rewrites. The sha1 for "dst" is shown as all 0's if a file on the filesystem @@ -86,7 +86,7 @@ verbatim and the line is terminated by a NUL byte. diff format for merges ---------------------- -"git-diff-tree", "git-diff-files" and "git-diff --raw" +`git-diff-tree`, `git-diff-files` and `git-diff --raw` can take `-c` or `--cc` option to generate diff output also for merge commits. The output differs from the format described above in the following way: @@ -128,7 +128,7 @@ other diff formats ------------------ The `--summary` option describes newly added, deleted, renamed and -copied files. The `--stat` option adds diffstat(1) graph to the +copied files. The `--stat` option adds `diffstat`(1) graph to the output. These options can be combined with other options, such as `-p`, and are meant for human consumption.