Re: [PATCH 2/7] move setting of object-type to alloc_* functions

2014-07-13 Thread Jeff King
On Sat, Jul 12, 2014 at 02:05:39PM -0400, Jeff King wrote: I don't particularly like 'flag' here. (not a massive dislike, mind you:) Perhaps: flag-object_type, type-node_type? Or, if that's too verbose, maybe just: flag-type, type-node? Me either, but as you noticed, type was taken.

[PATCH v2 1/8] alloc.c: remove the alloc_raw_commit_node() function

2014-07-13 Thread Jeff King
From: Ramsay Jones ram...@ramsay1.demon.co.uk In order to encapsulate the setting of the unique commit index, commit 969eba63 (commit: push commit_index update into alloc_commit_node, 10-06-2014) introduced a (logically private) intermediary allocator function. However, this function

[PATCH v2 2/8] alloc: write out allocator definitions

2014-07-13 Thread Jeff King
Because the allocator functions for tree, blobs, etc are all very similar, we originally used a macro to avoid repeating ourselves. Since the prior commit, though, the heavy lifting is done by an inline helper function. The macro does still save us a few lines, but at some readability cost. It

[PATCH v2 4/8] parse_object_buffer: do not set object type

2014-07-13 Thread Jeff King
The only way that obj can be non-NULL is if it came from one of the lookup_* functions. These functions always ensure that the object has the expected type (and return NULL otherwise), so there is no need for us to set the type. Signed-off-by: Jeff King p...@peff.net --- object.c | 2 -- 1 file

[PATCH v2 5/8] add object_as_type helper for casting objects

2014-07-13 Thread Jeff King
When we call lookup_commit, lookup_tree, etc, the logic goes something like: 1. Look for an existing object struct. If we don't have one, allocate and return a new one. 2. Double check that any object we have is the expected type (and complain and return NULL otherwise). 3.

[PATCH v2 6/8] alloc: factor out commit index

2014-07-13 Thread Jeff King
We keep a static counter to set the commit index on newly allocated objects. However, since we also need to set the index on any_objects which are converted to commits, let's make the counter available as a public function. While we're moving it, let's make sure the counter is allocated as an

[PATCH v2 3/8] move setting of object-type to alloc_* functions

2014-07-13 Thread Jeff King
The struct object type implements basic object polymorphism. Individual instances are allocated as concrete types (or as a union type that can store any object), and a struct object * can be cast into its real type after examining its type enum. This means it is dangerous to have a type field

[PATCH v2 8/8] diff-tree: avoid lookup_unknown_object

2014-07-13 Thread Jeff King
We generally want to avoid lookup_unknown_object, because it results in allocating more memory for the object than may be strictly necessary. In this case, it is used to check whether we have an already-parsed object before calling parse_object, to save us from reading the object from disk. Using

[PATCH v2 7/8] object_as_type: set commit index

2014-07-13 Thread Jeff King
The point of the index field of struct commit is that every allocated commit would have one. It is supposed to be an invariant that whenever object-type is set to OBJ_COMMIT, we have a unique index. Commit 969eba6 (commit: push commit_index update into alloc_commit_node, 2014-06-10) covered this

Re: [PATCH v3] http: Add Accept-Language header if possible

2014-07-13 Thread Yi, EungJun
2014-07-13 13:26 GMT+09:00 Eric Sunshine sunsh...@sunshineco.com: + /* Decide the precision for q-factor on number of preferred languages. */ + if (num_langs + 1 100) { /* +1 is for '*' */ + q_precision = 0.001; + q_format = ; q=%.3f; + } else

Re: [Bug] data loss with cyclic alternates

2014-07-13 Thread Ephrim Khong
Am 11.07.14 18:01, schrieb Junio C Hamano: Ephrim Khong dr.kh...@gmail.com writes: git seems to have issues with alternates when cycles are present (repo A has B/objects as alternates, B has A/objects as alternates). Yeah, don't do that. A thinks eh, the other guy must have it and B thinks

Re: [PATCH RFC v2 03/19] rebase -i: reword executes pre-commit hook on interim commit

2014-07-13 Thread Fabian Ruch
Hi Junio, Junio C Hamano writes: Fabian Ruch baf...@gmail.com writes: The to-do list command `reword` replays a commit like `pick` but lets the user also edit the commit's log message. This happens in two steps. Firstly, the named commit is cherry-picked. Secondly, the commit created in the

Re: [PATCH 3/4 v6] cache-tree: subdirectory tests

2014-07-13 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: On Fri, 2014-07-11 at 08:40 -0700, Junio C Hamano wrote: In the ideal world, I think whoever tries to compare two cache-trees (i.e. test-dump-cache-tree) should *not* care, because we are merely trying to show what the correct tree object name

