* [PATCH] upload-pack: remove unused "create_full_pack" code in do_rev_list
@ 2010-07-28 9:39 Nguyễn Thái Ngọc Duy
2010-07-28 16:47 ` Elijah Newren
2010-07-28 17:23 ` Junio C Hamano
0 siblings, 2 replies; 3+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2010-07-28 9:39 UTC (permalink / raw)
To: git, Junio C Hamano; +Cc: Nguyễn Thái Ngọc Duy
A bit of history in chronological order, the newest at bottom:
- 80ccaa7 (upload-pack: Move the revision walker into a separate function.)
do_rev_list was introduced with create_full_pack argument
- 21edd3f (upload-pack: Run rev-list in an asynchronous function.)
do_rev_list was now called by start_async, create_full_pack was
passed by rev_list.data
- f0cea83 (Shift object enumeration out of upload-pack)
rev_list.data was now zero permanently. Creating full pack was
done by passing --all to pack-objects
- ae6a560 (run-command: support custom fd-set in async)
rev_list.data = 0 was found out redudant and got rid of.
Get rid of the code as well, for less headache while reading do_rev_list.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
upload-pack.c | 29 ++++++++++++-----------------
1 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/upload-pack.c b/upload-pack.c
index dc464d7..8f4c718 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -105,7 +105,7 @@ static void show_edge(struct commit *commit)
fprintf(pack_pipe, "-%s\n", sha1_to_hex(commit->object.sha1));
}
-static int do_rev_list(int in, int out, void *create_full_pack)
+static int do_rev_list(int in, int out, void *user_data)
{
int i;
struct rev_info revs;
@@ -118,23 +118,18 @@ static int do_rev_list(int in, int out, void *create_full_pack)
if (use_thin_pack)
revs.edge_hint = 1;
- if (create_full_pack) {
- const char *args[] = {"rev-list", "--all", NULL};
- setup_revisions(2, args, &revs, NULL);
- } else {
- for (i = 0; i < want_obj.nr; i++) {
- struct object *o = want_obj.objects[i].item;
- /* why??? */
- o->flags &= ~UNINTERESTING;
- add_pending_object(&revs, o, NULL);
- }
- for (i = 0; i < have_obj.nr; i++) {
- struct object *o = have_obj.objects[i].item;
- o->flags |= UNINTERESTING;
- add_pending_object(&revs, o, NULL);
- }
- setup_revisions(0, NULL, &revs, NULL);
+ for (i = 0; i < want_obj.nr; i++) {
+ struct object *o = want_obj.objects[i].item;
+ /* why??? */
+ o->flags &= ~UNINTERESTING;
+ add_pending_object(&revs, o, NULL);
+ }
+ for (i = 0; i < have_obj.nr; i++) {
+ struct object *o = have_obj.objects[i].item;
+ o->flags |= UNINTERESTING;
+ add_pending_object(&revs, o, NULL);
}
+ setup_revisions(0, NULL, &revs, NULL);
if (prepare_revision_walk(&revs))
die("revision walk setup failed");
mark_edges_uninteresting(revs.commits, &revs, show_edge);
--
1.7.1.rc1.69.g24c2f7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] upload-pack: remove unused "create_full_pack" code in do_rev_list
2010-07-28 9:39 [PATCH] upload-pack: remove unused "create_full_pack" code in do_rev_list Nguyễn Thái Ngọc Duy
@ 2010-07-28 16:47 ` Elijah Newren
2010-07-28 17:23 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Elijah Newren @ 2010-07-28 16:47 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git, Junio C Hamano
Hi,
2010/7/28 Nguyễn Thái Ngọc Duy <pclouds@gmail.com>:
> A bit of history in chronological order, the newest at bottom:
>
> - 80ccaa7 (upload-pack: Move the revision walker into a separate function.)
> do_rev_list was introduced with create_full_pack argument
>
> - 21edd3f (upload-pack: Run rev-list in an asynchronous function.)
> do_rev_list was now called by start_async, create_full_pack was
> passed by rev_list.data
>
> - f0cea83 (Shift object enumeration out of upload-pack)
> rev_list.data was now zero permanently. Creating full pack was
> done by passing --all to pack-objects
>
> - ae6a560 (run-command: support custom fd-set in async)
> rev_list.data = 0 was found out redudant and got rid of.
>
> Get rid of the code as well, for less headache while reading do_rev_list.
Definitely a more detailed explanation than I gave for this patch
(http://thread.gmane.org/gmane.comp.version-control.git/151667). :-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] upload-pack: remove unused "create_full_pack" code in do_rev_list
2010-07-28 9:39 [PATCH] upload-pack: remove unused "create_full_pack" code in do_rev_list Nguyễn Thái Ngọc Duy
2010-07-28 16:47 ` Elijah Newren
@ 2010-07-28 17:23 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2010-07-28 17:23 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> A bit of history in chronological order, the newest at bottom:
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-28 17:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-28 9:39 [PATCH] upload-pack: remove unused "create_full_pack" code in do_rev_list Nguyễn Thái Ngọc Duy
2010-07-28 16:47 ` Elijah Newren
2010-07-28 17:23 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).