[PATCH v2 4/6] builtin/submodule--helper: store update_clone information in a struct

2018-07-16 Thread Stefan Beller
The information that is printed for update_submodules in 'submodule--helper update-clone' and consumed by 'git submodule update' is stored as a string per submodule. This made sense at the time of 48308681b07 (git submodule update: have a dedicated helper for cloning, 2016-02-29), but as we want

[PATCH v2 2/6] git-submodule.sh: rename unused variables

2018-07-16 Thread Stefan Beller
The 'mode' variable is not used in cmd_update for its original purpose, rename it to 'dummy' as it only serves the purpose to abort quickly documenting this knowledge. The variable 'stage' is also not used any more in cmd_update, so remove it. This went unnoticed as first each function used the

[PATCH v2 5/6] builtin/submodule--helper: factor out method to update a single submodule

2018-07-16 Thread Stefan Beller
In a later patch we'll find this method handy. Signed-off-by: Stefan Beller --- builtin/submodule--helper.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index fb54936efc7..034ba1bb2e0 100644

[PATCH v2 1/6] git-submodule.sh: align error reporting for update mode to use path

2018-07-16 Thread Stefan Beller
All other error messages in cmd_update are reporting the submodule based on its path, so let's do that for invalid update modes, too. Signed-off-by: Stefan Beller --- git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index

Re: [PATCH 13/16] test-reach: test can_all_from_reach_with_flags

2018-07-16 Thread Jonathan Tan
The subject should be can_all_from_reach_with_flag (without the "s" at the end). Likewise in the commit message. > To make this method testable, add a new can_all_from_reach method that > does the initial setup and final tear-down. Call the method from > 'test-tool reach'. This description leads

Re: [PATCH v3 1/7] gpg-interface: add new config to select how to sign a commit

2018-07-16 Thread Jeff King
On Tue, Jul 17, 2018 at 12:03:11AM +, brian m. carlson wrote: > > +gpg.format:: > > + Specifies which key format to use when signing with `--gpg-sign`. > > + Default is "openpgp", that is also the only supported value. > > I think, as discussed in the other thread, perhaps a different

Re: [PATCH 15/16] commit-reach: make can_all_from_reach... linear

2018-07-16 Thread Jonathan Tan
> The first step includes using a depth-first-search (DFS) from each from > commit, sorted by ascending generation number. We do not walk beyond the > minimum generation number or the minimum commit date. This DFS is likely > to be faster than the existing reachable() method because we expect >

Re: [PATCH] gc: do not warn about too many loose objects

2018-07-16 Thread Jonathan Nieder
Hi, Jeff King wrote: > On Mon, Jul 16, 2018 at 03:56:39PM -0700, Jonathan Nieder wrote: >> The calling command in the motivating example is Android's "repo" tool: >> >> bare_git.gc('--auto') >> >> from https://gerrit-review.googlesource.com/c/git-repo/+/10598/. I >> think it's

Re: [PATCH 00/16] Consolidate reachability logic

2018-07-16 Thread Jeff King
On Mon, Jul 16, 2018 at 02:54:38PM +0100, Ramsay Jones wrote: > On 16/07/18 14:00, Derrick Stolee via GitGitGadget wrote: > > There are many places in Git that use a commit walk to determine > > reachability between commits and/or refs. A lot of this logic is > > duplicated. > [snip] ... > >

[PATCH] gc: do not warn about too many loose objects

2018-07-16 Thread Jonathan Tan
In a087cc9819 ("git-gc --auto: protect ourselves from accumulated cruft", 2007-09-17), the user was warned if there were too many unreachable loose objects. This made sense at the time, because gc couldn't prune them safely. But subsequently, git prune learned the ability to not prune recently

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

2018-07-16 Thread Junio C Hamano
Johannes Sixt writes: > Am 12.07.2018 um 18:26 schrieb Junio C Hamano: >> Johannes Schindelin writes: >>> A much more meaningful measure would be: how many octopus merge commits >>> have been pushed to GitHub in the past two weeks. I don't think I have the >>> technical means to answer that

Re: [PATCH 00/16] Consolidate reachability logic

2018-07-16 Thread Eric Sunshine
On Mon, Jul 16, 2018 at 1:27 PM Stefan Beller wrote: > Another pain point of the Gadget is that CC's in the cover letter > do not work as I would imagine. The line > > CC: sbel...@google.com > > did not put that email into the cc field. gitgitgadget recognizes case-sensitive "Cc:" only[1]. [1]:

Re: [PATCH 11/25] t7400: fix broken "submodule add/reconfigure --force" test

