[v3,14/23] patch-ids.c: remove implicit dependency on the_index
diff mbox series

Message ID 20180909085418.31531-15-pclouds@gmail.com
State New
Headers show
Series
  • [v3,01/23] archive.c: remove implicit dependency the_repository
Related show

Commit Message

Duy Nguyen Sept. 9, 2018, 8:54 a.m. UTC
---
 builtin/log.c | 2 +-
 patch-ids.c   | 4 ++--
 patch-ids.h   | 3 ++-
 revision.c    | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

Comments

Stefan Beller Sept. 10, 2018, 6:49 p.m. UTC | #1
On Sun, Sep 9, 2018 at 1:54 AM Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
>
> ---

Junio would have to forge your Sign off here?
(I just realize this holds true for the whole series,
but it occurred to me in this patch, as I was looking at
the diff_setup[_done] part on the previous round.
Junio C Hamano Sept. 10, 2018, 7:28 p.m. UTC | #2
Stefan Beller <sbeller@google.com> writes:

> On Sun, Sep 9, 2018 at 1:54 AM Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
>>
>> ---
>
> Junio would have to forge your Sign off here?
> (I just realize this holds true for the whole series,
> but it occurred to me in this patch, as I was looking at
> the diff_setup[_done] part on the previous round.

That is fine; as I said elsewhere, I am treating patches, other than
regression fixes, sent to the list during prerelease freeze as mere
"test data" for the 2.19-pre version of Git, and I may end up
keeping the result of testing "git am" on them as topic branches,
but there is no promise I'd do so.  Reading patches on the list and
commenting on them can be done without sign-offs; you can treat them
as an early draft that is not meant for the final application.

I may come back to leftover patches in the list archive after the
release is made, but honestly I'd prefer to see them sent afresh
after the final for the next round, taking input from the review
comments as necessary.
Duy Nguyen Sept. 11, 2018, 4:05 p.m. UTC | #3
On Mon, Sep 10, 2018 at 8:50 PM Stefan Beller <sbeller@google.com> wrote:
>
> On Sun, Sep 9, 2018 at 1:54 AM Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
> >
> > ---
>
> Junio would have to forge your Sign off here?

I _knew_ I missed something in that "git format-patch" command but
couldn't figure out what! Will resend (I have to fix your other
comment about init_revisions anyway; my mistake)

Patch
diff mbox series

diff --git a/builtin/log.c b/builtin/log.c
index 4b602236d6..978fe7c10f 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -914,7 +914,7 @@  static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids)
 	if ((flags1 & UNINTERESTING) == (flags2 & UNINTERESTING))
 		die(_("Not a range."));
 
-	init_patch_ids(ids);
+	init_patch_ids(the_repository, ids);
 
 	/* given a range a..b get all patch ids for b..a */
 	init_revisions(&check_rev, rev->prefix);
diff --git a/patch-ids.c b/patch-ids.c
index 342950c79d..7da86047d9 100644
--- a/patch-ids.c
+++ b/patch-ids.c
@@ -56,10 +56,10 @@  static int patch_id_cmp(const void *cmpfn_data,
 	return oidcmp(&a->patch_id, &b->patch_id);
 }
 
-int init_patch_ids(struct patch_ids *ids)
+int init_patch_ids(struct repository *r, struct patch_ids *ids)
 {
 	memset(ids, 0, sizeof(*ids));
-	repo_diff_setup(the_repository, &ids->diffopts);
+	repo_diff_setup(r, &ids->diffopts);
 	ids->diffopts.detect_rename = 0;
 	ids->diffopts.flags.recursive = 1;
 	diff_setup_done(&ids->diffopts);
diff --git a/patch-ids.h b/patch-ids.h
index 79ac9a8498..82a12b66f8 100644
--- a/patch-ids.h
+++ b/patch-ids.h
@@ -6,6 +6,7 @@ 
 
 struct commit;
 struct object_id;
+struct repository;
 
 struct patch_id {
 	struct hashmap_entry ent;
@@ -20,7 +21,7 @@  struct patch_ids {
 
 int commit_patch_id(struct commit *commit, struct diff_options *options,
 		    struct object_id *oid, int);
-int init_patch_ids(struct patch_ids *);
+int init_patch_ids(struct repository *, struct patch_ids *);
 int free_patch_ids(struct patch_ids *);
 struct patch_id *add_commit_patch_id(struct commit *, struct patch_ids *);
 struct patch_id *has_commit_patch_id(struct commit *, struct patch_ids *);
diff --git a/revision.c b/revision.c
index 0c6dc8c163..d70587678c 100644
--- a/revision.c
+++ b/revision.c
@@ -877,7 +877,7 @@  static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
 		return;
 
 	left_first = left_count < right_count;
-	init_patch_ids(&ids);
+	init_patch_ids(the_repository, &ids);
 	ids.diffopts.pathspec = revs->diffopt.pathspec;
 
 	/* Compute patch-ids for one side */