[PATCH] Makefile: add pending semantic patches

2018-11-08 Thread Stefan Beller
From: SZEDER Gábor Add a description and place on how to use coccinelle for large refactorings that happen only once. Based-on-work-by: SZEDER Gábor Signed-off-by: Stefan Beller --- I consider including this patch in a resend instead. It outlays the basics of such a new workflow, which we

Re: [PATCH] gitk: don't highlight submodule diff lines outside submodule diffs

2018-11-06 Thread Stefan Beller
On Tue, Nov 6, 2018 at 12:03 PM Роман Донченко wrote: > > A line that starts with " <" or " >" is not necessarily a submodule > diff line. It might just be a context line in a normal diff, representing > a line starting with " <" or " >" respectively. > > Use the currdiffsubmod variable to

Re: [PATCH] diff: differentiate error handling in parse_color_moved_ws

2018-11-05 Thread Stefan Beller
On Sun, Nov 4, 2018 at 10:12 PM Junio C Hamano wrote: > > Junio C Hamano writes: > > > Stefan Beller writes: > > > >> > >> -static int parse_color_moved_ws(const char *arg) > >> +static unsigned parse_color_moved_ws(const char *arg) > >>

Re: Design of multiple hash support

2018-11-05 Thread Stefan Beller
On Sun, Nov 4, 2018 at 6:36 PM Junio C Hamano wrote: > > "brian m. carlson" writes: > > > I'm currently working on getting Git to support multiple hash algorithms > > in the same binary (SHA-1 and SHA-256). In order to have a fully > > functional binary, we'll need to have some way of

[PATCH] diff: differentiate error handling in parse_color_moved_ws

2018-11-02 Thread Stefan Beller
line options. As the function returns a bit field, change its signature to return an unsigned instead of an int; add a new bit to signal errors. Once the error is signaled, we discard the other bits, such that it doesn't matter if the error bit overlaps with any other bit. Signed-off-by: Stefan

Re: Using --word-diff breaks --color-moved

2018-11-02 Thread Stefan Beller
On Thu, Nov 1, 2018 at 6:19 PM james harvey wrote: > > This sounds like you are asking for two things: > > (1) make color-moved work with words (somehow) > > (2) allow the user to fine tune the heuristics for a block, > > such that default=zebra would still work. > > I was asking for #1. I

Re: [PATCH 3/9] diff: avoid generating unused hunk header lines

2018-11-02 Thread Stefan Beller
> +/* > + * Can be used as a no-op hunk_fn for xdi_diff_outf(), since a NULL > + * one just sends the hunk line to the line_fn callback). > + */ > +void discard_hunk_line(void *, long, long, long, long, const char *, long); Recently we had the discussion on style and naming things. On the one

Re: submodule support in git-bundle

2018-11-02 Thread Stefan Beller
> > This offloading-to-CDN (or "mostly resumable clone" in the > > sense that the communication with the server is minimal, and > > you get most of your data via resumable http range-requests) > > sounds like complete offtopic, but is one of the requirements > > for the repo to submodule

Re: [PATCH 19/24] submodule: use submodule repos for object lookup

2018-11-02 Thread Stefan Beller
On Fri, Nov 2, 2018 at 6:03 AM Derrick Stolee wrote: > > On 10/30/2018 6:08 PM, Stefan Beller wrote: > > This converts the 'show_submodule_header' function to use > > the repository API properly, such that the submodule objects > > are not added to the main object s

Re: submodule support in git-bundle

2018-11-02 Thread Stefan Beller
On Fri, Nov 2, 2018 at 9:10 AM Duy Nguyen wrote: > > I use git-bundle today and it occurs to me that if I want to use it to > transfer part of a history that involves submodule changes, things > aren't pretty. Has anybody given thought on how to do binary history > transfer that contains changes

Re: [PATCHv2 00/24] Bring more repository handles into our code base]

2018-11-01 Thread Stefan Beller
On Tue, Oct 30, 2018 at 11:41 PM Junio C Hamano wrote: > > Stefan Beller writes: > > > I also picked up the patch for pending semantic patches, as the > > first patch, can I have your sign off, please? > > I find this step quite lacking. > > What was post

Re: [PATCH 18/19] submodule: use submodule repos for object lookup

2018-11-01 Thread Stefan Beller
On Wed, Oct 31, 2018 at 6:38 AM Derrick Stolee wrote: > > On 10/16/2018 7:35 PM, Stefan Beller wrote: > > @@ -482,14 +483,46 @@ void prepare_submodule_repo_env(struct argv_array > > *out) > >DEFAULT_GIT_DIR_ENVIRONMENT); > > } > >

