git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dana How" <danahow@gmail.com>
To: "Junio C Hamano" <junkio@cox.net>
Cc: git@vger.kernel.org, danahow@gmail.com
Subject: [PATCH 06/13] small source reorderings to prepare for --pack-limit
Date: Thu, 5 Apr 2007 15:32:14 -0700	[thread overview]
Message-ID: <56b7f5510704051532q15ac161am413fc5a3cdf1c93@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 167 bytes --]

---
 builtin-pack-objects.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

-- 
Dana L. How  danahow@gmail.com  +1 650 804 5991 cell

[-- Attachment #2: 0006-small-source-reorderings-to-prepare-for-pack-limit.patch.txt --]
[-- Type: text/plain, Size: 2048 bytes --]

From a18da16f22cb2888cad3d6ce6c55332865eebb25 Mon Sep 17 00:00:00 2001
From: Dana How <how@deathvalley.cswitch.com>
Date: Thu, 5 Apr 2007 13:47:53 -0700
Subject: [PATCH 06/13] small source reorderings to prepare for --pack-limit

---
 builtin-pack-objects.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 7da06a8..0a9deb0 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -519,6 +519,16 @@ static off_t write_one(struct sha1file *f,
 	return offset + write_object(f, e);
 }
 
+typedef int (*entry_sort_t)(const struct object_entry *, const struct object_entry *);
+
+static entry_sort_t current_sort;
+
+/* forward declarations for write_pack_file */
+/* (probably should move sorting stuff up here) */
+static int sort_comparator(const void *_a, const void *_b);
+static int sha1_sort(const struct object_entry *a, const struct object_entry *b);
+static void write_index_file(void);
+
 static void write_pack_file(void)
 {
 	uint32_t i;
@@ -563,6 +573,10 @@ static void write_pack_file(void)
 	if (written != nr_result)
 		die("wrote %u objects while expecting %u", written, nr_result);
 	sha1close(f, pack_file_sha1, 1);
+	if (!pack_to_stdout) {
+		write_index_file();
+		puts(sha1_to_hex(object_list_sha1));
+	}
 }
 
 static void write_index_file(void)
@@ -1107,10 +1121,6 @@ static void get_object_details(void)
 	}
 }
 
-typedef int (*entry_sort_t)(const struct object_entry *, const struct object_entry *);
-
-static entry_sort_t current_sort;
-
 static int sort_comparator(const void *_a, const void *_b)
 {
 	struct object_entry *a = *(struct object_entry **)_a;
@@ -1699,10 +1709,6 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 			progress_update = 0;
 		}
 		write_pack_file();
-		if (!pack_to_stdout) {
-			write_index_file();
-			puts(sha1_to_hex(object_list_sha1));
-		}
 	}
 	if (progress)
 		fprintf(stderr, "Total %u (delta %u), reused %u (delta %u)\n",
-- 
1.5.1.rc2.18.g9c88-dirty


                 reply	other threads:[~2007-04-05 22:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56b7f5510704051532q15ac161am413fc5a3cdf1c93@mail.gmail.com \
    --to=danahow@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).