Re: [PATCH v3] checkout: optimize "git checkout -b "

2018-08-30 Thread Elijah Newren
Hi Duy, On Tue, Aug 21, 2018 at 7:52 AM Duy Nguyen wrote: > > On Mon, Aug 20, 2018 at 8:16 PM Elijah Newren wrote: > > Playing with sparse-checkout, it feels to me like a half-baked > > feature. It seems like it required too much manual work, and it was > > sometim

Re: [PATCH 1/1] delete multiple tags in a single transaction

2019-08-08 Thread Elijah Newren
On Wed, Aug 7, 2019 at 9:11 PM Phil Hord wrote: > > From: Phil Hord > > 'git tag -d' accepts one or more tag refs to delete, but each deletion > is done by calling `delete_ref` on each argv. This is painfully slow > when removing from packed refs. Use delete_refs instead so all the > removals can

Re: [PATCH v3 5/5] repo-settings: create feature.experimental setting

2019-08-08 Thread Elijah Newren
Sorry for the late reply... On Tue, Jul 30, 2019 at 3:49 PM Derrick Stolee via GitGitGadget wrote: > > --- a/Documentation/config/merge.txt > +++ b/Documentation/config/merge.txt > @@ -54,7 +54,8 @@ merge.directoryRenames:: > moved into the new directory. If set to "conflict", a conflict

Re: [PATCH v3 5/5] repo-settings: create feature.experimental setting

2019-08-08 Thread Elijah Newren
On Thu, Aug 8, 2019 at 12:00 PM Junio C Hamano wrote: > > Elijah Newren writes: > > >> --- a/Documentation/config/merge.txt > >> +++ b/Documentation/config/merge.txt > >> @@ -54,7 +54,8 @@ merge.directoryRenames:: > >> moved into the new

Re: [PATCH v3 5/5] repo-settings: create feature.experimental setting

2019-08-08 Thread Elijah Newren
On Thu, Aug 8, 2019 at 12:12 PM Derrick Stolee wrote: > > On 8/8/2019 2:59 PM, Junio C Hamano wrote: > > Elijah Newren writes: > > > >>> --- a/Documentation/config/merge.txt > >>> +++ b/Documentation/config/merge.txt > >>> @@ -54,7 +54,8 @@

[PATCH] git-fast-import.txt: clarify that multiple merge commits are allowed

2019-08-12 Thread Elijah Newren
nlimited number of `merge` commands per commit are permitted by fast-import". Fix the grammar to match the intent and implementation. Reported-by: Joachim Klein Signed-off-by: Elijah Newren --- Documentation/git-fast-import.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v3 01/24] merge-recursive: be consistent with assert

2019-08-15 Thread Elijah Newren
lines also read o->path, so it should be included in the assert. Signed-off-by: Elijah Newren --- merge-recursive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/merge-recursive.c b/merge-recursive.c index 6b812d67e3..1d960fa64b 100644 --- a/merge-recursive.c +++ b/m

[PATCH v3 00/24] Clean up merge API

2019-08-15 Thread Elijah Newren
s now patch 4, so it was mostly reviewed before but it now ties in nicely with patch 2. Derrick Stolee (1): merge-recursive: introduce an enum for detect_directory_renames values Elijah Newren (23): merge-recursive: be consistent with assert checkout: provide better conflict hunk descri

[PATCH v3 04/24] merge-recursive: provide a better label for diff3 common ancestor

2019-08-15 Thread Elijah Newren
a non-NULL opt->ancestor, merge_recursive() expects to set this value itself. Signed-off-by: Elijah Newren --- merge-recursive.c | 21 +++- t/t6036-recursive-corner-cases.sh | 8 +- t/t6047-diff3-conflict-markers.sh | 189 ++ 3 files changed, 214

[PATCH v3 07/24] merge-recursive: remove another implicit dependency on the_repository

2019-08-15 Thread Elijah Newren
nvert calls to get_commit_tree() to instead use repo_get_commit_tree() to get rid of another. Signed-off-by: Elijah Newren --- merge-recursive.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/merge-recursive.c b/merge-recursive.c index eae3e4fbcc..fb668fc84c 100644 --- a

[PATCH v3 02/24] checkout: provide better conflict hunk description with detached HEAD

2019-08-15 Thread Elijah Newren
ULL. A subsequent commit will prevent similar problems by enforcing that merge_trees() always be called with opt->ancestor != NULL.) Signed-off-by: Elijah Newren --- builtin/checkout.c | 8 1 file changed, 8 insertions(+) diff --git a/builtin/checkout.c b/builtin/checkout.c

[PATCH v3 03/24] merge-recursive: enforce opt->ancestor != NULL when calling merge_trees()

2019-08-15 Thread Elijah Newren
kers); add an assertion to prevent future codepaths from also overlooking this requirement. Enforcing this requirement also allows us to simplify the code for labelling the conflict hunks by no longer checking if the ancestor label is NULL. Signed-off-by: Elijah Newren --- merge-rec

[PATCH v3 06/24] merge-recursive: future-proof update_file_flags() against memory leaks

