From f5d4c4d0f19084a2d48f55f2f42cac25696a34f5 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Mon, 25 May 2009 18:00:10 +0200 Subject: [PATCH 1/5] merge-options.txt: Clarify merge --squash With the --squash option, merge sets up the index just like for a real merge, but without the merge info (stages). Say so. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- Documentation/merge-options.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt index 637b53f898..adadf8e4bf 100644 --- a/Documentation/merge-options.txt +++ b/Documentation/merge-options.txt @@ -39,7 +39,8 @@ --squash:: Produce the working tree and index state as if a real - merge happened, but do not actually make a commit or + merge happened (except for the merge information), + but do not actually make a commit or move the `HEAD`, nor record `$GIT_DIR/MERGE_HEAD` to cause the next `git commit` command to create a merge commit. This allows you to create a single commit on From f475e08edbbabe38bd758fd42f08f646551468d9 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 25 May 2009 06:37:15 -0400 Subject: [PATCH 2/5] lock_ref: inform callers of unavailable ref One of the ways that locking might fail is that there is a DF conflict between two refs (e.g., you want to lock "foo/bar" but "foo" already exists). In this case, we return an error, but there is no way for the caller to know the specific problem. This patch sets errno to ENOTDIR, which is the most sensible code. It's what we would see if the refs were stored purely in the filesystem (but these days we must check the namespace manually due to packed refs). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- refs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/refs.c b/refs.c index e65a3b4c4e..8679c17e0d 100644 --- a/refs.c +++ b/refs.c @@ -893,8 +893,10 @@ static struct ref_lock *lock_ref_sha1_basic(const char *ref, const unsigned char * name is a proper prefix of our refname. */ if (missing && - !is_refname_available(ref, NULL, get_packed_refs(), 0)) + !is_refname_available(ref, NULL, get_packed_refs(), 0)) { + last_errno = ENOTDIR; goto error_return; + } lock->lk = xcalloc(1, sizeof(struct lock_file)); From fa250759794ab98e6edfbbf2f6aa2cb912e535eb Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 25 May 2009 06:40:54 -0400 Subject: [PATCH 3/5] fetch: report ref storage DF errors more accurately When we fail to store a fetched ref, we recommend that the user try running "git prune" to remove up any old refs that have been deleted by the remote, which would clear up any DF conflicts. However, ref storage might fail for other reasons (e.g., permissions problems) in which case the advice is useless and misleading. This patch detects when there is an actual DF situation and only issues the advice when one is found. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- builtin-fetch.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/builtin-fetch.c b/builtin-fetch.c index 3c998ea740..1f7a3f1ce6 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -167,6 +167,9 @@ static struct ref *get_ref_map(struct transport *transport, return ref_map; } +#define STORE_REF_ERROR_OTHER 1 +#define STORE_REF_ERROR_DF_CONFLICT 2 + static int s_update_ref(const char *action, struct ref *ref, int check_old) @@ -181,9 +184,11 @@ static int s_update_ref(const char *action, lock = lock_any_ref_for_update(ref->name, check_old ? ref->old_sha1 : NULL, 0); if (!lock) - return 2; + return errno == ENOTDIR ? STORE_REF_ERROR_DF_CONFLICT : + STORE_REF_ERROR_OTHER; if (write_ref_sha1(lock, ref->new_sha1, msg) < 0) - return 2; + return errno == ENOTDIR ? STORE_REF_ERROR_DF_CONFLICT : + STORE_REF_ERROR_OTHER; return 0; } @@ -377,7 +382,7 @@ static int store_updated_refs(const char *url, const char *remote_name, } } fclose(fp); - if (rc & 2) + if (rc & STORE_REF_ERROR_DF_CONFLICT) error("some local refs could not be updated; try running\n" " 'git remote prune %s' to remove any old, conflicting " "branches", remote_name); From 0e5168fd18f3975d71d3a292b0e0df174bb884d5 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 25 May 2009 06:33:15 -0400 Subject: [PATCH 4/5] fix cat-file usage message and documentation cat-file with an object on the command line requires an option to tell it what to output (type, size, pretty-print, etc). However, the square brackets in the usage imply that those options are not required. This patch switches them to parentheses to indicate "required but grouped-OR" (curly braces might also work, but this follows the convention used already by "git stash"). While we're at it, let's change the specifier in the usage to . That's what the documentation uses, and it does actually use the regular object lookup. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/git-cat-file.txt | 4 ++-- builtin-cat-file.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt index b191276d7a..58c8d65772 100644 --- a/Documentation/git-cat-file.txt +++ b/Documentation/git-cat-file.txt @@ -9,8 +9,8 @@ git-cat-file - Provide content or type and size information for repository objec SYNOPSIS -------- [verse] -'git cat-file' [-t | -s | -e | -p | ] -'git cat-file' [--batch | --batch-check] < +'git cat-file' (-t | -s | -e | -p | ) +'git cat-file' (--batch | --batch-check) < DESCRIPTION ----------- diff --git a/builtin-cat-file.c b/builtin-cat-file.c index 8fad19daed..43ffe7ffae 100644 --- a/builtin-cat-file.c +++ b/builtin-cat-file.c @@ -201,8 +201,8 @@ static int batch_objects(int print_contents) } static const char * const cat_file_usage[] = { - "git cat-file [-t|-s|-e|-p|] ", - "git cat-file [--batch|--batch-check] < ", + "git cat-file (-t|-s|-e|-p|) ", + "git cat-file (--batch|--batch-check) < ", NULL }; From e57cb0158209ece040a4b873064504efd7d2ec0e Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 25 May 2009 19:20:39 -0700 Subject: [PATCH 5/5] Prepare for 1.6.3.2 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.6.3.2.txt | 51 ++++++++++++++++++++++++++++++ RelNotes | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 Documentation/RelNotes-1.6.3.2.txt diff --git a/Documentation/RelNotes-1.6.3.2.txt b/Documentation/RelNotes-1.6.3.2.txt new file mode 100644 index 0000000000..a3fceebb11 --- /dev/null +++ b/Documentation/RelNotes-1.6.3.2.txt @@ -0,0 +1,51 @@ +GIT v1.6.3.2 Release Notes +========================== + +Fixes since v1.6.3.1 +-------------------- + + * A few codepaths picked up the first few bytes from an sha1[] by + casting the (char *) pointer to (int *); GCC 4.4 did not like this, + and aborted compilation. + + * http-push had a small use-after-free bug. + + * command completion code in bash did not reliably detect that we are + in a bare repository. + + * "git for-each-ref" had a segfaulting bug when dealing with a tag object + created by an ancient git. + + * Some unlink(2) failures went undiagnosed. + + * The "recursive" merge strategy misbehaved when faced rename/delete + conflicts while coming up with an intermediate merge base. + + * GIT_TRACE mechanism segfaulted when tracing a shell-quoted aliases. + + * "git add ." in an empty directory complained that pathspec "." did not + match anything, which may be technically correct, but not useful. We + silently make it a no-op now. + + * "git format-patch -k" still added patch numbers if format.numbered + configuration was set. + + * OpenBSD also uses st_ctimspec in "struct stat", instead of "st_ctim". + + * With NO_CROSS_DIRECTORY_HARDLINKS, "make install" can be told not to + create hardlinks between $(gitexecdir)/git-$builtin_commands and + $(bindir)/git. + + * "git push" was converting OFS_DELTA pack representation into less + efficient REF_DELTA representation unconditionally upon transfer, + making the transferred data unnecessarily larger. + +Many other general usability updates around help text, diagnostic messages +and documentation are included as well. + +--- +exec >/var/tmp/1 +O=v1.6.3.1-51-g2a1feb9 +echo O=$(git describe maint) +git shortlog --no-merges $O..maint + diff --git a/RelNotes b/RelNotes index 0f6a588f1d..a433be58b7 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes-1.6.3.1.txt \ No newline at end of file +Documentation/RelNotes-1.6.3.2.txt \ No newline at end of file