2018-07-16 Thread Eric Sunshine
On Mon, Jul 16, 2018 at 11:51 AM Johannes Schindelin wrote: > On Mon, 16 Jul 2018, Johannes Schindelin wrote: > > > - git submodule add --force bogus-url submod && > > > + git submodule add --force /bogus-url submod && > > > > This breaks on Windows because of the absolute

Re: [PATCH v3] sequencer: use configured comment character

2018-07-16 Thread Daniel Harding
Hi Johannes, On Mon, 16 Jul 2018 at 18:59:03 +0300, Johannes Schindelin wrote: Hi Aaron, On Mon, 16 Jul 2018, Aaron Schrab wrote: Looking into that a bit further, it does seem like my explanation above was incorrect. Here's another attempt to explain why setting core.commentChar=auto isn't

Re: [PATCH 03/16] commit-reach: move commit_contains from ref-filter

2018-07-16 Thread Stefan Beller
On Mon, Jul 16, 2018 at 6:00 AM Derrick Stolee via GitGitGadget wrote: > + > +int commit_contains(struct ref_filter *filter, struct commit *commit, > + struct commit_list *list, struct contains_cache *cache) [...] > - > -static int commit_contains(struct ref_filter *filter,

[PATCH 01/16] commit-reach: move walk methods from commit.c

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee Signed-off-by: Derrick Stolee --- Makefile | 1 + commit-reach.c | 359 + commit-reach.h | 41 ++ commit.c | 358 4 files changed, 401 insertions(+), 358

[PATCH 00/16] Consolidate reachability logic

2018-07-16 Thread Derrick Stolee via GitGitGadget
There are many places in Git that use a commit walk to determine reachability between commits and/or refs. A lot of this logic is duplicated. I wanted to achieve the following: 1. Consolidate several different commit walks into one file 2. Reduce duplicate reachability logic 3. Increase

[PATCH 02/16] commit-reach: move ref_newer from remote.c

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee Signed-off-by: Derrick Stolee --- builtin/remote.c | 1 + commit-reach.c | 54 commit-reach.h | 2 ++ http-push.c | 1 + remote.c | 50 +--- remote.h | 1 -

[PATCH 15/16] commit-reach: make can_all_from_reach... linear

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee The can_all_from_reach_with_flags() algorithm is currently quadratic in the worst case, because it calls the reachable() method for every 'from' without tracking which commits have already been walked or which can already reach a commit in 'to'. Rewrite the algorithm to

[PATCH 11/16] test-reach: test get_merge_bases_many

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee The get_merge_bases_many method returns a list of merge bases for a single commit (A) against a list of commits (X). Some care is needed in constructing the expected behavior because the result is not the expected merge-base for an octopus merge with those parents but

[PATCH 12/16] test-reach: test reduce_heads

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee Signed-off-by: Derrick Stolee --- t/helper/test-reach.c | 7 +++ t/t6600-test-reach.sh | 22 ++ 2 files changed, 29 insertions(+) diff --git a/t/helper/test-reach.c b/t/helper/test-reach.c index 97c726040..73cb55208 100644 ---

[PATCH 14/16] commit-reach: replace ref_newer logic

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee The ref_newer method is used by 'git push' to check if a force-push is required. This method does not use any kind of cutoff when walking, so in the case of a force-push will walk all reachable commits. The is_descendant_of method already uses paint_down_to_common along

[PATCH 08/16] test-reach: create new test tool for ref_newer

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee As we prepare to change the behavior of the algorithms in commit-reach.c, create a new test-tool subcommand 'reach' to test these methods on interesting commit-graph shapes. To use the new test-tool, use 'test-tool reach ' and provide input to stdin that describes the

[PATCH 13/16] test-reach: test can_all_from_reach_with_flags

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee The can_all_from_reach_with_flags method is used by ok_to_give_up in upload-pack.c to see if we have done enough negotiation during a fetch. This method is intentionally created to preserve state between calls to assist with stateful negotiation, such as over SSH. To make

[PATCH 10/16] test-reach: test is_descendant_of

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee The is_descendant_of method takes a single commit as its first parameter and a list of commits as its second parameter. Extend the input of the 'test-tool reach' command to take multiple lines of the form "X:" to construct a list of commits. Pass these to is_descendant_of

[PATCH 03/16] commit-reach: move commit_contains from ref-filter

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee Signed-off-by: Derrick Stolee --- commit-reach.c | 120 commit-reach.h | 18 +- fast-import.c | 1 + ref-filter.c | 147 +++-- 4 files changed, 146 insertions(+), 140

[PATCH 05/16] upload-pack: refactor ok_to_give_up()

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee In anticipation of consolidating all commit reachability algorithms, refactor ok_to_give_up() in order to allow splitting its logic into an external method. Signed-off-by: Derrick Stolee --- upload-pack.c | 33 ++--- 1 file changed, 22

[PATCH 04/16] upload-pack: make reachable() more generic

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee In anticipation of moving the reachable() method to commit-reach.c, modify the prototype to be more generic to flags known outside of upload-pack.c. Also rename 'want' to 'from' to make the statement more clear outside of the context of haves/wants negotiation.

[PATCH 16/16] commit-reach: use can_all_from_reach

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee The is_descendant_of method previously used in_merge_bases() to check if the commit can reach any of the commits in the provided list. This had two performance problems: 1. The performance is quadratic in worst-case. 2. A single in_merge_bases() call requires walking

[PATCH 07/16] commit-reach: move can_all_from_reach_with_flags

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee Signed-off-by: Derrick Stolee --- commit-reach.c | 62 + commit-reach.h | 13 ++ upload-pack.c | 69 +- 3 files changed, 76 insertions(+), 68 deletions(-) diff --git

[PATCH 09/16] test-reach: test in_merge_bases

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee Signed-off-by: Derrick Stolee --- t/helper/test-reach.c | 6 ++ t/t6600-test-reach.sh | 18 ++ 2 files changed, 24 insertions(+) diff --git a/t/helper/test-reach.c b/t/helper/test-reach.c index 8cc570f3b..29104d41a 100644 --- a/t/helper/test-reach.c

[PATCH 06/16] upload-pack: generalize commit date cutoff

2018-07-16 Thread Derrick Stolee via GitGitGadget
From: Derrick Stolee The ok_to_give_up() method uses the commit date as a cutoff to avoid walking the entire reachble set of commits. Before moving the reachable() method to commit-reach.c, pull out the dependence on the global constant 'oldest_have' with a 'min_commit_date' parameter.

Re: [PATCH v1 00/25] RFC: structured logging

2018-07-16 Thread Jeff Hostetler
On 7/13/2018 2:51 PM, David Lang wrote: Please make an option for git to write these logs to syslog, not just a local file. Every modern syslog daemon has lots of tools to be able to deal with json messages well. David Lang That is certainly possible and we can easily add it in a later

Re: [PATCH 00/16] Consolidate reachability logic

2018-07-16 Thread Ramsay Jones
On 16/07/18 14:00, Derrick Stolee via GitGitGadget wrote: > There are many places in Git that use a commit walk to determine > reachability between commits and/or refs. A lot of this logic is > duplicated. [snip] ... This is not your problem, but I find these GitGitGadget submissions somewhat

Re: [PATCH] Add shell completion for git remote rm

2018-07-16 Thread Keith Smiley
Since there hasn't been any movement on the alternative solutions mentioned here, would it be reasonable to accept this patch in the meantime? -- Keith Smiley > On Jan 17, 2018, at 01:48, Duy Nguyen wrote: > >> On Wed, Jan 17, 2018 at 1:17 PM, Kevin Daudt wrote: >>> On Wed, Jan 17, 2018 at

Re: [PATCH 11/25] t7400: fix broken "submodule add/reconfigure --force" test

2018-07-16 Thread Johannes Schindelin
Hi Eric, On Sun, 1 Jul 2018, Eric Sunshine wrote: > This test has been dysfunctional since it was added by 619acfc78c > (submodule add: extend force flag to add existing repos, 2016-10-06), > however, two problems early in the test went unnoticed due to a broken > &&-chain later in the test. >

Re: [PATCH v2 00/16] object_id part 14

2018-07-16 Thread Derrick Stolee
On 7/15/2018 9:27 PM, brian m. carlson wrote: This is the fourteenth series of patches to switch to using struct object_id and the_hash_algo. This series converts several core pieces to use struct object_id, including the oid* and hex functions. All of these patches have been tested with both

Re: [PATCH v2 00/16] object_id part 14

2018-07-16 Thread Taylor Blau
On Mon, Jul 16, 2018 at 01:27:52AM +, brian m. carlson wrote: > This is the fourteenth series of patches to switch to using struct > object_id and the_hash_algo. This series converts several core pieces > to use struct object_id, including the oid* and hex functions. > > All of these patches

Re: [PATCH 11/25] t7400: fix broken "submodule add/reconfigure --force" test

2018-07-16 Thread Johannes Schindelin
Hi Eric, On Mon, 16 Jul 2018, Johannes Schindelin wrote: > On Sun, 1 Jul 2018, Eric Sunshine wrote: > > > This test has been dysfunctional since it was added by 619acfc78c > > (submodule add: extend force flag to add existing repos, 2016-10-06), > > however, two problems early in the test went

<    1   2