2019-08-15 Thread Elijah Newren
cations or deallocations, then all error paths correctly deallocate resources. Signed-off-by: Elijah Newren --- merge-recursive.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/merge-recursive.c b/merge-recursive.c index dd2ee5edee..eae3e4fbcc 100644 --- a/merge-recursi

[PATCH v3 05/24] merge-recursive: introduce an enum for detect_directory_renames values

2019-08-15 Thread Elijah Newren
From: Derrick Stolee Improve code readability by introducing an enum to replace the not-quite-boolean values taken on by detect_directory_renames. Signed-off-by: Derrick Stolee Signed-off-by: Elijah Newren --- builtin/am.c | 2 +- merge-recursive.c | 24 +++- merge

[PATCH v3 16/24] merge-recursive: rename merge_options argument to opt in header

2019-08-15 Thread Elijah Newren
In commit 259ccb6cc324 ("merge-recursive: rename merge_options argument from 'o' to 'opt'", 2019-04-05), I renamed a bunch of function arguments in merge-recursive.c, but forgot to make that same change to merge-recursive.h. Make the two match. Signed-off

[PATCH v3 12/24] cache-tree: share code between functions writing an index as a tree

2019-08-15 Thread Elijah Newren
current in-memory index. So: * split out common code into write_index_as_tree_internal() * rename write_tree_from_memory() to write_inmemory_index_as_tree(), make it call write_index_as_tree_internal(), and move it to cache-tree.c Signed-off-by: Elijah Newren --- builtin/checkout.c

[PATCH v3 08/24] Ensure index matches head before invoking merge machinery, round N

2019-08-15 Thread Elijah Newren
he index and make sure that the test fails in the expected way (meaning it reports a rename/rename conflict). This makes sure that all callers actually make the index match head. The next commit will then enforce the condition that index matches head earlier so this problem doesn't return i

[PATCH v3 09/24] merge-recursive: exit early if index != head

2019-08-15 Thread Elijah Newren
o mask bugs in other callers (which were fixed in the commit prior to this one). Make sure we do the index == head check at the beginning of the merge, and error out immediately if it fails. While we're at it, fix a small leak in the show-the-error codepath. Signed-off-by: Elijah New

[PATCH v3 20/24] merge-recursive: avoid losing output and leaking memory holding that output

2019-08-15 Thread Elijah Newren
handle showing any output in opt->obuf and for free'ing it. This requirement might be easy to overlook, so add a comment to merge-recursive.h pointing it out. (There are currently two callers that set buffer_output to 2, both in sequencer.c, and both of which handle this correctly.) S

[PATCH v3 23/24] merge-recursive: add sanity checks for relevant merge_options

2019-08-15 Thread Elijah Newren
values. Signed-off-by: Elijah Newren --- merge-recursive.c | 23 +++ merge-recursive.h | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/merge-recursive.c b/merge-recursive.c index 647b1f25c3..bc0da608c4 100644 --- a/merge-recursive.c +++ b/merge-recur

[PATCH v3 21/24] merge-recursive: split internal fields into a separate struct

2019-08-15 Thread Elijah Newren
merge_options has several internal fields that should not be set or read by external callers. This just complicates the API. Move them into an opaque merge_options_internal struct that is defined only in merge-recursive.c and keep these out of merge-recursive.h. Signed-off-by: Elijah Newren

[PATCH v3 10/24] merge-recursive: remove useless parameter in merge_trees()

2019-08-15 Thread Elijah Newren
ing how the output of merge_trees() and merge_recursive() differ. Signed-off-by: Elijah Newren --- builtin/checkout.c | 4 +--- merge-recursive.c | 6 +++--- merge-recursive.h | 20 sequencer.c| 4 ++-- 4 files changed, 22 insertions(+), 12 deletions(-) diff --

[PATCH v3 17/24] merge-recursive: move some definitions around to clean up the header

2019-08-15 Thread Elijah Newren
-off-by: Elijah Newren --- merge-recursive.c | 31 + merge-recursive.h | 87 +++ 2 files changed, 73 insertions(+), 45 deletions(-) diff --git a/merge-recursive.c b/merge-recursive.c index bffb5eac7d..e401114b8f 100644 --- a/merge

[PATCH v3 15/24] merge-recursive: rename 'mrtree' to 'result_tree', for clarity

2019-08-15 Thread Elijah Newren
It is not at all clear what 'mr' was supposed to stand for, at least not to me. Pick a clearer name for this variable. Signed-off-by: Elijah Newren --- merge-recursive.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/merge-recursive.c b/merge-recursi

[PATCH v3 14/24] merge-recursive: use common name for ancestors/common/base_list

2019-08-15 Thread Elijah Newren
o it four different ways instead of only three by using a different name in the signature for the .c file than the .h file. Change all of these to 'merge_base' or 'merge_bases'. Signed-off-by: Elijah Newren --- merge-recursive.c | 72 --

[PATCH v3 13/24] merge-recursive: fix some overly long lines

2019-08-15 Thread Elijah Newren
No substantive code change, just add some line breaks to fix lines that have grown in length due to various refactorings. Most remaining lines of excessive length in merge-recursive include error messages and it's not clear that splitting those improves things. Signed-off-by: Elijah N

