Re: [PATCH v2 0/3] Towards a useable git-branch

2013-05-25 Thread Duy Nguyen
On Sat, May 25, 2013 at 5:51 AM, Duy Nguyen pclo...@gmail.com wrote: I just had an idea that might bring pretty stuff to for-each-ref with probably reasonable effort, making for-each-ref format a superset of pretty. But I need to clean up my backlog first. Give me a few days, I will show you

Re: [PATCH 5/9] fast-export: add new --refspec option

2013-05-25 Thread Eric Sunshine
On Fri, May 24, 2013 at 10:47 PM, Felipe Contreras felipe.contre...@gmail.com wrote: So that we can covert the exported ref names. s/covert/convert/ Signed-off-by: Felipe Contreras felipe.contre...@gmail.com -- To unsubscribe from this list: send the line unsubscribe git in the body of a

Re: [PATCH v2 27/48] remote-hg: add test for new bookmark special

2013-05-25 Thread Eric Sunshine
On Fri, May 24, 2013 at 10:29 PM, Felipe Contreras felipe.contre...@gmail.com wrote: From the point of view of Mercurial, this creates a new branch head, and requires a forced push. Ideally, whoever, we would want it to work just like in git; new s/whoever/however/ branches can be pushed

Re: [PATCH v2 25/48] remote-hg: add test for diverged push

2013-05-25 Thread Eric Sunshine
On Fri, May 24, 2013 at 10:29 PM, Felipe Contreras felipe.contre...@gmail.com wrote: Neither mercurial nor git allows pushing to a remote when it's a non-fast-forward push. We should be able to detect theses errors and s/theses/these/ report them properly. As opposed to throwing an

Re: [PATCH 1/3] for-each-ref: introduce %C(...) for color

2013-05-25 Thread Eric Sunshine
On Fri, May 24, 2013 at 10:19 AM, Ramkumar Ramachandra artag...@gmail.com wrote: Since 'git branch' misses important options like --sort, --count, and --format that are present in 'git for-each-ref'. Until we are in a position to fix 'git branch', let us enhance the 'git for-each-ref' format

[PATCH v2 00/25] Remove assumptions about each_ref_fn arg lifetimes

2013-05-25 Thread Michael Haggerty
This is version two of the patch series. Aside from addressing Junio's comments about the first version, it goes significantly further than v1: I did a manual audit of the 50 (!) functions that are used as an each_ref_fn callback to the for_each_ref()-style functions. (I hope I haven't missed

[PATCH v2 01/25] describe: make own copy of refname

2013-05-25 Thread Michael Haggerty
Do not retain a reference to the refname passed to the each_ref_fn callback get_name(), because there is no guarantee of the lifetimes of these names. Instead, make a local copy when needed. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/describe.c | 6 -- 1 file changed,

[PATCH v2 06/25] cmd_diff(): rename local variable list - entry

2013-05-25 Thread Michael Haggerty
It's not a list, it's an array entry. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/diff.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/diff.c b/builtin/diff.c index 661fdde..84243d9 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@

[PATCH v2 10/25] revision: use object_array_filter() in implementation of gc_boundary()

2013-05-25 Thread Michael Haggerty
Use object_array_filter(), which will soon be made smarter about cleaning up discarded entries properly. Also add a function comment. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- This version changes the test to nr == alloc for clarity, but doesn't move the test to the caller as did

[PATCH v2 11/25] object_array_remove_duplicates(): rewrite to reduce copying

2013-05-25 Thread Michael Haggerty
The old version copied one entry to its destination position, then deleted any matching entries from the tail of the array. This required the tail of the array to be copied multiple times. It didn't affect the complexity of the algorithm because the whole tail has to be searched through anyway.

[PATCH v2 16/25] do_fetch(): reduce scope of peer_item

2013-05-25 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/fetch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index f949115..80c6e37 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -694,7 +694,6 @@ static int

[PATCH v2 17/25] do_fetch(): clean up existing_refs before exiting

2013-05-25 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/fetch.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index 80c6e37..48df5fa 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -697,6 +697,7 @@ static int

[PATCH v2 19/25] show_head_ref(): do not shadow name of argument

2013-05-25 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- http-backend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-backend.c b/http-backend.c index 6b85ffa..3135835 100644 --- a/http-backend.c +++ b/http-backend.c @@ -416,8 +416,8 @@ static int

[PATCH v2 18/25] add_existing(): do not retain a reference to sha1

2013-05-25 Thread Michael Haggerty
Its lifetime is not guaranteed, so make a copy. Free the memory when the string_list is cleared. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/fetch.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index

[PATCH v2 23/25] exclude_existing(): set existing_refs.strdup_strings

2013-05-25 Thread Michael Haggerty
The each_ref_fn add_existing() adds refnames to the existing_refs list. But the lifetimes of these refnames is not guaranteed by the refs API, so configure the string_list to make copies as it adds them. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/show-ref.c | 2 +- 1 file

[PATCH v2 24/25] register_ref(): make a copy of the bad reference SHA-1

2013-05-25 Thread Michael Haggerty
The lifetime of the sha1 parameter passed to an each_ref_fn callback is not guaranteed, so make a copy for later use. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- bisect.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bisect.c b/bisect.c index

[PATCH v2 25/25] refs: document the lifetime of the args passed to each_ref_fn

2013-05-25 Thread Michael Haggerty
The lifetime of the memory pointed to by the refname and sha1 arguments to each_ref_fn was never documented, but some callers used to assume that it was essentially permanent. In fact the API does *not* guarantee that these objects live beyond a single callback invocation. In the current code,

[PATCH v2 02/25] fetch: make own copies of refnames

2013-05-25 Thread Michael Haggerty
Do not retain references to refnames passed to the each_ref_fn callback add_existing(), because their lifetime is not guaranteed. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/fetch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/fetch.c

[PATCH v2 03/25] add_rev_cmdline(): make a copy of the name argument

2013-05-25 Thread Michael Haggerty
Instead of assuming that the memory pointed to by the name argument will live forever, make a local copy of it before storing it in the ref_cmdline_info. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- revision.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

[PATCH v2 04/25] builtin_diff_tree(): make it obvious that function wants two entries

2013-05-25 Thread Michael Haggerty
Instead of accepting an array and using exactly two elements from the array, take two single (struct object_array_entry *) arguments. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/diff.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git

[PATCH v2 05/25] cmd_diff(): use an object_array for holding trees

2013-05-25 Thread Michael Haggerty
Change cmd_diff() to use a (struct object_array) for holding the trees that it accumulates, rather than rolling its own equivalent. Incidentally, this change removes a hard-coded limit of 100 trees in combined diff, not that it matters in practice. Signed-off-by: Michael Haggerty

[PATCH v2 13/25] find_first_merges(): initialize merges variable using initializer

2013-05-25 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- submodule.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/submodule.c b/submodule.c index e728025..b837c04 100644 --- a/submodule.c +++ b/submodule.c @@ -846,7 +846,7 @@ static int find_first_merges(struct

[PATCH v2 12/25] fsck: don't put a void*-shaped peg in a char*-shaped hole

2013-05-25 Thread Michael Haggerty
The source of this nonsense was 04d3975937 fsck: reduce stack footprint , which wedged a pointer to parent into the object_array_entry's name field. The parent pointer was passed to traverse_one_object(), even though that function *didn't use it*. The useless code has been deleted over

[PATCH v2 15/25] object_array_entry: fix memory handling of the name field

2013-05-25 Thread Michael Haggerty
Previously, the memory management of the object_array_entry::name field was inconsistent and undocumented. object_array_entries are ultimately created by a single function, add_object_array_with_mode(), which has an argument const char *name. This function used to simply set the name field to

[PATCH v2 20/25] show_head_ref(): rename first parameter to refname

2013-05-25 Thread Michael Haggerty
This is the usual convention. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- http-backend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-backend.c b/http-backend.c index 3135835..0324417 100644 --- a/http-backend.c +++ b/http-backend.c @@ -410,14 +410,14

[PATCH v2 22/25] string_list_add_refs_by_glob(): add a comment about memory management

2013-05-25 Thread Michael Haggerty
Since string_list_add_one_ref() adds refname to the string list, but the lifetime of refname is limited, it is important that the string_list passed to string_list_add_one_ref() has strdup_strings set. Document this fact. All current callers do the right thing. Signed-off-by: Michael Haggerty

[PATCH v2 21/25] string_list_add_one_ref(): rename first parameter to refname

2013-05-25 Thread Michael Haggerty
This is the usual convention. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- notes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notes.c b/notes.c index f63fd57..fa7cdf7 100644 --- a/notes.c +++ b/notes.c @@ -918,12 +918,12 @@ out: return ret; }

[PATCH v2 14/25] find_first_merges(): remove unnecessary code

2013-05-25 Thread Michael Haggerty
No names are ever set for the object_array_entries in merges, so there is no need to pretend to copy them to the result array. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- submodule.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/submodule.c b/submodule.c

[PATCH v2 09/25] object_array: add function object_array_filter()

2013-05-25 Thread Michael Haggerty
Add a function that allows unwanted entries in an object_array to be removed. This encapsulation is a step towards giving object_array ownership of its entries' name memory. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- object.c | 16 object.h | 11 +++ 2

[PATCH v2 08/25] revision: split some overly-long lines

2013-05-25 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- revision.c | 20 ++-- revision.h | 32 +--- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/revision.c b/revision.c index 25e424c..8ac88d6 100644 --- a/revision.c +++

[PATCH v2 07/25] cmd_diff(): make it obvious which cases are exclusive of each other

2013-05-25 Thread Michael Haggerty
At first glance the OBJ_COMMIT, OBJ_TREE, and OBJ_BLOB cases look like they might be mutually exclusive. But the OBJ_COMMIT case doesn't end the loop iteration with continue like the other two cases, but rather falls through. So use if...else if...else construct to make it more obvious that only

Re: [PATCH v2 0/3] Towards a useable git-branch

2013-05-25 Thread Duy Nguyen
On Sat, May 25, 2013 at 1:26 PM, Duy Nguyen pclo...@gmail.com wrote: On Sat, May 25, 2013 at 5:51 AM, Duy Nguyen pclo...@gmail.com wrote: I just had an idea that might bring pretty stuff to for-each-ref with probably reasonable effort, making for-each-ref format a superset of pretty. But I

Re: [PATCH v2] config: allow inaccessible configuration under $HOME

2013-05-25 Thread Jason A. Donenfeld
Jonathan's patch would indeed be nice. In cgit, we are forced to do ugly things like this: /* Do not look in /etc/ for gitconfig and gitattributes. */ setenv(GIT_CONFIG_NOSYSTEM, 1, 1); setenv(GIT_ATTR_NOSYSTEM, 1, 1); /* We unset HOME and XDG_CONFIG_HOME before

Re: [PATCH v2 0/3] Towards a useable git-branch

2013-05-25 Thread Ramkumar Ramachandra
Duy Nguyen wrote: Ram, fetch the url above again. Its tip now is 5b4aa27 (for-each-ref: introduce format specifier %(*) and %(*) - 2013-05-25). Those changes make for-each-ref --format a superset of pretty. You can add new %(xxx) on top and resend the whole thing to the list for review. You

Re: [PATCH 1/3] for-each-ref: introduce %C(...) for color

2013-05-25 Thread Ramkumar Ramachandra
Antoine Pelisse wrote: Is it not possible for color to be used uninitialized here ? My compiler didn't complain; what am I missing? Doesn't the declaration char color[COLOR_MAXLEN]; initialize an empty string? More importantly, aren't there numerous instances of this in the codebase? -- To

Re: [PATCH 1/3] for-each-ref: introduce %C(...) for color

2013-05-25 Thread Ramkumar Ramachandra
David Aguilar wrote: Can you please also update Documentation/? Yeah, will do in the re-roll. Duy is bringing in pretty-formats. We'll probably need a separate document called pretty-ref-formats or some such thing. -- To unsubscribe from this list: send the line unsubscribe git in the body of a

Re: What's cooking in git.git (May 2013, #07; Fri, 24)

2013-05-25 Thread John Keeping
On Fri, May 24, 2013 at 02:15:55PM -0700, Junio C Hamano wrote: * jk/submodule-subdirectory-ok (2013-04-24) 3 commits (merged to 'next' on 2013-04-24 at 6306b29) + submodule: fix quoting in relative_path() (merged to 'next' on 2013-04-22 at f211e25) + submodule: drop the top-level

Re: [PATCH 1/3] for-each-ref: introduce %C(...) for color

2013-05-25 Thread John Keeping
On Sat, May 25, 2013 at 05:20:29PM +0530, Ramkumar Ramachandra wrote: Antoine Pelisse wrote: Is it not possible for color to be used uninitialized here ? My compiler didn't complain; what am I missing? Doesn't the declaration char color[COLOR_MAXLEN]; initialize an empty string? Why would

Re: [PATCH 1/3] for-each-ref: introduce %C(...) for color

2013-05-25 Thread Antoine Pelisse
On Sat, May 25, 2013 at 1:50 PM, Ramkumar Ramachandra artag...@gmail.com wrote: Antoine Pelisse wrote: Is it not possible for color to be used uninitialized here ? My compiler didn't complain; what am I missing? Doesn't the declaration char color[COLOR_MAXLEN]; initialize an empty string?

Re: [PATCH 1/3] for-each-ref: introduce %C(...) for color

2013-05-25 Thread Ramkumar Ramachandra
John Keeping wrote: Section 6.7.9 of the C11 standard says: If an object that has automatic storage duration is not initialized explicitly, its value is indeterminate. Ah, thanks. I'll initialize it to an empty string. More importantly, aren't there numerous instances of this in

