From 0d641f75d1237b34d3cfb411a18c813cfacb4726 Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Fri, 7 Nov 2008 04:26:55 -0800 Subject: Remove the period after the git-check-attr summary The period at the end of the git-check-attr summary causes there to be two periods after the summary in the git(1) manual page. Signed-off-by: Matt Kraai Signed-off-by: Junio C Hamano diff --git a/Documentation/git-check-attr.txt b/Documentation/git-check-attr.txt index 4b3c2b0..043274b 100644 --- a/Documentation/git-check-attr.txt +++ b/Documentation/git-check-attr.txt @@ -3,7 +3,7 @@ git-check-attr(1) NAME ---- -git-check-attr - Display gitattributes information. +git-check-attr - Display gitattributes information SYNOPSIS -- cgit v0.10.2-6-g49f6 From fa7b3c2f752a10a5dca9989d4a1c4b93ffa7f943 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 12 Nov 2008 11:52:35 -0800 Subject: checkout: Fix "initial checkout" detection Earlier commit 5521883 (checkout: do not lose staged removal, 2008-09-07) tightened the rule to prevent switching branches from losing local changes, so that staged removal of paths can be protected, while attempting to keep a loophole to still allow a special case of switching out of an un-checked-out state. However, the loophole was made a bit too tight, and did not allow switching from one branch (in an un-checked-out state) to check out another branch. The change to builtin-checkout.c in this commit loosens it to allow this, by not insisting the original commit and the new commit to be the same. It also introduces a new function, is_index_unborn (and an associated macro, is_cache_unborn), to check if the repository is truly in an un-checked-out state more reliably, by making sure that $GIT_INDEX_FILE did not exist when populating the in-core index structure. A few places the earlier commit 5521883 added the check for the initial checkout condition are updated to use this function. Signed-off-by: Junio C Hamano diff --git a/builtin-checkout.c b/builtin-checkout.c index 05eee4e..25845cd 100644 --- a/builtin-checkout.c +++ b/builtin-checkout.c @@ -269,8 +269,7 @@ static int merge_working_tree(struct checkout_opts *opts, } /* 2-way merge to the new branch */ - topts.initial_checkout = (!active_nr && - (old->commit == new->commit)); + topts.initial_checkout = is_cache_unborn(); topts.update = 1; topts.merge = 1; topts.gently = opts->merge; diff --git a/builtin-read-tree.c b/builtin-read-tree.c index 0706c95..38fef34 100644 --- a/builtin-read-tree.c +++ b/builtin-read-tree.c @@ -206,7 +206,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix) break; case 2: opts.fn = twoway_merge; - opts.initial_checkout = !active_nr; + opts.initial_checkout = is_cache_unborn(); break; case 3: default: diff --git a/cache.h b/cache.h index a1e4982..3960931 100644 --- a/cache.h +++ b/cache.h @@ -255,6 +255,7 @@ static inline void remove_name_hash(struct cache_entry *ce) #define read_cache() read_index(&the_index) #define read_cache_from(path) read_index_from(&the_index, (path)) +#define is_cache_unborn() is_index_unborn(&the_index) #define read_cache_unmerged() read_index_unmerged(&the_index) #define write_cache(newfd, cache, entries) write_index(&the_index, (newfd)) #define discard_cache() discard_index(&the_index) @@ -360,6 +361,7 @@ extern int init_db(const char *template_dir, unsigned int flags); /* Initialize and use the cache information */ extern int read_index(struct index_state *); extern int read_index_from(struct index_state *, const char *path); +extern int is_index_unborn(struct index_state *); extern int read_index_unmerged(struct index_state *); extern int write_index(const struct index_state *, int newfd); extern int discard_index(struct index_state *); diff --git a/read-cache.c b/read-cache.c index 967f483..525d138 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1239,6 +1239,11 @@ unmap: die("index file corrupt"); } +int is_index_unborn(struct index_state *istate) +{ + return (!istate->cache_nr && !istate->alloc && !istate->timestamp); +} + int discard_index(struct index_state *istate) { istate->cache_nr = 0; -- cgit v0.10.2-6-g49f6 From a1e4760fcfece8eb9b556f35a04a521fdee3963c Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Wed, 12 Nov 2008 13:23:58 -0500 Subject: Fix pack.packSizeLimit and --max-pack-size handling If the limit was sufficiently low, having a single object written could bust the limit (by design), but caused the remaining allowed size to go negative for subsequent objects, which for an unsigned variable is a rather huge limit. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index b0dddbe..8fe5124 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -245,8 +245,16 @@ static unsigned long write_object(struct sha1file *f, type = entry->type; /* write limit if limited packsize and not first object */ - limit = pack_size_limit && nr_written ? - pack_size_limit - write_offset : 0; + if (!pack_size_limit || !nr_written) + limit = 0; + else if (pack_size_limit <= write_offset) + /* + * the earlier object did not fit the limit; avoid + * mistaking this with unlimited (i.e. limit = 0). + */ + limit = 1; + else + limit = pack_size_limit - write_offset; if (!entry->delta) usable_delta = 0; /* no delta */ diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index 3a0ef87..2852a03 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -375,4 +375,10 @@ test_expect_success 'index-pack with --strict' ' ) ' +test_expect_success 'tolerate absurdly small packsizelimit' ' + git config pack.packSizeLimit 2 && + packname_9=$(git pack-objects test-9 Date: Wed, 12 Nov 2008 15:03:03 -0800 Subject: Start 1.6.0.5 cycle Signed-off-by: Junio C Hamano diff --git a/Documentation/RelNotes-1.6.0.5.txt b/Documentation/RelNotes-1.6.0.5.txt new file mode 100644 index 0000000..62f95e6 --- /dev/null +++ b/Documentation/RelNotes-1.6.0.5.txt @@ -0,0 +1,21 @@ +GIT v1.6.0.5 Release Notes +========================== + +Fixes since v1.6.0.4 +-------------------- + +* 'git checkout' used to crash when your HEAD was pointing at a deleted + branch. + +* 'git checkout' from an un-checked-out state did not allow switching out + of the current branch. + +* 'git pack-objects' did not make its best effort to honor --max-pack-size + option when a single first object already busted the given limit and + placed many objects in a single pack. + +* 'make check' cannot be run without sparse; people may have meant to say + 'make test' instead, so suggest that. + +* Many unsafe call to sprintf() style varargs functions are corrected. + diff --git a/RelNotes b/RelNotes index f9eb552..ebf508f 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes-1.6.0.4.txt \ No newline at end of file +Documentation/RelNotes-1.6.0.5.txt \ No newline at end of file -- cgit v0.10.2-6-g49f6