[PATCH v3 19/24] merge-recursive: comment and reorder the merge_options fields

2019-08-15 Thread Elijah Newren
them to find the options they need. Signed-off-by: Elijah Newren --- merge-recursive.c | 16 +++- merge-recursive.h | 40 ++-- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/merge-recursive.c b/merge-recursive.c index b846acf931

[PATCH v3 11/24] merge-recursive: don't force external callers to do our logging

2019-08-15 Thread Elijah Newren
tent merge in a renamed file). Signed-off-by: Elijah Newren --- merge-recursive.c | 7 +++ sequencer.c | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/merge-recursive.c b/merge-recursive.c index 89e9a7518c..6cee867d37 100644 --- a/merge-recursive.c +++ b/me

[PATCH v3 24/24] merge-recursive: alphabetize include list

2019-08-15 Thread Elijah Newren
Other than cache.h which needs to appear first, and merge-recursive.h which I want to be second so that we are more likely to notice if merge-recursive.h has any missing includes, the rest of the list is long and easier to look through if it's alphabetical. Signed-off-by: Elijah N

[PATCH v3 22/24] merge-recursive: rename MERGE_RECURSIVE_* to MERGE_VARIANT_*

2019-08-15 Thread Elijah Newren
I want to implement the same outward facing API as found within merge-recursive.h in a different merge strategy. However, that makes names like MERGE_RECURSIVE_{NORMAL,OURS,THEIRS} look a little funny; rename to MERGE_VARIANT_{NORMAL,OURS,THEIRS}. Signed-off-by: Elijah Newren --- merge

[PATCH v3 18/24] merge-recursive: consolidate unnecessary fields in merge_options

2019-08-15 Thread Elijah Newren
for combining the pairs of options into a single value; make it apply at time-of-config-loading instead of each-time-of-use. Signed-off-by: Elijah Newren --- merge-recursive.c | 27 +++ merge-recursive.h | 6 ++ 2 files changed, 13 insertions(+), 20 deletions(-) diff

BUG?: xdl_merge surprisingly does not recognize content conflict

2019-08-15 Thread Elijah Newren
;checkout.txt: note about losing staged changes with --merge", 2019-03-19) from nd/checkout-m-doc-update and commit 6eff409e8a76 ("checkout: prevent losing staged changes with --merge", 2019-03-22) from nd/checkout-m were included in git.git despite the fact that the latter was me

Re: BUG?: xdl_merge surprisingly does not recognize content conflict

2019-08-15 Thread Elijah Newren
On Thu, Aug 15, 2019 at 3:03 PM Elijah Newren wrote: > > It appears git.git had a case of a patch being resubmitted and both the > original (nd/checkout-m-doc-update) and new (nd/checkout-m) versions > getting applied, with the merge picking to include both versions of some > of

Re: BUG?: xdl_merge surprisingly does not recognize content conflict

2019-08-16 Thread Elijah Newren
On Fri, Aug 16, 2019 at 9:51 AM Junio C Hamano wrote: > > Elijah Newren writes: > > > Now, a manual merge of these files gives no conflicts, which surprises me: > > > > $ git merge-file ours base theirs; echo $? > > 0 > > Indeed that is surprisin

Re: [PATCH v3 23/24] merge-recursive: add sanity checks for relevant merge_options

