Re: [PATCH] submodule: add more exhaustive up-path testing

2018-08-14 Thread Stefan Beller
On Tue, Aug 14, 2018 at 2:05 PM Ævar Arnfjörð Bjarmason wrote: > > So ideally we'd also error out as soon as the host name is touched? > > Do we have some utility function that'll take whatever we have in > remote..url and spew out the username / host / path? We must, > since the clone protocol n

Re: [PATCH 2/2] submodule: munge paths to submodule git directories

2018-08-14 Thread Jonathan Nieder
Hi, Stefan Beller wrote: > On Tue, Aug 14, 2018 at 11:57 AM Jonathan Nieder wrote: >> Second, what if we store the pathname in config? We already store the >> URL there: >> >> [submodule "plugins/hooks"] >> url = https://gerrit.googlesource.com/plugins/hooks >> >> So we

Re: [PATCH] submodule: add more exhaustive up-path testing

2018-08-14 Thread Ævar Arnfjörð Bjarmason
On Tue, Aug 14 2018, Stefan Beller wrote: > On Tue, Aug 14, 2018 at 2:05 PM Ævar Arnfjörð Bjarmason > wrote: > >> > So ideally we'd also error out as soon as the host name is touched? >> >> Do we have some utility function that'll take whatever we have in >> remote..url and spew out the usernam

Re: [PATCH 0/7] Resend of sb/submodule-update-in-c

2018-08-14 Thread Stefan Beller
gist On Tue, Aug 14, 2018 at 2:01 PM Junio C Hamano wrote: > > Stefan Beller writes: > > > Thanks Brandon for pointing out to use repo_git_path instead of > > manually constructing the path. > > > > That is the only change in this resend. > > Rcpt. Hopefully this is now ready for 'next'? I don'

Re: [PATCH] submodule: add more exhaustive up-path testing

2018-08-14 Thread Stefan Beller
On Tue, Aug 14, 2018 at 2:16 PM Ævar Arnfjörð Bjarmason wrote: > > > On Tue, Aug 14 2018, Stefan Beller wrote: > > > On Tue, Aug 14, 2018 at 2:05 PM Ævar Arnfjörð Bjarmason > > wrote: > > > >> > So ideally we'd also error out as soon as the host name is touched? > >> > >> Do we have some utility

Re: Syncing HEAD

2018-08-14 Thread Jeff King
On Tue, Aug 14, 2018 at 05:06:16PM -0400, Jeff King wrote: > On Tue, Aug 14, 2018 at 10:09:37PM +0200, Christian Couder wrote: > > > When cloning with --mirror, the clone gets its HEAD initialized with > > the value HEAD has in its origin remote. After that if HEAD changes in > > origin there is

Re: [PATCH] t5310-pack-bitmaps: fix bogus 'pack-objects to file can use bitmap' test

2018-08-14 Thread Jeff King
On Tue, Aug 14, 2018 at 01:47:21PM +0200, SZEDER Gábor wrote: > The test 'pack-objects to file can use bitmap' added in 645c432d61 > (pack-objects: use reachability bitmap index when generating > non-stdout pack, 2016-09-10) is silently buggy and doesn't check what > it's supposed to. > > In 't53

Re: Syncing HEAD

2018-08-14 Thread Ævar Arnfjörð Bjarmason
On Tue, Aug 14 2018, Christian Couder wrote: > Hi, > > When cloning with --mirror, the clone gets its HEAD initialized with > the value HEAD has in its origin remote. After that if HEAD changes in > origin there is no simple way to sync HEAD at the same time as the > refs are synced. > > It look

git submodule: 3 modules same git repo?

2018-08-14 Thread Joakim Tjernlund
I am trying to create 3 submodules from the same git repo, each pointing to a different branch. Since the repo is somewhat large, I don't want the 3 submodules to clone the same repo 3 times, I want one clone and then have the 3 submodules to point to different commits. Is this possible? If not

[PATCH] partial-clone: render design doc using asciidoc

2018-08-14 Thread Jonathan Nieder
Rendered documentation can be easier to read than raw text because headings and emphasized phrases stand out. Add the missing markup and Makefile rule required to render this design document using asciidoc. Tested by running make -C Documentation technical/partial-clone.html and viewing the o

