git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v3 0/4] fast-export: general fixes
@ 2012-10-30 19:06 Felipe Contreras
  2012-10-30 19:06 ` [PATCH v3 1/4] fast-export: trivial cleanup Felipe Contreras
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Felipe Contreras @ 2012-10-30 19:06 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Junio C Hamano, Sverre Rabbelier, Jonathan Nieder,
	Johannes Schindelin, Elijah Newren, Felipe Contreras

Hi,

Note: sorry for the noise, the first try (v2) was silently eaten by the mailing
list handler.

First patches are general cleanups and fixes, the last patch fixes a real issue
that affects remote helpers.

Changes since v2:

 * Actually send it to the ml

Changes since v1:

 * Improved commit messages
 * Use /dev/null in tests
 * Add test for remote helpers

Felipe Contreras (4):
  fast-export: trivial cleanup
  fast-export: fix comparisson in tests
  fast-export: don't handle uninteresting refs
  fast-export: make sure refs are updated properly

 builtin/fast-export.c     | 16 +++++++++++-----
 t/t5800-remote-helpers.sh | 11 +++++++++++
 t/t9350-fast-export.sh    | 26 +++++++++++++++++++++++---
 3 files changed, 45 insertions(+), 8 deletions(-)

-- 
1.8.0

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v3 1/4] fast-export: trivial cleanup
  2012-10-30 19:06 [PATCH v3 0/4] fast-export: general fixes Felipe Contreras
@ 2012-10-30 19:06 ` Felipe Contreras
  2012-10-30 19:06 ` [PATCH v3 2/4] fast-export: fix comparisson in tests Felipe Contreras
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 21+ messages in thread
From: Felipe Contreras @ 2012-10-30 19:06 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Junio C Hamano, Sverre Rabbelier, Jonathan Nieder,
	Johannes Schindelin, Elijah Newren, Felipe Contreras

Setting commit to commit is a no-op. It might have been there to avoid a
compiler warning, but if so, it was the compiler to blame.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin/fast-export.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 12220ad..065f324 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -483,7 +483,7 @@ static void get_tags_and_duplicates(struct object_array *pending,
 	for (i = 0; i < pending->nr; i++) {
 		struct object_array_entry *e = pending->objects + i;
 		unsigned char sha1[20];
-		struct commit *commit = commit;
+		struct commit *commit;
 		char *full_name;
 
 		if (dwim_ref(e->name, strlen(e->name), sha1, &full_name) != 1)
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 2/4] fast-export: fix comparisson in tests
  2012-10-30 19:06 [PATCH v3 0/4] fast-export: general fixes Felipe Contreras
  2012-10-30 19:06 ` [PATCH v3 1/4] fast-export: trivial cleanup Felipe Contreras
@ 2012-10-30 19:06 ` Felipe Contreras
  2012-10-30 19:06 ` [PATCH v3 3/4] fast-export: don't handle uninteresting refs Felipe Contreras
  2012-10-30 19:06 ` [PATCH v3 4/4] fast-export: make sure refs are updated properly Felipe Contreras
  3 siblings, 0 replies; 21+ messages in thread
From: Felipe Contreras @ 2012-10-30 19:06 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Junio C Hamano, Sverre Rabbelier, Jonathan Nieder,
	Johannes Schindelin, Elijah Newren, Felipe Contreras

First the expected, then the actual, otherwise the diff would be the
opposite of what we want.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/t9350-fast-export.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
index 3e821f9..49bdb44 100755
--- a/t/t9350-fast-export.sh
+++ b/t/t9350-fast-export.sh
@@ -303,7 +303,7 @@ test_expect_success 'dropping tag of filtered out object' '
 (
 	cd limit-by-paths &&
 	git fast-export --tag-of-filtered-object=drop mytag -- there > output &&
-	test_cmp output expected
+	test_cmp expected output
 )
 '
 
@@ -320,7 +320,7 @@ test_expect_success 'rewriting tag of filtered out object' '
 (
 	cd limit-by-paths &&
 	git fast-export --tag-of-filtered-object=rewrite mytag -- there > output &&
-	test_cmp output expected
+	test_cmp expected output
 )
 '
 
@@ -351,7 +351,7 @@ test_expect_failure 'no exact-ref revisions included' '
 	(
 		cd limit-by-paths &&
 		git fast-export master~2..master~1 > output &&
-		test_cmp output expected
+		test_cmp expected output
 	)
 '
 
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 3/4] fast-export: don't handle uninteresting refs
  2012-10-30 19:06 [PATCH v3 0/4] fast-export: general fixes Felipe Contreras
  2012-10-30 19:06 ` [PATCH v3 1/4] fast-export: trivial cleanup Felipe Contreras
  2012-10-30 19:06 ` [PATCH v3 2/4] fast-export: fix comparisson in tests Felipe Contreras
@ 2012-10-30 19:06 ` Felipe Contreras
  2012-10-30 19:06 ` [PATCH v3 4/4] fast-export: make sure refs are updated properly Felipe Contreras
  3 siblings, 0 replies; 21+ messages in thread
From: Felipe Contreras @ 2012-10-30 19:06 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Junio C Hamano, Sverre Rabbelier, Jonathan Nieder,
	Johannes Schindelin, Elijah Newren, Felipe Contreras

They have been marked as UNINTERESTING for a reason, lets respect that.

Currently the first ref is handled properly, but not the rest, so:

 % git fast-export master ^master

Would currently throw a reset for master (2nd ref), which is not what we
want.

 % git fast-export master ^foo ^bar ^roo
 % git fast-export master salsa..tacos

Even if all these refs point to the same object; foo, bar, roo, salsa,
and tacos would all get a reset.

This is most certainly not what we want. After this patch, nothing gets
exported, because nothing was selected (everything is UNINTERESTING).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin/fast-export.c  | 7 ++++---
 t/t9350-fast-export.sh | 6 ++++++
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 065f324..7fb6fe1 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -523,10 +523,11 @@ static void get_tags_and_duplicates(struct object_array *pending,
 				typename(e->item->type));
 			continue;
 		}
-		if (commit->util)
+		if (commit->util) {
 			/* more than one name for the same object */
-			string_list_append(extra_refs, full_name)->util = commit;
-		else
+			if (!(commit->object.flags & UNINTERESTING))
+				string_list_append(extra_refs, full_name)->util = commit;
+		} else
 			commit->util = full_name;
 	}
 }
diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
index 49bdb44..6ea8f6f 100755
--- a/t/t9350-fast-export.sh
+++ b/t/t9350-fast-export.sh
@@ -440,4 +440,10 @@ test_expect_success 'fast-export quotes pathnames' '
 	)
 '
 
+test_expect_success 'proper extra refs handling' '
+	git fast-export master ^master master..master > actual &&
+	echo -n > expected &&
+	test_cmp expected actual
+'
+
 test_done
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 4/4] fast-export: make sure refs are updated properly
  2012-10-30 19:06 [PATCH v3 0/4] fast-export: general fixes Felipe Contreras
                   ` (2 preceding siblings ...)
  2012-10-30 19:06 ` [PATCH v3 3/4] fast-export: don't handle uninteresting refs Felipe Contreras
@ 2012-10-30 19:06 ` Felipe Contreras
  2012-10-31  0:11   ` [PATCH v2 " Jonathan Nieder
  2012-10-31  0:37   ` [PATCH v3 " Jonathan Nieder
  3 siblings, 2 replies; 21+ messages in thread
From: Felipe Contreras @ 2012-10-30 19:06 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Junio C Hamano, Sverre Rabbelier, Jonathan Nieder,
	Johannes Schindelin, Elijah Newren, Felipe Contreras

When an object has already been exported (and thus is in the marks) it
is flagged as SHOWN, so it will not be exported again, even if this time
it's exported through a different ref.

We don't need the object to be exported again, but we want the ref
updated, which doesn't happen.

Since we can't know if a ref was exported or not, let's just assume that
if the commit was marked (flags & SHOWN), the user still wants the ref
updated.

So:

 % git branch test master
 % git fast-export $mark_flags master
 % git fast-export $mark_flags test

Would export 'test' properly.

Additionally, this fixes issues with remote helpers; now they can push
refs wich objects have already been exported.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin/fast-export.c     | 11 ++++++++---
 t/t5800-remote-helpers.sh | 11 +++++++++++
 t/t9350-fast-export.sh    | 14 ++++++++++++++
 3 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 7fb6fe1..663a93d 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -523,11 +523,16 @@ static void get_tags_and_duplicates(struct object_array *pending,
 				typename(e->item->type));
 			continue;
 		}
-		if (commit->util) {
-			/* more than one name for the same object */
+
+		/*
+		 * This ref will not be updated through a commit, lets make
+		 * sure it gets properly upddated eventually.
+		 */
+		if (commit->util || commit->object.flags & SHOWN) {
 			if (!(commit->object.flags & UNINTERESTING))
 				string_list_append(extra_refs, full_name)->util = commit;
-		} else
+		}
+		if (!commit->util)
 			commit->util = full_name;
 	}
 }
diff --git a/t/t5800-remote-helpers.sh b/t/t5800-remote-helpers.sh
index e7dc668..69a145a 100755
--- a/t/t5800-remote-helpers.sh
+++ b/t/t5800-remote-helpers.sh
@@ -145,4 +145,15 @@ test_expect_failure 'push new branch with old:new refspec' '
 	compare_refs clone HEAD server refs/heads/new-refspec
 '
 
+test_expect_success 'push ref with existing object' '
+	(cd localclone &&
+	git branch point-to-master master &&
+	git push origin point-to-master
+	) &&
+
+	(cd server &&
+	git show-ref refs/heads/point-to-master
+	)
+'
+
 test_done
diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
index 6ea8f6f..a4178e3 100755
--- a/t/t9350-fast-export.sh
+++ b/t/t9350-fast-export.sh
@@ -446,4 +446,18 @@ test_expect_success 'proper extra refs handling' '
 	test_cmp expected actual
 '
 
+cat > expected << EOF
+reset refs/heads/master
+from :13
+
+EOF
+
+test_expect_success 'refs are updated even if no commits need to be exported' '
+	git fast-export --import-marks=tmp-marks \
+		--export-marks=tmp-marks master > /dev/null &&
+	git fast-export --import-marks=tmp-marks \
+		--export-marks=tmp-marks master > actual &&
+	test_cmp expected actual
+'
+
 test_done
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 4/4] fast-export: make sure refs are updated properly
  2012-10-30 19:06 ` [PATCH v3 4/4] fast-export: make sure refs are updated properly Felipe Contreras
@ 2012-10-31  0:11   ` Jonathan Nieder
  2012-10-31  2:08     ` Felipe Contreras
  2012-10-31  0:37   ` [PATCH v3 " Jonathan Nieder
  1 sibling, 1 reply; 21+ messages in thread
From: Jonathan Nieder @ 2012-10-31  0:11 UTC (permalink / raw)
  To: Felipe Contreras
  Cc: git, Jeff King, Junio C Hamano, Sverre Rabbelier,
	Johannes Schindelin, Elijah Newren

(cc-ing the git list)
Felipe Contreras wrote:

> When an object has already been exported (and thus is in the marks) it
> is flagged as SHOWN, so it will not be exported again, even if this time
> it's exported through a different ref.
>
> We don't need the object to be exported again, but we want the ref
> updated

Yes, makes perfect sense.

For what it's worth,
Acked-by: Jonathan Nieder <jrnieder@gmail.com>

[...]
> --- a/t/t5800-remote-helpers.sh
> +++ b/t/t5800-remote-helpers.sh
> @@ -145,4 +145,15 @@ test_expect_failure 'push new branch with old:new refspec' '
>  	compare_refs clone HEAD server refs/heads/new-refspec
>  '
>  
> +test_expect_success 'push ref with existing object' '
> +	(cd localclone &&
> +	git branch point-to-master master &&
> +	git push origin point-to-master
> +	) &&
> +
> +	(cd server &&
> +	git show-ref refs/heads/point-to-master
> +	)

Style: if you indent like this, the test becomes clearer:

	(
		cd localclone &&
		git branch point-to-master master &&
		git push origin point-to-master
	) &&
	(
		cd server &&
		git rev-parse --verify refs/heads/point-to-master
	)

[...]
> +test_expect_success 'refs are updated even if no commits need to be exported' '
> +	git fast-export --import-marks=tmp-marks \
> +		--export-marks=tmp-marks master > /dev/null &&

The redirect just makes the test log with "-v" less informative, so
I'd drop it.

> +	git fast-export --import-marks=tmp-marks \
> +		--export-marks=tmp-marks master > actual &&
> +	test_cmp expected actual

Redirections in git shell scripts are generally spelled as
"do_something >actual", without a space between the operator and
filename.

Hope that helps,
Jonathan

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/4] fast-export: make sure refs are updated properly
  2012-10-30 19:06 ` [PATCH v3 4/4] fast-export: make sure refs are updated properly Felipe Contreras
  2012-10-31  0:11   ` [PATCH v2 " Jonathan Nieder
@ 2012-10-31  0:37   ` Jonathan Nieder
  2012-10-31  1:33     ` Sverre Rabbelier
                       ` (2 more replies)
  1 sibling, 3 replies; 21+ messages in thread
From: Jonathan Nieder @ 2012-10-31  0:37 UTC (permalink / raw)
  To: Felipe Contreras
  Cc: git, Jeff King, Junio C Hamano, Sverre Rabbelier,
	Johannes Schindelin, Elijah Newren

Felipe Contreras wrote:

> --- a/builtin/fast-export.c
> +++ b/builtin/fast-export.c
> @@ -523,11 +523,16 @@ static void get_tags_and_duplicates(struct object_array *pending,
>  				typename(e->item->type));
>  			continue;
>  		}
> -		if (commit->util) {
> -			/* more than one name for the same object */
> +
> +		/*
> +		 * This ref will not be updated through a commit, lets make
> +		 * sure it gets properly upddated eventually.
> +		 */
> +		if (commit->util || commit->object.flags & SHOWN) {
>  			if (!(commit->object.flags & UNINTERESTING))
>  				string_list_append(extra_refs, full_name)->util = commit;
> -		} else
> +		}
> +		if (!commit->util)
>  			commit->util = full_name;

Here's an explanation of why the above makes sense to me.

get_tags_and_duplicates() gets called after the marks import and
before the revision walk.  It walks through the revs from the
commandline and for each one:

 - peels it to a refname, and then to a commit
 - stores the refname so fast-export knows what arg to pass to
   the "commit" command during the revision walk
 - if it already had a refname stored, instead adds the
   (refname, commit) pair to the extra_refs list, so fast-export
   knows to add a "reset" command later.

If the commit already has the SHOWN flag set because it was pointed to
by a mark, it is not going to come up in the revision walk, so it will
not be mentioned in the output stream unless it is added to
extra_refs.  That's what this patch does.

Incidentally, the change from "else" to "if (!commit->util)" is
unnecessary because if a commit is already SHOWN then it will not be
encountered in the revision walk so commit->util does not need to be
set.

If the commit does not have the SHOWN or UNINTERESTING flag set but it
is going to get the UNINTERESTING flag set during the walk because of
a negative commit listed on the command line, this patch won't help.

Jonathan

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/4] fast-export: make sure refs are updated properly
  2012-10-31  0:37   ` [PATCH v3 " Jonathan Nieder
@ 2012-10-31  1:33     ` Sverre Rabbelier
  2012-10-31  6:05       ` Jonathan Nieder
  2012-10-31  2:13     ` [PATCH v3 4/4] fast-export: make sure refs are updated properly Felipe Contreras
  2012-11-02 13:12     ` Jeff King
  2 siblings, 1 reply; 21+ messages in thread
From: Sverre Rabbelier @ 2012-10-31  1:33 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Felipe Contreras, git, Jeff King, Junio C Hamano,
	Johannes Schindelin, Elijah Newren

On Tue, Oct 30, 2012 at 5:37 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Felipe Contreras wrote:
>
>> --- a/builtin/fast-export.c
>> +++ b/builtin/fast-export.c
>> @@ -523,11 +523,16 @@ static void get_tags_and_duplicates(struct object_array *pending,
>>                               typename(e->item->type));
>>                       continue;
>>               }
>> -             if (commit->util) {
>> -                     /* more than one name for the same object */
>> +
>> +             /*
>> +              * This ref will not be updated through a commit, lets make
>> +              * sure it gets properly upddated eventually.
>> +              */
>> +             if (commit->util || commit->object.flags & SHOWN) {
>>                       if (!(commit->object.flags & UNINTERESTING))
>>                               string_list_append(extra_refs, full_name)->util = commit;
>> -             } else
>> +             }
>> +             if (!commit->util)
>>                       commit->util = full_name;
>
> Here's an explanation of why the above makes sense to me.
>
> get_tags_and_duplicates() gets called after the marks import and
> before the revision walk.  It walks through the revs from the
> commandline and for each one:
>
>  - peels it to a refname, and then to a commit
>  - stores the refname so fast-export knows what arg to pass to
>    the "commit" command during the revision walk
>  - if it already had a refname stored, instead adds the
>    (refname, commit) pair to the extra_refs list, so fast-export
>    knows to add a "reset" command later.
>
> If the commit already has the SHOWN flag set because it was pointed to
> by a mark, it is not going to come up in the revision walk, so it will
> not be mentioned in the output stream unless it is added to
> extra_refs.  That's what this patch does.
>
> Incidentally, the change from "else" to "if (!commit->util)" is
> unnecessary because if a commit is already SHOWN then it will not be
> encountered in the revision walk so commit->util does not need to be
> set.
>
> If the commit does not have the SHOWN or UNINTERESTING flag set but it
> is going to get the UNINTERESTING flag set during the walk because of
> a negative commit listed on the command line, this patch won't help.

Thanks for the thorough explanation. Perhaps some of that could make
it's way into the commit message?

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 4/4] fast-export: make sure refs are updated properly
  2012-10-31  0:11   ` [PATCH v2 " Jonathan Nieder
@ 2012-10-31  2:08     ` Felipe Contreras
  0 siblings, 0 replies; 21+ messages in thread