Re: Using --word-diff breaks --color-moved

2018-10-31 Thread Stefan Beller
On Wed, Oct 31, 2018 at 12:07 AM james harvey wrote: > I think these options can co-exist. I could be wrong, but I'm betting > the code for "--color-moved" was only written with the typical full > line(s) diff in mind, and wasn't written with "--word-diff" in mind. I think it was brought up,

Re: Using --word-diff breaks --color-moved

2018-10-31 Thread Stefan Beller
On Tue, Oct 30, 2018 at 7:06 PM james harvey wrote: > > If you use both "--word-diff" and "--color-moved", regardless of the > order of arguments, "--word-diff" takes precedence and "--color-moved" > isn't allowed to do anything. The order of arguments doesn't matter here, as these just set

[PATCH 21/24] commit-graph: convert remaining function to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
Convert all functions to handle arbitrary repositories in commit-graph.c that are used by functions taking a repository argument already. Notable exclusion is write_commit_graph and its local functions as that only works on the_repository. Signed-off-by: Stefan Beller --- commit-graph.c | 40

[PATCH 22/24] commit: make free_commit_buffer and release_commit_memory repository agnostic

2018-10-30 Thread Stefan Beller
Pass the object pool to free_commit_buffer and release_commit_memory, such that we can eliminate access to 'the_repository'. Also remove the TODO in release_commit_memory, as commit->util was removed in 9d2c97016f (commit.h: delete 'util' field in struct commit, 2018-05-19) Signed-off-by: Ste

[PATCH 13/24] commit-reach: prepare get_merge_bases to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
Similarly to previous patches, the get_merge_base functions are used often in the code base, which makes migrating them hard. Implement the new functions, prefixed with 'repo_' and hide the old functions behind a wrapper macro. Signed-off-by: Stefan Beller --- commit-reach.c

[PATCH 20/24] submodule: don't add submodule as odb for push

2018-10-30 Thread Stefan Beller
.) This code of push_submodule() is exercised in t5531 and continues to work, showing that the submodule odbc is not needed. Signed-off-by: Stefan Beller --- submodule.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/submodule.c b/submodule.c index 0fdda45252..da1ac1e6f8 100644

[PATCH 17/24] commit: prepare logmsg_reencode to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- commit.h| 8 contrib/coccinelle/the_repository.pending.cocci | 9 + pretty.c| 13 +++-- 3 files changed, 24 insertions(+), 6

[PATCH 18/24] pretty: prepare format_commit_message to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- contrib/coccinelle/the_repository.pending.cocci | 10 ++ pretty.c| 15 --- pretty.h| 7 ++- 3 files changed, 24 insertions

[PATCH 19/24] submodule: use submodule repos for object lookup

2018-10-30 Thread Stefan Beller
This converts the 'show_submodule_header' function to use the repository API properly, such that the submodule objects are not added to the main object store. Signed-off-by: Stefan Beller --- submodule.c | 76 ++--- 1 file changed, 61 insertions

[PATCH 12/24] commit-reach.c: allow get_merge_bases_many_0 to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
Signed-off-by: Stefan Beller --- commit-reach.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/commit-reach.c b/commit-reach.c index ab2bb1e5d5..bf7a513991 100644 --- a/commit-reach.c +++ b/commit-reach.c @@ -216,7 +216,8 @@ static int remove_redundant(struct

[PATCH 14/24] commit-reach: prepare in_merge_bases[_many] to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
Signed-off-by: Stefan Beller --- commit-reach.c | 15 +-- commit-reach.h | 12 ++-- contrib/coccinelle/the_repository.pending.cocci | 16 3 files changed, 35 insertions(+), 8 deletions(-) diff

[PATCH 16/24] commit: prepare repo_unuse_commit_buffer to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
Signed-off-by: Stefan Beller --- commit.c| 6 -- commit.h| 7 ++- contrib/coccinelle/the_repository.pending.cocci | 8 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/commit.c b

[PATCH 15/24] commit: prepare get_commit_buffer to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
Signed-off-by: Stefan Beller --- commit.c| 8 +--- commit.h| 7 ++- contrib/coccinelle/the_repository.pending.cocci | 8 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/commit.c b

[PATCH 24/24] t/helper/test-repository: celebrate independence from the_repository

2018-10-30 Thread Stefan Beller
any accidental access is more likely to be found. Signed-off-by: Stefan Beller --- cache.h| 2 ++ t/helper/test-repository.c | 10 ++ 2 files changed, 12 insertions(+) diff --git a/cache.h b/cache.h index f7fabdde8f..9f535040af 100644 --- a/cache.h +++ b/cach

[PATCH 23/24] path.h: make REPO_GIT_PATH_FUNC repository agnostic

2018-10-30 Thread Stefan Beller
git_pathdup uses the_repository internally, but the macro REPO_GIT_PATH_FUNC is specifically made for arbitrary repositories. Switch to repo_git_path which works on arbitrary repositories. Signed-off-by: Stefan Beller --- path.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 10/24] commit-reach.c: allow merge_bases_many to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
Signed-off-by: Stefan Beller --- commit-reach.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/commit-reach.c b/commit-reach.c index 080ae0a758..4cf471bfaf 100644 --- a/commit-reach.c +++ b/commit-reach.c @@ -95,7 +95,9 @@ static struct commit_list

