Re: [PATCH] fetch-pack: do not remove .git/shallow file when --depth is not specified

2013-08-25 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > > The two possible fixes which I see are: > > > > 1) Replace back if (alternate_shallow_file) condition in fetch pack with > >if (args->depth > 0) > > > > 2) alternate_shallow_file should be copy of shallow_lock.filename not a > >reference to it > >

Re: [PATCHv2] write_index: optionally allow broken null sha1s

2013-08-25 Thread Junio C Hamano
Jonathan Nieder writes: > In other words, why not use something like this? > > write_index: optionally allow broken null sha1s > > Commit 4337b58 (do not write null sha1s to on-disk index, 2012-07-28) > added a safety check preventing git from writing null sha1s into the >

Re: [PATCH 2/2] dir: test_one_path: fix inconsistent behavior due to missing '/'

2013-08-25 Thread Junio C Hamano
Eric Sunshine writes: > ... A > follow-up series [2] fixes both directory_exists_in_index() and > directory_exists_in_index_icase() to be more liberal in what they > accept, relieving the caller of the burden. By the time that series > was posted, however, Junio and Peff had decided that a fix at

Re: [PATCH 1/3] t3404: preserve test_tick state across short SHA-1 collision test

2013-08-25 Thread Junio C Hamano
Jonathan Nieder writes: > Eric Sunshine wrote: >> On Sun, Aug 25, 2013 at 1:55 AM, Jonathan Nieder wrote: > >>> Would be clearer if the code in a subshell were indented: >>> >>> ( >>> unset test_tick && >>> test_commit ... >>> ) >> >> I considered

Re: [PATCH] commit: search author pattern against mailmap

2013-08-25 Thread Junio C Hamano
Jeff King writes: > Exactly. Sample (largely untested) patch is below if you want to use it > as a starting point. There are probably a few additional cleanups on top > (e.g., "git log" understands "--mailmap", which should probably be > centralized to handle_revision_opt). > > I'm on the fence.

[PATCH] fetch-pack: do not remove .git/shallow file when --depth is not specified

2013-08-25 Thread Nguyễn Thái Ngọc Duy
fetch_pack() can remove .git/shallow file when a shallow repository becomes a full one again. This behavior is triggered incorrectly when tags are also fetched because fetch_pack() will be called twice. At the first fetch_pack() call: - shallow_lock is set up - alternate_shallow_file points to s

[BUG] Shallow fetch can result in broken git repo

2013-08-25 Thread Kacper Kornet
Starting from "6035d6a fetch-pack: prepare updated shallow file before fetching the pack" the shallow fetches of commits with tags can result in broken git repo. The following script illustrates the problem: #!/bin/sh mkdir repo1 repo2 cd repo1 git init for i in `seq 1 3`; do echo $i > f

My github account

2013-08-25 Thread Sam Hathcock
-- 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] commit: search author pattern against mailmap

2013-08-25 Thread Antoine Pelisse
On Sun, Aug 25, 2013 at 6:51 PM, Jeff King wrote: > On Sun, Aug 25, 2013 at 03:37:24PM +0200, Antoine Pelisse wrote: > >> So we would stop passing mailmap string_list along down to map_user(), >> and the mailmap file (or blob) would be read the first time it's >> needed, and stored in a static glo

Re: [PATCH 1/5] replace: forbid replacing an object with one of a different type

2013-08-25 Thread Johannes Sixt
Am 25.08.2013 21:44, schrieb Christian Couder: > What about: > > die("Objects must be of the same type.\n" > "'%s' points to a replaced object of type '%s'\n" > "while '%s' points to a replacement object of type '%s'.", Much better! -- Hannes --

Re: Re: [PATCH 09/13] Improve section "Merge multiple trees"

2013-08-25 Thread Jonathan Nieder
Thomas Ackermann wrote: >> Maybe the intent is >> >> Git can help you perform a three-way merge, which can in turn be [...] > If you don't mind I will use your text No problem. Signed-off-by: Jonathan Nieder -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a

Re: [PATCH 3/5] t6050-replace: test that objects are of the same type

2013-08-25 Thread Johannes Sixt
Am 25.08.2013 15:06, schrieb Christian Couder: > +test_expect_success 'replaced and replacement objects must be of the same > type' ' > + test_must_fail git replace mytag $HASH1 2>err && > + grep "Object ref '\''mytag'\'' is of type '\''tag'\''" err && Uh, this hurts in the eye! Please wr

Re: [PATCHv2] write_index: optionally allow broken null sha1s

2013-08-25 Thread Jonathan Nieder
On Sun, Aug 25, 2013 at 05:58:18AM -0400, Jeff King wrote: > On Sat, Aug 24, 2013 at 11:15:00PM -0700, Jonathan Nieder wrote: >>> I was tempted to not involve filter-branch in this commit at all, and >>> instead require the user to manually invoke >>> >>> GIT_ALLOW_NULL_SHA1=1 git filter-branch

Re: [PATCH 1/5] replace: forbid replacing an object with one of a different type

2013-08-25 Thread Christian Couder
From: Johannes Sixt > Am 25.08.2013 15:06, schrieb Christian Couder: >> @@ -100,6 +101,15 @@ static int replace_object(const char *object_ref, const >> char *replace_ref, >> if (check_refname_format(ref, 0)) >> die("'%s' is not a valid ref name.", ref); >> >> +obj_type =

Re: [PATCH 1/5] replace: forbid replacing an object with one of a different type

2013-08-25 Thread Johannes Sixt
Am 25.08.2013 15:06, schrieb Christian Couder: > @@ -100,6 +101,15 @@ static int replace_object(const char *object_ref, const > char *replace_ref, > if (check_refname_format(ref, 0)) > die("'%s' is not a valid ref name.", ref); > > + obj_type = sha1_object_info(object, NU

Re: [PATCH] commit: search author pattern against mailmap

2013-08-25 Thread Jeff King
On Sun, Aug 25, 2013 at 03:37:24PM +0200, Antoine Pelisse wrote: > So we would stop passing mailmap string_list along down to map_user(), > and the mailmap file (or blob) would be read the first time it's > needed, and stored in a static global variable in mailmap.c. I think > I'm OK with that bec

Re: git-p4 out of memory for very large repository

2013-08-25 Thread Pete Wyckoff
cmt...@gmail.com wrote on Fri, 23 Aug 2013 07:48 -0400: > On Fri, Aug 23, 2013 at 08:16:58AM +0100, Luke Diamand wrote: > > On 23/08/13 02:12, Corey Thompson wrote: > > >Hello, > > > > > >Has anyone actually gotten git-p4 to clone a large Perforce repository? > > > > Yes. I've cloned repos with a

Re: [PATCH] commit: search author pattern against mailmap

2013-08-25 Thread Antoine Pelisse
On Sun, Aug 25, 2013 at 12:30 PM, Jeff King wrote: > On Sun, Aug 25, 2013 at 12:01:29PM +0200, Antoine Pelisse wrote: > >> So I kept clear_mailmap() where you put it, but I think it could be moved >> right after get_revision(). That is because I think format_commit_message() >> will run another re

[PATCH 2/5] Documentation/replace: state that objects must be of the same type

2013-08-25 Thread Christian Couder
A previous patch ensures that both the replaced and the replacement objects passed to git replace must be of the same type. While at it state that there is no other restriction on both objects. Signed-off-by: Christian Couder --- Documentation/git-replace.txt | 7 --- 1 file changed, 4 inse

[PATCH 0/5] Check replacement object type and minor updates

2013-08-25 Thread Christian Couder
Here is a reroll of the patch forbiding replacing an bject with one of a different type (1/5). It is followed by a documentation update (2/5) and a test (3/5). I also added for good mesure another test (4/5) I came up with while developing the previous test, and another doc update related to what w

[PATCH 5/5] Documentation/replace: add Creating Replacement Objects section

2013-08-25 Thread Christian Couder
There were no hints in the documentation about how to create replacement objects. Signed-off-by: Christian Couder --- Documentation/git-replace.txt | 16 1 file changed, 16 insertions(+) diff --git a/Documentation/git-replace.txt b/Documentation/git-replace.txt index aa66d27..7

[PATCH 3/5] t6050-replace: test that objects are of the same type

2013-08-25 Thread Christian Couder
Signed-off-by: Christian Couder --- t/t6050-replace.sh | 13 + 1 file changed, 13 insertions(+) diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh index decdc33..8f631ac 100755 --- a/t/t6050-replace.sh +++ b/t/t6050-replace.sh @@ -263,4 +263,17 @@ test_expect_success 'not just comm

[PATCH 4/5] t6050-replace: add test to clean up all the replace refs

2013-08-25 Thread Christian Couder
Signed-off-by: Christian Couder --- t/t6050-replace.sh | 6 ++ 1 file changed, 6 insertions(+) diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh index 8f631ac..4807689 100755 --- a/t/t6050-replace.sh +++ b/t/t6050-replace.sh @@ -276,4 +276,10 @@ test_expect_success 'replaced and replaceme

[PATCH 1/5] replace: forbid replacing an object with one of a different type

2013-08-25 Thread Christian Couder
Users replacing an object with one of a different type were not prevented to do so, even if it was obvious, and stated in the doc, that bad things would result from doing that. To avoid mistakes, it is better to just forbid that though. There is no case where one object can be replaced with one o

Re:urgent...

2013-08-25 Thread Young Chang
I need your partnership in a business transaction worth $18.2m USD for you to handle with me. Are you interested? -- "Independencia y Patria Socialista, Viviremos y Venceremos" -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.o

Aw: Re: [PATCH 09/13] Improve section "Merge multiple trees"

2013-08-25 Thread Thomas Ackermann
> > Maybe the intent is > > Git can help you perform a three-way merge, which can in turn be > used for a many-way merge by repeating the merge procedure several > times. The usual situation is that you only do one three-way merge > (reconciling two lines of history) and

Aw: Re: [PATCH 08/13] Improve section "Manipulating branches"

2013-08-25 Thread Thomas Ackermann
> > But is this correct? I somehow thought that we check with the > current or the upstream. > You are correct. I will add this. Thanks. --- Thomas -- 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

Aw: Re: [PATCH 07/13] Improve description in "How to merge"

2013-08-25 Thread Thomas Ackermann
> > Hm. It's been too long since I was a novice, since I find the above > clear already. > OK; I will drop that patch. --- Thomas -- 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.kerne

Re: [PATCH] commit: search author pattern against mailmap

2013-08-25 Thread Jeff King
On Sun, Aug 25, 2013 at 12:01:29PM +0200, Antoine Pelisse wrote: > So I kept clear_mailmap() where you put it, but I think it could be moved > right after get_revision(). That is because I think format_commit_message() > will run another read_mailmap() with an heap-allocated string_list. > Anyway,

[PATCH] commit: search author pattern against mailmap

2013-08-25 Thread Antoine Pelisse
"git commit --author=$name" sets the author to one whose name matches the given string from existing commits, when $name is not in the "Name " format. However, it does not honor the mailmap to use the canonical name for the author found this way. Fix it by telling the logic to find a matching exis

[PATCHv2] write_index: optionally allow broken null sha1s

2013-08-25 Thread Jeff King
On Sat, Aug 24, 2013 at 11:15:00PM -0700, Jonathan Nieder wrote: > > I was tempted to not involve filter-branch in this commit at all, and > > instead require the user to manually invoke > > > > GIT_ALLOW_NULL_SHA1=1 git filter-branch ... > > > > to perform such a filter. That would be slightly

Re: [PATCH] commit: search author pattern against mailmap

2013-08-25 Thread Antoine Pelisse
On Sun, Aug 25, 2013 at 7:16 AM, Junio C Hamano wrote: > Jeff King writes: >> Do we need to clear_mailmap before returning to avoid a leak? > > Good question. What I queued yesterday seems to have a call to > clear_mailmap(&mailmap) before that return. Indeed, the version you queued has clear_ma

Aw: Re: [PATCH 11/13] Remove obscure reference from "Examples"

2013-08-25 Thread Thomas Ackermann
> > > > - A "test" tree into which patches are initially placed so that they > > can get some exposure when integrated with other ongoing development. > > - This tree is available to Andrew for pulling into -mm whenever he > > - wants. > > This drops useful information (namely, that

Aw: Re: [PATCH 06/13] Simplify "How to make a commit"

2013-08-25 Thread Thomas Ackermann
> > That's a mouthful. I'd say > > To update the index with the contents of a new or modified file, use > OK; thanks! I will change this. --- Thomas -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo

Aw: Re: [PATCH 05/13] Fix some typos

2013-08-25 Thread Thomas Ackermann
> > > > -Or you can use linkgit:git-name-rev[1], which will give the commit a > > +or you can use linkgit:git-name-rev[1], which will give the commit a > > I think this reads better with a capital 'O'. (The pedant in me > likes it, too, since a colon ends a sentence.) > > The lowercase 'but'

Re: [PATCH] mailmap: handle mailmap blobs without trailing newlines

2013-08-25 Thread Jeff King
On Sun, Aug 25, 2013 at 04:55:00AM -0400, Jeff King wrote: > On Sun, Aug 25, 2013 at 04:45:50AM -0400, Jeff King wrote: > > > This is the minimal fix. Another option would be to switch > > read_mailmap_buf to read_mailmap_string, and I think we could even get > > away with avoiding the extra allo

Re: [PATCH] mailmap: handle mailmap blobs without trailing newlines

2013-08-25 Thread Jeff King
On Sun, Aug 25, 2013 at 04:45:50AM -0400, Jeff King wrote: > This is the minimal fix. Another option would be to switch > read_mailmap_buf to read_mailmap_string, and I think we could even get > away with avoiding the extra allocation/copy in the loop (because > read_mailmap_line seems to cope wit

Re: [PATCH 1/3] t3404: preserve test_tick state across short SHA-1 collision test

2013-08-25 Thread Jonathan Nieder
Eric Sunshine wrote: > On Sun, Aug 25, 2013 at 1:55 AM, Jonathan Nieder wrote: >> Would be clearer if the code in a subshell were indented: >> >> ( >> unset test_tick && >> test_commit ... >> ) > > I considered it, but decided against it for a coupl

[PATCH] mailmap: handle mailmap blobs without trailing newlines

2013-08-25 Thread Jeff King
The read_mailmap_buf function reads each line of the mailmap using strchrnul, like: const char *end = strchrnul(buf, '\n'); unsigned long linelen = end - buf + 1; But that's off-by-one when we actually hit the NUL byte; our line does not have a terminator, and so is only "end - buf" bytes

Aw: Re: [PATCH 03/13] Use current output for "git repack"

2013-08-25 Thread Thomas Ackermann
> > Sure. I wonder if there should be some text to replace the output > that mentions the pack being created, though. E.g.: > > > > > > > You can then run > > Total 6020 (delta 4070), reused 0 (delta 0) > --

Aw: Re: [PATCH 02/13] Use current "detached HEAD" message

2013-08-25 Thread Thomas Ackermann
> > I wonder if this longer wall of text (added in 13be3e31, 2010-01-29) > is too aggressive. > > It is the only piece of advice that I explicitly disable in > ~/.gitconfig, so I haven't looked at it again for a while. Since > then, the usual stream of questions about how to recover from peopl

Re: [PATCH 2/2] dir: test_one_path: fix inconsistent behavior due to missing '/'

2013-08-25 Thread Eric Sunshine
On Sun, Aug 25, 2013 at 2:00 AM, Jonathan Nieder wrote: > Eric Sunshine wrote: > >> Although undocumented, directory_exists_in_index_icase(dirname,len) >> unconditionally assumes the presence of a '/' at dirname[len] (despite >> being past the end-of-string). Callers are expected to respect > [...

Re: [PATCH 1/3] t3404: preserve test_tick state across short SHA-1 collision test

2013-08-25 Thread Eric Sunshine
On Sun, Aug 25, 2013 at 1:55 AM, Jonathan Nieder wrote: > Hi, > > Eric Sunshine wrote: > >> The short SHA-1 collision test requires carefully crafted commits in >> order to ensure a collision at rebase time. > > Yeah, this breaks the usual rule that tests should be independent > of hashing functio

Re: [PATCH 3/3] t/t7106-reset-unborn-branch.sh: Add PERL prerequisite

2013-08-25 Thread Jonathan Nieder
Junio C Hamano wrote: > The change to the one that feeds 'y' to "reset -p" may be a bit too > pedantic, as we are not in the business of testing "echo y", though. Yeah, that's true. Here's a patch for squashing in. diff --git i/t/t7106-reset-unborn-branch.sh w/t/t7106-reset-unborn-branch.sh ind