From: Felipe Contreras @ 2012-10-31  2:08 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: git, Jeff King, Junio C Hamano, Sverre Rabbelier,
	Johannes Schindelin, Elijah Newren

On Wed, Oct 31, 2012 at 1:11 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> (cc-ing the git list)
> Felipe Contreras wrote:
>
>> When an object has already been exported (and thus is in the marks) it
>> is flagged as SHOWN, so it will not be exported again, even if this time
>> it's exported through a different ref.
>>
>> We don't need the object to be exported again, but we want the ref
>> updated
>
> Yes, makes perfect sense.
>
> For what it's worth,
> Acked-by: Jonathan Nieder <jrnieder@gmail.com>

Yay!

> [...]
>> --- a/t/t5800-remote-helpers.sh
>> +++ b/t/t5800-remote-helpers.sh
>> @@ -145,4 +145,15 @@ test_expect_failure 'push new branch with old:new refspec' '
>>       compare_refs clone HEAD server refs/heads/new-refspec
>>  '
>>
>> +test_expect_success 'push ref with existing object' '
>> +     (cd localclone &&
>> +     git branch point-to-master master &&
>> +     git push origin point-to-master
>> +     ) &&
>> +
>> +     (cd server &&
>> +     git show-ref refs/heads/point-to-master
>> +     )
>
> Style: if you indent like this, the test becomes clearer:

And then it would become inconsistent with the rest of the file.

>> +     git fast-export --import-marks=tmp-marks \
>> +             --export-marks=tmp-marks master > actual &&
>> +     test_cmp expected actual
>
> Redirections in git shell scripts are generally spelled as
> "do_something >actual", without a space between the operator and
> filename.

I generally am OK with adapting to whatever code-style is used
(sometimes under protest), but this is a place where I draw   the
line. Sorry, '>actual' is more annoying to me than a knife screeching
glass. Fortunately, '> actual' is used in many other places in 't/',
so I'm going to use the other people jumping over the bridge argument.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/4] fast-export: make sure refs are updated properly
  2012-10-31  0:37   ` [PATCH v3 " Jonathan Nieder
  2012-10-31  1:33     ` Sverre Rabbelier
