Re: [RFC PATCH 2/3] Documentation/git-rev-list: s///

2018-12-07 Thread Matthew DeVore
On Sun, Oct 21, 2018 at 7:21 PM Junio C Hamano wrote: > > Matthew DeVore writes: > > >> It is more like "this is a set operation across commits. We also > >> show objects that are reachable from the commits in the resulting > >> set and are not reacha

[PATCH] terminology tweak: prune -> path limiting

2018-12-06 Thread Matthew DeVore
In the codebase, "prune" is a highly overloaded term, and it caused me a lot of trouble to figure out what it meant when it was used in the context of path limiting. Stop using the word "prune" when we really mean "path limiting." Signed-off-by: Matthew DeVore --

Re: What's cooking in git.git (Nov 2018, #06; Wed, 21)

2018-12-05 Thread Matthew DeVore
On 11/21/2018 01:00 AM, Junio C Hamano wrote: * md/list-lazy-objects-fix (2018-10-29) 1 commit - list-objects.c: don't segfault for missing cmdline objects "git rev-list --exclude-promissor-objects" had to take an object that does not exist locally (and is lazily available) from the

[PATCH v3] list-objects.c: don't segfault for missing cmdline objects

2018-12-05 Thread Matthew DeVore
--ignore-missing. If it is not passed, die when an object is missing. Otherwise, just silently ignore it. Signed-off-by: Matthew DeVore --- revision.c | 2 ++ t/t0410-partial-clone.sh | 16 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/revision.c b

Re: easy way to demonstrate length of colliding SHA-1 prefixes?

2018-12-03 Thread Matthew DeVore
On 12/02/2018 05:23 AM, Ævar Arnfjörð Bjarmason wrote: On Sun, Dec 02 2018, Robert P. J. Day wrote: as part of an upcoming git class i'm delivering, i thought it would be amusing to demonstrate the maximum length of colliding SHA-1 prefixes in a repository (in my case, i use the linux

[PATCH v2] revisions.c: put promisor option in specialized struct

2018-12-03 Thread Matthew DeVore
Put the allow_exclude_promisor_objects flag in setup_revision_opt. When it was in rev_info, it was unclear when it was used, since rev_info is passed to functions that don't use the flag. This resulted in unnecessary setting of the flag in prune.c, so fix that as well. Signed-off-by: Matthew

Re: [PATCH] revisions.c: put promisor option in specialized struct