Re: [PATCH v3] http: Add Accept-Language header if possible

2014-07-13 Thread Junio C Hamano
Yi, EungJun semtlen...@gmail.com writes: I think it is possible like this: num_langs += 1; /* for '*' */ decimal_places = 1 + (num_langs 10) + (num_langs 100); snprintf(q_format, sizeof(q_format), ; q=%%.%df, decimal_places); for (q_precision = 1.0; decimal_places-- 0;)

Re: [PATCH 3/3 v5] tag: support configuring --sort via .gitconfig

2014-07-13 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Fri, Jul 11, 2014 at 02:54:25PM -0700, Junio C Hamano wrote: Yeah, we're quite inconsistent there. In some cases we silently ignore something unknown (e.g., a color.diff.* slot that we do not understand), but in most cases if it is a config key we

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-13 Thread Junio C Hamano
Eric Sunshine sunsh...@sunshineco.com writes: Made parse_sort_string take a var parameter, and if given will only warn about invalid parameter, instead of error. This seems unnecessarily ugly since it's hard-coding specialized knowledge of the callers' error-reporting requirements into what

Re: [PATCH v7 4/4] cache-tree: Write updated cache-tree after commit

2014-07-13 Thread Junio C Hamano
Eric Sunshine sunsh...@sunshineco.com writes: + (echo p; echo 1; echo; echo s; echo n; echo y; echo q) | git commit --interactive -m foo Broken -chain. Would a printf make this more readable? printf p\n1\n\ns\nn\ny\nq\n | git commt ... Perhaps not. But printf %s\n

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-13 Thread Jeff King
On Sun, Jul 13, 2014 at 10:10:27AM -0700, Junio C Hamano wrote: Eric Sunshine sunsh...@sunshineco.com writes: Made parse_sort_string take a var parameter, and if given will only warn about invalid parameter, instead of error. This seems unnecessarily ugly since it's hard-coding

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-13 Thread Jeff King
On Sun, Jul 13, 2014 at 01:33:56PM -0400, Jeff King wrote: I realize that I am reinventing the error-reporting wheel on a sleepy Sunday afternoon without having thought about it much, so there is probably some gotcha or case that makes this ugly, or perhaps it just ends up verbose in

Re: [PATCH v7 4/4] cache-tree: Write updated cache-tree after commit

2014-07-13 Thread Eric Sunshine
On Sun, Jul 13, 2014 at 1:22 PM, Junio C Hamano gits...@pobox.com wrote: Eric Sunshine sunsh...@sunshineco.com writes: + (echo p; echo 1; echo; echo s; echo n; echo y; echo q) | git commit --interactive -m foo Broken -chain. Would a printf make this more readable? printf

Re: [PATCH 2/7] move setting of object-type to alloc_* functions

2014-07-13 Thread Ramsay Jones
On 13/07/14 07:41, Jeff King wrote: On Sat, Jul 12, 2014 at 02:05:39PM -0400, Jeff King wrote: I don't particularly like 'flag' here. (not a massive dislike, mind you:) Perhaps: flag-object_type, type-node_type? Or, if that's too verbose, maybe just: flag-type, type-node? Me either, but

[PATCH v9 2/4] test-dump-cache-tree: invalid trees are not errors

2014-07-13 Thread David Turner
From: David Turner dtur...@twopensource.com Do not treat known-invalid trees as errors even when their subtree_nr is incorrect. Because git already knows that these trees are invalid, an incorrect subtree_nr will not cause problems. Add a couple of comments. Signed-off-by: David Turner

[PATCH v9 1/4] cache-tree: Create/update cache-tree on checkout

2014-07-13 Thread David Turner
From: David Turner dtur...@twopensource.com When git checkout checks out a branch, create or update the cache-tree so that subsequent operations are faster. update_main_cache_tree learned a new flag, WRITE_TREE_REPAIR. When WRITE_TREE_REPAIR is set, portions of the cache-tree which do not

[PATCH v9 4/4] cache-tree: Write updated cache-tree after commit

2014-07-13 Thread David Turner
From: David Turner dtur...@twopensource.com During the commit process, update the cache-tree. Write this updated cache-tree so that it's ready for subsequent commands. Add test code which demonstrates that git commit now writes the cache tree. Make all tests test the entire cache-tree, not just

[PATCH v9 3/4] cache-tree: subdirectory tests

2014-07-13 Thread David Turner
From: David Turner dtur...@twopensource.com Add tests to confirm that invalidation of subdirectories neither over- nor under-invalidates. Signed-off-by: David Turner dtur...@twitter.com --- t/t0090-cache-tree.sh | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-)

Re: [PATCH v3] http: Add Accept-Language header if possible