2019-08-16 Thread Elijah Newren
On Fri, Aug 16, 2019 at 12:52 PM Junio C Hamano wrote: > > Elijah Newren writes: > > > There are lots of options that callers can set, yet most have a limited > > range of valid values, some options are meant for output (e.g. > > opt->obuf, which is expected to

Re: [PATCH v3 23/24] merge-recursive: add sanity checks for relevant merge_options

2019-08-16 Thread Elijah Newren
On Fri, Aug 16, 2019 at 12:59 PM Junio C Hamano wrote: > > > diff --git a/merge-recursive.c b/merge-recursive.c > > index 647b1f25c3..bc0da608c4 100644 > > --- a/merge-recursive.c > > +++ b/merge-recursive.c > > @@ -3620,6 +3620,29 @@ static int merge_start(struct merge_options *opt, > > struct t

Re: [PATCH v3 04/24] merge-recursive: provide a better label for diff3 common ancestor

2019-08-16 Thread Elijah Newren
On Fri, Aug 16, 2019 at 2:33 PM Junio C Hamano wrote: > > Elijah Newren writes: > > > @@ -3507,6 +3507,11 @@ int merge_recursive(struct merge_options *opt, > > struct commit *merged_common_ancestors; > > struct tree *mrtree; > > int cle

Re: [PATCH v3 12/24] cache-tree: share code between functions writing an index as a tree

2019-08-16 Thread Elijah Newren
On Fri, Aug 16, 2019 at 3:01 PM Junio C Hamano wrote: > > Elijah Newren writes: > > > write_tree_from_memory() appeared to be a merge-recursive special that > > basically duplicated write_index_as_tree(). The two have a different > > signature, but the bigg

Re: [PATCH v3 18/24] merge-recursive: consolidate unnecessary fields in merge_options

2019-08-16 Thread Elijah Newren
On Fri, Aug 16, 2019 at 3:14 PM Junio C Hamano wrote: > > Elijah Newren writes: > > > static inline int merge_detect_rename(struct merge_options *opt) > > { > > - return opt->merge_detect_rename >= 0 ? opt->merge_detect_rename : > > -

Re: [PATCH v3 21/24] merge-recursive: split internal fields into a separate struct

2019-08-16 Thread Elijah Newren
On Fri, Aug 16, 2019 at 2:19 PM SZEDER Gábor wrote: > > On Thu, Aug 15, 2019 at 02:40:50PM -0700, Elijah Newren wrote: > > diff --git a/merge-recursive.c b/merge-recursive.c > > > static void merge_finalize(struct merge_options *opt) > > { > > flus

[PATCH v4 10/24] merge-recursive: remove useless parameter in merge_trees()

2019-08-17 Thread Elijah Newren
ing how the output of merge_trees() and merge_recursive() differ. Signed-off-by: Elijah Newren --- builtin/checkout.c | 4 +--- merge-recursive.c | 6 +++--- merge-recursive.h | 20 sequencer.c| 4 ++-- 4 files changed, 22 insertions(+), 12 deletions(-) diff --

[PATCH v4 08/24] Ensure index matches head before invoking merge machinery, round N

2019-08-17 Thread Elijah Newren
he index and make sure that the test fails in the expected way (meaning it reports a rename/rename conflict). This makes sure that all callers actually make the index match head. The next commit will then enforce the condition that index matches head earlier so this problem doesn't return i

[PATCH v4 07/24] merge-recursive: remove another implicit dependency on the_repository

2019-08-17 Thread Elijah Newren
nvert calls to get_commit_tree() to instead use repo_get_commit_tree() to get rid of another. Signed-off-by: Elijah Newren --- merge-recursive.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/merge-recursive.c b/merge-recursive.c index 1d4df952e5..88a33e6e72 100644 --- a

[PATCH v4 11/24] merge-recursive: don't force external callers to do our logging

2019-08-17 Thread Elijah Newren
tent merge in a renamed file). Signed-off-by: Elijah Newren --- merge-recursive.c | 7 +++ sequencer.c | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/merge-recursive.c b/merge-recursive.c index 4ce783dbfa..fda67dd371 100644 --- a/merge-recursive.c +++ b/me

[PATCH v4 02/24] checkout: provide better conflict hunk description with detached HEAD

2019-08-17 Thread Elijah Newren
ULL. A subsequent commit will prevent similar problems by enforcing that merge_trees() always be called with opt->ancestor != NULL.) Signed-off-by: Elijah Newren --- builtin/checkout.c | 8 1 file changed, 8 insertions(+) diff --git a/builtin/checkout.c b/builtin/checkout.c

[PATCH v4 06/24] merge-recursive: future-proof update_file_flags() against memory leaks

2019-08-17 Thread Elijah Newren
cations or deallocations, then all error paths correctly deallocate resources. Signed-off-by: Elijah Newren --- merge-recursive.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/merge-recursive.c b/merge-recursive.c index 9622781612..1d4df952e5 100644 --- a/merge-recursi

[PATCH v4 14/24] merge-recursive: use common name for ancestors/common/base_list

2019-08-17 Thread Elijah Newren
o it four different ways instead of only three by using a different name in the signature for the .c file than the .h file. Change all of these to 'merge_base' or 'merge_bases'. Signed-off-by: Elijah Newren --- merge-recursive.c | 72 --

[PATCH v4 03/24] merge-recursive: enforce opt->ancestor != NULL when calling merge_trees()

2019-08-17 Thread Elijah Newren
kers); add an assertion to prevent future codepaths from also overlooking this requirement. Enforcing this requirement also allows us to simplify the code for labelling the conflict hunks by no longer checking if the ancestor label is NULL. Signed-off-by: Elijah Newren --- merge-rec

[PATCH v4 17/24] merge-recursive: move some definitions around to clean up the header

2019-08-17 Thread Elijah Newren
-off-by: Elijah Newren --- merge-recursive.c | 31 + merge-recursive.h | 87 +++ 2 files changed, 73 insertions(+), 45 deletions(-) diff --git a/merge-recursive.c b/merge-recursive.c index 1823a87706..9807b24c65 100644 --- a/merge

[PATCH v4 01/24] merge-recursive: be consistent with assert

2019-08-17 Thread Elijah Newren
lines also read o->path, so it should be included in the assert. Signed-off-by: Elijah Newren --- merge-recursive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/merge-recursive.c b/merge-recursive.c index 6b812d67e3..1d960fa64b 100644 --- a/merge-recursive.c +++ b/m

[PATCH v4 05/24] merge-recursive: introduce an enum for detect_directory_renames values

2019-08-17 Thread Elijah Newren
From: Derrick Stolee Improve code readability by introducing an enum to replace the not-quite-boolean values taken on by detect_directory_renames. Signed-off-by: Derrick Stolee Signed-off-by: Elijah Newren --- builtin/am.c | 2 +- merge-recursive.c | 24 +++- merge

[PATCH v4 00/24] Clean up merge API

2019-08-17 Thread Elijah Newren
r detect_directory_renames values Elijah Newren (23): merge-recursive: be consistent with assert checkout: provide better conflict hunk description with detached HEAD merge-recursive: enforce opt->ancestor != NULL when calling merge_trees() merge-recursive: provide a better la

[PATCH v4 04/24] merge-recursive: provide a better label for diff3 common ancestor

2019-08-17 Thread Elijah Newren
a non-NULL opt->ancestor, merge_recursive() expects to set this value itself. Signed-off-by: Elijah Newren --- merge-recursive.c | 16 ++- t/t6036-recursive-corner-cases.sh | 8 +- t/t6047-diff3-conflict-markers.sh | 189 ++ 3 files changed, 209

[PATCH v4 18/24] merge-recursive: consolidate unnecessary fields in merge_options

2019-08-17 Thread Elijah Newren
for combining the pairs of options into a single value; make it apply at time-of-config-loading instead of each-time-of-use. Signed-off-by: Elijah Newren --- merge-recursive.c | 27 +++ merge-recursive.h | 6 ++ 2 files changed, 13 insertions(+), 20 deletions(-) diff

[PATCH v4 16/24] merge-recursive: rename merge_options argument to opt in header

2019-08-17 Thread Elijah Newren
In commit 259ccb6cc324 ("merge-recursive: rename merge_options argument from 'o' to 'opt'", 2019-04-05), I renamed a bunch of function arguments in merge-recursive.c, but forgot to make that same change to merge-recursive.h. Make the two match. Signed-off

[PATCH v4 21/24] merge-recursive: split internal fields into a separate struct

2019-08-17 Thread Elijah Newren
merge_options has several internal fields that should not be set or read by external callers. This just complicates the API. Move them into an opaque merge_options_internal struct that is defined only in merge-recursive.c and keep these out of merge-recursive.h. Signed-off-by: Elijah Newren

[PATCH v4 09/24] merge-recursive: exit early if index != head

2019-08-17 Thread Elijah Newren
o mask bugs in other callers (which were fixed in the commit prior to this one). Make sure we do the index == head check at the beginning of the merge, and error out immediately if it fails. While we're at it, fix a small leak in the show-the-error codepath. Signed-off-by: Elijah New

[PATCH v4 22/24] merge-recursive: rename MERGE_RECURSIVE_* to MERGE_VARIANT_*

2019-08-17 Thread Elijah Newren
I want to implement the same outward facing API as found within merge-recursive.h in a different merge strategy. However, that makes names like MERGE_RECURSIVE_{NORMAL,OURS,THEIRS} look a little funny; rename to MERGE_VARIANT_{NORMAL,OURS,THEIRS}. Signed-off-by: Elijah Newren --- merge

[PATCH v4 13/24] merge-recursive: fix some overly long lines

2019-08-17 Thread Elijah Newren
No substantive code change, just add some line breaks to fix lines that have grown in length due to various refactorings. Most remaining lines of excessive length in merge-recursive include error messages and it's not clear that splitting those improves things. Signed-off-by: Elijah N

[PATCH v4 19/24] merge-recursive: comment and reorder the merge_options fields

2019-08-17 Thread Elijah Newren
them to find the options they need. Signed-off-by: Elijah Newren --- merge-recursive.c | 16 +++- merge-recursive.h | 40 ++-- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/merge-recursive.c b/merge-recursive.c index 0f0b952c04

[PATCH v4 20/24] merge-recursive: avoid losing output and leaking memory holding that output

2019-08-17 Thread Elijah Newren
handle showing any output in opt->obuf and for free'ing it. This requirement might be easy to overlook, so add a comment to merge-recursive.h pointing it out. (There are currently two callers that set buffer_output to 2, both in sequencer.c, and both of which handle this correctly.) S

[PATCH v4 12/24] cache-tree: share code between functions writing an index as a tree

2019-08-17 Thread Elijah Newren
current in-memory index. So: * split out common code into write_index_as_tree_internal() * rename write_tree_from_memory() to write_inmemory_index_as_tree(), make it call write_index_as_tree_internal(), and move it to cache-tree.c Signed-off-by: Elijah Newren --- builtin/checkout.c

[PATCH v4 15/24] merge-recursive: rename 'mrtree' to 'result_tree', for clarity

2019-08-17 Thread Elijah Newren
It is not at all clear what 'mr' was supposed to stand for, at least not to me. Pick a clearer name for this variable. Signed-off-by: Elijah Newren --- merge-recursive.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/merge-recursive.c b/merge-recursi

[PATCH v4 24/24] merge-recursive: alphabetize include list

2019-08-17 Thread Elijah Newren
Other than cache.h which needs to appear first, and merge-recursive.h which I want to be second so that we are more likely to notice if merge-recursive.h has any missing includes, the rest of the list is long and easier to look through if it's alphabetical. Signed-off-by: Elijah N

[PATCH v4 23/24] merge-recursive: add sanity checks for relevant merge_options

2019-08-17 Thread Elijah Newren
values. Signed-off-by: Elijah Newren --- merge-recursive.c | 24 1 file changed, 24 insertions(+) diff --git a/merge-recursive.c b/merge-recursive.c index fa3f8eb0b2..0231d7b049 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -3615,6 +3615,30 @@ static int merge

Re: [PATCH 0/9] [RFC] New sparse-checkout builtin and "cone" mode

2019-08-21 Thread Elijah Newren
On Tue, Aug 20, 2019 at 8:12 AM Derrick Stolee via GitGitGadget wrote: > > This RFC includes a potential direction to make the sparse-checkout more > user-friendly. While there, I also present a way to use a limited set of > patterns to gain a significant performance boost in very large repositori

Re: [PATCH 2/2] DEPRECATION: warn about 'git checkout -b'

2019-08-21 Thread Elijah Newren
On Wed, Aug 21, 2019 at 12:21 PM Derrick Stolee via GitGitGadget wrote: > > From: Derrick Stolee > > Recommend that users use 'git switch -c' instead. > > Signed-off-by: Derrick Stolee > --- > builtin/.checkout.c.swp | Bin 77824 -> 0 bytes > builtin/checkout.c | 9 - > 2 files c

Re: [PATCH 0/2] [RFC] Revert/delay performance regression in 'git checkout -b'

2019-08-21 Thread Elijah Newren
Hi, On Wed, Aug 21, 2019 at 12:21 PM Derrick Stolee via GitGitGadget wrote: > > As we were integrating Git 2.23.0 into VFS for Git, we discovered that "git > checkout -b new-branch" went from 0.3s to 10+s on the Windows OS repo. This > was an intentional change when writing the "git switch" built

Re: [PATCH 0/2] [RFC] Revert/delay performance regression in 'git checkout -b'

2019-08-21 Thread Elijah Newren
On Wed, Aug 21, 2019 at 5:01 PM SZEDER Gábor wrote: > > On Wed, Aug 21, 2019 at 12:18:32PM -0700, Derrick Stolee via GitGitGadget > wrote: > > As we were integrating Git 2.23.0 into VFS for Git, we discovered that "git > > checkout -b new-branch" went from 0.3s to 10+s on the Windows OS repo. > >

RFC: Proposing git-filter-repo for inclusion in git.git

2019-08-22 Thread Elijah Newren
://git.github.io/rev_news/2019/08/21/edition-54/#an-introduction-to-git-filter-repo--written-by-elijah-newren [3] https://public-inbox.org/git/cabpp-bfc--s+d0ijrkfcrxp5lxfi+__yf4edxkpo5z+gonw...@mail.gmail.com/

Re: RFC: Proposing git-filter-repo for inclusion in git.git

2019-08-22 Thread Elijah Newren
On Thu, Aug 22, 2019 at 1:24 PM Junio C Hamano wrote: > > Elijah Newren writes: > > > Questions, comments, or concerns with this proposal? Alternative > > proposals? If inclusion is acceptable, are there any other tasks that > > need to be completed first? > &

Re: RFC: Proposing git-filter-repo for inclusion in git.git

2019-08-23 Thread Elijah Newren
Hi Eric! On Thu, Aug 22, 2019 at 8:01 PM Eric Wong wrote: > > Elijah Newren wrote: > > * Remove git-filter-branch from git.git. Mention in the release > > notes where people can go to get it.[1] > > > > filter-branch is not merely a slow or difficult-to-use to

Re: RFC: Proposing git-filter-repo for inclusion in git.git

2019-08-23 Thread Elijah Newren
On Fri, Aug 23, 2019 at 11:06 AM Elijah Newren wrote: > Safety: Ooh, and another one I remembered just after hitting 'send': * If the user provides a --tag-name-filter that maps multiple tags to the same name, no warning or error is provided; filter-branch simply overwrites eac

Re: [PATCH 1/9] sparse-checkout: create builtin with 'list' subcommand

2019-08-23 Thread Elijah Newren
On Tue, Aug 20, 2019 at 8:13 AM Derrick Stolee via GitGitGadget wrote: > The documentation provided is adapted from the "git read-tree" > documentation with a few edits for clarity in the new context. > Extra sections are added to hint toward a future change to > a moer restricted pattern set. s

Re: [PATCH 2/9] sparse-checkout: create 'init' subcommand

2019-08-23 Thread Elijah Newren
On Tue, Aug 20, 2019 at 8:13 AM Derrick Stolee via GitGitGadget wrote: > > From: Derrick Stolee > > Getting started with a sparse-checkout file can be daunting. Help > users start their sparse enlistment using 'git sparse-checkout init'. > This will set 'core.sparseCheckout=true' in their config,

Re: [PATCH 3/9] clone: add --sparse mode

2019-08-23 Thread Elijah Newren
On Tue, Aug 20, 2019 at 8:12 AM Derrick Stolee via GitGitGadget wrote: > > From: Derrick Stolee > > When someone wants to clone a large repository, but plans to work > using a sparse-checkout file, they either need to do a full > checkout first and then reduce the patterns they included, or > clo

Re: [PATCH 4/9] sparse-checkout: 'add' subcommand

2019-08-23 Thread Elijah Newren
On Tue, Aug 20, 2019 at 8:12 AM Derrick Stolee via GitGitGadget wrote: > > From: Derrick Stolee > > The 'git sparse-checkout add' subcommand takes a list of patterns > over stdin and writes them to the sparse-checkout file. Then, it > updates the working directory using 'git read-tree -mu HEAD'.

Re: [PATCH 5/9] sparse-checkout: create 'disable' subcommand

2019-08-23 Thread Elijah Newren
On Tue, Aug 20, 2019 at 8:14 AM Derrick Stolee via GitGitGadget wrote: > > From: Derrick Stolee > > The instructions for disabling a sparse-checkout to a full > working directory are complicated and non-intuitive. Add a > subcommand, 'git sparse-checkout disable', to perform those > steps for the

Re: [PATCH 6/9] trace2:experiment: clear_ce_flags_1

2019-08-23 Thread Elijah Newren
On Tue, Aug 20, 2019 at 8:12 AM Jeff Hostetler via GitGitGadget wrote: > > From: Jeff Hostetler Can the commit summary be turned into English? > The clear_ce_flags_1 method is used by many types of calls to > unpack_trees(). Add trace2 regions around the method, including > some flag informatio

Re: [PATCH 7/9] sparse-checkout: add 'cone' mode

2019-08-23 Thread Elijah Newren
On Tue, Aug 20, 2019 at 8:13 AM Derrick Stolee via GitGitGadget wrote: > > From: Derrick Stolee > > The sparse-checkout feature can have quadratic performance as > the number of patterns and number of entries in the index grow. > If there are 1,000 patterns and 1,000,000 entries, this time can >

Re: [PATCH 8/9] sparse-checkout: use hashmaps for cone patterns

2019-08-23 Thread Elijah Newren
On Tue, Aug 20, 2019 at 8:12 AM Derrick Stolee via GitGitGadget wrote: > > From: Derrick Stolee > > The parent and recursive patterns allowed by the "cone mode" > option in sparse-checkout are restrictive enough that we > can avoid using the regex parsing. Everything is based on > prefix matches,

Re: [PATCH 9/9] sparse-checkout: init and add in cone mode

2019-08-23 Thread Elijah Newren
On Tue, Aug 20, 2019 at 8:12 AM Derrick Stolee via GitGitGadget wrote: > Perhaps "sparse-checkout: modify 'init' and 'add' for cone mode" for the summary? > From: Derrick Stolee > > To make the cone pattern set easy to use, update the behavior of > 'git sparse-checkout [init|add]'. Maybe switc

Re: [PATCH 0/9] [RFC] New sparse-checkout builtin and "cone" mode

2019-08-23 Thread Elijah Newren
On Thu, Aug 22, 2019 at 6:10 AM Derrick Stolee wrote: > > On 8/21/2019 5:52 PM, Elijah Newren wrote: > > On Tue, Aug 20, 2019 at 8:12 AM Derrick Stolee via GitGitGadget > > wrote: > >> Here are some more specific details: > >> > >> * git sparse-

Re: [PATCH 0/9] [RFC] New sparse-checkout builtin and "cone" mode

2019-08-26 Thread Elijah Newren
On Mon, Aug 26, 2019 at 6:29 AM Derrick Stolee wrote: > > On 8/24/2019 1:40 AM, Elijah Newren wrote: > > On Thu, Aug 22, 2019 at 6:10 AM Derrick Stolee wrote: > >> > >> On 8/21/2019 5:52 PM, Elijah Newren wrote: > >>> On Tue, Aug 20, 2019 at 8:12 AM De

Re: [PATCH 1/2] fast-import: duplicate parsed encoding string

2019-08-26 Thread Elijah Newren
On Sun, Aug 25, 2019 at 1:08 AM Jeff King wrote: > > We read each line of the fast-import stream into the command_buf strbuf. > When reading a commit, we parse a line like "encoding foo" by storing a > pointer to "foo", but not making a copy. We may then read an unbounded > number of other lines (

Re: [PATCH 0/2] fast-import input string handling bugs

2019-08-26 Thread Elijah Newren
On Sun, Aug 25, 2019 at 1:06 AM Jeff King wrote: > > On Sun, Aug 25, 2019 at 02:57:48AM -0400, Jeff King wrote: > > > And I think this is actually a real bug in the current code! We keep a > > pointer to the encoding string, which survives because of the history. > > But that history is bounded, a

Re: [Question] clone performance

2019-08-26 Thread Elijah Newren
On Mon, Aug 26, 2019 at 12:04 PM Jeff King wrote: > > On Mon, Aug 26, 2019 at 10:16:48AM -0400, randall.s.bec...@rogers.com wrote: > > > On August 24, 2019 5:00 PM, Bryan Turner wrote: > > > On Fri, Aug 23, 2019 at 6:59 PM wrote: > > > > > > > > Hi All, > > > > > > > > I'm trying to answer a ques

[RFC PATCH 4/5] Recommend git-filter-repo instead of git-filter-branch in documentation

2019-08-26 Thread Elijah Newren
d of comparison and I would ultimately just say that filter-repo can do everything BFG can, so ultimately it seems that it is just better to remove that section altogether. Signed-off-by: Elijah Newren --- Documentation/git-fast-export.txt | 6 ++--- Documentation/git-filter-

[RFC PATCH 3/5] git-sh-i18n: work with external scripts

2019-08-26 Thread Elijah Newren
external location. Signed-off-by: Elijah Newren --- git-sh-i18n.sh | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/git-sh-i18n.sh b/git-sh-i18n.sh index 8eef60b43f..3d04d5d515 100644 --- a/git-sh-i18n.sh +++ b/git-sh-i18n.sh @@ -5,7 +5,12 @@ # # Export the TEXTDOMAIN* data

[RFC PATCH 1/5] t6006: simplify and optimize empty message test

2019-08-26 Thread Elijah Newren
easured by the best of 3 runs of `time ./t6006-rev-list-format.sh`) by about 11% on Linux and by 13% on Mac. Signed-off-by: Elijah Newren --- t/t6006-rev-list-format.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-forma

[RFC PATCH 0/5] Remove git-filter-branch from git.git; host it elsewhere

2019-08-26 Thread Elijah Newren
y deletes git-filter-branch, its tests, and documentation. Elijah Newren (5): t6006: simplify and optimize empty message test t3427: accelerate this test by using fast-export and fast-import git-sh-i18n: work with external scripts Recommend git-filter-repo instead of git-filter-branch in

[RFC PATCH 5/5] Remove git-filter-branch, it is now external to git.git

2019-08-26 Thread Elijah Newren
Signed-off-by: Elijah Newren --- .gitignore | 1 - Documentation/git-filter-branch.txt | 461 --- Makefile| 1 - command-list.txt| 1 - git-filter-branch.sh| 662

[RFC PATCH 2/5] t3427: accelerate this test by using fast-export and fast-import

2019-08-26 Thread Elijah Newren
everything in this test -- not just the filter-branch or fast-export/fast-import pair): Linux: 4.305s -> 3.684s (~17% speedup) Mac: 10.128s -> 7.038s (~30% speedup) Signed-off-by: Elijah Newren --- t/t3427-rebase-subtree.sh | 32 1 file chang

Re: [RFC PATCH 0/5] Remove git-filter-branch from git.git; host it elsewhere

2019-08-26 Thread Elijah Newren
On Mon, Aug 26, 2019 at 6:39 PM Derrick Stolee wrote: > > On 8/26/2019 7:52 PM, Elijah Newren wrote: > > Following up on the suggestion to make git.git smaller and shed non-core > > tools, here's an RFC series to do so with git-filter-branch. This > > series firs

Re: [RFC PATCH 4/5] Recommend git-filter-repo instead of git-filter-branch in documentation

2019-08-26 Thread Elijah Newren
On Mon, Aug 26, 2019 at 6:33 PM Derrick Stolee wrote: > > On 8/26/2019 7:52 PM, Elijah Newren wrote: > > +WARNING > > +--- > > +'git filter-branch' has a litany of gotchas that can and will cause > > +history to be rewritten incorrectly (in addit

Re: [RFC PATCH 0/5] Remove git-filter-branch from git.git; host it elsewhere

2019-08-27 Thread Elijah Newren
On Tue, Aug 27, 2019 at 1:43 AM Sergey Organov wrote: > > Eric Wong writes: > > > [...] > > > AFAIK, filter-branch is not causing support headaches for any > > git developers today. With so many commands in git, it's > > unlikely newbies will ever get around to discover it :) > > So I think thin

[PATCH] merge-options.txt: clarify meaning of various ff-related options

2019-08-27 Thread Elijah Newren
As discovered on the mailing list, some of the descriptions of the ff-related options were unclear. Try to be more precise with what these options do. Signed-off-by: Elijah Newren --- I noticed this patch sitting around in one of my branches, and noticed it wasn't upstream. I'm pre

[PATCH v2 1/4] t6006: simplify and optimize empty message test

2019-08-27 Thread Elijah Newren
easured by the best of 3 runs of `time ./t6006-rev-list-format.sh`) by about 11% on Linux and by 13% on Mac. Signed-off-by: Elijah Newren --- t/t6006-rev-list-format.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-forma

[PATCH v2 3/4] Recommend git-filter-repo instead of git-filter-branch

2019-08-27 Thread Elijah Newren
it seems like I would need to provide some kind of comparison and I would ultimately just say that filter-repo can do everything BFG can, so ultimately it seems that it is just better to remove that section altogether. Signed-off-by: Elijah Newren --- Documentation/git-fast-export.txt | 6 ++--

[PATCH v2 2/4] t3427: accelerate this test by using fast-export and fast-import

2019-08-27 Thread Elijah Newren
everything in this test -- not just the filter-branch or fast-export/fast-import pair): Linux: 4.305s -> 3.684s (~17% speedup) Mac: 10.128s -> 7.038s (~30% speedup) Signed-off-by: Elijah Newren --- t/t3427-rebase-subtree.sh | 22 ++ 1 file changed, 14 inse

<    5   6   7   8   9   10   11   12   13   14   >