Re: [PATCH 1/2] pack-refs: write peeled entry for non-tags

2013-03-17 Thread Jeff King
On Sat, Mar 16, 2013 at 02:50:56PM +0100, Michael Haggerty wrote: @@ -39,14 +40,13 @@ static int handle_one_ref(const char *path, const unsigned char *sha1, return 0; fprintf(cb-refs_file, %s %s\n, sha1_to_hex(sha1), path); - if (is_tag_ref) { - struct

Re: [PATCH 2/2] pack-refs: add fully-peeled trait

2013-03-17 Thread Jeff King
On Sat, Mar 16, 2013 at 03:06:22PM +0100, Michael Haggerty wrote: refname = parse_ref_line(refline, sha1); if (refname) { - last = create_ref_entry(refname, sha1, flag, 1); + /* +* Older git did not write

Re: [RFC/PATCH] Introduce remote.pushdefault

2013-03-17 Thread Junio C Hamano
Ramkumar Ramachandra artag...@gmail.com writes: How will adding remote.pushdefault have any impact, unless I explicitly remove this branch-specific remote configuration? Besides, without branch.name.remote configured, I can't even pull and expect changes to be merged. If the triangle

Re: [PATCH 0/3] fix unparsed object access in upload-pack

2013-03-17 Thread Junio C Hamano
Jeff King p...@peff.net writes: [3/3]: upload-pack: load non-tip want objects from disk While investigating the bug, I found some weirdness around the stateless-rpc check_non_tip code. As far as I can tell, that code never actually gets triggered. It's not too surprising

Re: [PATCH] Preallocate hash tables when the number of inserts are known in advance

2013-03-17 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: On Sun, Mar 17, 2013 at 12:34 PM, Junio C Hamano gits...@pobox.com wrote: Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: This avoids unnecessary re-allocations and reinsertions. On webkit.git (i.e. about 182k inserts to the name hash table), this reduces

Re: [PATCH v1 22/45] archive: convert to use parse_pathspec

2013-03-17 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: No, the literal strings are reparsed in path_exists() before being fed to read_tree_recursive. Yuck. OK. Thanks. -- 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

Re: [PATCH] safe_create_leading_directories: fix race that could give a false negative

2013-03-17 Thread Junio C Hamano
Steven Walter stevenrwal...@gmail.com writes: If two processes are racing to create the same directory tree, they will both see that the directory doesn't exist, both try to mkdir(), and one of them will fail. This is okay, as we only care that the directory gets created. So, we add a check

Re: [PATCH] sha1_name: pass object name length to diagnose_invalid_sha1_path()

2013-03-17 Thread Junio C Hamano
René Scharfe rene.scha...@lsrfire.ath.cx writes: The only caller of diagnose_invalid_sha1_path() extracts a substring from an object name by creating a NUL-terminated copy of the interesting part. Add a length parameter to the function and thus avoid the need for an allocation, thereby

[PATCH v2 0/4] peel-ref optimization fixes

2013-03-17 Thread Jeff King
Here's a re-roll that takes into account the feedback from round 1: [1/4]: avoid segfaults on parse_object failure [2/4]: use parse_object_or_die instead of die(bad object) These two patches are new; they are conceptually independent of the rest of the series, but there's a textual

[PATCH v2 1/4] avoid segfaults on parse_object failure

2013-03-17 Thread Jeff King
Many call-sites of parse_object assume that they will get a non-NULL return value; this is not the case if we encounter an error while parsing the object. This patch adds a wrapper function around parse_object that handles dying automatically, and uses it anywhere we immediately try to access the

[PATCH v2 2/4] use parse_object_or_die instead of die(bad object)

2013-03-17 Thread Jeff King
Some call-sites do: o = parse_object(sha1); if (!o) die(bad object %s, some_name); We can now handle that as a one-liner, and get more consistent output. In the third case of this patch, it looks like we are losing information, as the existing message also outputs the sha1 hex;

[PATCH v2 3/4] pack-refs: write peeled entry for non-tags

2013-03-17 Thread Jeff King
When we pack an annotated tag ref, we write not only the sha1 of the tag object along with the ref, but also the sha1 obtained by peeling the tag. This lets readers of the pack-refs file know the peeled value without having to actually load the object, speeding up upload-pack's ref advertisement.

[PATCH v2 4/4] pack-refs: add fully-peeled trait

2013-03-17 Thread Jeff King
From: Michael Haggerty mhag...@alum.mit.edu Older versions of pack-refs did not write peel lines for refs outside of refs/tags. This meant that on reading the pack-refs file, we might set the REF_KNOWS_PEELED flag for such a ref, even though we do not know anything about its peeled value. The

[PATCH 0/2] minor fast-export speedup

2013-03-17 Thread Jeff King
While grepping through all of the calls to parse_object (to see how they handled error conditions, for the other series I just posted), I noticed this opportunity for a small speedup in fast-export (5-15%). The first patch is a cleanup, the second is the interesting bit. [1/2]: fast-export:

[PATCH 1/2] fast-export: rename handle_object function

2013-03-17 Thread Jeff King
The handle_object function is rather vaguely named; it only operates on blobs, and its purpose is to export the blob to the output stream. Let's call it export_blob to make it more clear what it does. Signed-off-by: Jeff King p...@peff.net --- builtin/fast-export.c | 6 +++--- 1 file changed, 3

[PATCH 2/2] fast-export: do not load blob objects twice

2013-03-17 Thread Jeff King
When fast-export wants to export a blob object, it first calls parse_object to get a struct object and check whether we have already shown the object. If we haven't shown it, we then use read_sha1_file to pull it from disk and write it out. That means we load each blob from disk twice: once for

Re: [PATCH 0/3] fix unparsed object access in upload-pack

2013-03-17 Thread Jeff King
On Sat, Mar 16, 2013 at 11:17:18PM -0700, Junio C Hamano wrote: I almost wonder if we should cut it out entirely. It is definitely a possible race condition, but I wonder if anybody actually hits it in practice (and if they do, the consequence is that the fetch fails and needs to be

Re: [PATCH] Preallocate hash tables when the number of inserts are known in advance

2013-03-17 Thread Jeff King
On Sun, Mar 17, 2013 at 10:28:06AM +0700, Nguyen Thai Ngoc Duy wrote: This avoids unnecessary re-allocations and reinsertions. On webkit.git (i.e. about 182k inserts to the name hash table), this reduces about 100ms out of 3s user time. Good idea. I had a similar thought when analyzing the

Re: [PATCH 05/12] pretty: save commit encoding from logmsg_reencode if the caller needs it

2013-03-17 Thread Eric Sunshine
On Fri, Mar 15, 2013 at 10:24 PM, Nguyễn Thái Ngọc Duy pclo...@gmail.com wrote: The commit encoding is parsed by logmsg_reencode, there's no need for the caller to re-parse it again. The reencoded message now have the s/have/has/ new encoding, not the original one. The caller would need to

Re: [PATCH 09/12] pretty: add %C(auto) for auto-coloring on the next placeholder

2013-03-17 Thread Eric Sunshine
On Fri, Mar 15, 2013 at 10:24 PM, Nguyễn Thái Ngọc Duy pclo...@gmail.com wrote: This is not simply convenient over $C(auto,xxx). Some placeholders s/\$/%/ (actually only one, %d) do multi coloring and we can't emit a multiple colors with %C(auto,xxx). diff --git

Re: [PATCH 10/12] pretty: support padding placeholders, % % and %

2013-03-17 Thread Eric Sunshine
On Fri, Mar 15, 2013 at 10:24 PM, Nguyễn Thái Ngọc Duy pclo...@gmail.com wrote: Either %, % or % standing before a placeholder specifies how many s/%/%/ diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt index 8734224..87ca2c4 100644 ---

Re: [PATCH 12/12] pretty: support % that steal trailing spaces

2013-03-17 Thread Eric Sunshine
On Fri, Mar 15, 2013 at 10:24 PM, Nguyễn Thái Ngọc Duy pclo...@gmail.com wrote: This is pretty useful in `%(100)%s%Cred%(20)% an' where %s does not s/% an/%an/ use up all 100 columns and %an needs more than 20 columns. By replacing %(20) with %(20), %an can steal spaces from %s. diff --git

Re: [PATCH] sha1_name: pass object name length to diagnose_invalid_sha1_path()

2013-03-17 Thread René Scharfe
Am 17.03.2013 08:10, schrieb Junio C Hamano: @@ -1158,16 +1159,16 @@ static void diagnose_invalid_sha1_path(const char *prefix, if (!get_tree_entry(tree_sha1, fullname, sha1, mode)) { die(Path '%s' exists, but not

Re: [PATCH] gitk: Add user-configurable branch bg color

2013-03-17 Thread Manuel Bua
On 03/17/2013 03:57 AM, David Aguilar wrote: In some cases, the default branch background color (green) isn't an optimal choice, thus it can be difficult to read. I'm just curious -- is it difficult to read because gitk does not specify a foreground color, thus causing it to pickup a system

[PATCH] combine-diff: coalesce lost lines optimally

2013-03-17 Thread Antoine Pelisse
This replaces the greedy implementation to coalesce lost lines by using dynamic programming to find the Longest Common Subsequence. The O(n²) time complexity is obviously bigger than previous implementation but it can produce shorter diff results (and most likely easier to read). List of lost

Re: [PATCH 4/6] introduce a commit metapack

2013-03-17 Thread Duy Nguyen
On Thu, Jan 31, 2013 at 6:06 PM, Duy Nguyen pclo...@gmail.com wrote: On Wed, Jan 30, 2013 at 09:16:29PM +0700, Duy Nguyen wrote: Perhaps we could store abbrev sha-1 instead of full sha-1. Nice space/time trade-off. Following the on-disk format experiment yesterday, I changed the format to:

Re: [PATCH] combine-diff: coalesce lost lines optimally

2013-03-17 Thread Antoine Pelisse
I'm also having a hard time trying it with more than two parents. How I am supposed to have more than two parents while octopus merge refuses if there are conflicts ? OK, creating the merge commit myself solves the issue: git init test git add test git commit -m initial seq 100 test git

[PATCH] safe_create_leading_directories: fix race that could give a false negative

2013-03-17 Thread Steven Walter
If two processes are racing to create the same directory tree, they will both see that the directory doesn't exist, both try to mkdir(), and one of them will fail. This is okay, as we only care that the directory gets created. So, we add a check for EEXIST from mkdir, and continue if the

Re: [PATCH 0/3] fix unparsed object access in upload-pack

2013-03-17 Thread René Scharfe
Am 17.03.2013 06:40, schrieb Jeff King: We do have the capability to roll out to one or a few of our servers (the granularity is not 0.2%, but it is still small). I'm going to try to keep us more in sync with upstream git, but I don't know if I will get to the point of ever deploying master or

Re: [PATCH/RFC] http_init: only initialize SSL for https

2013-03-17 Thread Antoine Pelisse
With redirects taken into account, I can't think of any really good way around avoiding this init... Is there any way for curl to initialize SSL on-demand ? -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH] safe_create_leading_directories: fix race that could give a false negative

2013-03-17 Thread Junio C Hamano
Steven Walter stevenrwal...@gmail.com writes: If two processes are racing to create the same directory tree, they will both see that the directory doesn't exist, both try to mkdir(), and one of them will fail. This is okay, as we only care that the directory gets created. So, we add a check

Re: [PATCH v2 4/4] pack-refs: add fully-peeled trait

2013-03-17 Thread Junio C Hamano
Jeff King p...@peff.net writes: From: Michael Haggerty mhag...@alum.mit.edu Older versions of pack-refs did not write peel lines for refs outside of refs/tags. This meant that on reading the pack-refs file, we might set the REF_KNOWS_PEELED flag for such a ref, even though we do not know

Re: [PATCH] git-p4: support exclusively locked files

2013-03-17 Thread Pete Wyckoff
danny.tho...@blackboard.com wrote on Wed, 13 Mar 2013 13:51 -0400: By default, newly added binary files are exclusively locked by Perforce: 'add default change (binary+l) *exclusive*' This results in a 'Could not determine file type' error as the regex expects the line to end after the

Re: [PATCH] combine-diff: coalesce lost lines optimally

2013-03-17 Thread Junio C Hamano
Antoine Pelisse apeli...@gmail.com writes: This replaces the greedy implementation to coalesce lost lines by using dynamic programming to find the Longest Common Subsequence. The O(n²) time complexity is obviously bigger than previous implementation but it can produce shorter diff results

Re: Make GIT_USE_LOOKUP default?

2013-03-17 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: This env comes from jc/sha1-lookup in 2008 (merge commit e9f9d4f), 5 years ago. I wonder if it's good enough to turn on by default and keep improving from there, or is it still experimental? The algorithm has been used in production in other codepaths like

Re: [PATCH] combine-diff: coalesce lost lines optimally

2013-03-17 Thread Antoine Pelisse
Hopefully, my patch takes about the same time as git 1.7.9.5 and produces the same output on that commit ;) Unfortunately on a commit that would remove A LOT of lines (1) from 7 parents, the times goes from 0.01s to 1.5s... I'm pretty sure that scenario is quite uncommon though. On Sun, Mar

[PATCH] remote.name.pushurl does not consider aliases when pushing

2013-03-17 Thread Rob Hoelz
Hi everyone! I found a bug in Git today and wrote up a fix; I did my best to conform to the rules layed out in Documentation/SubmittingPatches, but please let me know if I need to change anything to get my work merged. =) I have CC'ed Josh Triplet, as he was the last one to touch the line I

Re: [PATCH v1 11/45] parse_pathspec: support stripping submodule trailing slashes

2013-03-17 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: This flag is equivalent to builtin/ls-files.c:strip_trailing_slashes() and is intended to replace that function when ls-files is converted to use parse_pathspec. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- pathspec.c | 9

Re: [PATCH v1 14/45] Guard against new pathspec magic in pathspec matching code

2013-03-17 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: GUARD_PATHSPEC() marks pathspec-sensitive code (basically anything in 'struct pathspec' except fields nr and original). GUARD_PATHSPEC() is not supposed to fail. The steps for a new pathspec magic or optimization would be: - update

Re: [PATCH/RFC] http_init: only initialize SSL for https

2013-03-17 Thread Daniel Stenberg
On Sun, 17 Mar 2013, Antoine Pelisse wrote: With redirects taken into account, I can't think of any really good way around avoiding this init... Is there any way for curl to initialize SSL on-demand ? Yes, but not without drawbacks. If you don't call curl_global_init() at all, libcurl will

Re: [PATCH] remote.name.pushurl does not consider aliases when pushing

2013-03-17 Thread Junio C Hamano
Rob Hoelz r...@hoelz.ro writes: Hi everyone! I found a bug in Git today and wrote up a fix; I did my best to conform to the rules layed out in Documentation/SubmittingPatches, but please let me know if I need to change anything to get my work merged. =) I have CC'ed Josh Triplet, as he

[PATCH] t1507: Test that branchname@{upstream} is interpreted as branch

2013-03-17 Thread Kacper Kornet
Syntax branchname@{upstream} should interpret its argument as a name of a branch. Add the test to check that it doesn't try to interpret it as a refname if the branch in question does not exist. Signed-off-by: Kacper Kornet drae...@pld-linux.org --- Maybe I'm too cautious adding this test. But

Re: [PATCH/RFC] http_init: only initialize SSL for https

2013-03-17 Thread Junio C Hamano
Daniel Stenberg dan...@haxx.se writes: On Sun, 17 Mar 2013, Antoine Pelisse wrote: With redirects taken into account, I can't think of any really good way around avoiding this init... Is there any way for curl to initialize SSL on-demand ? Yes, but not without drawbacks. If you don't

Re: [PATCH] combine-diff: coalesce lost lines optimally

2013-03-17 Thread Junio C Hamano
Antoine Pelisse apeli...@gmail.com writes: +/* Coalesce new lines into base by finding LCS */ +static struct lline *coalesce_lines(struct lline *base, int *lenbase, + struct lline *new, int lennew, + unsigned long parent) +{

Re: [PATCH] remote.name.pushurl does not consider aliases when pushing

2013-03-17 Thread Rob Hoelz
On Sun, 17 Mar 2013 15:14:32 -0700 Junio C Hamano gits...@pobox.com wrote: Rob Hoelz r...@hoelz.ro writes: Hi everyone! I found a bug in Git today and wrote up a fix; I did my best to conform to the rules layed out in Documentation/SubmittingPatches, but please let me know if I need

[PATCH] push: Alias pushurl from push rewrites

2013-03-17 Thread Rob Hoelz
git push currently doesn't consider pushInsteadOf when using pushurl; this tests and fixes that. If you use pushurl with an alias that has a pushInsteadOf configuration value, Git does not take advantage of it. For example: [url git://github.com/] insteadOf = github: [url

Re: [PATCH] push: Alias pushurl from push rewrites

2013-03-17 Thread Junio C Hamano
Rob Hoelz r...@hoelz.ro writes: git push currently doesn't consider pushInsteadOf when using pushurl; this tests and fixes that. If you use pushurl with an alias that has a pushInsteadOf configuration value, Git does not take advantage of it. For example: [url git://github.com/]

Re: [PATCH v1 11/45] parse_pathspec: support stripping submodule trailing slashes

2013-03-17 Thread Duy Nguyen
On Mon, Mar 18, 2013 at 4:55 AM, Junio C Hamano gits...@pobox.com wrote: Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: This flag is equivalent to builtin/ls-files.c:strip_trailing_slashes() and is intended to replace that function when ls-files is converted to use parse_pathspec.

Re: git: how the pack-objects.c find the object's delta

2013-03-17 Thread Duy Nguyen
Hi, I can't say from a first glance. Maybe git@vger can help? On Sun, Mar 17, 2013 at 10:08 PM, 方栋 fangd...@pipul.org wrote: hello i don't understand this: src in builtin/pack-objects.c find_deltas() function, line 1800: static void find_deltas(struct object_entry **list, unsigned

Re: [PATCH v2 4/4] pack-refs: add fully-peeled trait

2013-03-17 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu and ACK for the whole series, once Junio's points are addressed. Regarding Junio's readability suggestion: I agree that his versions are a bit more readable, albeit at the expense of having to evaluate a bit more logic for each reference

Re: Tag peeling peculiarities

2013-03-17 Thread Michael Haggerty
On 03/16/2013 02:38 PM, Michael Haggerty wrote: On 03/16/2013 10:34 AM, Jeff King wrote: On Sat, Mar 16, 2013 at 09:48:42AM +0100, Michael Haggerty wrote: My patch series is nearly done. I will need another day or two to review and make it submission-ready, but I wanted to give you an idea

git branch based hook desigh

2013-03-17 Thread Joydeep Bakshi
Hello list, I have implemented git pre-received hook successfully. And it works on the repo level. Could anyone suggest how to call branch level hook please ?-- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info