[PATCH v5 18/21] completion: support `git range-diff`

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Tab completion of `git range-diff` is very convenient, especially given that the revision arguments to specify the commit ranges to compare are typically more complex than, say, what is normally passed to `git log`. Signed-off-by: Johannes Schindelin ---

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

2018-08-10 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

[PATCH v5 19/21] range-diff: left-pad patch numbers

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin As pointed out by Elijah Newren, tbdiff has this neat little alignment trick where it outputs the commit pairs with patch numbers that are padded to the maximal patch number's width: 1: cafedead = 1: acefade first patch [...] 314: beefeada <

[PATCH v5 16/21] range-diff --dual-color: skip white-space warnings

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When displaying a diff of diffs, it is possible that there is an outer `+` before a context line. That happens when the context changed between old and new commit. When that context line starts with a tab (after the space that marks it as context line), our diff

[PATCH v5 05/21] range-diff: also show the diff between patches

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Just like tbdiff, we now show the diff between matching patches. This is a "diff of two diffs", so it can be a bit daunting to read for the beginner. An alternative would be to display an interdiff, i.e. the hypothetical diff which is the result of first reverting the

[PATCH v5 00/21] Add range-diff, a tbdiff lookalike

2018-08-10 Thread Johannes Schindelin via GitGitGadget
The incredibly useful git-tbdiff [https://github.com/trast/tbdiff] tool to compare patch series (say, to see what changed between two iterations sent to the Git mailing list) is slightly less useful for this developer due to the fact that it requires the hungarian and numpy Python packages which

[PATCH v5 10/21] range-diff: do not show "function names" in hunk headers

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin We are comparing complete, formatted commit messages with patches. There are no function names here, so stop looking for them. Signed-off-by: Johannes Schindelin --- range-diff.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/range-diff.c b/range-diff.c

[PATCH v5 07/21] range-diff: indent the diffs just like tbdiff

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The main information in the `range-diff` view comes from the list of matching and non-matching commits, the diffs are additional information. Indenting them helps with the reading flow. Signed-off-by: Johannes Schindelin --- builtin/range-diff.c | 10 ++ 1

[PATCH v5 09/21] range-diff: adjust the output of the commit pairs

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This not only uses "dashed stand-ins" for "pairs" where one side is missing (i.e. unmatched commits that are present only in one of the two commit ranges), but also adds onelines for the reader's pleasure. This change brings `git range-diff` yet another step closer to

[PATCH v5 08/21] range-diff: suppress the diff headers

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When showing the diff between corresponding patches of the two branch versions, we have to make up a fake filename to run the diff machinery. That filename does not carry any meaningful information, hence tbdiff suppresses it. So we should, too. Signed-off-by:

[PATCH v5 02/21] Introduce `range-diff` to compare iterations of a topic branch

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This command does not do a whole lot so far, apart from showing a usage that is oddly similar to that of `git tbdiff`. And for a good reason: the next commits will turn `range-branch` into a full-blown replacement for `tbdiff`. At this point, we ignore tbdiff's color

[PATCH v5 01/21] linear-assignment: a function to solve least-cost assignment problems

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The problem solved by the code introduced in this commit goes like this: given two sets of items, and a cost matrix which says how much it "costs" to assign any given item of the first set to any given item of the second, assign all items (except when the sets have

[PATCH v2 2/4] mingw: implement lock_or_unlock_fd_for_appending()

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin For some reason, t/t5552-skipping-fetch-negotiator.sh fails particularly often on Windows due to racy tracing where the `git upload-pack` and the `git fetch` processes compete for the same file. We just introduced a remedy that uses fcntl(), but Windows does not have

[PATCH v2 3/4] trace: lock the trace file to avoid racy trace_write() calls

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When multiple processes try to write to the same file, it is not guaranteed that everything works as expected: those writes can overlap, and in the worst case even lose messages. This happens in t/t5552-skipping-fetch-negotiator.sh, where we abuse the `GIT_TRACE`

[PATCH v2 4/4] trace: verify that locking works

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Recently, t5552 introduced a pattern where two processes try to write to the same GIT_TRACE file in parallel. This is not safe, as the two processes fighting over who gets to append to the file can cause garbled lines and may even result in data loss on Windows (where

[PATCH v2 1/4] Introduce a function to lock/unlock file descriptors when appending

2018-08-10 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This function will be used to make write accesses in trace_write() a bit safer. Note: this patch takes a very different approach for cross-platform support than Git is historically taking: the original approach is to first implement everything on Linux, using the

[PATCH v2 0/4] t5552: fix flakiness by introducing proper locking for GIT_TRACE

2018-08-10 Thread Johannes Schindelin via GitGitGadget
I reported a couple of times that t5552 is not passing reliably. It has now reached next, and will no doubt infect master soon. Turns out that it is not a Windows-specific issue, even if it occurs a lot more often on Windows than elsewhere. (And even if it is apparently impossible to trigger on

[PATCH 2/4] mingw: implement lock_or_unlock_fd_for_appending()

2018-08-09 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin For some reason, t/t5552-skipping-fetch-negotiator.sh fails particularly often on Windows due to racy tracing where the `git upload-pack` and the `git fetch` processes compete for the same file. We just introduced a remedy that uses fcntl(), but Windows does not have

[PATCH 1/4] Introduce a function to lock/unlock file descriptors when appending

2018-08-09 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This function will be used to make write accesses in trace_write() a bit safer. Note: this patch takes a very different approach for cross-platform support than Git is historically taking: the original approach is to first implement everything on Linux, using the

[PATCH 3/4] trace: lock the trace file to avoid racy trace_write() calls

2018-08-09 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When multiple processes try to write to the same file, it is not guaranteed that everything works as expected: those writes can overlap, and in the worst case even lose messages. This happens in t/t5552-skipping-fetch-negotiator.sh, where we abuse the `GIT_TRACE`

[PATCH 0/4] t5552: fix flakiness by introducing proper locking for GIT_TRACE

2018-08-09 Thread Johannes Schindelin via GitGitGadget
I reported a couple of times that t5552 is not passing reliably. It has now reached next, and will no doubt infect master soon. Turns out that it is not a Windows-specific issue, even if it occurs a lot more often on Windows than elsewhere. The culprit is that two processes try simultaneously

[PATCH 4/4] trace: verify that locking works

2018-08-09 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Recently, t5552 introduced a pattern where two processes try to write to the same GIT_TRACE file in parallel. This is not safe, as the two processes fighting over who gets to append to the file can cause garbled lines and may even result in data loss on Windows (where

[PATCH v3 0/2] Make git rebase work with --rebase-merges and --exec

2018-08-09 Thread Johannes Schindelin via GitGitGadget
It was reported via IRC that the exec lines are inserted in the wrong spots when using --rebase-merges. The reason is that we used a simple, incorrect implementation that happened to work as long as the generated todo list only contains pick, fixup and squash commands. Which is not the case

[PATCH v3 1/2] t3430: demonstrate what -r, --autosquash & --exec should do

2018-08-09 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The --exec option's implementation is not really well-prepared for --rebase-merges. Demonstrate this. Signed-off-by: Johannes Schindelin --- t/t3430-rebase-merges.sh | 17 + 1 file changed, 17 insertions(+) diff --git a/t/t3430-rebase-merges.sh

[PATCH v3 2/2] rebase --exec: make it work with --rebase-merges

2018-08-09 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The idea of `--exec` is to append an `exec` call after each `pick`. Since the introduction of fixup!/squash! commits, this idea was extended to apply to "pick, possibly followed by a fixup/squash chain", i.e. an exec would not be inserted between a `pick` and any of

[PATCH 1/2] git-compat-util.h: fix typo

2018-08-08 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The words "save" and "safe" are both very wonderful words, each with their own set of meanings. Let's not confuse them with one another save on occasion of a pun. Signed-off-by: Johannes Schindelin --- git-compat-util.h | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 0/2] Fix two grammar errors related to the word "save"

2018-08-08 Thread Johannes Schindelin via GitGitGadget
I stumbled over the one in git-compat-util.h while working on an unrelated bug fix, and then got curious whether there are other places where we use save instead of safe, too. Turns out we do not, but there was another grammar error where a spurious . interrupted a sentence. Johannes Schindelin

[PATCH 2/2] remote-curl: remove spurious period

2018-08-08 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin We should not interrupt. sentences in the middle. Signed-off-by: Johannes Schindelin --- remote-curl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote-curl.c b/remote-curl.c index 99b0bedc6..fb28309e8 100644 --- a/remote-curl.c +++

[PATCH v2 1/2] t3430: demonstrate what -r, --autosquash & --exec should do

2018-08-06 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The --exec option's implementation is not really well-prepared for --rebase-merges. Demonstrate this. Signed-off-by: Johannes Schindelin --- t/t3430-rebase-merges.sh | 17 + 1 file changed, 17 insertions(+) diff --git a/t/t3430-rebase-merges.sh

[PATCH v2 2/2] rebase --exec: make it work with --rebase-merges

2018-08-06 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The idea of `--exec` is to append an `exec` call after each `pick`. Since the introduction of fixup!/squash! commits, this idea was extended to apply to "pick, possibly followed by a fixup/squash chain", i.e. an exec would not be inserted between a `pick` and any of

[PATCH v2 0/2] Make git rebase work with --rebase-merges and --exec

2018-08-06 Thread Johannes Schindelin via GitGitGadget
It was reported via IRC that the exec lines are inserted in the wrong spots when using --rebase-merges. The reason is that we used a simple, incorrect implementation that happened to work as long as the generated todo list only contains pick, fixup and squash commands. Which is not the case

[PATCH 1/4] line-log: demonstrate a bug with nearly-overlapping ranges

2018-08-04 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Currently, this test case throws an assertion: Assertion failed! Program: git.exe File: line-log.c, Line 71 Signed-off-by: Johannes Schindelin --- t/t4211-line-log.sh | 17 + 1 file changed, 17 insertions(+) diff --git

[PATCH 0/4] line-log: be more careful when adjusting multiple line ranges

2018-08-04 Thread Johannes Schindelin via GitGitGadget
I am a heavy user of git log -L In fact, I use the feature where multiple ranges can be specified extensively, via a not-exactly-trivial shell script function that takes the currently staged changes (or if none are staged, the current unstanged changes) and turns them into the corresponding

[PATCH 4/4] line-log: convert an assertion to a full BUG() call

2018-08-04 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The assertion in question really indicates a bug, when triggered, so we might just as well use the sanctioned method to report it. Signed-off-by: Johannes Schindelin --- line-log.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/line-log.c

[PATCH 3/4] line-log: optimize ranges by joining them when possible

2018-08-04 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Technically, it is okay to have line ranges that touch (i.e. the end of the first range ends just before the next range begins). However, it is inefficient, and when the user provides such touching ranges via multiple `-L` options, we already join them. When we

[PATCH 2/4] line-log: adjust start/end of ranges individually

2018-08-04 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When traversing commits and adjusting the ranges, things can get really tricky. For example, when the line range of interest encloses several hunks of a commit, the line range can actually shrink. Currently, range_set_shift_diff() does not anticipate that scenario and

[PATCH 0/1] Support git pull --rebase=i

2018-08-04 Thread Johannes Schindelin via GitGitGadget
The patch [https://github.com/git-for-windows/git/commit/4aa8b8c82] that introduced support for pull --rebase= into the Git for Windows project still allowed the very convenient abbreviation git pull --rebase=i which was later lost when it was ported to the builtin git pull, and it was not

[PATCH 1/1] pull --rebase=: allow single-letter abbreviations for the type

2018-08-04 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Git for Windows' original 4aa8b8c8283 (Teach 'git pull' to handle --rebase=interactive, 2011-10-21) had support for the very convenient abbreviation git pull --rebase=i which was later lost when it was ported to the builtin `git pull`, and it was not

[PATCH 0/2] Make git rebase work with --rebase-merges and --exec

2018-08-03 Thread Johannes Schindelin via GitGitGadget
It was reported via IRC that the exec lines are inserted in the wrong spots when using --rebase-merges. The reason is that we used a simple, incorrect implementation that happened to work as long as the generated todo list only contains pick, fixup and squash commands. Which is not the case

[PATCH 1/2] t3430: demonstrate what -r, --autosquash & --exec should do

2018-08-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The --exec option's implementation is not really well-prepared for --rebase-merges. Demonstrate this. Signed-off-by: Johannes Schindelin --- t/t3430-rebase-merges.sh | 17 + 1 file changed, 17 insertions(+) diff --git a/t/t3430-rebase-merges.sh

[PATCH 2/2] rebase --exec: make it work with --rebase-merges

2018-08-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The idea of `--exec` is to append an `exec` call after each `pick`. Since the introduction of fixup!/squash! commits, this idea was extended to apply to "pick, possibly followed by a fixup/squash chain", i.e. an exec would not be inserted between a `pick` and any of

[PATCH v2 8/9] vscode: add a dictionary for cSpell

2018-07-30 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The quite useful cSpell extension allows VS Code to have "squiggly" lines under spelling mistakes. By default, this would add too much clutter, though, because so much of Git's source code uses words that would trigger cSpell. Let's add a few words to make the spell

[PATCH v2 7/9] vscode: use 8-space tabs, no trailing ws, etc for Git's source code

2018-07-30 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This adds a couple settings for the .c/.h files so that it is easier to conform to Git's conventions while editing the source code. Signed-off-by: Johannes Schindelin --- contrib/vscode/init.sh | 8 1 file changed, 8 insertions(+) diff --git

[PATCH v2 4/9] mingw: define WIN32 explicitly

2018-07-30 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This helps VS Code's intellisense to figure out that we want to include windows.h, and that we want to define the minimum target Windows version as Windows Vista/2008R2. Signed-off-by: Johannes Schindelin --- config.mak.uname | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v2 0/9] Add support to develop Git in Visual Studio Code

2018-07-30 Thread Johannes Schindelin via GitGitGadget
[Visual Studio Code](https://code.visualstudio.com/) (nickname "VS Code") is a light-weight, cross-platform, Open Source development environment, with an increasingly powerful extension to support C/C++ development. In particular the intellisense support as well as all the other niceties

[PATCH v2 6/9] vscode: wrap commit messages at column 72 by default

2018-07-30 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When configuring VS Code as core.editor (via `code --wait`), we really want to adhere to the Git conventions of wrapping commit messages. Signed-off-by: Johannes Schindelin --- contrib/vscode/init.sh | 4 1 file changed, 4 insertions(+) diff --git

[PATCH v2 9/9] vscode: let cSpell work on commit messages, too

2018-07-30 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin By default, the cSpell extension ignores all files under .git/. That includes, unfortunately, COMMIT_EDITMSG, i.e. commit messages. However, spell checking is *quite* useful when writing commit messages... And since the user hardly ever opens any file inside .git (apart

[PATCH v2 1/9] contrib: add a script to initialize VS Code configuration

2018-07-30 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin VS Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. Among other languages, it has support for C/C++ via an extension, which offers to not only build and debug the code, but also Intellisense,

[PATCH v2 3/9] cache.h: extract enum declaration from inside a struct declaration

2018-07-30 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin While it is technically possible, it is confusing. Not only the user, but also VS Code's intellisense. Signed-off-by: Johannes Schindelin --- cache.h | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/cache.h b/cache.h

[PATCH v2 5/9] vscode: only overwrite C/C++ settings

2018-07-30 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The C/C++ settings are special, as they are the only generated VS Code configurations that *will* change over the course of Git's development, e.g. when a new constant is defined. Therefore, let's only update the C/C++ settings, also to prevent user modifications from

[PATCH v2 2/9] vscode: hard-code a couple defines

2018-07-30 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Sadly, we do not get all of the definitions via ALL_CFLAGS. Some defines are passed to GCC *only* when compiling specific files, such as git.o. Let's just hard-code them into the script for the time being. Signed-off-by: Johannes Schindelin ---

[PATCH 3/9] cache.h: extract enum declaration from inside a struct declaration

2018-07-23 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin While it is technically possible, it is confusing. Not only the user, but also VS Code's intellisense. Signed-off-by: Johannes Schindelin --- cache.h | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/cache.h b/cache.h

[PATCH 7/9] vscode: use 8-space tabs, no trailing ws, etc for Git's source code

2018-07-23 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This adds a couple settings for the .c/.h files so that it is easier to conform to Git's conventions while editing the source code. Signed-off-by: Johannes Schindelin --- contrib/vscode/init.sh | 8 1 file changed, 8 insertions(+) diff --git

[PATCH 5/9] vscode: only overwrite C/C++ settings

2018-07-23 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The C/C++ settings are special, as they are the only generated VS Code configurations that *will* change over the course of Git's development, e.g. when a new constant is defined. Therefore, let's only update the C/C++ settings, also to prevent user modifications from

[PATCH 4/9] mingw: define WIN32 explicitly

2018-07-23 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This helps VS Code's intellisense to figure out that we want to include windows.h, and that we want to define the minimum target Windows version as Windows Vista/2008R2. Signed-off-by: Johannes Schindelin --- config.mak.uname | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 9/9] vscode: let cSpell work on commit messages, too

2018-07-23 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin By default, the cSpell extension ignores all files under .git/. That includes, unfortunately, COMMIT_EDITMSG, i.e. commit messages. However, spell checking is *quite* useful when writing commit messages... And since the user hardly ever opens any file inside .git (apart

[PATCH 8/9] vscode: add a dictionary for cSpell

2018-07-23 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The quite useful cSpell extension allows VS Code to have "squiggly" lines under spelling mistakes. By default, this would add too much clutter, though, because so much of Git's source code uses words that would trigger cSpell. Let's add a few words to make the spell

[PATCH 6/9] vscode: wrap commit messages at column 72 by default

2018-07-23 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When configuring VS Code as core.editor (via `code --wait`), we really want to adhere to the Git conventions of wrapping commit messages. Signed-off-by: Johannes Schindelin --- contrib/vscode/init.sh | 4 1 file changed, 4 insertions(+) diff --git

[PATCH 0/9] Add support to develop Git in Visual Studio Code

2018-07-23 Thread Johannes Schindelin via GitGitGadget
[Visual Studio Code](https://code.visualstudio.com/) (nickname "VS Code") is a light-weight, cross-platform, Open Source development environment, with an increasingly powerful extension to support C/C++ development. In particular the intellisense support as well as all the other niceties

[PATCH 1/9] contrib: add a script to initialize VS Code configuration

2018-07-23 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin VS Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. Among other languages, it has support for C/C++ via an extension. To start developing Git with VS Code, simply run the Unix shell script

[PATCH 2/9] vscode: hard-code a couple defines

2018-07-23 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Sadly, we do not get all of the definitions via ALL_CFLAGS. Some defines are passed to GCC *only* when compiling specific files, such as git.o. Let's just hard-code them into the script for the time being. Signed-off-by: Johannes Schindelin ---

[PATCH 1/1] t7406: avoid failures solely due to timing issues

2018-07-23 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Regression tests are automated tests which try to ensure a specific behavior. The idea is: if the test case fails, the behavior indicated in the test case's title regressed. If a regression test that fails, even occasionally, for any reason other than to indicate the

[PATCH 0/1] t7406: avoid failures solely due to timing issues

2018-07-23 Thread Johannes Schindelin via GitGitGadget
This fixes a regression test that produces false positives occasionally: https://git-for-windows.visualstudio.com/git/_build/results?buildId=14035=logs Johannes Schindelin (1): t7406: avoid failures solely due to timing issues t/t7406-submodule-update.sh | 11 ++- 1 file changed, 6

[PATCH v4 21/21] range-diff: use dim/bold cues to improve dual color mode

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin It *is* a confusing thing to look at a diff of diffs. All too easy is it to mix up whether the -/+ markers refer to the "inner" or the "outer" diff, i.e. whether a `+` indicates that a line was added by either the old or the new diff (or both), or whether the new diff

[PATCH v4 20/21] range-diff: make --dual-color the default mode

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin After using this command extensively for the last two months, this developer came to the conclusion that even if the dual color mode still leaves a lot of room for confusion about what was actually changed, the non-dual color mode is substantially worse in that regard.

[PATCH v4 06/21] range-diff: right-trim commit messages

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When comparing commit messages, we need to keep in mind that they are indented by four spaces. That is, empty lines are no longer empty, but have "trailing whitespace". When displaying them in color, that results in those nagging red lines. Let's just right-trim the

[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

[PATCH v4 07/21] range-diff: indent the diffs just like tbdiff

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The main information in the `range-diff` view comes from the list of matching and non-matching commits, the diffs are additional information. Indenting them helps with the reading flow. Signed-off-by: Johannes Schindelin --- builtin/range-diff.c | 10 ++ 1

[PATCH v4 05/21] range-diff: also show the diff between patches

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Just like tbdiff, we now show the diff between matching patches. This is a "diff of two diffs", so it can be a bit daunting to read for the beginner. An alternative would be to display an interdiff, i.e. the hypothetical diff which is the result of first reverting the

[PATCH v4 19/21] range-diff: left-pad patch numbers

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin As pointed out by Elijah Newren, tbdiff has this neat little alignment trick where it outputs the commit pairs with patch numbers that are padded to the maximal patch number's width: 1: cafedead = 1: acefade first patch [...] 314: beefeada <

[PATCH v4 13/21] color: add the meta color GIT_COLOR_REVERSE

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This "color" simply reverts background and foreground. It will be used in the upcoming "dual color" mode of `git range-diff`, where we will reverse colors for the -/+ markers and the fragment headers of the "outer" diff. Signed-off-by: Johannes Schindelin --- color.h

[PATCH v4 16/21] range-diff --dual-color: fix bogus white-space warning

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When displaying a diff of diffs, it is possible that there is an outer `+` before a context line. That happens when the context changed between old and new commit. When that context line starts with a tab (after the space that marks it as context line), our diff

[PATCH v4 03/21] range-diff: first rudimentary implementation

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin At this stage, `git range-diff` can determine corresponding commits of two related commit ranges. This makes use of the recently introduced implementation of the linear assignment algorithm. The core of this patch is a straight port of the ideas of tbdiff, the

[PATCH v4 10/21] range-diff: do not show "function names" in hunk headers

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin We are comparing complete, formatted commit messages with patches. There are no function names here, so stop looking for them. Signed-off-by: Johannes Schindelin --- range-diff.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/range-diff.c b/range-diff.c

[PATCH v4 09/21] range-diff: adjust the output of the commit pairs

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This change brings `git range-diff` yet another step closer to feature parity with tbdiff: it now shows the oneline, too, and indicates with `=` when the commits have identical diffs. Signed-off-by: Johannes Schindelin --- range-diff.c | 64

[PATCH v4 14/21] diff: add an internal option to dual-color diffs of diffs

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When diffing diffs, it can be quite daunting to figure out what the heck is going on, as there are nested +/- signs. Let's make this easier by adding a flag in diff_options that allows color-coding the outer diff sign with inverted colors, so that the preimage and

[PATCH v4 08/21] range-diff: suppress the diff headers

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When showing the diff between corresponding patches of the two branch versions, we have to make up a fake filename to run the diff machinery. That filename does not carry any meaningful information, hence tbdiff suppresses it. So we should, too. Signed-off-by:

[PATCH v4 12/21] range-diff: use color for the commit pairs

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Arguably the most important part of `git range-diff`'s output is the list of commits in the two branches, together with their relationships. For that reason, tbdiff introduced color-coding that is pretty intuitive, especially for unchanged patches (all dim yellow, like

[PATCH v4 01/21] linear-assignment: a function to solve least-cost assignment problems

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The problem solved by the code introduced in this commit goes like this: given two sets of items, and a cost matrix which says how much it "costs" to assign any given item of the first set to any given item of the second, assign all items (except when the sets have

[PATCH v4 02/21] Introduce `range-diff` to compare iterations of a topic branch

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This command does not do a whole lot so far, apart from showing a usage that is oddly similar to that of `git tbdiff`. And for a good reason: the next commits will turn `range-branch` into a full-blown replacement for `tbdiff`. At this point, we ignore tbdiff's color

[PATCH v4 00/21] Add `range-diff`, a `tbdiff` lookalike

2018-07-21 Thread Johannes Schindelin via GitGitGadget
The incredibly useful [`git-tbdiff`](https://github.com/trast/tbdiff) tool to compare patch series (say, to see what changed between two iterations sent to the Git mailing list) is slightly less useful for this developer due to the fact that it requires the `hungarian` and `numpy` Python

[PATCH v4 18/21] completion: support `git range-diff`

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Tab completion of `git range-diff` is very convenient, especially given that the revision arguments to specify the commit ranges to compare are typically more complex than, say, what is normally passed to `git log`. Signed-off-by: Johannes Schindelin ---

[PATCH v4 15/21] range-diff: offer to dual-color the diffs

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When showing what changed between old and new commits, we show a diff of the patches. This diff is a diff between diffs, therefore there are nested +/- signs, and it can be relatively hard to understand what is going on. With the --dual-color option, the preimage and

[PATCH v4 04/21] range-diff: improve the order of the shown commits

2018-07-21 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This patch lets `git range-diff` use the same order as tbdiff. The idea is simple: for left-to-right readers, it is natural to assume that the `git range-diff` is performed between an older vs a newer version of the branch. As such, the user is probably more interested

[PATCH v2 1/2] repack: point out a bug handling stale shallow info

2018-07-17 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin A `git fetch --prune` can turn previously-reachable objects unreachable, even commits that are in the `shallow` list. A subsequent `git repack -ad` will then unceremoniously drop those unreachable commits, and the `shallow` list will become stale. This means that when

[PATCH v2 2/2] repack -ad: prune the list of shallow commits

2018-07-17 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin While it is true that we never add unreachable commits into pack files intentionally (as `git repack`'s documentation states), we must not forget that a `git fetch --prune` (or even a `git fetch` when a ref was force-pushed in the meantime) can make a commit unreachable

[PATCH v2 0/2] repack -ad: fix after `fetch --prune` in a shallow repository

2018-07-17 Thread Johannes Schindelin via GitGitGadget
Under certain circumstances, commits that were reachable can be made unreachable, e.g. via `git fetch --prune`. These commits might have been packed already, in which case `git repack -adlf` will just drop them without giving them the usual grace period before an eventual `git prune` (via `git

[PATCH 1/1] vcbuild/README: update to accommodate for missing common-cmds.h

2018-07-16 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin In 60f487ac0ef (Remove common-cmds.h, 2018-05-10), we forgot to adjust this README when removing the common-cmds.h file. Signed-off-by: Johannes Schindelin --- compat/vcbuild/README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 0/1] vcbuild/README: update to accommodate for missing common-cmds.h

2018-07-16 Thread Johannes Schindelin via GitGitGadget
In 60f487ac0ef (Remove common-cmds.h, 2018-05-10), we forgot to adjust this README when removing the common-cmds.h file. Signed-off-by: Johannes Schindelin Johannes Schindelin (1): vcbuild/README: update to accommodate for missing common-cmds.h compat/vcbuild/README | 4 ++-- 1 file

[PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-13 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin While it is true that we never add unreachable commits into pack files intentionally (as `git repack`'s documentation states), we must not forget that a `git fetch --prune` (or even a `git fetch` when a ref was force-pushed in the meantime) can make a commit unreachable

[PATCH 0/2] repack -ad: fix after `fetch --prune` in a shallow repository

2018-07-13 Thread Johannes Schindelin via GitGitGadget
Under certain circumstances, commits that were reachable can be made unreachable, e.g. via `git fetch --prune`. These commits might have been packed already, in which case `git repack -adlf` will just drop them without giving them the usual grace period before an eventual `git prune` (via `git

[PATCH 1/2] repack: point out a bug handling stale shallow info

2018-07-13 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin A `git fetch --prune` can turn previously-reachable objects unreachable, even commits that are in the `shallow` list. A subsequent `git repack -ad` will then unceremoniously drop those unreachable commits, and the `shallow` list will become stale. This means that when

[PATCH 2/3] rebase --rebase-merges: add support for octopus merges

2018-07-11 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Previously, we introduced the `merge` command for use in todo lists, to allow to recreate and modify branch topology. For ease of implementation, and to make review easier, the initial implementation only supported merge commits with exactly two parents. This patch

[PATCH 0/3] rebase -r: support octopus merges

2018-07-11 Thread Johannes Schindelin via GitGitGadget
The `--rebase-merges` option of `git rebase` generates todo lists that include the merge commits that are to be rebased. To keep things simpler to review, I decided to support only regular, 2-parent merge commits first. With this patch series, support is extended to cover also octopus merges.

[PATCH 1/3] merge: allow reading the merge commit message from a file

2018-07-11 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This is consistent with `git commit` which, like `git merge`, supports passing the commit message via `-m ` and, unlike `git merge` before this patch, via `-F `. It is useful to allow this for scripted use, or for the upcoming patch to allow (re-)creating octopus

[PATCH 3/3] rebase --rebase-merges: adjust man page for octopus support

2018-07-11 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Now that we support octopus merges in the `--rebase-merges` mode, we should give users who actually read the manuals a chance to know about this fact. Signed-off-by: Johannes Schindelin --- Documentation/git-rebase.txt | 7 --- 1 file changed, 4 insertions(+), 3

[PATCH v3 02/20] Introduce `range-diff` to compare iterations of a topic branch

2018-07-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This command does not do a whole lot so far, apart from showing a usage that is oddly similar to that of `git tbdiff`. And for a good reason: the next commits will turn `range-branch` into a full-blown replacement for `tbdiff`. At this point, we ignore tbdiff's color

[PATCH v3 03/20] range-diff: first rudimentary implementation

2018-07-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin At this stage, `git range-diff` can determine corresponding commits of two related commit ranges. This makes use of the recently introduced implementation of the Hungarian algorithm. The core of this patch is a straight port of the ideas of tbdiff, the apparently

[PATCH v3 15/20] range-diff: offer to dual-color the diffs

2018-07-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When showing what changed between old and new commits, we show a diff of the patches. This diff is a diff between diffs, therefore there are nested +/- signs, and it can be relatively hard to understand what is going on. With the --dual-color option, the preimage and

[PATCH v3 14/20] diff: add an internal option to dual-color diffs of diffs

2018-07-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin When diffing diffs, it can be quite daunting to figure out what the heck is going on, as there are nested +/- signs. Let's make this easier by adding a flag in diff_options that allows color-coding the outer diff sign with inverted colors, so that the preimage and

<    1   2   3   4   >