Re: [PATCH v4 17/21] range-diff: populate the man page

2018-08-10 Thread Johannes Schindelin
Hi Thomas,

On Sun, 29 Jul 2018, Thomas Gummerer wrote:

> On 07/21, Johannes Schindelin via GitGitGadget wrote:
> > From: Johannes Schindelin 
> > 
> >  Documentation/git-range-diff.txt | 229 +++
> >  1 file changed, 229 insertions(+)
> > 
> > [...]
> >
> > +CONFIGURATION
> > +-
> > +This command uses the `diff.color.*` and `pager.range-diff` settings
> > +(the latter is on by default).
> > +See linkgit:git-config[1].
> 
> Would it be worth implementing a `rangeDiff.dualColor` configuration
> at some point?  Dual color mode seems like something I would like to
> have on by default, even if we are not making it the default for the
> command itself.
> 
> (Again this is something that can be a future enhancement).

Sure, go wild!

Ciao,
Dscho


Re: [PATCH v4 17/21] range-diff: populate the man page

2018-07-29 Thread Thomas Gummerer
On 07/21, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin 
> 
> The bulk of this patch consists of a heavily butchered version of
> tbdiff's README written by Thomas Rast and Thomas Gummerer, lifted from

Thanks for the mention here, but this was really mostly Thomas Rast's
writing.  My contributions here are very minor compared to his :)

> https://github.com/trast/tbdiff.
> 
> Signed-off-by: Johannes Schindelin 
> ---
>  Documentation/git-range-diff.txt | 229 +++
>  1 file changed, 229 insertions(+)
> 
> [...]
>
> +CONFIGURATION
> +-
> +This command uses the `diff.color.*` and `pager.range-diff` settings
> +(the latter is on by default).
> +See linkgit:git-config[1].

Would it be worth implementing a `rangeDiff.dualColor` configuration
at some point?  Dual color mode seems like something I would like to
have on by default, even if we are not making it the default for the
command itself.

(Again this is something that can be a future enhancement).

> +EXAMPLES
> +
> [...]
> -- 
> gitgitgadget
> 


[PATCH v4 17/21] range-diff: populate the man page

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin 

The bulk of this patch consists of a heavily butchered version of
tbdiff's README written by Thomas Rast and Thomas Gummerer, lifted from
https://github.com/trast/tbdiff.

Signed-off-by: Johannes Schindelin 
---
 Documentation/git-range-diff.txt | 229 +++
 1 file changed, 229 insertions(+)

diff --git a/Documentation/git-range-diff.txt b/Documentation/git-range-diff.txt
index de0ca5df4..f1a6737f8 100644
--- a/Documentation/git-range-diff.txt
+++ b/Documentation/git-range-diff.txt
@@ -5,6 +5,235 @@ NAME
 
 git-range-diff - Compare two commit ranges (e.g. two versions of a branch)
 
+SYNOPSIS
+
+[verse]
+'git range-diff' [--color=[]] [--no-color] []
+   [--dual-color] [--creation-factor=]
+   (   | ... |)
+
+DESCRIPTION
+---
+
+This command shows the differences between two versions of a patch
+series, or more generally, two commit ranges (ignoring merge commits).
+
+To that end, it first finds pairs of commits from both commit ranges
+that correspond with each other. Two commits are said to correspond when
+the diff between their patches (i.e. the author information, the commit
+message and the commit diff) is reasonably small compared to the
+patches' size. See ``Algorithm`` below for details.
+
+Finally, the list of matching commits is shown in the order of the
+second commit range, with unmatched commits being inserted just after
+all of their ancestors have been shown.
+
+
+OPTIONS
+---
+--dual-color::
+   When the commit diffs differ, recreate the original diffs'
+   coloring, and add outer -/+ diff markers with the *background*
+   being red/green to make it easier to see e.g. when there was a
+   change in what exact lines were added.
+
+--creation-factor=::
+   Set the creation/deletion cost fudge factor to ``.
+   Defaults to 60. Try a larger value if `git range-diff` erroneously
+   considers a large change a total rewrite (deletion of one commit
+   and addition of another), and a smaller one in the reverse case.
+   See the ``Algorithm`` section below for an explanation why this is
+   needed.
+
+ ::
+   Compare the commits specified by the two ranges, where
+   `` is considered an older version of ``.
+
+...::
+   Equivalent to passing `..` and `..`.
+
+  ::
+   Equivalent to passing `..` and `..`.
+   Note that `` does not need to be the exact branch point
+   of the branches. Example: after rebasing a branch `my-topic`,
+   `git range-diff my-topic@{u} my-topic@{1} my-topic` would
+   show the differences introduced by the rebase.
+
+`git range-diff` also accepts the regular diff options (see
+linkgit:git-diff[1]), most notably the `--color=[]` and
+`--no-color` options. These options are used when generating the "diff
+between patches", i.e. to compare the author, commit message and diff of
+corresponding old/new commits. There is currently no means to tweak the
+diff options passed to `git log` when generating those patches.
+
+
+CONFIGURATION
+-
+This command uses the `diff.color.*` and `pager.range-diff` settings
+(the latter is on by default).
+See linkgit:git-config[1].
+
+
+EXAMPLES
+
+
+When a rebase required merge conflicts to be resolved, compare the changes
+introduced by the rebase directly afterwards using:
+
+
+$ git range-diff @{u} @{1} @
+
+
+
+A typical output of `git range-diff` would look like this:
+
+
+-:  --- > 1:  0ddba11 Prepare for the inevitable!
+1:  c0debee = 2:  cab005e Add a helpful message at the start
+2:  f00dbal ! 3:  decafe1 Describe a bug
+@@ -1,3 +1,3 @@
+ Author: A U Thor 
+
+-TODO: Describe a bug
++Describe a bug
+@@ -324,5 +324,6
+  This is expected.
+
+-+What is unexpected is that it will also crash.
+++Unexpectedly, it also crashes. This is a bug, and the jury is
+++still out there how to fix it best. See ticket #314 for details.
+
+  Contact
+3:  bedead < -:  --- TO-UNDO
+
+
+In this example, there are 3 old and 3 new commits, where the developer
+removed the 3rd, added a new one before the first two, and modified the
+commit message of the 2nd commit as well its diff.
+
+When the output goes to a terminal, it is color-coded by default, just
+like regular `git diff`'s output. In addition, the first line (adding a
+commit) is green, the last line (deleting a commit) is red, the second
+line (with a perfect match) is yellow like the commit header of `git
+show`'s output, and the third line colors the old commit red, the new
+one green and the rest like `git show`'s commit header.
+
+The color-coded diff is actually a bit hard to read, though, as it
+colors the entire lines red or green. The line that added "What is
+unexpected" in the old commit, for example, is completely red, even if
+the intent of the old commit was to add something.
+
+To help with that, use the