@ 2012-10-31  2:13     ` Felipe Contreras
  2012-11-02 13:12     ` Jeff King
  2 siblings, 0 replies; 21+ messages in thread
From: Felipe Contreras @ 2012-10-31  2:13 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: git, Jeff King, Junio C Hamano, Sverre Rabbelier,
	Johannes Schindelin, Elijah Newren

On Wed, Oct 31, 2012 at 1:37 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Felipe Contreras wrote:
>
>> --- a/builtin/fast-export.c
>> +++ b/builtin/fast-export.c
>> @@ -523,11 +523,16 @@ static void get_tags_and_duplicates(struct object_array *pending,
>>                               typename(e->item->type));
>>                       continue;
>>               }
>> -             if (commit->util) {
>> -                     /* more than one name for the same object */
>> +
>> +             /*
>> +              * This ref will not be updated through a commit, lets make
>> +              * sure it gets properly upddated eventually.
>> +              */
>> +             if (commit->util || commit->object.flags & SHOWN) {
>>                       if (!(commit->object.flags & UNINTERESTING))
>>                               string_list_append(extra_refs, full_name)->util = commit;
>> -             } else
>> +             }
>> +             if (!commit->util)
>>                       commit->util = full_name;
>
> Here's an explanation of why the above makes sense to me.
>
> get_tags_and_duplicates() gets called after the marks import and
> before the revision walk.  It walks through the revs from the
> commandline and for each one:
>
>  - peels it to a refname, and then to a commit
>  - stores the refname so fast-export knows what arg to pass to
>    the "commit" command during the revision walk
>  - if it already had a refname stored, instead adds the
>    (refname, commit) pair to the extra_refs list, so fast-export
>    knows to add a "reset" command later.
>
> If the commit already has the SHOWN flag set because it was pointed to
> by a mark, it is not going to come up in the revision walk, so it will
> not be mentioned in the output stream unless it is added to
> extra_refs.  That's what this patch does.

That is correct.

> Incidentally, the change from "else" to "if (!commit->util)" is
> unnecessary because if a commit is already SHOWN then it will not be
> encountered in the revision walk so commit->util does not need to be
> set.

Maybe, but that's yet another change, and with more changes come more
possibilities of regressions. I haven't verified this is the case.

If this makes sense, I would do it in another, separate patch.

> If the commit does not have the SHOWN or UNINTERESTING flag set but it
> is going to get the UNINTERESTING flag set during the walk because of
> a negative commit listed on the command line, this patch won't help.

I don't know what that means in practice.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/4] fast-export: make sure refs are updated properly
  2012-10-31  1:33     ` Sverre Rabbelier
@ 2012-10-31  6:05       ` Jonathan Nieder
  2012-10-31  9:53         ` [OT] How to get the discussion details via notes Peter Baumann
  0 siblings, 1 reply; 21+ messages in thread
From: Jonathan Nieder @ 2012-10-31  6:05 UTC (permalink / raw)
  To: Sverre Rabbelier
  Cc: Felipe Contreras, git, Jeff King, Junio C Hamano,
	Johannes Schindelin, Elijah Newren

Sverre Rabbelier wrote:

> Thanks for the thorough explanation. Perhaps some of that could make
> it's way into the commit message?

It's fine with me if it doesn't, since the original commit message
covers the basics (current behavior and intent of the change) in its
first two paragraphs and anyone wanting more detail can use

	GIT_NOTES_REF=refs/remotes/charon/notes/full \
	git show --show-notes <commit>

to find more details.

Thanks,
Jonathan

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [OT] How to get the discussion details via notes
  2012-10-31  6:05       ` Jonathan Nieder
@ 2012-10-31  9:53         ` Peter Baumann
  2012-10-31 12:29           ` Drew Northup
  2012-10-31 14:10           ` Jeff King
  0 siblings, 2 replies; 21+ messages in thread
From: Peter Baumann @ 2012-10-31  9:53 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git

Dropping the Cc list, as this is off topic

On Tue, Oct 30, 2012 at 11:05:29PM -0700, Jonathan Nieder wrote:
> Sverre Rabbelier wrote:
> 
> > Thanks for the thorough explanation. Perhaps some of that could make
> > it's way into the commit message?
> 
> It's fine with me if it doesn't, since the original commit message
> covers the basics (current behavior and intent of the change) in its
> first two paragraphs and anyone wanting more detail can use
> 
> 	GIT_NOTES_REF=refs/remotes/charon/notes/full \
> 	git show --show-notes <commit>
> 
> to find more details.

I seem to miss something here, but I don't get it how the notes ref
becomes magically filled with the details of this discussion.

Care to explain?

-Peter

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [OT] How to get the discussion details via notes
  2012-10-31  9:53         ` [OT] How to get the discussion details via notes Peter Baumann
@ 2012-10-31 12:29           ` Drew Northup
  2012-10-31 14:10           ` Jeff King
  1 sibling, 0 replies; 21+ messages in thread
From: Drew Northup @ 2012-10-31 12:29 UTC (permalink / raw)
  To: Peter Baumann; +Cc: Jonathan Nieder, git

On Wed, Oct 31, 2012 at 5:53 AM, Peter Baumann <waste.manager@gmx.de> wrote:
> Dropping the Cc list, as this is off topic
>
> On Tue, Oct 30, 2012 at 11:05:29PM -0700, Jonathan Nieder wrote:
>> Sverre Rabbelier wrote:
>>
>> > Thanks for the thorough explanation. Perhaps some of that could make
>> > it's way into the commit message?
>>
>> It's fine with me if it doesn't, since the original commit message
>> covers the basics (current behavior and intent of the change) in its
>> first two paragraphs and anyone wanting more detail can use
>>
>>       GIT_NOTES_REF=refs/remotes/charon/notes/full \
>>       git show --show-notes <commit>
>>
>> to find more details.
>
> I seem to miss something here, but I don't get it how the notes ref
> becomes magically filled with the details of this discussion.
>
> Care to explain?

If I have an email thread I'd like to store alongside a commit I'll
put that into a note, but I usually don't push that kind of thing out
to a remote repo.
Does that help?

-- 
-Drew Northup
--------------------------------------------------------------
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [OT] How to get the discussion details via notes
  2012-10-31  9:53         ` [OT] How to get the discussion details via notes Peter Baumann
  2012-10-31 12:29           ` Drew Northup
@ 2012-10-31 14:10           ` Jeff King
  2012-11-01  7:49             ` Peter Baumann
  1 sibling, 1 reply; 21+ messages in thread
From: Jeff King @ 2012-10-31 14:10 UTC (permalink / raw)
  To: Peter Baumann; +Cc: Thomas Rast, Jonathan Nieder, git

On Wed, Oct 31, 2012 at 10:53:27AM +0100, Peter Baumann wrote:

> > covers the basics (current behavior and intent of the change) in its
> > first two paragraphs and anyone wanting more detail can use
> > 
> > 	GIT_NOTES_REF=refs/remotes/charon/notes/full \
> > 	git show --show-notes <commit>
> > 
> > to find more details.
> 
> I seem to miss something here, but I don't get it how the notes ref
> becomes magically filled with the details of this discussion.

Thomas Rast (aka charon) keeps a mapping of commits to the email threads
that led to them. You can fetch it from:

   git://repo.or.cz/git/trast.git

(try the notes/full and notes/terse refs).

-Peff

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [OT] How to get the discussion details via notes
  2012-10-31 14:10           ` Jeff King
@ 2012-11-01  7:49             ` Peter Baumann
  0 siblings, 0 replies; 21+ messages in thread
From: Peter Baumann @ 2012-11-01  7:49 UTC (permalink / raw)
  To: Jeff King; +Cc: Thomas Rast, Jonathan Nieder, git

On Wed, Oct 31, 2012 at 10:10:24AM -0400, Jeff King wrote:
> On Wed, Oct 31, 2012 at 10:53:27AM +0100, Peter Baumann wrote:
> 
> > > covers the basics (current behavior and intent of the change) in its
> > > first two paragraphs and anyone wanting more detail can use
> > > 
> > > 	GIT_NOTES_REF=refs/remotes/charon/notes/full \
> > > 	git show --show-notes <commit>
> > > 
> > > to find more details.
> > 
> > I seem to miss something here, but I don't get it how the notes ref
> > becomes magically filled with the details of this discussion.
> 
> Thomas Rast (aka charon) keeps a mapping of commits to the email threads
> that led to them. You can fetch it from:
> 
>    git://repo.or.cz/git/trast.git
> 
> (try the notes/full and notes/terse refs).
> 

Nice! I didn't know about that.

-Peter

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/4] fast-export: make sure refs are updated properly
  2012-10-31  0:37   ` [PATCH v3 " Jonathan Nieder
  2012-10-31  1:33     ` Sverre Rabbelier
  2012-10-31  2:13     ` [PATCH v3 4/4] fast-export: make sure refs are updated properly Felipe Contreras
@ 2012-11-02 13:12     ` Jeff King
  2012-11-02 14:55       ` Jonathan Nieder
                         ` (2 more replies)
  2 siblings, 3 replies; 21+ messages in thread
From: Jeff King @ 2012-11-02 13:12 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Felipe Contreras, git, Junio C Hamano, Sverre Rabbelier,
	Johannes Schindelin, Elijah Newren

On Tue, Oct 30, 2012 at 05:37:21PM -0700, Jonathan Nieder wrote:

> If the commit does not have the SHOWN or UNINTERESTING flag set but it
> is going to get the UNINTERESTING flag set during the walk because of
> a negative commit listed on the command line, this patch won't help.

Right, so my understanding of the situation is that doing this:

  $ git branch foo master~1
  $ git fast-export foo master~1..master

won't show "foo", which seems wrong to me. _But_ we currently get that
wrong already, so Felipe's patches are not making anything worse, but
are fixing some situations (namely when master~1 is not mentioned on the
command-line, but rather in a marks file).

Is that correct?

If so, then this series isn't regressing behavior; the only downside is
that it's an incomplete fix. In theory this could get in the way of the
full fix later on, but given the commit messages and the archive of this
discussion, it would be simple enough to revert it later in favor of a
more full fix. Is that accurate?

