From 92446aba47b0e0db28f7b858ea387efcca30ab44 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 25 Feb 2007 02:18:11 -0500 Subject: [PATCH 1/5] Don't modify CREDITS-FILE if it hasn't changed. We should always avoid rewriting a built file during `make install` if nothing has changed since `make all`. This is to help support the typical installation process of compiling a package as yourself, then installing it as root. Forcing CREDITS-FILE to be always be rebuilt in the Makefile means that CREDITS-GEN needs to check for a change and only update CREDITS-FILE if the file content actually differs. After all, content is king in Git. Signed-off-by: Junio C Hamano Signed-off-by: Shawn O. Pearce --- CREDITS-GEN | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/CREDITS-GEN b/CREDITS-GEN index da2c07629e..d1b0f86355 100755 --- a/CREDITS-GEN +++ b/CREDITS-GEN @@ -20,8 +20,8 @@ tree_search () generate_credits () { tip=$1 && - rm -f $CF && - git shortlog -n -s $tip | sed 's/: .*$//' >$CF || exit + rm -f "$2" && + git shortlog -n -s $tip | sed 's/: .*$//' >"$2" || exit } # Always use the tarball credits file if found, just @@ -36,10 +36,14 @@ generate_credits () # that fact. # +credits_tmp=/var/tmp/gitgui-credits-$$ +trap 'rm -f "$credits_tmp"' 0 + +orig="$credits_tmp" + if test -f credits then - rm -f $CF && - cp credits $CF || exit + orig=credits elif prefix="$(git rev-parse --show-prefix 2>/dev/null)" && test -n "$prefix" && head=$(git rev-list --max-count=1 HEAD -- . 2>/dev/null) && @@ -47,12 +51,21 @@ elif prefix="$(git rev-parse --show-prefix 2>/dev/null)" && tip=$(tree_search $head $tree) && test -n "$tip" then - generate_credits $tip || exit + generate_credits $tip "$orig" || exit elif tip="$(git rev-parse --verify HEAD 2>/dev/null)" && test -n "$tip" then - generate_credits $tip || exit + generate_credits $tip "$orig" || exit else echo "error: Cannot locate authorship information." >&2 exit 1 fi + +if test -f "$orig" && cmp -s "$orig" "$CF" +then + : noop +else + rm -f "$CF" && + cat "$orig" >"$CF" +fi + From ab242f809a9e06ebf935c0512155fc5661ab84ab Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 25 Feb 2007 01:24:34 -0800 Subject: [PATCH 2/5] rerere: do not skip two conflicted paths next to each other. The code forgot to take the for (;;) loop control into account, incrementing the index once too many. Signed-off-by: Junio C Hamano --- builtin-rerere.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-rerere.c b/builtin-rerere.c index 318d959d89..ac0bf335a8 100644 --- a/builtin-rerere.c +++ b/builtin-rerere.c @@ -160,7 +160,7 @@ static int find_conflict(struct path_list *conflict) ce_stage(e3) == 3 && ce_same_name(e1, e2) && ce_same_name(e1, e3)) { path_list_insert((const char *)e1->name, conflict); - i += 3; + i += 2; } } return 0; From 128917274943bd0e2dea69862c5a9893a962e350 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 25 Feb 2007 01:29:43 -0800 Subject: [PATCH 3/5] rerere: do not deal with symlinks. Who would use multi-line symlinks that would benefit from rerere? Just ignore them. Signed-off-by: Junio C Hamano --- builtin-rerere.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/builtin-rerere.c b/builtin-rerere.c index ac0bf335a8..58c5fed91d 100644 --- a/builtin-rerere.c +++ b/builtin-rerere.c @@ -154,11 +154,15 @@ static int find_conflict(struct path_list *conflict) return error("Could not read index"); for (i = 0; i + 2 < active_nr; i++) { struct cache_entry *e1 = active_cache[i]; - struct cache_entry *e2 = active_cache[i + 1]; - struct cache_entry *e3 = active_cache[i + 2]; - if (ce_stage(e1) == 1 && ce_stage(e2) == 2 && - ce_stage(e3) == 3 && ce_same_name(e1, e2) && - ce_same_name(e1, e3)) { + struct cache_entry *e2 = active_cache[i+1]; + struct cache_entry *e3 = active_cache[i+2]; + if (ce_stage(e1) == 1 && + ce_stage(e2) == 2 && + ce_stage(e3) == 3 && + ce_same_name(e1, e2) && ce_same_name(e1, e3) && + S_ISREG(ntohl(e1->ce_mode)) && + S_ISREG(ntohl(e2->ce_mode)) && + S_ISREG(ntohl(e3->ce_mode))) { path_list_insert((const char *)e1->name, conflict); i += 2; } From ffa84ffb77b06f9793967fb4f4dd5c946da8e341 Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Sun, 25 Feb 2007 09:34:27 -0800 Subject: [PATCH 4/5] Allow arbitrary number of arguments to git-pack-objects If a repository ever gets in a situation where there are too many packs (more than 60 or so), perhaps because of frequent use of git-fetch -k or incremental git-repack, then it becomes impossible to fully repack the repository with git-repack -a. That command just dies with the cryptic message fatal: too many internal rev-list options This message comes from git-pack-objects, which is passed one command line option like --unpacked=pack-.pack for each pack file to be repacked. However, the current code has a static limit of 64 command line arguments and just aborts if more arguments are passed to it. Fix this by dynamically allocating the array of command line arguments, and doubling the size each time it overflows. Signed-off-by: Roland Dreier Signed-off-by: Junio C Hamano --- builtin-pack-objects.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index 3824ee33ac..971388276a 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -1551,9 +1551,12 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) int use_internal_rev_list = 0; int thin = 0; int i; - const char *rp_av[64]; + const char **rp_av; + int rp_ac_alloc = 64; int rp_ac; + rp_av = xcalloc(rp_ac_alloc, sizeof(*rp_av)); + rp_av[0] = "pack-objects"; rp_av[1] = "--objects"; /* --thin will make it --objects-edge */ rp_ac = 2; @@ -1626,8 +1629,11 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) !strcmp("--reflog", arg) || !strcmp("--all", arg)) { use_internal_rev_list = 1; - if (ARRAY_SIZE(rp_av) - 1 <= rp_ac) - die("too many internal rev-list options"); + if (rp_ac >= rp_ac_alloc - 1) { + rp_ac_alloc = alloc_nr(rp_ac_alloc); + rp_av = xrealloc(rp_av, + rp_ac_alloc * sizeof(*rp_av)); + } rp_av[rp_ac++] = arg; continue; } From d2dc6222d4e2f7fa5efc82175d14d60d7b804687 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 25 Feb 2007 10:53:42 -0800 Subject: [PATCH 5/5] Add Release Notes to prepare for 1.5.0.2 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.5.0.2.txt | 59 ++++++++++++++++++++++++++++++ RelNotes | 2 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 Documentation/RelNotes-1.5.0.2.txt diff --git a/Documentation/RelNotes-1.5.0.2.txt b/Documentation/RelNotes-1.5.0.2.txt new file mode 100644 index 0000000000..4dc1344859 --- /dev/null +++ b/Documentation/RelNotes-1.5.0.2.txt @@ -0,0 +1,59 @@ +GIT v1.5.0.2 Release Notes +========================== + +Fixes since v1.5.0.1 +-------------------- + +* Bugfixes + + - 'git diff maint master next' did not correctly give combined + diff across three trees. + + - 'git fast-import' portability fix for Solaris. + + - 'git show-ref --verify' without arguments did not error out + but segfaulted. + + - 'git diff :tracked-file `pwd`/an-untracked-file' gave an extra + slashes after a/ and b/. + + - 'git format-patch' produced too long filenames if the commit + message had too long line at the beginning. + + - Running 'make all' and then without changing anything + running 'make install' still rebuilt some files. This + was inconvenient when building as yourself and then + installing as root (especially problematic when the source + directory is on NFS and root is mapped to nobody). + + - 'git-rerere' failed to deal with two unconflicted paths that + sorted next to each other. + + - 'git-rerere' attempted to open(2) a symlink and failed if + there was a conflict. Since a conflicting change to a + symlink would not benefit from rerere anyway, the command + now ignores conflicting changes to symlinks. + + - 'git-repack' did not like to pass more than 64 arguments + internally to underlying 'rev-list' logic, which made it + impossible to repack after accumulating many (small) packs + in the repository. + +* Documentation updates + + - added and clarified core.bare, core.legacyheaders configurations. + + - updated "git-clone --depth" documentation. + +* Assorted git-gui fixes. + + +-- +exec >/var/tmp/1 +O=v1.5.0.1-35-gffa84ff +echo O=`git describe maint` +git shortlog --no-merges $O..maint + +#Local Variables: +#mode: text +#End: diff --git a/RelNotes b/RelNotes index 63941cdfa9..5308f6b956 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes-1.5.0.1.txt \ No newline at end of file +Documentation/RelNotes-1.5.0.2.txt \ No newline at end of file