[PATCH 04/24] object-store: allow read_object_file_extended to read from arbitrary repositories

2018-10-30 Thread Stefan Beller
read_object_file_extended is not widely used, so migrate it all at once. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- object-store.h | 5 +++-- sha1-file.c| 11 ++- streaming.c| 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/object

[PATCH 03/24] packfile: allow has_packed_and_bad to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
has_packed_and_bad is not widely used, so just migrate it all at once. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- packfile.c | 5 +++-- packfile.h | 2 +- sha1-file.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packfile.c b/packfile.c index

[PATCH 02/24] sha1_file: allow read_object to read objects in arbitrary repositories

2018-10-30 Thread Stefan Beller
Allow read_object (a file local functon in sha1_file) to handle arbitrary repositories by passing the repository down to oid_object_info_extended. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- sha1-file.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff

[PATCH 11/24] commit-reach.c: allow remove_redundant to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
Signed-off-by: Stefan Beller --- commit-reach.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/commit-reach.c b/commit-reach.c index 4cf471bfaf..ab2bb1e5d5 100644 --- a/commit-reach.c +++ b/commit-reach.c @@ -156,7 +156,7 @@ struct commit_list

[PATCH 07/24] object: parse_object to honor its repository argument

2018-10-30 Thread Stefan Beller
In 8e4b0b6047 (object.c: allow parse_object to handle arbitrary repositories, 2018-06-28), we forgot to pass the repository down to the read_object_file. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH 05/24] object-store: prepare read_object_file to deal with arbitrary repositories

2018-10-30 Thread Stefan Beller
not apply the resulting patch from 'make coccicheck' to keep the diff of this patch small. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- contrib/coccinelle/the_repository.pending.cocci | 13 + object-store.h | 10 -- 2 files

[PATCH 08/24] commit: allow parse_commit* to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
Just like the previous commit, parse_commit and friends are used a lot and are found in new patches, so we cannot change their signature easily. Re-introduce these function prefixed with 'repo_' that take a repository argument and keep the original as a shallow macro. Signed-off-by: Stefan

[PATCH 06/24] object-store: prepare has_{sha1, object}_file[_with_flags] to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
Signed-off-by: Stefan Beller --- .../coccinelle/the_repository.pending.cocci | 29 +++ object-store.h| 22 ++ sha1-file.c | 15 ++ 3 files changed, 55 insertions(+), 11 deletions(-) diff

[PATCH 09/24] commit-reach.c: allow paint_down_to_common to handle arbitrary repositories

2018-10-30 Thread Stefan Beller
As the function is file local and not widely used, migrate it all at once. Signed-off-by: Stefan Beller --- commit-reach.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/commit-reach.c b/commit-reach.c index a9da65c462..080ae0a758 100644 --- a/commit-reach.c

[PATCHv2 00/24] Bring more repository handles into our code base]

2018-10-30 Thread Stefan Beller
This resends sb/more-repo-in-api On Thu, Oct 25, 2018 at 2:14 AM SZEDER Gábor wrote: > On Tue, Oct 16, 2018 at 04:35:49PM -0700, Stefan Beller wrote: > > This converts the 'show_submodule_header' function to use > > the repository API properly, such that the submodule objects &g

[PATCH 01/24] Makefile: add pending semantic patches

2018-10-30 Thread Stefan Beller
From: SZEDER Gábor There are basically two main use cases for semantic patches: - To avoid undesirable code patterns, e.g. we should not use sha1_to_hex(oid.hash) or strbuf_addf(, "fixed string"), but use oid_to_hex() or strbuf_addstr(, "fixed string") instead.

Re: [RFC PATCH] index-pack: improve performance on NFS

2018-10-29 Thread Stefan Beller
On Mon, Oct 29, 2018 at 3:27 PM Jeff King wrote: > So yeah, that's the other thing I'm thinking about regarding having a > maximum loose cache size. tangent: This preloading/caching could be used for a more precise approach to decide when to gc instead of using some statistical sampling of

Re: [RFC] Generation Number v2

2018-10-29 Thread Stefan Beller
> Based on the performance results alone, we should remove minimum > generation numbers, (epoch, date) pairs, and FELINE index from > consideration. There are enough examples of these indexes performing > poorly. > > In contrast, maximum generation numbers and corrected commit > dates both

Re: [PATCH 06/10] repository: repo_submodule_init to take a submodule struct

2018-10-26 Thread Stefan Beller
On Fri, Oct 26, 2018 at 12:15 PM Jonathan Tan wrote: [snip] > The expected pattern. > > This patch looks good to me. I'll take this as a "Reviewed-by"? Thanks, Stefan

Re: [PATCH v2 1/7] remote.c: add braces in anticipation of a follow-up change

2018-10-26 Thread Stefan Beller
On Fri, Oct 26, 2018 at 12:27 PM Ævar Arnfjörð Bjarmason wrote: > > The CodingGuidelines say "When there are multiple arms to a > conditional and some of them require braces, enclose even a single > line block in braces for consistency.". Fix the code in > match_explicit() to conform. A tangent

Re: What's cooking in git.git (Oct 2018, #05; Fri, 26)

2018-10-26 Thread Stefan Beller
> > * sb/strbuf-h-update (2018-09-29) 1 commit > (merged to 'next' on 2018-10-26 at e4ad935cb0) > + strbuf.h: format according to coding guidelines > > Code clean-up to serve as a BCP example. > > Will merge to 'master'. > Further clean-up patches may need to follow soon before this >

Re: [PATCH v7 00/10] Make submodules work if .gitmodules is not checked out

2018-10-26 Thread Stefan Beller
On Thu, Oct 25, 2018 at 6:59 PM Junio C Hamano wrote: > > Stefan Beller writes: > > >> In this series I am addressing the comments by Stefan Beller about the > >> tests in patch 9. > >> > >> If the new tests look OK, I'd say we try moving t

[PATCH 10/10] builtin/fetch: check for submodule updates in any ref update

2018-10-25 Thread Stefan Beller
s so far, not for FETCH_HEAD. Make sure that fetching a superproject to its FETCH_HEAD, also respects the existence checks for objects in the submodule recursion. Signed-off-by: Stefan Beller --- builtin/fetch.c | 8 ++-- t/t5526-fetch-submodules.sh | 24

[PATCH 09/10] fetch: try fetching submodules if needed objects were not fetched

2018-10-25 Thread Stefan Beller
ry fetching the object ids, we need to identify the object names, which is done in this function check_for_new_submodule_commits(), so we'll also run that code in case the submodule recursion is set to "on". Signed-off-by: Stefan Beller --- builtin/fetch.c |

[PATCH 08/10] submodule.c: fetch in submodules git directory instead of in worktree

2018-10-25 Thread Stefan Beller
Keep the properties introduced in 10f5c52656 (submodule: avoid auto-discovery in prepare_submodule_repo_env(), 2016-09-01), by fixating the git directory of the submodule. Signed-off-by: Stefan Beller --- submodule.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git

[PATCH 07/10] submodule: migrate get_next_submodule to use repository structs

2018-10-25 Thread Stefan Beller
if the submodule is broken. Signed-off-by: Stefan Beller --- submodule.c | 51 +++ 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/submodule.c b/submodule.c index e4b494af7b..a1a32cab7d 100644 --- a/submodule.c +++ b/submodule.c @@ -1240,6

[PATCH 05/10] submodule: store OIDs in changed_submodule_names

2018-10-25 Thread Stefan Beller
access to the util pointer for longer that contains the commits that we need to fetch, which will be useful in a later patch. Signed-off-by: Stefan Beller Reviewed-by: Jonathan Tan --- submodule.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/submodule.c

[PATCH 06/10] repository: repo_submodule_init to take a submodule struct

2018-10-25 Thread Stefan Beller
that is not confused with the struct submodule as easily. Perform such renames in similar functions as well. Also move its documentation into the header file. Signed-off-by: Stefan Beller --- builtin/grep.c | 17 +++- builtin/ls-files.c | 12

[PATCH 03/10] submodule.c: sort changed_submodule_names before searching it

