Re: git svn's performance issue and strange pauses, and other thing
Eric Wong wrote: > Jakob sent some patches a few months ago which seem to address the > issue. Unfortunately we forgot about them :x Hin-Tak: have you tried Jakob's patches? I've taken another look, signed-off and pushed to my master. > Can you take a look at the following two "mergeinfo-speedups" > in my repo? (git://bogomips.org/git-svn) > > Jakob Stoklund Olesen (2): > git-svn: only look at the new parts of svn:mergeinfo > git-svn: only look at the root path for svn:mergeinfo > > Also downloadable here: > > http://bogomips.org/git-svn.git/patch?id=9b258e721b30785357535 > http://bogomips.org/git-svn.git/patch?id=73409a2145e93b436d74a > > Can you please give them a try? -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] completion: add --show-signature for log and show
Signed-off-by: David Aguilar --- contrib/completion/git-completion.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 5ea5b82..2ed230a 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1467,6 +1467,7 @@ _git_log () --abbrev-commit --abbrev= --relative-date --date= --pretty= --format= --oneline + --show-signature --cherry-pick --graph --decorate --decorate= @@ -2344,6 +2345,7 @@ _git_show () ;; --*) __gitcomp "--pretty= --format= --abbrev-commit --oneline + --show-signature $__git_diff_common_options " return -- 2.1.2.331.gf8f34bb -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/16] make prune mtime-checking more careful
Jeff King writes: > There's quite a lot of patches here, but most of them are preparatory > cleanups. The meat is in patches 13, 15, and 16. > > [01/16]: foreach_alt_odb: propagate return value from callback > [02/16]: isxdigit: cast input to unsigned char > [03/16]: object_array: factor out slopbuf-freeing logic > [04/16]: object_array: add a "clear" function > [05/16]: clean up name allocation in prepare_revision_walk > [06/16]: reachable: clear pending array after walking it > [07/16]: t5304: use test_path_is_* instead of "test -f" > [08/16]: t5304: use helper to report failure of "test foo = bar" > [09/16]: prune: factor out loose-object directory traversal > [10/16]: count-objects: do not use xsize_t when counting object size > [11/16]: count-objects: use for_each_loose_file_in_objdir > [12/16]: sha1_file: add for_each iterators for loose and packed objects > [13/16]: prune: keep objects reachable from recent objects > [14/16]: pack-objects: refactor unpack-unreachable expiration check > [15/16]: pack-objects: match prune logic for discarding objects > [16/16]: write_sha1_file: freshen existing objects Somebody please help me out here. This applied on top of 'maint' (which does have c40fdd01) makes the test #9 (prune: do not prune detached HEAD with no reflog) fail. If we merge 'dt/cache-tree-repair' (which in turn needs 'jc/reopen-lock-file') to 'maint' and then apply these on top, the said test passes. But I do not see an apparent reason why X-<. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] use skip_prefix() to avoid more magic numbers
Continue where ae021d87 (use skip_prefix to avoid magic numbers) left off and use skip_prefix() in more places for determining the lengths of prefix strings to avoid using dependent constants and other indirect methods. Signed-off-by: Rene Scharfe --- builtin/apply.c | 2 +- builtin/branch.c| 29 +++ builtin/cat-file.c | 5 ++-- builtin/checkout.c | 6 ++--- builtin/clean.c | 7 +++--- builtin/commit.c| 18 +++ builtin/get-tar-commit-id.c | 5 ++-- builtin/log.c | 6 +++-- builtin/remote-ext.c| 10 pretty.c| 56 + 10 files changed, 69 insertions(+), 75 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 8714a88..97f7e8e 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -435,7 +435,7 @@ static unsigned long linelen(const char *buffer, unsigned long size) static int is_dev_null(const char *str) { - return !memcmp("/dev/null", str, 9) && isspace(str[9]); + return skip_prefix(str, "/dev/null", &str) && isspace(*str); } #define TERM_SPACE 1 diff --git a/builtin/branch.c b/builtin/branch.c index 9e4666f..6785097 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -81,14 +81,16 @@ static int parse_branch_color_slot(const char *var, int ofs) static int git_branch_config(const char *var, const char *value, void *cb) { + const char *slot_name; + if (starts_with(var, "column.")) return git_column_config(var, value, "branch", &colopts); if (!strcmp(var, "color.branch")) { branch_use_color = git_config_colorbool(var, value); return 0; } - if (starts_with(var, "color.branch.")) { - int slot = parse_branch_color_slot(var, 13); + if (skip_prefix(var, "color.branch.", &slot_name)) { + int slot = parse_branch_color_slot(var, slot_name - var); if (slot < 0) return 0; if (!value) @@ -335,20 +337,18 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags, static struct { int kind; const char *prefix; - int pfxlen; } ref_kind[] = { - { REF_LOCAL_BRANCH, "refs/heads/", 11 }, - { REF_REMOTE_BRANCH, "refs/remotes/", 13 }, + { REF_LOCAL_BRANCH, "refs/heads/" }, + { REF_REMOTE_BRANCH, "refs/remotes/" }, }; /* Detect kind */ for (i = 0; i < ARRAY_SIZE(ref_kind); i++) { prefix = ref_kind[i].prefix; - if (strncmp(refname, prefix, ref_kind[i].pfxlen)) - continue; - kind = ref_kind[i].kind; - refname += ref_kind[i].pfxlen; - break; + if (skip_prefix(refname, prefix, &refname)) { + kind = ref_kind[i].kind; + break; + } } if (ARRAY_SIZE(ref_kind) <= i) return 0; @@ -872,13 +872,10 @@ int cmd_branch(int argc, const char **argv, const char *prefix) head = resolve_refdup("HEAD", head_sha1, 0, NULL); if (!head) die(_("Failed to resolve HEAD as a valid ref.")); - if (!strcmp(head, "HEAD")) { + if (!strcmp(head, "HEAD")) detached = 1; - } else { - if (!starts_with(head, "refs/heads/")) - die(_("HEAD not found below refs/heads!")); - head += 11; - } + else if (!skip_prefix(head, "refs/heads/", &head)) + die(_("HEAD not found below refs/heads!")); hashcpy(merge_filter_ref, head_sha1); diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 7073304..f8d8129 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -82,8 +82,9 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name) enum object_type type; unsigned long size; char *buffer = read_sha1_file(sha1, &type, &size); - if (memcmp(buffer, "object ", 7) || - get_sha1_hex(buffer + 7, blob_sha1)) + const char *target; + if (!skip_prefix(buffer, "object ", &target) || + get_sha1_hex(target, blob_sha1)) die("%s not a valid tag", sha1_to_hex(sha1)); free(buffer); } else diff --git a/builtin/checkout.c b/builtin/checkout.c index 8afdf2b..cef1996 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1150,10 +1150,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
Re: Submodules and GIT_ALTERNATE_OBJECT_DIRECTORIES
Am 03.10.2014 um 13:56 schrieb Michal Sojka: On Fri, Oct 03 2014, Jens Lehmann wrote: Am 30.09.2014 um 15:25 schrieb Michal Sojka: I'd like to shorten the time needed by our continuous integration (CI) tool to clone the source repositories. Currently the full clone takes about 10 minutes (even from local server). Our main repository has several submodules so the CI tool runs "git submodule update --init". My idea was to use GIT_ALTERNATE_OBJECT_DIRECTORIES to cache objects from several submodule repositories locally. However, this does not work because GIT_ALTERNATE_OBJECT_DIRECTORIES is considered local to the super-project and is not propagated to the "git clone" for submodules (git-submodule.sh calls clear_local_git_env). > My question is why is GIT_ALTERNATE_OBJECT_DIRECTORIES considered local to the repository? If I could modify the command-line I would use the "git submodule update" with the --reference option, which is propagated to clones of all submodules. Letting GIT_ALTERNATE_OBJECT_DIRECTORIES propagate to the submodules should have the same effect as --reference option. So why it is not propagated? Because then it would /always/ propagate? So while that would have the same effect as using the --reference option, not using the --reference option would behave differently, no? That's a good reason, thanks. Fortunately, I found a way how to add --reference to the submodule update command issued by the CI tool (Bamboo). Instead of calling git directly, the CI tool calls my "git" script, which modifies the command line in case of "submodule update" and then calls the real git. Good to hear that! In the CI tool we use at $dayjob (Jenkins) we do not use the automatic submodule update provided by the Git plugin but call submodule update in the shell execution before building it. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] git-tag.txt: Add a missing hyphen to `-s`
Signed-off-by: Wieland Hoffmann --- Documentation/git-tag.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt index 3209083..e953ba4 100644 --- a/Documentation/git-tag.txt +++ b/Documentation/git-tag.txt @@ -42,7 +42,7 @@ committer identity for the current user is used to find the GnuPG key for signing. The configuration variable `gpg.program` is used to specify custom GnuPG binary. -Tag objects (created with `-a`, `s`, or `-u`) are called "annotated" +Tag objects (created with `-a`, `-s`, or `-u`) are called "annotated" tags; they contain a creation date, the tagger name and e-mail, a tagging message, and an optional GnuPG signature. Whereas a "lightweight" tag is simply a name for an object (usually a commit -- 2.1.2 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] mailsplit: remove unnecessary unlink(2) call
The output file hasn't been created at this point, yet, so there is no need to delete it when exiting early. Suggested-by: Jeff King Signed-off-by: Rene Scharfe --- Original thread: http://thread.gmane.org/gmane.comp.version-control.git/255140 builtin/mailsplit.c | 1 - 1 file changed, 1 deletion(-) diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c index 763cda0..8e02ea1 100644 --- a/builtin/mailsplit.c +++ b/builtin/mailsplit.c @@ -59,7 +59,6 @@ static int split_one(FILE *mbox, const char *name, int allow_bare) int is_bare = !is_from_line(buf.buf, buf.len); if (is_bare && !allow_bare) { - unlink(name); fprintf(stderr, "corrupt mailbox\n"); exit(1); } -- 2.1.2 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html