Sorry if I am belaboring the discussion. I just want to make sure I
understand the situation before deciding what to do with the topic. It
sounds like the consensus at this point is "not perfect, but good enough
to make forward progress".

-Peff

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/4] fast-export: make sure refs are updated properly
  2012-11-02 13:12     ` Jeff King
@ 2012-11-02 14:55       ` Jonathan Nieder
  2012-11-02 15:17       ` Johannes Schindelin
  2012-11-02 15:34       ` Felipe Contreras
  2 siblings, 0 replies; 21+ messages in thread
From: Jonathan Nieder @ 2012-11-02 14:55 UTC (permalink / raw)
  To: Jeff King
  Cc: Felipe Contreras, git, Junio C Hamano, Sverre Rabbelier,
	Johannes Schindelin, Elijah Newren

Jeff King wrote:

> If so, then this series isn't regressing behavior; the only downside is
> that it's an incomplete fix. In theory this could get in the way of the
> full fix later on, but given the commit messages and the archive of this
> discussion, it would be simple enough to revert it later in favor of a
> more full fix. Is that accurate?
>
> Sorry if I am belaboring the discussion. I just want to make sure I
> understand the situation before deciding what to do with the topic. It
> sounds like the consensus at this point is "not perfect, but good enough
> to make forward progress".

Patch 1, 2, and 4 are good modulo their descriptions.  They should
work fine without patch 3.

Patch 3 is a regression in comprehensibility.  I think we can do
better.  Maybe all it would take is a less confusing description, and
tweaks to the code (to loop over revs->cmdline instead of
revs->pending) could come on top.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/4] fast-export: make sure refs are updated properly
  2012-11-02 13:12     ` Jeff King
  2012-11-02 14:55       ` Jonathan Nieder
@ 2012-11-02 15:17       ` Johannes Schindelin
  2012-11-02 15:19         ` Jeff King
  2012-11-02 15:34       ` Felipe Contreras
  2 siblings, 1 reply; 21+ messages in thread
From: Johannes Schindelin @ 2012-11-02 15:17 UTC (permalink / raw)
  To: Jeff King
  Cc: Jonathan Nieder, Felipe Contreras, git, Junio C Hamano,
	Sverre Rabbelier, Elijah Newren

Hi Peff,

On Fri, 2 Nov 2012, Jeff King wrote:

> On Tue, Oct 30, 2012 at 05:37:21PM -0700, Jonathan Nieder wrote:
> 
> > If the commit does not have the SHOWN or UNINTERESTING flag set but it
> > is going to get the UNINTERESTING flag set during the walk because of
> > a negative commit listed on the command line, this patch won't help.
> 
> Right, so my understanding of the situation is that doing this:
> 
>   $ git branch foo master~1
>   $ git fast-export foo master~1..master
> 
> won't show "foo", which seems wrong to me. _But_ we currently get that
> wrong already, so Felipe's patches are not making anything worse, but
> are fixing some situations (namely when master~1 is not mentioned on the
> command-line, but rather in a marks file).
> 
> Is that correct?
> 
> If so, then this series isn't regressing behavior; the only downside is
> that it's an incomplete fix. In theory this could get in the way of the
> full fix later on, but given the commit messages and the archive of this
> discussion, it would be simple enough to revert it later in favor of a
> more full fix. Is that accurate?

>From my understanding, yes.

> Sorry if I am belaboring the discussion. I just want to make sure I
> understand the situation before deciding what to do with the topic. It
> sounds like the consensus at this point is "not perfect, but good enough
> to make forward progress".

I appreciate that stance very much. The patch Sverre and I proposed was
also an incomplete fix (although I suspect it would fix the issue you
pointed out above), so I agree with the "perfect is the enemy of the good"
approach, obviously.

May I just ask to include a summary of that rationale into the commit
message rather than relying on people having internet access and knowing
where to look? Adding the following to the commit message would be good
enough for me:

	Note that

		$ git branch foo master~1
		$ git fast-export foo master~1..master

	still does not update the "foo" ref, but a partial fix is better
	than no fix.

Thanks,
Dscho

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/4] fast-export: make sure refs are updated properly
  2012-11-02 15:17       ` Johannes Schindelin
@ 2012-11-02 15:19         ` Jeff King
  2012-11-02 15:35           ` Felipe Contreras
  0 siblings, 1 reply; 21+ messages in thread
From: Jeff King @ 2012-11-02 15:19 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Jonathan Nieder, Felipe Contreras, git, Junio C Hamano,
	Sverre Rabbelier, Elijah Newren

On Fri, Nov 02, 2012 at 04:17:14PM +0100, Johannes Schindelin wrote:

> > If so, then this series isn't regressing behavior; the only downside is
> > that it's an incomplete fix. In theory this could get in the way of the
> > full fix later on, but given the commit messages and the archive of this
> > discussion, it would be simple enough to revert it later in favor of a
> > more full fix. Is that accurate?
> 
> From my understanding, yes.
> 
> > Sorry if I am belaboring the discussion. I just want to make sure I
> > understand the situation before deciding what to do with the topic. It
> > sounds like the consensus at this point is "not perfect, but good enough
> > to make forward progress".
> 
> I appreciate that stance very much. The patch Sverre and I proposed was
> also an incomplete fix (although I suspect it would fix the issue you
> pointed out above), so I agree with the "perfect is the enemy of the good"
> approach, obviously.