Re: t5570-git-daemon fails with SIGPIPE on OSX

2018-08-14 Thread Jeff King
On Mon, Aug 06, 2018 at 05:11:13PM +0200, SZEDER Gábor wrote: > - 'git upload-pack' receives the request, parses the want line, > notices the corrupt pack, responds with an 'ERR upload-pack: not > our ref' pkt-line, and die()s right away. > > - 'git fetch' finally approaches the end o

Re: [PATCH 2/2] submodule: munge paths to submodule git directories

2018-08-14 Thread Stefan Beller
On Tue, Aug 14, 2018 at 2:12 PM Jonathan Nieder wrote: > > Hi, > > Stefan Beller wrote: > > On Tue, Aug 14, 2018 at 11:57 AM Jonathan Nieder wrote: > > >> Second, what if we store the pathname in config? We already store the > >> URL there: > >> > >> [submodule "plugins/hooks"] > >>

Re: t5570-git-daemon fails with SIGPIPE on OSX

2018-08-14 Thread Jeff King
On Tue, Aug 14, 2018 at 06:32:47PM -0400, Jeff King wrote: > I suspect the (largely untested) patch below would make your test > problems go away. Or instead, we could simply add sigpipe=ok to the > test_must_fail invocation, but I agree with you that the current > behavior on OS X is not ideal (t

[PATCH 1/2] store submodule in common dir

2018-08-14 Thread Stefan Beller
Signed-off-by: Stefan Beller --- path.c | 1 + 1 file changed, 1 insertion(+) On Tue, Aug 14, 2018 at 3:27 PM Joakim Tjernlund wrote: > > I am trying to create 3 submodules from the same git repo, each pointing to a > different branch. > Since the repo is somewhat large, I don't want the 3 s

Re: [PATCH v4 4/6] rev-list: handle missing tree objects properly

2018-08-14 Thread Matthew DeVore
On Tue, Aug 14, 2018 at 11:06 AM Jonathan Tan wrote: > > > Previously, we assumed only blob objects could be missing. This patch > > makes rev-list handle missing trees like missing blobs. A missing tree > > will cause an error if --missing indicates an error should be caused, > > and the hash is

Re: [PATCH v4 4/6] rev-list: handle missing tree objects properly

2018-08-14 Thread Jonathan Tan
> > > @@ -373,6 +375,7 @@ int cmd_rev_list(int argc, const char **argv, const > > > char *prefix) > > > init_revisions(&revs, prefix); > > > revs.abbrev = DEFAULT_ABBREV; > > > revs.commit_format = CMIT_FMT_UNSPECIFIED; > > > + revs.do_not_die_on_missing_tree = 1; > > > > Is

Re: [PATCH] partial-clone: render design doc using asciidoc

2018-08-14 Thread Stefan Beller
On Tue, Aug 14, 2018 at 3:28 PM Jonathan Nieder wrote: > > Rendered documentation can be easier to read than raw text because > headings and emphasized phrases stand out. Add the missing markup and > Makefile rule required to render this design document using asciidoc. > > Tested by running > >

Re: [PATCH 1/2] store submodule in common dir

2018-08-14 Thread Junio C Hamano
Stefan Beller writes: > Signed-off-by: Stefan Beller > --- > path.c | 1 + > 1 file changed, 1 insertion(+) > > On Tue, Aug 14, 2018 at 3:27 PM Joakim Tjernlund > wrote: >> >> I am trying to create 3 submodules from the same git repo, each pointing to >> a different branch. >> Since the re

Re: git submodule: 3 modules same git repo?

2018-08-14 Thread Jonathan Nieder
Hi, Joakim Tjernlund wrote: > I am trying to create 3 submodules from the same git repo, each pointing to a > different branch. > Since the repo is somewhat large, I don't want the 3 submodules to clone the > same repo 3 > times, I want one clone and then have the 3 submodules to point to diffe

Re: [PATCH] partial-clone: render design doc using asciidoc

2018-08-14 Thread Jonathan Nieder
Hi, Stefan Beller wrote: > On Tue, Aug 14, 2018 at 3:28 PM Jonathan Nieder wrote: >> repack in GC has been updated to not touch promisor >> packfiles at all, and to only repack other objects. > > We'd need to adapt this documentation in Jonathans series? Yes, or in a separate patch. >> -[0] ht

Re: [PATCH v4 4/6] rev-list: handle missing tree objects properly

2018-08-14 Thread Jonathan Tan
> > So we don't want to die in list-objects.c. If we > > fail to fetch, then we will die on line 213 in rev-list.c. > > Why don't we want to die in list-objects.c? When --missing=error is > passed, fetch_if_missing retains its default value of 1, so > parse_tree_gently() will attempt to fetch it -

Re: [PATCH] partial-clone: render design doc using asciidoc

2018-08-14 Thread Stefan Beller
On Tue, Aug 14, 2018 at 4:12 PM Jonathan Nieder wrote: > > Hi, > > Stefan Beller wrote: > > On Tue, Aug 14, 2018 at 3:28 PM Jonathan Nieder wrote: > > >> repack in GC has been updated to not touch promisor > >> packfiles at all, and to only repack other objects. > > > > We'd need to adapt this do

Re: [PATCH 1/2] store submodule in common dir

2018-08-14 Thread Junio C Hamano
Junio C Hamano writes: > My understanding of what Joakim wants to do is to have a top-level > project that has three subdirectories, e.g. kernel/v2.2, kernel/v2.4 > and kernel/v2.6, each of which is a submodule that houses these > versions of Linux kernel source, but only clone Linus's repository

Re: [PATCH 1/2] store submodule in common dir

2018-08-14 Thread Stefan Beller
On Tue, Aug 14, 2018 at 4:04 PM Junio C Hamano wrote: > > Stefan Beller writes: > > > Signed-off-by: Stefan Beller > > --- > > path.c | 1 + > > 1 file changed, 1 insertion(+) > > > > On Tue, Aug 14, 2018 at 3:27 PM Joakim Tjernlund > > wrote: > >> > >> I am trying to create 3 submodules from

Re: [PATCH 1/2] store submodule in common dir

2018-08-14 Thread Stefan Beller
On Tue, Aug 14, 2018 at 4:20 PM Junio C Hamano wrote: > > Junio C Hamano writes: > > > My understanding of what Joakim wants to do is to have a top-level > > project that has three subdirectories, e.g. kernel/v2.2, kernel/v2.4 > > and kernel/v2.6, each of which is a submodule that houses these >

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Matthew DeVore
On Tue, Aug 14, 2018 at 1:55 PM Junio C Hamano wrote: > > Jonathan Tan writes: > > >> - grep -E "tree|blob" objs >trees_and_blobs && > >> - test_line_count = 1 trees_and_blobs > >> + grep -E "tree|blob" objs \ > >> + | awk -f print_1.awk >trees_and_blobs && > >> + git -C r1 rev-parse HEAD: >expec

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Matthew DeVore
On Tue, Aug 14, 2018 at 1:01 PM Jeff King wrote: > > On Tue, Aug 14, 2018 at 10:28:13AM -0700, Matthew DeVore wrote: > > > The name "tree:0" allows later filtering based on depth, i.e. "tree:1" > > would filter out all but the root tree and blobs. In order to avoid > > confusion between 0 and capi

[PATCH v5 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Matthew DeVore
Teach list-objects the "tree:0" filter which allows for filtering out all tree and blob objects (unless other objects are explicitly specified by the user). The purpose of this patch is to allow smaller partial clones. The name of this filter - tree:0 - does not explicitly specify that it also fil

[PATCH v5 3/6] list-objects: always parse trees gently

2018-08-14 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 | 4 +--- 1 file chang

[PATCH v5 4/6] rev-list: handle missing tree objects properly

2018-08-14 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 --- bui

[PATCH v5 0/6] filter: support for excluding all trees and blobs

2018-08-14 Thread Matthew DeVore
Please take a look. I believe I have applied or responded to all suggestions since the last iteration. Matthew DeVore (6): list-objects: store common func args in struct list-objects: refactor to process_tree_contents list-objects: always parse trees gently rev-list: handle missing tree ob

[PATCH v5 1/6] list-objects: store common func args in struct

2018-08-14 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 v5 2/6] list-objects: refactor to process_tree_contents

2018-08-14 Thread Matthew DeVore
This will be used in a follow-up patch to reduce indentation needed when invoking the logic conditionally. i.e. rather than: if (foo) { while (...) { /* this is very indented */ } } we will have: if (foo) process_tree_contents(...); Signed-off-by: Matthew

[PATCH v5 5/6] revision: mark non-user-given objects instead

2018-08-14 Thread Matthew DeVore
Currently, list-objects.c incorrectly treats all root trees of commits as USER_GIVEN. Also, it would be easier to mark objects that are non-user-given instead of user-given, since the places in the code where we access an object through a reference are more obvious than the places where we access a

Re: [PATCH 1/2] store submodule in common dir

2018-08-14 Thread Jonathan Nieder
Junio C Hamano wrote: > Theoretically we should be able to make modules/kernel%2fv2.[24] > additional "worktree"s of modules/kernel%2fv2.6, but given that > these are all "bare" repositories without an attached working tree, > I am not sure how that would supposed to work. Thinking about > having

Re: [PATCH v4 6/6] list-objects-filter: implement filter tree:0

2018-08-14 Thread Jeff King
On Tue, Aug 14, 2018 at 04:55:34PM -0700, Matthew DeVore wrote: > > - it's expensive to compute, because you have to actually walk all of > > the possible commits and trees that could refer to it. This > > prohibits a lot of other optimizations like reachability bitmaps > > (though w

Re: [PATCH 0/9] Add missing includes and forward declares

2018-08-14 Thread Jeff King
On Mon, Aug 13, 2018 at 11:24:37AM -0700, Junio C Hamano wrote: > As things are slowly moving out of the so-far kitchen-sink "cache.h" > into more specific subsystem headers (like object-store.h), we may > actually want to tighten the "header that includes it first" part a > bit in the future, so

Re: [PATCH 0/9] Add missing includes and forward declares

2018-08-14 Thread Jonathan Nieder
Jeff King wrote: > On Mon, Aug 13, 2018 at 11:24:37AM -0700, Junio C Hamano wrote: >> Jeff King wrote: >>> So I think the better test is a two-line .c file with: >>> >>> #include "git-compat-util.h" >>> #include $header_to_check >> >> But until that tightening happens, I do not actually mind t

Re: [PATCH 0/9] Add missing includes and forward declares

2018-08-14 Thread Jonathan Nieder
Jeff King wrote: > Subject: [PATCH] test-tool.h: include git-compat-util.h > > The test-tool programs include "test-tool.h" as their first > include, which breaks our CodingGuideline of "the first > include must be git-compat-util.h or an equivalent". This > isn't actually a problem, as test-tool.

Re: [PATCHv3 1/6] Add missing includes and forward declares

2018-08-14 Thread Jonathan Nieder
Elijah Newren wrote: > Subject: Add missing includes and forward declares nit: s/declares/declarations/ This is a huge patch. Was it autogenerated or generated manually? Can the commit message say something about methodology? Is there an easy way to review it? (Keep in mind that I'm super laz

Re: [PATCHv3 2/6] alloc: make allocate_alloc_state and clear_alloc_state more consistent

2018-08-14 Thread Jonathan Nieder
Elijah Newren wrote: > Since both functions are using the same data type, they should either both > refer to it as void *, or both use the real type (struct alloc_state *). > Opt for the latter. > > Signed-off-by: Elijah Newren > --- > alloc.c | 2 +- > alloc.h | 2 +- > 2 files changed, 2 inse

Re: [PATCHv3 3/6] Move definition of enum branch_track from cache.h to branch.h

2018-08-14 Thread Jonathan Nieder
Elijah Newren wrote: > 'branch_track' feels more closely related to branching, and it is > needed later in branch.h; rather than #include'ing cache.h in branch.h > for this small enum, just move the enum and the external declaration > for git_branch_track to branch.h. > > Signed-off-by: Elijah New

Re: [PATCHv3 4/6] urlmatch.h: fix include guard

2018-08-14 Thread Jonathan Nieder
Elijah Newren wrote: > Signed-off-by: Elijah Newren > --- > urlmatch.h | 2 ++ > 1 file changed, 2 insertions(+) Reviewed-by: Jonathan Nieder This has two benefits: - avoids the definitions in this header from being evaluated twice - many compilers recognize the #include guard idiom and als

Re: [PATCHv3 5/6] compat/precompose_utf8.h: use more common include guard style

2018-08-14 Thread Jonathan Nieder
Elijah Newren wrote: > Signed-off-by: Elijah Newren > --- > compat/precompose_utf8.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Jonathan Nieder The more unusual style is less likely to be recognized by compilers, so we can waste some I/O re-reading the header at co

Re: [PATCHv3 6/6] Add missing includes and forward declares

2018-08-14 Thread Jonathan Nieder
Hi, Elijah Newren wrote: > Signed-off-by: Elijah Newren > --- > bisect.h | 2 ++ > pack-objects.h | 1 + > 2 files changed, 3 insertions(+) Do you have more context about why these are in a separate commit? For pack-objects.h, I think you might be making a fix to the cc/delta-islands to

Re: [PATCH 0/9] Add missing includes and forward declares

2018-08-14 Thread Junio C Hamano
Elijah Newren writes: > On Mon, Aug 13, 2018 at 11:24 AM Junio C Hamano wrote: >> Jeff King writes: > >> As things are slowly moving out of the so-far kitchen-sink "cache.h" >> into more specific subsystem headers (like object-store.h), we may >> actually want to tighten the "header that includ

Re: Syncing HEAD

2018-08-14 Thread Christian Couder
On Tue, Aug 14, 2018 at 11:47 PM, Jeff King wrote: > On Tue, Aug 14, 2018 at 05:06:16PM -0400, Jeff King wrote: > >> On Tue, Aug 14, 2018 at 10:09:37PM +0200, Christian Couder wrote: >> >> > When cloning with --mirror, the clone gets its HEAD initialized with >> > the value HEAD has in its origin

Re: [PATCHv3 1/6] Add missing includes and forward declares

2018-08-14 Thread Elijah Newren
On Tue, Aug 14, 2018 at 10:10 PM Jonathan Nieder wrote: > > Elijah Newren wrote: > > > Subject: Add missing includes and forward declares > > nit: s/declares/declarations/ Thanks. > This is a huge patch. Was it autogenerated or generated manually? > Can the commit message say something about me

Re: [PATCH 0/9] Add missing includes and forward declares

2018-08-14 Thread Elijah Newren
On Tue, Aug 14, 2018 at 10:45 PM Junio C Hamano wrote: > Elijah Newren writes: > > > On Mon, Aug 13, 2018 at 11:24 AM Junio C Hamano wrote: > >> Jeff King writes: > > > >> As things are slowly moving out of the so-far kitchen-sink "cache.h" > >> into more specific subsystem headers (like object

Re: [PATCHv3 1/6] Add missing includes and forward declares

2018-08-14 Thread Jonathan Nieder
Elijah Newren wrote: > I didn't want to repeat that description in all 6 patches, since all > six came from that, so I put it in the cover letter. Since patch #1 > has most that changes though, I guess it makes sense to include it at > least in that one? Yes, that sounds sensible to me. [...] >

Aw: [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet

2018-08-14 Thread Jochen Kühner
  We use git for windows, there I cannot fin the git-submodule.sh! How can I fix it there?   Gesendet: Dienstag, 14. August 2018 um 20:22 Uhr Von: "Stefan Beller" An: jochen.kueh...@gmx.de Cc: git@vger.kernel.org, "Stefan Beller" Betreff: [PATCH] git-submodule.sh: accept verbose flag in cmd_

Re: [PATCHv3 1/6] Add missing includes and forward declares

2018-08-14 Thread Elijah Newren
On Tue, Aug 14, 2018 at 11:13 PM Jonathan Nieder wrote: > > Elijah Newren wrote: > > > I didn't want to repeat that description in all 6 patches, since all > > six came from that, so I put it in the cover letter. Since patch #1 > > has most that changes though, I guess it makes sense to include i

<    1   2