2018-12-03 Thread Matthew DeVore
On 12/03/2018 01:24 PM, Jeff King wrote: @@ -297,7 +296,8 @@ struct setup_revision_opt { const char *def; void (*tweak)(struct rev_info *, struct setup_revision_opt *); const char *submodule; /* TODO: drop this and use rev_info->repo */ - int assume_dashdash; +

Re: [RFC 2/2] exclude-promisor-objects: declare when option is allowed

2018-12-03 Thread Matthew DeVore
On 12/03/2018 01:15 PM, Jeff King wrote: That said, our C99 designated initializer weather-balloons haven't gotten any complaints yet. So I think you could actually do: struct setup_revision_opt s_r_opt = { .allow_exclude_promisor_objects = 1, }; I like this way best, so I'll

[PATCH] revisions.c: put promisor option in specialized struct

2018-12-03 Thread Matthew DeVore
Put the allow_exclude_promisor_objects flag in setup_revision_opt. When it was in rev_info, it was unclear when it was used, since rev_info is passed to functions that don't use the flag. This resulted in unnecessary setting of the flag in prune.c, so fix that as well. Signed-off-by: Matthew

Re: [RFC 2/2] exclude-promisor-objects: declare when option is allowed

2018-12-03 Thread Matthew DeVore
On 12/01/2018 11:44 AM, Jeff King wrote: repo_init_revisions(the_repository, , NULL); save_commit_buffer = 0; - revs.allow_exclude_promisor_objects_opt = 1; - setup_revisions(ac, av, , NULL); + + memset(_r_opt, 0, sizeof(s_r_opt)); +

Re: [RFC 2/2] exclude-promisor-objects: declare when option is allowed

2018-11-30 Thread Matthew DeVore
On 11/21/2018 08:40 AM, Jeff King wrote: On Mon, Oct 22, 2018 at 06:13:42PM -0700, Matthew DeVore wrote: diff --git a/builtin/prune.c b/builtin/prune.c index 41230f8215..11284d0bf3 100644 --- a/builtin/prune.c +++ b/builtin/prune.c @@ -120,6 +120,7 @@ int cmd_prune(int argc, const char

Re: [RFC PATCH 3/3] list-objects-filter: teach tree:# how to handle >0

2018-11-07 Thread Matthew DeVore
at 7:31 PM Junio C Hamano wrote: > > Matthew DeVore writes: > > > The long-term goal at the end of this is to allow a partial clone to > > eagerly fetch an entire directory of files by fetching a tree and > > specifying =1. This, for instance, would make a build operation &

[PATCH v2] list-objects.c: don't segfault for missing cmdline objects

2018-10-25 Thread Matthew DeVore
-by: Matthew DeVore --- list-objects.c | 3 ++- t/t0410-partial-clone.sh | 6 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/list-objects.c b/list-objects.c index c41cc80db5..27ed2c6cab 100644 --- a/list-objects.c +++ b/list-objects.c @@ -245,7 +245,8 @@ void

Re: [PATCH] revision.c: drop missing objects from cmdline

2018-10-25 Thread Matthew DeVore
On Tue, Oct 23, 2018 at 9:54 PM Junio C Hamano wrote: > > Matthew DeVore writes: > > > No code which reads cmdline in struct rev_info can handle NULL objects > > in cmdline.rev[i].item, so stop adding them to the cmdline.rev array. > > "The code is not pre

[PATCH] revision.c: drop missing objects from cmdline

2018-10-23 Thread Matthew DeVore
: git rev-list --objects --missing=print $missing_hash Already fails with a "fatal: bad object HASH" message and this patch does not change that. Signed-off-by: Matthew DeVore --- revision.c | 12 t/t0410-partial-clone.sh | 11 ++- 2 files c

Re: [RFC 2/2] exclude-promisor-objects: declare when option is allowed

2018-10-23 Thread Matthew DeVore
On Tue, 23 Oct 2018, Junio C Hamano wrote: Not really. We were already doing a controlled failure via die(), so these two tests would not have caught the problem in the code before the fix in this patch. BUG is apparently considered a "wrong" failure and not a controlled one by

Re: [RFC 0/2] explicitly support or not support --exclude-promisor-objects

2018-10-23 Thread Matthew DeVore
On Tue, 23 Oct 2018, Junio C Hamano wrote: Thanks; both patches make sense. As the problematic feature appeared in 2.17.x track, I'll see if I can easily make it ready to be merged down to maint-2.17 track later when somebody wants to. Great. Thank you for the review.

Re: [RFC 0/2] explicitly support or not support --exclude-promisor-objects

2018-10-22 Thread Matthew DeVore
On Mon, 22 Oct 2018, Matthew DeVore wrote: This patch set fixes incorrect parsing of the --exclude-promisor-objects option that I found while working on: Somehow I sent two copies of every message in the patchset. I'm sorry for the mess.

[RFC 0/2] explicitly support or not support --exclude-promisor-objects

2018-10-22 Thread Matthew DeVore
This patch set fixes incorrect parsing of the --exclude-promisor-objects option that I found while working on: https://public-inbox.org/git/cover.1539298957.git.matv...@google.com/ Thank you, Matthew DeVore (2): Documentation/git-log.txt: do not show --exclude-promisor-objects exclude

[RFC 2/2] exclude-promisor-objects: declare when option is allowed

2018-10-22 Thread Matthew DeVore
invoked by another command passing --exclude-promisor-object. Signed-off-by: Matthew DeVore --- builtin/pack-objects.c | 1 + builtin/prune.c| 1 + builtin/rev-list.c | 1 + revision.c | 3 ++- revision.h | 1 + t/t4202-log.sh | 4 t/t8002-blame.sh

[RFC 1/2] Documentation/git-log.txt: do not show --exclude-promisor-objects

2018-10-22 Thread Matthew DeVore
Do not suggest that --exclude-promisor-objects is supported by git-log, since it currently BUG-crashes and it's not necessary to support it. Options that control behavior for promisor objects should be limited to a small number of commands. Signed-off-by: Matthew DeVore --- Documentation/rev

Re: [RFC PATCH 2/3] Documentation/git-rev-list: s///

2018-10-19 Thread Matthew DeVore
On Sun, Oct 14, 2018 at 4:25 PM Junio C Hamano wrote: > > Matthew DeVore writes: > > > -List commits that are reachable by following the `parent` links from the > > -given commit(s), but exclude commits that are reachable from the one(s) > > -given with a '{caret}' in

[PATCH v2] list-objects: support for skipping tree traversal

2018-10-17 Thread Matthew DeVore
-by: Matthew DeVore --- list-objects-filter.c | 11 +-- list-objects-filter.h | 6 ++ list-objects.c | 5 - t/t6112-rev-list-filters-objects.sh | 13 + 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/list

Re: [RFC PATCH 1/3] list-objects: support for skipping tree traversal

2018-10-17 Thread Matthew DeVore
On Sun, Oct 14, 2018 at 4:15 PM Junio C Hamano wrote: > > This step looks more like "ow, we could have done the tree:0 support > that is in 'next' better" than a part of "here is a series to do > tree:N for non zero value of N". > > If that is the case, I'd prefer to see this step polished enough

Re: [RFC] revision: Add --sticky-default option

2018-10-17 Thread Matthew DeVore
On Wed, 17 Oct 2018, Jeff King wrote: Yuck, t4202 is a mix of older and newer styles. I'm OK with this as-is because you've matched the surrounding code, but these days I'd probably write: test_expect_success '--sticky-default ^' ' { echo sixth echo

Re: [PATCH v12 0/8] filter: support for excluding all trees and blobs

2018-10-16 Thread Matthew DeVore
On Sun, Oct 14, 2018 at 8:43 PM Junio C Hamano wrote: > > Junio C Hamano writes: > > > Matthew DeVore writes: > > > >> Here is a re-roll-up since I haven't received any additional corrections > >> for > >> almost a week. > > > >

[PATCH v12 8/8] list-objects-filter: implement filter tree:0

2018-10-12 Thread Matthew DeVore
nt to the feature. Signed-off-by: Matthew DeVore --- Documentation/rev-list-options.txt | 5 +++ list-objects-filter-options.c | 13 +++ list-objects-filter-options.h | 1 + list-objects-filter.c | 49 ++ t/t5317-pack-objects-filter-obje

[PATCH v12 7/8] list-objects-filter-options: do not over-strbuf_init

2018-10-12 Thread Matthew DeVore
. It should be the caller's responsibility to make sure errbuf is not garbage, since garbage content is easily avoidable with STRBUF_INIT. Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/list-objects-filter

[PATCH v12 4/8] rev-list: handle missing tree objects properly

2018-10-12 Thread Matthew DeVore
Previously, we assumed only blob objects could be missing. This patch makes rev-list handle missing trees like missing blobs. The --missing=* and --exclude-promisor-objects flags now work for trees as they already do for blobs. This is demonstrated in t6112. Signed-off-by: Matthew DeVore

[PATCH v12 3/8] list-objects: always parse trees gently

2018-10-12 Thread Matthew DeVore
If parsing fails when revs->ignore_missing_links and revs->exclude_promisor_objects are both false, we print the OID anyway in the die("bad tree object...") call, so any message printed by parse_tree_gently() is superfluous. Signed-off-by: Matthew DeVore --- list-objects.c

[PATCH v12 5/8] revision: mark non-user-given objects instead

2018-10-12 Thread Matthew DeVore
to the rev_info struct. This seems to have been an oversight, and pack-objects has the correct behavior, so I added a test to make sure that rev-list now behaves properly. Signed-off-by: Matthew DeVore --- list-objects.c | 31 + revision.c

[PATCH v12 6/8] list-objects-filter: use BUG rather than die

2018-10-12 Thread Matthew DeVore
In some cases in this file, BUG makes more sense than die. In such cases, a we get there from a coding error rather than a user error. 'return' has been removed following some instances of BUG since BUG does not return. Signed-off-by: Matthew DeVore --- list-objects-filter.c | 11

[PATCH v12 0/8] filter: support for excluding all trees and blobs

2018-10-12 Thread Matthew DeVore
quot; observed ' test_expect_success 'verify emitted+omitted == all' ' @@ -240,7 +240,7 @@ test_expect_success 'verify tree:0 includes trees in "filtered" output' ' xargs -n1 git -C r3 cat-file -t >unsorted_filtered_types && sort -u unsorted_filtered_types >filt

[PATCH v12 1/8] list-objects: store common func args in struct

2018-10-12 Thread Matthew DeVore
This will make utility functions easier to create, as done by the next patch. Signed-off-by: Matthew DeVore --- list-objects.c | 158 +++-- 1 file changed, 74 insertions(+), 84 deletions(-) diff --git a/list-objects.c b/list-objects.c index c99c47ac1

[PATCH v12 2/8] list-objects: refactor to process_tree_contents

2018-10-12 Thread Matthew DeVore
-by: Matthew DeVore --- list-objects.c | 68 ++ 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/list-objects.c b/list-objects.c index 584518a3f..ccc529e5e 100644 --- a/list-objects.c +++ b/list-objects.c @@ -94,6 +94,46 @@ static void

[RFC PATCH 3/3] list-objects-filter: teach tree:# how to handle >0

2018-10-11 Thread Matthew DeVore
, would make a build operation fast and convenient. It is fast because the partial clone does not need to fetch each file individually, and convenient because the user does not need to supply a sparse-checkout specification. Signed-off-by: Matthew DeVore --- Documentation/rev-list-options.txt | 8

[RFC PATCH 2/3] Documentation/git-rev-list: s///

2018-10-11 Thread Matthew DeVore
-pathological way. Signed-off-by: Matthew DeVore --- Documentation/git-rev-list.txt | 21 - Documentation/rev-list-options.txt | 16 builtin/rev-list.c | 2 +- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/Documentation/git

[RFC PATCH 1/3] list-objects: support for skipping tree traversal

2018-10-11 Thread Matthew DeVore
-by: Matthew DeVore --- list-objects-filter.c | 11 +-- list-objects-filter.h | 6 ++ list-objects.c | 5 - t/t6112-rev-list-filters-objects.sh | 10 ++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/list

[RFC PATCH 0/3] support for filtering trees and blobs based on depth

2018-10-11 Thread Matthew DeVore
ant to do something like "make" it will be quite slow of we initiate a separate fetch for every file needed. Alternatively, fetching directories at a time - as soon as any file in a directory is accessed - is a reasonable approach. Thank you, Matthew DeVore (3): list-objects: support for

Re: [PATCH v11 8/8] list-objects-filter: implement filter tree:0

2018-10-08 Thread Matthew DeVore
On Sat, Oct 6, 2018 at 5:10 PM Junio C Hamano wrote: > > As output made inside test_expect_{succcess,failure} are discarded > by default and shown while debugging tests, there is no strong > reason to use "grep -q" in our tests. I saw a few instances of > "grep -q" added in this series including

[PATCH v5 5/7] tests: don't swallow Git errors upstream of pipes

2018-10-05 Thread Matthew DeVore
placement in a prior patch. Signed-off-by: Matthew DeVore --- t/t5317-pack-objects-filter-objects.sh | 156 + t/t5616-partial-clone.sh | 14 ++- t/t6112-rev-list-filters-objects.sh| 103 3 files changed, 141 insertions(+), 132 deletions

[PATCH v5 7/7] tests: order arguments to git-rev-list properly

2018-10-05 Thread Matthew DeVore
invocations of git-rev-list that occur in command substitution in which the exit code is discarded, since fixing those properly will require a more involved cleanup. Signed-off-by: Matthew DeVore --- t/t5616-partial-clone.sh| 26 + t/t5702-protocol-v2.sh

[PATCH v5 6/7] t9109: don't swallow Git errors upstream of pipes

2018-10-05 Thread Matthew DeVore
quotes from double to single to avoid premature string interpolation. Signed-off-by: Matthew DeVore --- t/t9101-git-svn-props.sh | 34 +- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh index

[PATCH v5 4/7] t/*: fix ordering of expected/observed arguments

2018-10-05 Thread Matthew DeVore
Fix various places where the ordering was obviously wrong, meaning it was easy to find with grep. Signed-off-by: Matthew DeVore --- t/t-basic.sh | 2 +- t/t0021-conversion.sh | 4 +-- t/t1300-config.sh | 4 +-- t/t1303-wacky

[PATCH v5 2/7] Documentation: add shell guidelines

2018-10-05 Thread Matthew DeVore
wing to t/README (since it is specific to writing tests): Pipes and $(git ...) should be avoided when they swallow exit codes of Git processes Signed-off-by: Matthew DeVore --- Documentation/CodingGuidelines | 18 ++ t/README | 27 ++

[PATCH v5 1/7] t/README: reformat Do, Don't, Keep in mind lists

2018-10-05 Thread Matthew DeVore
o the list of "do's" and phrase as "Remember..." Signed-off-by: Matthew DeVore --- t/README | 42 -- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/t/README b/t/README index 9028b47d9..68012d673 100644 --- a/t/README +

[PATCH v5 3/7] tests: standardize pipe placement

2018-10-05 Thread Matthew DeVore
line before and after the pipe where it aids readability (it usually does). This better matches the coding style documented in Documentation/CodingGuidelines and used in shell scripts elsewhere in the tree. Signed-off-by: Matthew DeVore --- t/lib-gpg.sh | 9 +- t/t1006

[PATCH v5 0/7] subject: Clean up tests for test_cmp arg ordering and pipe placement

2018-10-05 Thread Matthew DeVore
missing=print \ +master..origin/master >observed && test_line_count = 0 observed ' Matthew DeVore (7): t/README: reformat Do, Don't, Keep in mind lists Documentation: add shell guidelines tests: standardize pipe placement t/*: fix ordering of expected/observ

[PATCH v11 6/8] list-objects-filter: use BUG rather than die

2018-10-05 Thread Matthew DeVore
In some cases in this file, BUG makes more sense than die. In such cases, a we get there from a coding error rather than a user error. 'return' has been removed following some instances of BUG since BUG does not return. Signed-off-by: Matthew DeVore --- list-objects-filter.c | 11

[PATCH v11 5/8] revision: mark non-user-given objects instead

2018-10-05 Thread Matthew DeVore
to the rev_info struct. This seems to have been an oversight, and pack-objects has the correct behavior, so I added a test to make sure that rev-list now behaves properly. Signed-off-by: Matthew DeVore --- list-objects.c | 31 + revision.c

[PATCH v11 8/8] list-objects-filter: implement filter tree:0

2018-10-05 Thread Matthew DeVore
nt to the feature. Signed-off-by: Matthew DeVore --- Documentation/rev-list-options.txt | 5 +++ list-objects-filter-options.c | 13 +++ list-objects-filter-options.h | 1 + list-objects-filter.c | 49 ++ t/t5317-pack-objects-filter-obje

[PATCH v11 7/8] list-objects-filter-options: do not over-strbuf_init

2018-10-05 Thread Matthew DeVore
. It should be the caller's responsibility to make sure errbuf is not garbage, since garbage content is easily avoidable with STRBUF_INIT. Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/list-objects-filter

[PATCH v11 4/8] rev-list: handle missing tree objects properly

2018-10-05 Thread Matthew DeVore
Previously, we assumed only blob objects could be missing. This patch makes rev-list handle missing trees like missing blobs. The --missing=* and --exclude-promisor-objects flags now work for trees as they already do for blobs. This is demonstrated in t6112. Signed-off-by: Matthew DeVore

[PATCH v11 2/8] list-objects: refactor to process_tree_contents

2018-10-05 Thread Matthew DeVore
-by: Matthew DeVore --- list-objects.c | 68 ++ 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/list-objects.c b/list-objects.c index 584518a3f..ccc529e5e 100644 --- a/list-objects.c +++ b/list-objects.c @@ -94,6 +94,46 @@ static void

[PATCH v11 1/8] list-objects: store common func args in struct

2018-10-05 Thread Matthew DeVore
This will make utility functions easier to create, as done by the next patch. Signed-off-by: Matthew DeVore --- list-objects.c | 158 +++-- 1 file changed, 74 insertions(+), 84 deletions(-) diff --git a/list-objects.c b/list-objects.c index c99c47ac1

[PATCH v11 3/8] list-objects: always parse trees gently

2018-10-05 Thread Matthew DeVore
If parsing fails when revs->ignore_missing_links and revs->exclude_promisor_objects are both false, we print the OID anyway in the die("bad tree object...") call, so any message printed by parse_tree_gently() is superfluous. Signed-off-by: Matthew DeVore --- list-objects.c

[PATCH v11 0/8] filter: support for excluding all trees and blobs

2018-10-05 Thread Matthew DeVore
ered_types && +xargs -n1 git -C r3 cat-file -t >unsorted_filtered_types && +sort -u unsorted_filtered_types >filtered_types && printf "blob\ntree\n" >expected && test_cmp expected filtered_types ' Matthew DeVor

Re: [PATCH v4 2/7] Documentation: add shell guidelines

2018-10-05 Thread Matthew DeVore
On Fri, Oct 5, 2018 at 9:48 AM Junio C Hamano wrote: > > Matthew DeVore writes: > > > Add the following guideline to Documentation/CodingGuidelines: > > > > &&, ||, and | should appear at the end of lines, not the > > beginning, and

Re: [PATCH v4 5/7] tests: don't swallow Git errors upstream of pipes

2018-10-05 Thread Matthew DeVore
I just realized that the changes to t9101 should actually be part of the next patch (6/7), not this one. I've fixed that for the next re-roll.

Re: [PATCH v4 5/7] tests: don't swallow Git errors upstream of pipes

2018-10-05 Thread Matthew DeVore
On Fri, Oct 5, 2018 at 9:48 AM Junio C Hamano wrote: > > Hopefully this is not a blind mechanical patch, as introduction of > unexpected temporary files in the working tree could interfere with > later tests (e.g. they may expect exact set of untracked files, and > these new temporary files would

Re: [PATCH v4 1/7] t/README: reformat Do, Don't, Keep in mind lists

2018-10-05 Thread Matthew DeVore
On Thu, Oct 4, 2018 at 11:15 PM Junio C Hamano wrote: > > Matthew DeVore writes: > > > -Do's, don'ts & things to keep in mind > > +Do's & don'ts > > - > > We may not format this with AsciiDoc, but please shorten the &g

Re: [PATCH v10 0/8] filter: support for excluding all trees and blobs

2018-10-03 Thread Matthew DeVore
On Wed, Oct 3, 2018 at 12:52 PM Matthew DeVore wrote: > > This is a minor change to the previous rollup. It moves positional > arguments to the end of git-rev-list invocations. Here is an interdiff > from v9: ... There is another problem with this patchset related to droppe

[PATCH v10 8/8] list-objects-filter: implement filter tree:0

2018-10-03 Thread Matthew DeVore
nt to the feature. Signed-off-by: Matthew DeVore --- Documentation/rev-list-options.txt | 5 +++ list-objects-filter-options.c | 13 +++ list-objects-filter-options.h | 1 + list-objects-filter.c | 49 ++ t/t5317-pack-objects-filter-obje

[PATCH v10 6/8] list-objects-filter: use BUG rather than die

2018-10-03 Thread Matthew DeVore
In some cases in this file, BUG makes more sense than die. In such cases, a we get there from a coding error rather than a user error. 'return' has been removed following some instances of BUG since BUG does not return. Signed-off-by: Matthew DeVore --- list-objects-filter.c | 11

[PATCH v10 5/8] revision: mark non-user-given objects instead

2018-10-03 Thread Matthew DeVore
to the rev_info struct. This seems to have been an oversight, and pack-objects has the correct behavior, so I added a test to make sure that rev-list now behaves properly. Signed-off-by: Matthew DeVore --- list-objects.c | 31 + revision.c

[PATCH v10 4/8] rev-list: handle missing tree objects properly

2018-10-03 Thread Matthew DeVore
Previously, we assumed only blob objects could be missing. This patch makes rev-list handle missing trees like missing blobs. The --missing=* and --exclude-promisor-objects flags now work for trees as they already do for blobs. This is demonstrated in t6112. Signed-off-by: Matthew DeVore

[PATCH v10 7/8] list-objects-filter-options: do not over-strbuf_init

2018-10-03 Thread Matthew DeVore
. It should be the caller's responsibility to make sure errbuf is not garbage, since garbage content is easily avoidable with STRBUF_INIT. Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/list-objects-filter

[PATCH v10 3/8] list-objects: always parse trees gently

2018-10-03 Thread Matthew DeVore
If parsing fails when revs->ignore_missing_links and revs->exclude_promisor_objects are both false, we print the OID anyway in the die("bad tree object...") call, so any message printed by parse_tree_gently() is superfluous. Signed-off-by: Matthew DeVore --- list-objects.c

[PATCH v10 1/8] list-objects: store common func args in struct

2018-10-03 Thread Matthew DeVore
This will make utility functions easier to create, as done by the next patch. Signed-off-by: Matthew DeVore --- list-objects.c | 158 +++-- 1 file changed, 74 insertions(+), 84 deletions(-) diff --git a/list-objects.c b/list-objects.c index c99c47ac1

[PATCH v10 2/8] list-objects: refactor to process_tree_contents

2018-10-03 Thread Matthew DeVore
-by: Matthew DeVore --- list-objects.c | 68 ++ 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/list-objects.c b/list-objects.c index 584518a3f..ccc529e5e 100644 --- a/list-objects.c +++ b/list-objects.c @@ -94,6 +94,46 @@ static void

[PATCH v10 0/8] filter: support for excluding all trees and blobs

2018-10-03 Thread Matthew DeVore
st HEAD --quiet --objects --filter-print-omitted --filter=tree:0 | + git -C r3 rev-list --quiet --objects --filter-print-omitted \ + --filter=tree:0 HEAD | awk -f print_1.awk | sed s/~// | xargs -n1 git -C r3 cat-file -t | Thank you, Matt

Re: [PATCH v3 5/5] list-objects-filter: implement filter tree:0

2018-10-03 Thread Matthew DeVore
On Tue, Aug 14, 2018 at 8:13 AM Jeff Hostetler wrote: > > There are a couple of options here: > [] If really want to omit all trees and blobs (and we DO NOT want > the oidset of everything omitted), then we might be able to > shortcut the traversal and speed things up. > > {} add a

Re: [PATCH v4 7/7] tests: order arguments to git-rev-list properly

2018-10-03 Thread Matthew DeVore
On Wed, Oct 3, 2018 at 9:26 AM Matthew DeVore wrote: > > - git -C pc1 rev-list HEAD --quiet --objects --missing=print >revs && > + git -C pc1 rev-list --quiet --objects --missing=print >revs HEAD && > awk -f print_1.awk revs | ... >

[PATCH v4 7/7] tests: order arguments to git-rev-list properly

2018-10-03 Thread Matthew DeVore
invocations of git-rev-list that occur in command substitution in which the exit code is discarded, since fixing those properly will require a more involved cleanup. Signed-off-by: Matthew DeVore --- t/t5616-partial-clone.sh| 26 + t/t5702-protocol-v2.sh

[PATCH v4 4/7] t/*: fix ordering of expected/observed arguments

2018-10-03 Thread Matthew DeVore
Fix various places where the ordering was obviously wrong, meaning it was easy to find with grep. Signed-off-by: Matthew DeVore --- t/t-basic.sh | 2 +- t/t0021-conversion.sh | 4 +-- t/t1300-config.sh | 4 +-- t/t1303-wacky

[PATCH v4 6/7] t9109: don't swallow Git errors upstream of pipes

2018-10-03 Thread Matthew DeVore
quotes from double to single to avoid premature string interpolation. Signed-off-by: Matthew DeVore --- t/t9101-git-svn-props.sh | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh index 8cba331fc

[PATCH v4 5/7] tests: don't swallow Git errors upstream of pipes

2018-10-03 Thread Matthew DeVore
placement in a prior patch. Signed-off-by: Matthew DeVore --- t/t5317-pack-objects-filter-objects.sh | 156 + t/t5616-partial-clone.sh | 14 ++- t/t6112-rev-list-filters-objects.sh| 103 t/t9101-git-svn-props.sh | 3 +- 4 files

[PATCH v4 1/7] t/README: reformat Do, Don't, Keep in mind lists

2018-10-03 Thread Matthew DeVore
o the list of "do's" and phrase as "Remember..." Signed-off-by: Matthew DeVore --- t/README | 40 +++- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/t/README b/t/README index 9028b47d9..85024aba6 100644 --- a/t/README +++ b/t/

[PATCH v4 2/7] Documentation: add shell guidelines

2018-10-03 Thread Matthew DeVore
pipes and $(git ...) should be avoided when they swallow exit codes of Git processes Signed-off-by: Matthew DeVore --- Documentation/CodingGuidelines | 18 ++ t/README | 28 2 files changed, 46 insertions(+) di

[PATCH v4 3/7] tests: standardize pipe placement

2018-10-03 Thread Matthew DeVore
line before and after the pipe where it aids readability (it usually does). This better matches the coding style documented in Documentation/CodingGuidelines and used in shell scripts elsewhere in the tree. Signed-off-by: Matthew DeVore --- t/lib-gpg.sh | 9 +- t/t1006

[PATCH v4 0/7] Clean up tests for test_cmp arg ordering and pipe placement

2018-10-03 Thread Matthew DeVore
patchset modifies the tests where most of these mistakes are present, and I want the tests added in the other patchset to be consistent with the code around it. Thank you, Matthew DeVore (7): t/README: reformat Do, Don't, Keep in mind lists Documentation: add shell guidelines tests: standardize

Re: [PATCH v3 1/5] CodingGuidelines: add shell piping guidelines

2018-10-01 Thread Matthew DeVore
On Thu, Sep 27, 2018 at 2:18 PM SZEDER Gábor wrote: > > On Tue, Sep 25, 2018 at 02:58:08PM -0700, Matthew DeVore wrote: > > + - Use Git upstream in the non-final position in a piped chain, as in: > > Note the starting upper case 'U'. > > > + - Use command substitution i

Re: [PATCH v3 1/5] CodingGuidelines: add shell piping guidelines

2018-09-25 Thread Matthew DeVore
not the beginning, and the \ line continuation character should be omitted And the following to t/README (since it is specific to writing tests): pipes and $(git ...) should be avoided when they swallow exit codes of Git processes Signed-off-b

Re: [PATCH v3 1/5] CodingGuidelines: add shell piping guidelines

2018-09-21 Thread Matthew DeVore
On Thu, Sep 20, 2018 at 7:06 PM Eric Sunshine wrote: > > On Thu, Sep 20, 2018 at 9:43 PM Matthew DeVore wrote: > > Add two guidelines: > > Probably s/two/three/ or s/two/several/ since the patch now adds three > guidelines. > > > - pipe characters sho

[PATCH v9 5/8] revision: mark non-user-given objects instead

2018-09-21 Thread Matthew DeVore
to the rev_info struct. This seems to have been an oversight, and pack-objects has the correct behavior, so I added a test to make sure that rev-list now behaves properly. Signed-off-by: Matthew DeVore --- list-objects.c | 31 + revision.c

[PATCH v9 6/8] list-objects-filter: use BUG rather than die

2018-09-21 Thread Matthew DeVore
In some cases in this file, BUG makes more sense than die. In such cases, a we get there from a coding error rather than a user error. 'return' has been removed following some instances of BUG since BUG does not return. Signed-off-by: Matthew DeVore --- list-objects-filter.c | 11

[PATCH v9 7/8] list-objects-filter-options: do not over-strbuf_init

2018-09-21 Thread Matthew DeVore
. It should be the caller's responsibility to make sure errbuf is not garbage, since garbage content is easily avoidable with STRBUF_INIT. Signed-off-by: Matthew DeVore --- list-objects-filter-options.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/list-objects-filter

[PATCH v9 8/8] list-objects-filter: implement filter tree:0

2018-09-21 Thread Matthew DeVore
nt to the feature. Signed-off-by: Matthew DeVore --- Documentation/rev-list-options.txt | 5 +++ list-objects-filter-options.c | 13 +++ list-objects-filter-options.h | 1 + list-objects-filter.c | 49 ++ t/t5317-pack-objects-filter-obje

[PATCH v9 4/8] rev-list: handle missing tree objects properly

2018-09-21 Thread Matthew DeVore
Previously, we assumed only blob objects could be missing. This patch makes rev-list handle missing trees like missing blobs. The --missing=* and --exclude-promisor-objects flags now work for trees as they already do for blobs. This is demonstrated in t6112. Signed-off-by: Matthew DeVore

[PATCH v9 2/8] list-objects: refactor to process_tree_contents

2018-09-21 Thread Matthew DeVore
-by: Matthew DeVore --- list-objects.c | 68 ++ 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/list-objects.c b/list-objects.c index 584518a3f..ccc529e5e 100644 --- a/list-objects.c +++ b/list-objects.c @@ -94,6 +94,46 @@ static void

[PATCH v9 3/8] list-objects: always parse trees gently

2018-09-21 Thread Matthew DeVore
If parsing fails when revs->ignore_missing_links and revs->exclude_promisor_objects are both false, we print the OID anyway in the die("bad tree object...") call, so any message printed by parse_tree_gently() is superfluous. Signed-off-by: Matthew DeVore --- list-objects.c

[PATCH v9 0/8] filter: support for excluding all trees and blobs

2018-09-21 Thread Matthew DeVore
Since v8, I cleaned up the test scripts in the following ways: - correct order of expect/actual arguments to test_cmp - correct pipe placement - put flags before positional arguments Also, removed some junk in the commit message of the 5th patch. Thank you, Matthew DeVore (8): list-objects

[PATCH v9 1/8] list-objects: store common func args in struct

2018-09-21 Thread Matthew DeVore
This will make utility functions easier to create, as done by the next patch. Signed-off-by: Matthew DeVore --- list-objects.c | 158 +++-- 1 file changed, 74 insertions(+), 84 deletions(-) diff --git a/list-objects.c b/list-objects.c index c99c47ac1

[PATCH v3 2/5] tests: standardize pipe placement

2018-09-20 Thread Matthew DeVore
line before and after the pipe where it aids readability (it usually does). This better matches the coding style documented in Documentation/CodingGuidelines and used in shell scripts elsewhere in the tree. Signed-off-by: Matthew DeVore --- t/lib-gpg.sh | 9 +- t/t1006

[PATCH v3 4/5] tests: don't swallow Git errors upstream of pipes

2018-09-20 Thread Matthew DeVore
placement in a prior patch. Signed-off-by: Matthew DeVore --- t/t5317-pack-objects-filter-objects.sh | 156 + t/t5616-partial-clone.sh | 14 ++- t/t6112-rev-list-filters-objects.sh| 103 t/t9101-git-svn-props.sh | 3 +- 4 files

[PATCH v3 5/5] t9109: don't swallow Git errors upstream of pipes

2018-09-20 Thread Matthew DeVore
quotes from double to single to avoid premature string interpolation. Signed-off-by: Matthew DeVore --- t/t9101-git-svn-props.sh | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh index 8cba331fc

[PATCH v3 0/5] Clean up tests for test_cmp arg ordering and pipe placement

2018-09-20 Thread Matthew DeVore
have time. - Unbroke t9101 git-svn test which I had broken pretty badly in v2 of the patchset. - Cleaned up and generalized the wording of the added points in CodingGuidelines. Thank you, Matthew DeVore (5): CodingGuidelines: add shell piping guidelines tests: standardize pipe

[PATCH v3 3/5] t/*: fix ordering of expected/observed arguments

2018-09-20 Thread Matthew DeVore
Fix various places where the ordering was obviously wrong, meaning it was easy to find with grep. Signed-off-by: Matthew DeVore --- t/t-basic.sh | 2 +- t/t0021-conversion.sh | 4 +-- t/t1300-config.sh | 4 +-- t/t1303-wacky

[PATCH v3 1/5] CodingGuidelines: add shell piping guidelines

2018-09-20 Thread Matthew DeVore
Add two guidelines: - pipe characters should appear at the end of lines, and not cause indentation - pipes should be avoided when they swallow exit codes that can potentially fail --- Documentation/CodingGuidelines | 27 +++ 1 file changed, 27 insertions(+) diff

Re: [PATCH v2 1/6] CodingGuidelines: add shell piping guidelines

2018-09-19 Thread Matthew DeVore
On Wed, Sep 19, 2018 at 5:36 AM Eric Sunshine wrote: > > On Tue, Sep 18, 2018 at 10:11 PM Matthew DeVore wrote: > > Yes, it's probably better to add a point about that. Here is the new > > documentation after applying your suggestions: > > > > - If a piped seque

  1   2   >