Re: [PATCH v5 00/23] Signed push

2014-09-16 Thread Jaime Soriano Pastor
On Tue, Sep 16, 2014 at 12:24 AM, Junio C Hamano wrote: > A failing test has been added at the end for smart HTTP. It appears > that somewhere in the callchain "--signed" is forgotten and the > sending end not to send the certificate for some reason. If > somebody with a fresh set of eyes can lo

[PATCH] read_index_from(): catch out of order entries when reading an index file

2014-08-29 Thread Jaime Soriano Pastor
Signed-off-by: Jaime Soriano Pastor --- read-cache.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/read-cache.c b/read-cache.c index 5d3c8bd..023d6d7 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1465,6 +1465,21 @@ static struct cache_entry *create_from_disk(struct

Re: [PATCH 1/2] Check order when reading index

2014-08-27 Thread Jaime Soriano Pastor
On Wed, Aug 27, 2014 at 11:11 PM, Junio C Hamano wrote: > I was asking for an answer more from what you know about the code. > For example, would read_index_unmerged() choke if the index has two > or more stage #1 (or stage #3) entries for the same path (provided > that the index is otherwise norm

Re: [PATCH 1/2] Check order when reading index

2014-08-27 Thread Jaime Soriano Pastor
On Tue, Aug 26, 2014 at 7:43 PM, Junio C Hamano wrote: > Does the current codebase choke with such entries in the index file, > like you saw in your index file with both stage #0 and stage #1 > entries? Not sure, I couldn't reproduce an scenario with an index with multiple entries in the same sta

[PATCH 1/2] read_index_from(): catch out of order entries when reading an index file

2014-08-27 Thread Jaime Soriano Pastor
Signed-off-by: Jaime Soriano Pastor --- read-cache.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/read-cache.c b/read-cache.c index 7f5645e..1cdb762 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1438,6 +1438,21 @@ static struct cache_entry *create_from_disk(struct

[PATCH 2/2] read_index_unmerged(): remove unnecessary loop index adjustment

2014-08-27 Thread Jaime Soriano Pastor
Signed-off-by: Jaime Soriano Pastor --- read-cache.c | 1 - 1 file changed, 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index 1cdb762..39fca8c 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1971,7 +1971,6 @@ int read_index_unmerged(struct index_state *istate) if

Re: [PATCH 1/2] Check order when reading index

2014-08-26 Thread Jaime Soriano Pastor
On Tue, Aug 26, 2014 at 6:53 PM, Junio C Hamano wrote: > > Yes---that is what I meant by the "virtual stuff". Unlike resolve > work by Daniel (around Sep 2005 $gmane/8088) that tried to use > multiple ancestors directly in a single merge, recursive limits > itself to repeated use of pairwise merg

Re: [PATCH 1/2] Check order when reading index

2014-08-26 Thread Jaime Soriano Pastor
On Mon, Aug 25, 2014 at 10:52 PM, Junio C Hamano wrote: > On Mon, Aug 25, 2014 at 12:44 PM, Jeff King wrote: >> For my own curiosity, how do you get into this situation, and what does >> it mean to have multiple stage#1 entries for the same path? What would >> "git cat-file :1:path" output? > > T

Re: [PATCH 1/2] Check order when reading index

2014-08-25 Thread Jaime Soriano Pastor
On Mon, Aug 25, 2014 at 7:21 PM, Junio C Hamano wrote: > Jaime Soriano Pastor writes: > >> Subject: Re: [PATCH 1/2] Check order when reading index > > Please be careful when crafting the commit title. This single line > will be the only one that readers will have to identi

Re: [PATCH 2/2] Loop index increases monotonically when reading unmerged entries

2014-08-24 Thread Jaime Soriano Pastor
I think this line is dangerous, if add_cache_entry is not able to remove higher-stages it will be looping forever, as happens in the case of this thread. I cannot see why it's even needed, and removing it doesn't break any test. On Sun, Aug 24, 2014 at 7:57 PM, Jaime Soriano Pas

[PATCH 2/2] Loop index increases monotonically when reading unmerged entries

2014-08-24 Thread Jaime Soriano Pastor
Signed-off-by: Jaime Soriano Pastor --- read-cache.c | 1 - 1 file changed, 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index c1a9619..3d70386 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1971,7 +1971,6 @@ int read_index_unmerged(struct index_state *istate) if

[PATCH 1/2] Check order when reading index

2014-08-24 Thread Jaime Soriano Pastor
Signed-off-by: Jaime Soriano Pastor --- read-cache.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/read-cache.c b/read-cache.c index 7f5645e..c1a9619 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1438,6 +1438,21 @@ static struct cache_entry *create_from_disk(struct

Re: [PATCH 4/4] git update-index --cacheinfo can be used to select a stage when there are merged and unmerged entries

2014-08-21 Thread Jaime Soriano Pastor
On Wed, Aug 20, 2014 at 11:08 PM, Junio C Hamano wrote: > Jaime Soriano Pastor writes: > >> Subject: Re: [PATCH 4/4] git update-index --cacheinfo can be used to select >> a stage when there are merged and unmerged entries > > Hmph, what does it even mean? Shared with

Re: [PATCH 3/4] Added tests for the case of merged and unmerged entries for the same file

2014-08-21 Thread Jaime Soriano Pastor
On Wed, Aug 20, 2014 at 11:00 PM, Junio C Hamano wrote: > Jaime Soriano Pastor writes: > >> Signed-off-by: Jaime Soriano Pastor >> --- >> t/t9904-unmerged-file-with-merged-entry.sh | 86 >> ++ > > Isn't this number alre

Re: [PATCH] Check order when reading index

2014-08-21 Thread Jaime Soriano Pastor
On Thu, Aug 21, 2014 at 3:43 PM, Jaime Soriano Pastor wrote: > + if (!ce_stage(ce)) > + die("Multiple stage entries for merged file '%s'", > + ce->name); This case can be provoked by "git updat

[PATCH] Check order when reading index

2014-08-21 Thread Jaime Soriano Pastor
Signed-off-by: Jaime Soriano Pastor --- read-cache.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/read-cache.c b/read-cache.c index 7f5645e..e117d3a 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1438,6 +1438,21 @@ static struct cache_entry *create_from_disk(struct

Re: [PATCH 0/4] Handling unmerged files with merged entries

2014-08-21 Thread Jaime Soriano Pastor
Good points. On Thu, Aug 21, 2014 at 12:19 AM, Junio C Hamano wrote: > After looking at what you did in 1/4, I started to wonder if we can > solve this in add_index_entry_with_check() in a less intrusive way. > When we call the function with a stage #0 entry, we are telling the > index that any e

[PATCH 2/4] Error out when adding a file with merged and unmerged entries

2014-08-20 Thread Jaime Soriano Pastor
Signed-off-by: Jaime Soriano Pastor --- read-cache.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/read-cache.c b/read-cache.c index c932b83..d549d0b 100644 --- a/read-cache.c +++ b/read-cache.c @@ -935,6 +935,7 @@ static int add_index_entry_with_check

[PATCH 0/4] Handling unmerged files with merged entries

2014-08-20 Thread Jaime Soriano Pastor
date-index --cacheinfo can be used to select an specific staged version to resolve the conflict, without the need of reseting the working copy. It did nothing before. Tests added for these cases. Rest of the tests remain unchanged and pass too. Jaime Soriano Pastor (4): read_index_unmerged do

[PATCH 1/4] read_index_unmerged doesn't loop forever if merged stage exists for unmerged file

2014-08-20 Thread Jaime Soriano Pastor
Signed-off-by: Jaime Soriano Pastor --- read-cache.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/read-cache.c b/read-cache.c index 7f5645e..c932b83 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1933,6 +1933,7 @@ int read_index_unmerged(struct

[PATCH 4/4] git update-index --cacheinfo can be used to select a stage when there are merged and unmerged entries

2014-08-20 Thread Jaime Soriano Pastor
Signed-off-by: Jaime Soriano Pastor --- builtin/update-index.c | 1 + cache.h| 1 + read-cache.c | 3 ++- t/t9904-unmerged-file-with-merged-entry.sh | 14 +++--- 4 files changed, 15 insertions(+), 4

[PATCH 3/4] Added tests for the case of merged and unmerged entries for the same file

2014-08-20 Thread Jaime Soriano Pastor
Signed-off-by: Jaime Soriano Pastor --- t/t9904-unmerged-file-with-merged-entry.sh | 86 ++ 1 file changed, 86 insertions(+) create mode 100755 t/t9904-unmerged-file-with-merged-entry.sh diff --git a/t/t9904-unmerged-file-with-merged-entry.sh b/t/t9904-unmerged

Re: [PATCH] read-cache.c: Ensure unmerged entries are removed

2014-08-18 Thread Jaime Soriano Pastor
wrote: > Jaime Soriano Pastor writes: > >> I'd like to add some tests too for this, but I don't know how to >> reproduce this state with git commands only, is there any way to add >> entries to the index without checkings? > > Perhaps feeding "update-inde

Re: [PATCH] read-cache.c: Ensure unmerged entries are removed

2014-08-16 Thread Jaime Soriano Pastor
Fri, Aug 15, 2014 at 11:45 PM, Junio C Hamano wrote: > Jaime Soriano Pastor writes: > >> On Thu, Aug 14, 2014 at 1:04 AM, Junio C Hamano wrote: >>> Being a conservative, I'd rather avoid doing any magic during >>> read_cache() time. "ls-files -s" for e

Re: [PATCH] read-cache.c: Ensure unmerged entries are removed

2014-08-15 Thread Jaime Soriano Pastor
On Thu, Aug 14, 2014 at 1:04 AM, Junio C Hamano wrote: > Being a conservative, I'd rather avoid doing any magic during > read_cache() time. "ls-files -s" for example should show the four > stages so that the "broken" state can be inspected. > Well, only read_cache_unmerged() is modified in the sen

Re: [PATCH] read-cache.c: Ensure unmerged entries are removed

2014-08-13 Thread Jaime Soriano Pastor
On Tue, Aug 12, 2014 at 8:39 PM, Junio C Hamano wrote: > > Jaime Soriano Pastor writes: > > > Wrong implementations of tools that modify the index can left > > some files as merged and unmerged at the same time. Avoid undesiderable > > behaviours by handlin

Re: [PATCH] read-cache.c: Ensure unmerged entries are removed

2014-08-13 Thread Jaime Soriano Pastor
On Tue, Aug 12, 2014 at 8:31 PM, Junio C Hamano wrote: > > Jaime Soriano Pastor writes: > > > A file in the index can be left as merged and unmerged at the same time > > by some tools as libgit2, this causes some undesiderable behaviours in git. > > Well, doesn'

[PATCH] read-cache.c: Ensure unmerged entries are removed

2014-08-12 Thread Jaime Soriano Pastor
he index with git read-tree --empty, but I think this would be more intrussive than the patch. Regards, Jaime Soriano. Jaime Soriano Pastor (1): read-cache.c: Ensure unmerged entries are removed read-cache.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.0.4.1.g8a38f

[PATCH] read-cache.c: Ensure unmerged entries are removed

2014-08-12 Thread Jaime Soriano Pastor
Wrong implementations of tools that modify the index can left some files as merged and unmerged at the same time. Avoid undesiderable behaviours by handling this situation. Signed-off-by: Jaime Soriano Pastor --- read-cache.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions