logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git
commit: 9614d6ff951521d68a37101fb36d477c47819dd7
parent 88c27384043b7574f4ccb2cab45c728d4db2bac9
Author: Michael Forney <mforney@mforney.org>
Date:   Sun, 21 Jun 2020 14:37:29 -0700

git: Fix bug with submodule summary

Diffstat:

M.gitmodules2+-
Apkg/git/patch/0001-revision-use-repository-from-rev_info-when-parsing-c.patch114+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/git/patch/0002-submodule-use-submodule-repository-when-preparing-su.patch45+++++++++++++++++++++++++++++++++++++++++++++
Mpkg/git/ver2+-
4 files changed, 161 insertions(+), 2 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -92,7 +92,7 @@ [submodule "pkg/git/src"] path = pkg/git/src url = https://github.com/git/git - ignore = untracked + ignore = all [submodule "pkg/hostap/src"] path = pkg/hostap/src url = git://w1.fi/hostap.git diff --git a/pkg/git/patch/0001-revision-use-repository-from-rev_info-when-parsing-c.patch b/pkg/git/patch/0001-revision-use-repository-from-rev_info-when-parsing-c.patch @@ -0,0 +1,114 @@ +From 5436472ffdcd5d33b6756a295a10add09db83dd6 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 21 Jun 2020 14:29:38 -0700 +Subject: [PATCH] revision: use repository from rev_info when parsing commits + +Since revision.c was the only user of the parse_commit_gently +compatibility define, remove it from commit.h. + +Signed-off-by: Michael Forney <mforney@mforney.org> +--- + commit.h | 1 - + revision.c | 18 +++++++++--------- + 2 files changed, 9 insertions(+), 10 deletions(-) + +diff --git a/commit.h b/commit.h +index 1b2dea5d85..a2e8ca99a2 100644 +--- a/commit.h ++++ b/commit.h +@@ -97,7 +97,6 @@ static inline int parse_commit_no_graph(struct commit *commit) + + #ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS + #define parse_commit_internal(item, quiet, use) repo_parse_commit_internal(the_repository, item, quiet, use) +-#define parse_commit_gently(item, quiet) repo_parse_commit_gently(the_repository, item, quiet) + #define parse_commit(item) repo_parse_commit(the_repository, item) + #endif + +diff --git a/revision.c b/revision.c +index 60cca8c0b9..3ac0a50ed3 100644 +--- a/revision.c ++++ b/revision.c +@@ -437,7 +437,7 @@ static struct commit *handle_commit(struct rev_info *revs, + if (object->type == OBJ_COMMIT) { + struct commit *commit = (struct commit *)object; + +- if (parse_commit(commit) < 0) ++ if (repo_parse_commit(revs->repo, commit) < 0) + die("unable to parse commit %s", name); + if (flags & UNINTERESTING) { + mark_parents_uninteresting(commit); +@@ -987,7 +987,7 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit) + ts->treesame[0] = 1; + } + } +- if (parse_commit(p) < 0) ++ if (repo_parse_commit(revs->repo, p) < 0) + die("cannot simplify commit %s (because of %s)", + oid_to_hex(&commit->object.oid), + oid_to_hex(&p->object.oid)); +@@ -1032,7 +1032,7 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit) + * IOW, we pretend this parent is a + * "root" commit. + */ +- if (parse_commit(p) < 0) ++ if (repo_parse_commit(revs->repo, p) < 0) + die("cannot simplify commit %s (invalid %s)", + oid_to_hex(&commit->object.oid), + oid_to_hex(&p->object.oid)); +@@ -1100,7 +1100,7 @@ static int process_parents(struct rev_info *revs, struct commit *commit, + parent = parent->next; + if (p) + p->object.flags |= UNINTERESTING; +- if (parse_commit_gently(p, 1) < 0) ++ if (repo_parse_commit_gently(revs->repo, p, 1) < 0) + continue; + if (p->parents) + mark_parents_uninteresting(p); +@@ -1131,7 +1131,7 @@ static int process_parents(struct rev_info *revs, struct commit *commit, + struct commit *p = parent->item; + int gently = revs->ignore_missing_links || + revs->exclude_promisor_objects; +- if (parse_commit_gently(p, gently) < 0) { ++ if (repo_parse_commit_gently(revs->repo, p, gently) < 0) { + if (revs->exclude_promisor_objects && + is_promisor_object(&p->object.oid)) { + if (revs->first_parent_only) +@@ -3289,7 +3289,7 @@ static void explore_walk_step(struct rev_info *revs) + if (!c) + return; + +- if (parse_commit_gently(c, 1) < 0) ++ if (repo_parse_commit_gently(revs->repo, c, 1) < 0) + return; + + if (revs->sort_order == REV_SORT_BY_AUTHOR_DATE) +@@ -3327,7 +3327,7 @@ static void indegree_walk_step(struct rev_info *revs) + if (!c) + return; + +- if (parse_commit_gently(c, 1) < 0) ++ if (repo_parse_commit_gently(revs->repo, c, 1) < 0) + return; + + explore_to_depth(revs, c->generation); +@@ -3408,7 +3408,7 @@ static void init_topo_walk(struct rev_info *revs) + for (list = revs->commits; list; list = list->next) { + struct commit *c = list->item; + +- if (parse_commit_gently(c, 1)) ++ if (repo_parse_commit_gently(revs->repo, c, 1)) + continue; + + test_flag_and_insert(&info->explore_queue, c, TOPO_WALK_EXPLORED); +@@ -3470,7 +3470,7 @@ static void expand_topo_walk(struct rev_info *revs, struct commit *commit) + if (parent->object.flags & UNINTERESTING) + continue; + +- if (parse_commit_gently(parent, 1) < 0) ++ if (repo_parse_commit_gently(revs->repo, parent, 1) < 0) + continue; + + if (parent->generation < info->min_generation) { +-- +2.27.0 + diff --git a/pkg/git/patch/0002-submodule-use-submodule-repository-when-preparing-su.patch b/pkg/git/patch/0002-submodule-use-submodule-repository-when-preparing-su.patch @@ -0,0 +1,45 @@ +From a6b653527f20282c3eeff86551d4ca49b81861e3 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 21 Jun 2020 14:31:53 -0700 +Subject: [PATCH] submodule: use submodule repository when preparing summary + +This prevents looking up a submodule commit in the outer repository's +commit graph, causing a fatal error. + +Signed-off-by: Michael Forney <mforney@mforney.org> +--- + submodule.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/submodule.c b/submodule.c +index e2ef5698c8..937c4f4fdc 100644 +--- a/submodule.c ++++ b/submodule.c +@@ -438,13 +438,13 @@ void handle_ignore_submodules_arg(struct diff_options *diffopt, + */ + } + +-static int prepare_submodule_summary(struct rev_info *rev, const char *path, ++static int prepare_submodule_summary(struct repository *r, struct rev_info *rev, const char *path, + struct commit *left, struct commit *right, + struct commit_list *merge_bases) + { + struct commit_list *list; + +- repo_init_revisions(the_repository, rev, NULL); ++ repo_init_revisions(r, rev, NULL); + setup_revisions(0, NULL, rev, NULL); + rev->left_right = 1; + rev->first_parent_only = 1; +@@ -632,7 +632,7 @@ void show_submodule_summary(struct diff_options *o, const char *path, + goto out; + + /* Treat revision walker failure the same as missing commits */ +- if (prepare_submodule_summary(&rev, path, left, right, merge_bases)) { ++ if (prepare_submodule_summary(sub, &rev, path, left, right, merge_bases)) { + diff_emit_submodule_error(o, "(revision walker failed)\n"); + goto out; + } +-- +2.27.0 + diff --git a/pkg/git/ver b/pkg/git/ver @@ -1 +1 @@ -2.27.0 r0 +2.27.0 r1