git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] Export matches_pack_name() and fix its return value
@ 2007-09-17  8:44 Junio C Hamano
  2007-09-17  8:44 ` [PATCH 2/8] pack-objects --keep-unreachable Junio C Hamano
                   ` (6 more replies)
  0 siblings, 7 replies; 19+ messages in thread
From: Junio C Hamano @ 2007-09-17  8:44 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

The function sounds boolean; make it behave as one, not "0 for
success, non-zero for failure".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 cache.h     |    1 +
 sha1_file.c |   14 +++++++-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/cache.h b/cache.h
index 70abbd5..3fa5b8e 100644
--- a/cache.h
+++ b/cache.h
@@ -529,6 +529,7 @@ extern void *unpack_entry(struct packed_git *, off_t, enum object_type *, unsign
 extern unsigned long unpack_object_header_gently(const unsigned char *buf, unsigned long len, enum object_type *type, unsigned long *sizep);
 extern unsigned long get_size_from_delta(struct packed_git *, struct pack_window **, off_t);
 extern const char *packed_object_info_detail(struct packed_git *, off_t, unsigned long *, unsigned long *, unsigned int *, unsigned char *);
+extern int matches_pack_name(struct packed_git *p, const char *name);
 
 /* Dumb servers support */
 extern int update_server_info(int);
diff --git a/sha1_file.c b/sha1_file.c
index 9978a58..5801c3e 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1684,22 +1684,22 @@ off_t find_pack_entry_one(const unsigned char *sha1,
 	return 0;
 }
 
-static int matches_pack_name(struct packed_git *p, const char *ig)
+int matches_pack_name(struct packed_git *p, const char *name)
 {
 	const char *last_c, *c;
 
-	if (!strcmp(p->pack_name, ig))
-		return 0;
+	if (!strcmp(p->pack_name, name))
+		return 1;
 
 	for (c = p->pack_name, last_c = c; *c;)
 		if (*c == '/')
 			last_c = ++c;
 		else
 			++c;
-	if (!strcmp(last_c, ig))
-		return 0;
+	if (!strcmp(last_c, name))
+		return 1;
 
-	return 1;
+	return 0;
 }
 
 static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e, const char **ignore_packed)
@@ -1717,7 +1717,7 @@ static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e, cons
 		if (ignore_packed) {
 			const char **ig;
 			for (ig = ignore_packed; *ig; ig++)
-				if (!matches_pack_name(p, *ig))
+				if (matches_pack_name(p, *ig))
 					break;
 			if (*ig)
 				goto next;
-- 
1.5.3.1.967.g6bb01

^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [PATCH 0/8] Updated git-gc --auto series.
@ 2007-09-17  8:27 Junio C Hamano
  2007-09-17  8:27 ` [PATCH 7/8] git-gc --auto: restructure the way "repack" command line is built Junio C Hamano
  0 siblings, 1 reply; 19+ messages in thread
From: Junio C Hamano @ 2007-09-17  8:27 UTC (permalink / raw)
  To: git

An updated series of "git-gc --auto", on top of 'next',
consisting of 8 patches, will follow this message.

Differences from the previous round are:

 - Earlier if you have too many unreachable loose objects,
   automated gc would have tried to "repack -d -l" which would
   not improve the situation at all every time it was run.  It
   now at least warns upon such a situation;

 - pack-objects learned --keep-unreachable option which helps
   "repack -a -d" not to lose packed but unreachable objects
   while repacking existing packs into a new pack;

 - repack learned -A option which is similar to -a but gives
   --keep-unreachable to underlying pack-objects;

 - "git-gc --auto" runs "git-repack -A -d -l" when there are too
   many packs in the repository;

 - These changes are documented ;-)

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2007-09-18  3:02 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-17  8:44 [PATCH 1/8] Export matches_pack_name() and fix its return value Junio C Hamano
2007-09-17  8:44 ` [PATCH 2/8] pack-objects --keep-unreachable Junio C Hamano
2007-09-17  8:44 ` [PATCH 3/8] repack -A -d: use --keep-unreachable when repacking Junio C Hamano
2007-09-17  9:29   ` Johannes Schindelin
2007-09-17 10:00     ` Andreas Ericsson
2007-09-18  3:01     ` Shawn O. Pearce
2007-09-17  8:44 ` [PATCH 4/8] git-gc --auto: move threshold check to need_to_gc() function Junio C Hamano
2007-09-17  8:44 ` [PATCH 5/8] git-gc --auto: add documentation Junio C Hamano
2007-09-17  9:36   ` Johannes Schindelin
2007-09-17 19:54     ` Junio C Hamano
2007-09-17  8:44 ` [PATCH 6/8] git-gc --auto: protect ourselves from accumulated cruft Junio C Hamano
2007-09-17  8:44 ` [PATCH 7/8] git-gc --auto: restructure the way "repack" command line is built Junio C Hamano
2007-09-17  9:41   ` Johannes Schindelin
2007-09-17 19:53     ` Junio C Hamano
2007-09-17  8:44 ` [PATCH 8/8] git-gc --auto: run "repack -A -d -l" as necessary Junio C Hamano
2007-09-17  9:53   ` Johannes Schindelin
2007-09-17 19:54     ` Junio C Hamano
2007-09-18  2:59   ` Shawn O. Pearce
  -- strict thread matches above, loose matches on Subject: below --
2007-09-17  8:27 [PATCH 0/8] Updated git-gc --auto series Junio C Hamano
2007-09-17  8:27 ` [PATCH 7/8] git-gc --auto: restructure the way "repack" command line is built 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).