Thanks for the response.

> May I just ask to include a summary of that rationale into the commit
> message rather than relying on people having internet access and knowing
> where to look? Adding the following to the commit message would be good
> enough for me:
> 
> 	Note that
> 
> 		$ git branch foo master~1
> 		$ git fast-export foo master~1..master
> 
> 	still does not update the "foo" ref, but a partial fix is better
> 	than no fix.

Yes, I think that makes a lot of sense.

Felipe, I notice that you sent out a big "fast-export improvements"
series. Does that supersede this?

-Peff

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/4] fast-export: make sure refs are updated properly
  2012-11-02 13:12     ` Jeff King
  2012-11-02 14:55       ` Jonathan Nieder
  2012-11-02 15:17       ` Johannes Schindelin
@ 2012-11-02 15:34       ` Felipe Contreras
  2 siblings, 0 replies; 21+ messages in thread
From: Felipe Contreras @ 2012-11-02 15:34 UTC (permalink / raw)
  To: Jeff King
  Cc: Jonathan Nieder, git, Junio C Hamano, Sverre Rabbelier,
	Johannes Schindelin, Elijah Newren

On Fri, Nov 2, 2012 at 2:12 PM, Jeff King <peff@peff.net> wrote:
> On Tue, Oct 30, 2012 at 05:37:21PM -0700, Jonathan Nieder wrote:
>
>> If the commit does not have the SHOWN or UNINTERESTING flag set but it
>> is going to get the UNINTERESTING flag set during the walk because of
>> a negative commit listed on the command line, this patch won't help.
>
> Right, so my understanding of the situation is that doing this:
>
>   $ git branch foo master~1
>   $ git fast-export foo master~1..master
>
> won't show "foo", which seems wrong to me. _But_ we currently get that
> wrong already, so Felipe's patches are not making anything worse, but
> are fixing some situations (namely when master~1 is not mentioned on the
> command-line, but rather in a marks file).
>
> Is that correct?

Yes, that's correct. But my patch ("make sure refs are updated
properly") does _not_ change in any shape or form what happens with
what you specify in the command line, only what happens with marks.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/4] fast-export: make sure refs are updated properly
  2012-11-02 15:19         ` Jeff King
@ 2012-11-02 15:35           ` Felipe Contreras
  0 siblings, 0 replies; 21+ messages in thread
From: Felipe Contreras @ 2012-11-02 15:35 UTC (permalink / raw)
  To: Jeff King
  Cc: Johannes Schindelin, Jonathan Nieder, git, Junio C Hamano,
	Sverre Rabbelier, Elijah Newren

On Fri, Nov 2, 2012 at 4:19 PM, Jeff King <peff@peff.net> wrote:
> On Fri, Nov 02, 2012 at 04:17:14PM +0100, Johannes Schindelin wrote:

>> May I just ask to include a summary of that rationale into the commit
>> message rather than relying on people having internet access and knowing
>> where to look? Adding the following to the commit message would be good
>> enough for me:
>>
>>       Note that
>>
>>               $ git branch foo master~1
>>               $ git fast-export foo master~1..master
>>
>>       still does not update the "foo" ref, but a partial fix is better
>>       than no fix.
>
> Yes, I think that makes a lot of sense.
>
> Felipe, I notice that you sent out a big "fast-export improvements"
> series. Does that supersede this?

Yes. I noticed this patch fixes other tests.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2012-11-02 15:35 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-30 19:06 [PATCH v3 0/4] fast-export: general fixes Felipe Contreras
2012-10-30 19:06 ` [PATCH v3 1/4] fast-export: trivial cleanup Felipe Contreras
2012-10-30 19:06 ` [PATCH v3 2/4] fast-export: fix comparisson in tests Felipe Contreras
2012-10-30 19:06 ` [PATCH v3 3/4] fast-export: don't handle uninteresting refs Felipe Contreras
2012-10-30 19:06 ` [PATCH v3 4/4] fast-export: make sure refs are updated properly Felipe Contreras
2012-10-31  0:11   ` [PATCH v2 " Jonathan Nieder
2012-10-31  2:08     ` Felipe Contreras
2012-10-31  0:37   ` [PATCH v3 " Jonathan Nieder
2012-10-31  1:33     ` Sverre Rabbelier
2012-10-31  6:05       ` Jonathan Nieder
2012-10-31  9:53         ` [OT] How to get the discussion details via notes Peter Baumann
2012-10-31 12:29           ` Drew Northup
2012-10-31 14:10           ` Jeff King
2012-11-01  7:49             ` Peter Baumann
2012-10-31  2:13     ` [PATCH v3 4/4] fast-export: make sure refs are updated properly Felipe Contreras
2012-11-02 13:12     ` Jeff King
2012-11-02 14:55       ` Jonathan Nieder
2012-11-02 15:17       ` Johannes Schindelin
2012-11-02 15:19         ` Jeff King
2012-11-02 15:35           ` Felipe Contreras
2012-11-02 15:34       ` Felipe Contreras

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).