2018-10-25 Thread Stefan Beller
has better worst case execution times. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- submodule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/submodule.c b/submodule.c index e145ebbb16..9fbfcfcfe1 100644 --- a/submodule.c +++ b/submodule.c @@ -1270

[PATCH 04/10] submodule.c: tighten scope of changed_submodule_names struct

2018-10-25 Thread Stefan Beller
The `changed_submodule_names` are only used for fetching, so let's make it part of the struct that is passed around for fetching submodules. Signed-off-by: Stefan Beller --- submodule.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/submodule.c b

[PATCH 02/10] submodule.c: fix indentation

2018-10-25 Thread Stefan Beller
The submodule subsystem is really bad at staying within 80 characters. Fix it while we are here. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- submodule.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/submodule.c b/submodule.c index 2b7082b2db

[PATCH 00/10] Resending sb/submodule-recursive-fetch-gets-the-tip

2018-10-25 Thread Stefan Beller
jonathanta...@google.com/ This is still based on ao/submodule-wo-gitmodules-checked-out. previous version https://public-inbox.org/git/20181016181327.107186-1-sbel...@google.com/ Stefan Beller (10): sha1-array: provide oid_array_filter submodule.c: fix indentation submodule.c: sort changed_submo

[PATCH 01/10] sha1-array: provide oid_array_filter

2018-10-25 Thread Stefan Beller
Helped-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- Documentation/technical/api-oid-array.txt | 5 + sha1-array.c | 17 + sha1-array.h | 3 +++ 3 files changed, 25 insertions

Re: [PATCH 8/9] fetch: retry fetching submodules if needed objects were not fetched

2018-10-25 Thread Stefan Beller
On Tue, Oct 23, 2018 at 4:38 PM Jonathan Tan wrote: > > > > Another thing you need to clarify is what happens if the fetch-by-commit > > > fails. Right now, it seems that it will make the whole thing fail, which > > > might be a surprising change in behavior. > > > > But a positive surprise, I

Re: New semantic patches vs. in-flight topics [was: Re: [PATCH 00/19] Bring more repository handles into our code base]

2018-10-25 Thread Stefan Beller
On Wed, Oct 24, 2018 at 6:59 PM SZEDER Gábor wrote: > > On Mon, Oct 22, 2018 at 11:54:06AM -0700, Stefan Beller wrote: > > > For the sake of a good history, I would think running 'make coccicheck' > > and applying the resulting patches would be best as part of the (dirty) &

Re: [PATCH v7 00/10] Make submodules work if .gitmodules is not checked out

2018-10-25 Thread Stefan Beller
> In this series I am addressing the comments by Stefan Beller about the > tests in patch 9. > > If the new tests look OK, I'd say we try moving the series to "next" and > see what happens? Sounds good to me. Thanks, Stefan

Re: [PATCH] fetch-pack: be more precise in parsing v2 response

2018-10-25 Thread Stefan Beller
On Thu, Oct 25, 2018 at 2:04 AM Junio C Hamano wrote: > > Junio C Hamano writes: > > > Jonathan Tan writes: > > > >> +GIT_TRACE_PACKET="$(pwd)/log" test_must_fail git -C http_child \ > >> +-c protocol.version=2 \ > >> +fetch "$HTTPD_URL/one_time_sed/http_parent" 2>

Re: Confusing behavior with ignored submodules and `git commit -a`

2018-10-25 Thread Stefan Beller
On Thu, Oct 25, 2018 at 11:03 AM Michael Forney wrote: > > On 2018-03-16, Michael Forney wrote: > > Hi, > > > > In the past few months have noticed some confusing behavior with > > ignored submodules. I finally got around to bisecting this to commit > > 5556808690ea245708fb80383be5c1afee2fb3eb

Re: [PATCH 7/9] submodule: fetch in submodules git directory instead of in worktree

2018-10-23 Thread Stefan Beller
On Tue, Oct 23, 2018 at 3:55 PM Jonathan Tan wrote: > > When adding the comment here, we'd also want to have > > the comment in prepare_submodule_repo_env, which > > could be its own preparation commit. > > I agree with the protection. As for the preparation commit, I don't > think it's always

Re: [PATCH 8/9] fetch: retry fetching submodules if needed objects were not fetched

2018-10-23 Thread Stefan Beller
On Wed, Oct 17, 2018 at 5:40 PM Jonathan Tan wrote: > > > Currently when git-fetch is asked to recurse into submodules, it dispatches > > a plain "git-fetch -C " (with some submodule related options > > such as prefix and recusing strategy, but) without any information of the > > remote or the

Re: git pull defaults for recursesubmodules

2018-10-23 Thread Stefan Beller
On Tue, Oct 23, 2018 at 2:04 PM Tommi Vainikainen wrote: > > I configured my local git to fetch with recurseSubmodules = on-demand, > which I found the most convenient setting. However then I noticed that > I mostly use git pull actually to fetch from remotes, but git pull > does not utilize any

Re: [PATCH 7/9] submodule: fetch in submodules git directory instead of in worktree

2018-10-23 Thread Stefan Beller
On Wed, Oct 17, 2018 at 3:58 PM Jonathan Tan wrote: > > > This patch started as a refactoring to make 'get_next_submodule' more > > readable, but upon doing so, I realized that "git fetch" of the submodule > > actually doesn't need to be run in the submodules worktree. So let's run > > it in its

Re: New semantic patches vs. in-flight topics [was: Re: [PATCH 00/19] Bring more repository handles into our code base]

2018-10-23 Thread Stefan Beller
On Tue, Oct 23, 2018 at 2:38 AM Junio C Hamano wrote: > > Junio C Hamano writes: > > > I actually think this round does a far nicer job playing well with > > other topics than any earlier series. The pain you are observing I > > think come primarily from my not making the best use of these > >

Re: [PATCH v2 1/1] protocol: advertise multiple supported versions

2018-10-22 Thread Stefan Beller
> > similar to argv_array_pushl or would that be overengineered? > Am I missing some other way to do this cleanly? I'll admit I'm not very > familiar with va_lists. Ah, you're right. By not passing pointers (and I am unfamiliar with va_lists, too), this was a moot suggestion. > > Yeah, my

Re: New semantic patches vs. in-flight topics [was: Re: [PATCH 00/19] Bring more repository handles into our code base]

2018-10-22 Thread Stefan Beller
> Stepping back a bit, I'd imagine in an ideal world where "make > coccicheck" can be done instantaneously _and_ the spatch machinery > is just as reliable as C compilers. > [...] > Now we do not live in that ideal world and [...] > such a series will have zero > chance of landing in 'pu', unless

Bug with "git mv" and submodules, and with "git submodule add something --force"

2018-10-22 Thread Stefan Beller
On Sun, Oct 21, 2018 at 7:52 PM Junio C Hamano wrote: > > Jonathan Nieder writes: > > > Stefan Beller wrote: > > > >> Maybe for now we can do with just an update of the documentation/bugs > >> section and say we cannot move files in and out of submodules

Re: [PATCH 00/59] Split config.txt

2018-10-22 Thread Stefan Beller
On Sat, Oct 20, 2018 at 5:39 AM Nguyễn Thái Ngọc Duy wrote: > > I started this a couple months back, moving a couple big config > sections out of config.txt to make it more manageable. This series > almost completes that. It moves all configs (except http.* which have > changes on 'pu') out of

Re: New semantic patches vs. in-flight topics [was: Re: [PATCH 00/19] Bring more repository handles into our code base]

2018-10-22 Thread Stefan Beller
On Mon, Oct 22, 2018 at 10:39 AM SZEDER Gábor wrote: > > On Tue, Oct 16, 2018 at 04:35:31PM -0700, Stefan Beller wrote: > > the last patch (applying the semantic patches) has been omitted as that > > would produce a lot of merge conflicts. Without that patch, this merges &

Re: Bug with "git mv" and submodules, and with "git submodule add something --force"

2018-10-19 Thread Stefan Beller
On Fri, Oct 19, 2018 at 5:43 AM Juergen Vogl wrote: > > Hi there, > > tested on both, git 2.18 and git 2.19.1: > > moving a file with `git mv` from a project to a submodule results in an > **undefined state** of the local repository. Luckily we do have a submodule in git.git itself, so we can

Re: [PATCH] submodule.c: remove some of the_repository references