2014-07-13 Thread Yi, EungJun
2014-07-14 1:57 GMT+09:00 Junio C Hamano gits...@pobox.com: If you do not want floating point (and I think we tend to avoid it when we do not need it), you can realize that in your use of 0.1 and 0.01 and 0.001 there is nothing fundamentally floating-point; you can measure how many digits

Re: [PATCH 00/14] Add submodule test harness

2014-07-13 Thread Junio C Hamano
Jens Lehmann jens.lehm...@web.de writes: Perhaps squashing this to 7e8e5af9 instead? Yes please, this is much better than my first attempt. One thing that I found troubling is the ../../../ three levels up is hardcoded. Would it be always true for any value of $1? If the submodule is bound

Kindly reply

2014-07-13 Thread Carlos Ramirez
My name is Carlos Ramirez, I am lawyer here in Madrid Spain. I want to transfer an abandoned sum of 13.5 Millions USD to your account.50% will be for you. No risk involved. Contact me for more details. Kindly reply me back to my alternative email address ( carlos...@aol.com ) Regards

Re: Race condition in git push --mirror can cause silent ref rewinding

2014-07-13 Thread Alex Vandiver
On 07/02/2014 07:10 PM, Alex Vandiver wrote: On 07/02/2014 06:20 PM, Junio C Hamano wrote: Alex Vandiver a...@chmrr.net writes: [remote github] url = g...@github.com:bestpractical/rt.git fetch = +refs/*:refs/* mirror = yes git push github master^:master must

Re: [PATCH 2/2] dir: remove PATH_MAX limitation

2014-07-13 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: [01/20] dir.c: coding style fix [02/20] dir.h: move struct exclude declaration to top level [03/20] prep_exclude: remove the artificial PATH_MAX limit ...perhaps with s/if (!dir-basebuf.alloc)/if (!dir-basebuf.buf)/ @Duy any reason for not signing off

Kindly reply

2014-07-13 Thread Carlos Ramirez
My name is Carlos Ramirez, I am lawyer here in Madrid Spain. I want to transfer an abandoned sum of 13.5 Millions USD to your account.50% will be for you. No risk involved. Contact me for more details. Kindly reply me back to my alternative email address ( carlos...@aol.com ) Regards

Re: [PATCH v6 28/32] gc: style change -- no SP before closing bracket

2014-07-13 Thread Junio C Hamano
On Wed, Jul 9, 2014 at 2:47 AM, Eric Sunshine sunsh...@sunshineco.com wrote: On Wed, Jul 9, 2014 at 3:33 AM, Nguyễn Thái Ngọc Duy pclo...@gmail.com wrote: Yet, there is a space after the opening '{'. So, this is now inconsistently formatted as: { foo, bar} So, if we drop the other

Re: [PATCH v7 00/31] Support multiple checkouts

2014-07-13 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: fd = open(git_path(repos/%s/gitdir, id), O_RDONLY); ... - while (path[len - 1] == '\n' || path[len - 1] == '\r') + while (len (path[len - 1] == '\n' || path[len - 1] == '\r')) len--; Do we anticipate (or even

[PATCH/RFH 0/3] stable priority-queue

2014-07-13 Thread Jeff King
As Junio and I discussed earlier in [1], this series makes the prio_queue struct stable with respect to object insertion (which in turn means we can use it to replace commit_list in more places). I think everything here is correct, but the second commit fails the final test in t5539. I think the

[PATCH 1/3] prio-queue: factor out compare and swap operations

2014-07-13 Thread Jeff King
When manipulating the priority queue's heap, we frequently have to compare and swap heap entries. As we are storing only void pointers right now, this is quite easy to do inline in a few lines. However, when we start using a more complicated heap entry in a future patch, that will get longer.

[PATCH 2/3] prio-queue: make output stable with respect to insertion

2014-07-13 Thread Jeff King
If two items are added to a prio_queue and compare equal, they currently come out in an apparently random order (this order is deterministic for a particular sequence of insertions and removals, but does not necessarily match the insertion order). This makes it unlike using a date-ordered

[PATCH 3/3] paint_down_to_common: use prio_queue

2014-07-13 Thread Jeff King
When we are traversing to find merge bases, we keep our usual commit_list of commits to process, sorted by their commit timestamp. As we add each parent to the list, we have to spend O(width of history) to do the insertion, where the width of history is the number of simultaneous lines of

Re: [PATCH 2/7] move setting of object-type to alloc_* functions

2014-07-13 Thread Jeff King
On Sun, Jul 13, 2014 at 08:27:51PM +0100, Ramsay Jones wrote: Thinking on this more, writing out the definitions is the only sane thing to do here, now that alloc_commit_node does not use the macro. Otherwise you are inviting people to modify the macro, but fail to notice that the commit