Commit with an empty message broken since v1.8.2.1

2013-05-25 Thread Mislav Marohnić
Commit a24a41ea9a928ccde2db074ab0835c4817223c9d introduces a bug which is still present in latest master. This command git commit -m --allow-empty --allow-empty-message should create an empty commit with an empty message and never open a text editor for the commit message. Since the

Re: Bug when git rev-list options --first-parent and --ancestry-path are used together?

2013-05-25 Thread Michael Haggerty
On 05/24/2013 08:12 PM, Junio C Hamano wrote: Michael Haggerty mhag...@alum.mit.edu writes: Now assume a slightly more complicated situation, in which master has been merged to feature branch at some point: o - 0 - 1 - 2 - 3 - 4← master \ \ A - B - C - D ← branch

[PATCH] trivial: Add missing period in documentation

2013-05-25 Thread Phil Hord
--- Documentation/diff-options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 104579d..b8a9b86 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -480,7 +480,7 @@

git clone does not understand insteadOf URLs

2013-05-25 Thread Gioele Barabucci
Hello, it seems that `git clone` does not understand keywords used `insteadOf` longer URLs. $ git clone remote-repo/ProjectA.git fatal repository 'remote-repo/ProjectA.git' does not exist I suppose that git interprets the argument as a local directory. Git should see if the argument

[PATCH] commit: don't start editor if empty message is given with -m

2013-05-25 Thread René Scharfe
If an empty message is specified with the option -m of git commit then the editor is started. That's unexpected and unnecessary. Instead of using the length of the message string for checking if the user specified one, directly remember if the option -m was given. Reported-by: Mislav Marohnić

Re: [PATCH v13 02/15] path.c: refactor relative_path(), not only strip prefix

2013-05-25 Thread Jiang Xin
2013/5/22 Michael Haggerty mhag...@alum.mit.edu: Sorry for coming late to the party. I am on a business travel, and respond late also. ;-) On 05/22/2013 03:40 AM, Jiang Xin wrote: Different results for relative_path() before and after this refactor: abs path base path relative

Re: [PATCH v3 2/4] fetch-pack: prepare updated shallow file before fetching the pack

2013-05-25 Thread Duy Nguyen
On Tue, May 7, 2013 at 10:59 PM, Junio C Hamano gits...@pobox.com wrote: if (args-depth 0) { + struct stat st; + if (!fstat(shallow_lock.fd, st) + st.st_size == 0) { + unlink_or_warn(git_path(shallow)); Are we unlinking the

[PATCH v4 0/4] nd/clone-connectivity-shortcut updates

2013-05-25 Thread Nguyễn Thái Ngọc Duy
This addresses the comments from Junio and Eric in v3 [1]. [1] http://thread.gmane.org/gmane.comp.version-control.git/219611/focus=223584 Nguyễn Thái Ngọc Duy (4): clone: let the user know when check_everything_connected is run fetch-pack: prepare updated shallow file before fetching the

[PATCH v4 1/4] clone: let the user know when check_everything_connected is run

2013-05-25 Thread Nguyễn Thái Ngọc Duy
check_everything_connected could take a long time, especially in the clone case where the whole DAG is traversed. The user deserves to know what's going on. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- builtin/clone.c | 4 1 file

[PATCH v4 2/4] fetch-pack: prepare updated shallow file before fetching the pack

2013-05-25 Thread Nguyễn Thái Ngọc Duy
index-pack --strict looks up and follows parent commits. If shallow information is not ready by the time index-pack is run, index-pack may be led to non-existent objects. Make fetch-pack save shallow file to disk before invoking index-pack. git learns new global option --shallow-file to pass on

[PATCH v4 3/4] index-pack: remove dead code (it should never happen)

2013-05-25 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- builtin/index-pack.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 79dfe47..f52a04f 100644 --- a/builtin/index-pack.c

[PATCH v4 4/4] clone: open a shortcut for connectivity check

2013-05-25 Thread Nguyễn Thái Ngọc Duy
In order to make sure the cloned repository is good, we run rev-list --objects --not --all $new_refs on the repository. This is expensive on large repositories. This patch attempts to mitigate the impact in this special case. In the good clone case, we only have one pack. If all of the following

GIT Architecture

2013-05-25 Thread Rafael Abraão
Hello. I´m postgraduate student in distributed computing and I'm searching on git. I would like to know is there any website where I can find the main components and connectors of the architecture of GIT. Is there any website where I can find components-connector view point. I appreciate any