2018-10-19 Thread Stefan Beller
On Fri, Oct 19, 2018 at 10:34 AM Nguyễn Thái Ngọc Duy wrote: > > > struct collect_changed_submodules_cb_data { > + struct repository *repo; This slightly overlaps with sb/submodule-recursive-fetch-gets-the-tip, but we can have this patch on its own as I have to rebuild that series, will

Re: [PATCH/WIP 00/19] Kill the_index, final part

2018-10-19 Thread Stefan Beller
On Fri, Oct 19, 2018 at 7:52 AM Nguyễn Thái Ngọc Duy wrote: > > Stefan I see you start removing more references of the_repository in > another series (haven't really looked at it yet) so this is just heads > up so we could coordinate if needed. Still WIP, not really ready for > review yet. I'll

Re: [PATCH v2] diff: don't attempt to strip prefix from absolute Windows paths

2018-10-19 Thread Stefan Beller
may be other OS that have interesting absolute path which I may be unaware of. Reviewed-by: Stefan Beller

Re: [PATCH v2 19/24] submodule.c: remove implicit dependency on the_index

2018-10-19 Thread Stefan Beller
> > > > Yeah. Killing the_index is just the first small step (didn't look that > > small when I started). Now it's all about the_repository ;-) and we > > have like 400 references of it just in library code. > > I suspect it is much worse than that, even. There are many spots that > likely are

Re: [RFC PATCH 0/2] Bring the_repository into cmd_foo

2018-10-18 Thread Stefan Beller
On Thu, Oct 18, 2018 at 2:01 PM Jonathan Tan wrote: > > > > Or instead we could accelerate the long term plan of removing a > > > hard coded the_repository and have each cmd builtin take an additional > > > repository pointer from the init code, such that we'd bring all of Git to > > > work on

Re: [PATCH 4/9] submodule.c: move global changed_submodule_names into fetch submodule struct

2018-10-18 Thread Stefan Beller
On Wed, Oct 17, 2018 at 2:26 PM Jonathan Tan wrote: > > > The `changed_submodule_names` are only used for fetching, so let's make it > > part of the struct that is passed around for fetching submodules. > > Keep the titles of commit messages to 50 characters or under. renamed > > > +static void

Re: [PATCH] diff: don't attempt to strip prefix from absolute Windows paths

2018-10-18 Thread Stefan Beller
On Thu, Oct 18, 2018 at 11:38 AM Johannes Sixt wrote: > There is one peculiarity, though: [...] The explanation makes sense, and the code looks good. Do we want to have a test for this niche case?

[RFC PATCH 2/2 (BREAKS BUILD)] builtin/merge-base.c: do not rely on the_repository any more

2018-10-18 Thread Stefan Beller
To avoid creeping in the dependency of the_repository, use GIT_NO_THE_REPOSITORY in the test to prove it still works. Signed-off-by: Stefan Beller --- This doesn't work yet, as we have not converted get_oid, yet. It proves that GIT_NO_THE_REPOSITORY works, though. Stefan builtin/merge-base.c

[RFC PATCH 1/2] repository: have get_the_repository() to remove the_repository dependency

2018-10-18 Thread Stefan Beller
. Signed-off-by: Stefan Beller --- repository.c | 10 ++ repository.h | 13 - 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/repository.c b/repository.c index 5dd1486718..babb88 100644 --- a/repository.c +++ b/repository.c @@ -20,6 +20,16 @@ void

[RFC PATCH 0/2] Bring the_repository into cmd_foo

2018-10-18 Thread Stefan Beller
for git-merge-base. The core idea is found in patch 1, and the proof of concept is found in patch 2. What do you think? Thanks, Stefan Stefan Beller (3): repository: have get_the_repository() to remove the_repository dependency builtin/merge-base.c: do not rely on the_repos

Re: [PATCH 0/9] Resending sb/submodule-recursive-fetch-gets-the-tip

2018-10-18 Thread Stefan Beller
On Thu, Oct 18, 2018 at 12:30 AM Junio C Hamano wrote: > > Stefan Beller writes: > > > This is based on ao/submodule-wo-gitmodules-checked-out. > > > > This resends origin/sb/submodule-recursive-fetch-gets-the-tip, resolving > > the issues pointed out via >

Re: [PATCH 00/19] Bring more repository handles into our code base

2018-10-17 Thread Stefan Beller
On Wed, Oct 17, 2018 at 5:41 AM Derrick Stolee wrote: > > On 10/16/2018 7:35 PM, Stefan Beller wrote: > > > > This series takes another approach as it doesn't change the signature > > of > > functions, but introduces new functions that can deal with a

[PATCH] builtin/submodule--helper: remove debugging leftover tracing

2018-10-16 Thread Stefan Beller
-by: Stefan Beller --- To be applied on (or squashed into the tip of) sb/submodule-update-in-c builtin/submodule--helper.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 5c9d1fb496..c7d3841ffc 100644 --- a/builtin/submodule

[PATCH 16/19] commit: prepare logmsg_reencode to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- commit.h| 8 contrib/coccinelle/the_repository.cocci | 9 + pretty.c| 13 +++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git

[PATCH 14/19] commit: prepare get_commit_buffer to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
Signed-off-by: Stefan Beller --- commit.c| 8 +--- commit.h| 7 ++- contrib/coccinelle/the_repository.cocci | 8 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/commit.c b/commit.c index fe942754e2

[PATCH 13/19] commit-reach: prepare in_merge_bases[_many] to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
Signed-off-by: Stefan Beller --- commit-reach.c | 15 +-- commit-reach.h | 12 ++-- contrib/coccinelle/the_repository.cocci | 16 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/commit-reach.c

[PATCH 15/19] commit: prepare repo_unuse_commit_buffer to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
Signed-off-by: Stefan Beller --- commit.c| 6 -- commit.h| 7 ++- contrib/coccinelle/the_repository.cocci | 8 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/commit.c b/commit.c index cc5321af8c

[PATCH 17/19] pretty: prepare format_commit_message to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- contrib/coccinelle/the_repository.cocci | 10 ++ pretty.c| 15 --- pretty.h| 7 ++- 3 files changed, 24 insertions(+), 8 deletions(-) diff

[PATCH 18/19] submodule: use submodule repos for object lookup

2018-10-16 Thread Stefan Beller
This converts the 'show_submodule_header' function to use the repository API properly, such that the submodule objects are not added to the main object store. Signed-off-by: Stefan Beller --- submodule.c | 75 ++--- 1 file changed, 60 insertions

[PATCH 19/19] submodule: don't add submodule as odb for push

2018-10-16 Thread Stefan Beller
.) Signed-off-by: Stefan Beller --- submodule.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/submodule.c b/submodule.c index 7305ae2e10..e623e6bf7f 100644 --- a/submodule.c +++ b/submodule.c @@ -1024,9 +1024,6 @@ static int push_submodule(const char *path, const

[PATCH 08/19] commit-reach.c: allow paint_down_to_common to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
As the function is file local and not widely used, migrate it all at once. Signed-off-by: Stefan Beller --- commit-reach.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/commit-reach.c b/commit-reach.c index 5a845440a9..2f7ae20bd4 100644 --- a/commit-reach.c

[PATCH 05/19] object-store: prepare has_{sha1, object}_file[_with_flags] to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
Signed-off-by: Stefan Beller --- contrib/coccinelle/the_repository.cocci | 29 + object-store.h | 22 ++- sha1-file.c | 15 - 3 files changed, 55 insertions(+), 11 deletions(-) diff --git

[PATCH 07/19] commit: allow parse_commit* to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
Just like the previous commit, parse_commit and friends are used a lot and are found in new patches, so we cannot change their signature easily. Re-introduce these function prefixed with 'repo_' that take a repository argument and keep the original as a shallow macro. Signed-off-by: Stefan

[PATCH 12/19] commit-reach: prepare get_merge_bases to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
Similarly to previous patches, the get_merge_base functions are used often in the code base, which makes migrating them hard. Implement the new functions, prefixed with 'repo_' and hide the old functions behind a wrapper macro. Signed-off-by: Stefan Beller --- commit-reach.c

[PATCH 09/19] commit-reach.c: allow merge_bases_many to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
Signed-off-by: Stefan Beller --- commit-reach.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/commit-reach.c b/commit-reach.c index 2f7ae20bd4..aacd8cdc1e 100644 --- a/commit-reach.c +++ b/commit-reach.c @@ -92,7 +92,9 @@ static struct commit_list

[PATCH 11/19] commit-reach.c: allow get_merge_bases_many_0 to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
Signed-off-by: Stefan Beller --- commit-reach.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/commit-reach.c b/commit-reach.c index bce4169f1f..df93274966 100644 --- a/commit-reach.c +++ b/commit-reach.c @@ -213,7 +213,8 @@ static int remove_redundant(struct

[PATCH 10/19] commit-reach.c: allow remove_redundant to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
Signed-off-by: Stefan Beller --- commit-reach.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/commit-reach.c b/commit-reach.c index aacd8cdc1e..bce4169f1f 100644 --- a/commit-reach.c +++ b/commit-reach.c @@ -153,7 +153,7 @@ struct commit_list

[PATCH 02/19] packfile: allow has_packed_and_bad to handle arbitrary repositories

2018-10-16 Thread Stefan Beller
has_packed_and_bad is not widely used, so just migrate it all at once. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- packfile.c | 5 +++-- packfile.h | 2 +- sha1-file.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packfile.c b/packfile.c index

<    1   2   3   4   5   6   7   8   9   10   >