* [PATCH 0/6] transport-helper: some clarifications and a fix
@ 2013-04-18 0:05 Felipe Contreras
2013-04-18 0:05 ` [PATCH 1/6] transport-helper: clarify *:* refspec Felipe Contreras
` (5 more replies)
0 siblings, 6 replies; 14+ messages in thread
From: Felipe Contreras @ 2013-04-18 0:05 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner, Felipe Contreras
Hi,
It seems the workings of transport-helper are anything but clear, so let's try
to clarify them a bit, and after that, hopefully it would become clearer why
the last patch is actually a good fix.
Felipe Contreras (6):
transport-helper: clarify *:* refspec
transport-helper: update refspec documentation
transport-helper: clarify pushing without refspecs
transport-helper: warn when refspec is not used
transport-helper: trivial code shuffle
transport-helper: update remote helper namespace
Documentation/gitremote-helpers.txt | 12 ++++++------
t/t5801-remote-helpers.sh | 39 ++++++++++++++++++-------------------
transport-helper.c | 37 +++++++++++++++++++++++------------
3 files changed, 50 insertions(+), 38 deletions(-)
--
1.8.2.1.679.g509521a
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/6] transport-helper: clarify *:* refspec
2013-04-18 0:05 [PATCH 0/6] transport-helper: some clarifications and a fix Felipe Contreras
@ 2013-04-18 0:05 ` Felipe Contreras
2013-04-18 7:28 ` Thomas Rast
2013-04-18 0:05 ` [PATCH 2/6] transport-helper: update refspec documentation Felipe Contreras
` (4 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Felipe Contreras @ 2013-04-18 0:05 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner, Felipe Contreras
The *:* refspec doesn't work, and never has, clarify the code and
documentation to reflect that. This in effect reverts commit 9e7673e
(gitremote-helpers(1): clarify refspec behaviour).
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
Documentation/gitremote-helpers.txt | 4 ++--
t/t5801-remote-helpers.sh | 15 ---------------
transport-helper.c | 2 +-
3 files changed, 3 insertions(+), 18 deletions(-)
diff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt
index f506031..0c91aba 100644
--- a/Documentation/gitremote-helpers.txt
+++ b/Documentation/gitremote-helpers.txt
@@ -174,8 +174,8 @@ ref.
This capability can be advertised multiple times. The first
applicable refspec takes precedence. The left-hand of refspecs
advertised with this capability must cover all refs reported by
-the list command. If a helper does not need a specific 'refspec'
-capability then it should advertise `refspec *:*`.
+the list command. If no 'refspec' capability is advertised,
+there is an implied `refspec *:*`.
'bidi-import'::
This modifies the 'import' capability.
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index f387027..cd1873c 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -120,21 +120,6 @@ test_expect_failure 'pushing without refspecs' '
compare_refs local2 HEAD server HEAD
'
-test_expect_success 'pulling with straight refspec' '
- (cd local2 &&
- GIT_REMOTE_TESTGIT_REFSPEC="*:*" git pull) &&
- compare_refs local2 HEAD server HEAD
-'
-
-test_expect_failure 'pushing with straight refspec' '
- test_when_finished "(cd local2 && git reset --hard origin)" &&
- (cd local2 &&
- echo content >>file &&
- git commit -a -m eleven &&
- GIT_REMOTE_TESTGIT_REFSPEC="*:*" git push) &&
- compare_refs local2 HEAD server HEAD
-'
-
test_expect_success 'pulling without marks' '
(cd local2 &&
GIT_REMOTE_TESTGIT_NO_MARKS=1 git pull) &&
diff --git a/transport-helper.c b/transport-helper.c
index dcd8d97..cea787c 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -469,7 +469,7 @@ static int fetch_with_import(struct transport *transport,
* were fetching.
*
* (If no "refspec" capability was specified, for historical
- * reasons we default to *:*.)
+ * reasons we default to the equivalent of *:*.)
*
* Store the result in to_fetch[i].old_sha1. Callers such
* as "git fetch" can use the value to write feedback to the
--
1.8.2.1.679.g509521a
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/6] transport-helper: update refspec documentation
2013-04-18 0:05 [PATCH 0/6] transport-helper: some clarifications and a fix Felipe Contreras
2013-04-18 0:05 ` [PATCH 1/6] transport-helper: clarify *:* refspec Felipe Contreras
@ 2013-04-18 0:05 ` Felipe Contreras
2013-04-18 0:05 ` [PATCH 3/6] transport-helper: clarify pushing without refspecs Felipe Contreras
` (3 subsequent siblings)
5 siblings, 0 replies; 14+ messages in thread
From: Felipe Contreras @ 2013-04-18 0:05 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner, Felipe Contreras
The refspec capability is not only used by 'import', also by 'export',
and it's recommend in both.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
Documentation/gitremote-helpers.txt | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt
index 0c91aba..ba7240c 100644
--- a/Documentation/gitremote-helpers.txt
+++ b/Documentation/gitremote-helpers.txt
@@ -159,11 +159,11 @@ Miscellaneous capabilities
carried out.
'refspec' <refspec>::
- This modifies the 'import' capability, allowing the produced
- fast-import stream to modify refs in a private namespace
- instead of writing to refs/heads or refs/remotes directly.
- It is recommended that all importers providing the 'import'
- capability use this.
+ For remote helpers that implement 'import' or 'export', this capability
+ allows the refs to be constrained to a private namespace, instead of
+ writing to refs/heads or refs/remotes directly.
+ It is recommended that all importers providing the 'import' or 'export'
+ capabilities use this.
+
A helper advertising the capability
`refspec refs/heads/*:refs/svn/origin/branches/*`
--
1.8.2.1.679.g509521a
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/6] transport-helper: clarify pushing without refspecs
2013-04-18 0:05 [PATCH 0/6] transport-helper: some clarifications and a fix Felipe Contreras
2013-04-18 0:05 ` [PATCH 1/6] transport-helper: clarify *:* refspec Felipe Contreras
2013-04-18 0:05 ` [PATCH 2/6] transport-helper: update refspec documentation Felipe Contreras
@ 2013-04-18 0:05 ` Felipe Contreras
2013-04-18 0:14 ` Sverre Rabbelier
2013-04-18 18:56 ` Stefano Lattarini
2013-04-18 0:05 ` [PATCH 4/6] transport-helper: warn when refspec is not used Felipe Contreras
` (2 subsequent siblings)
5 siblings, 2 replies; 14+ messages in thread
From: Felipe Contreras @ 2013-04-18 0:05 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner, Felipe Contreras
This has never worked, since it's inception the code simply skips all
the refs, essentially telling fast-export to do nothing.
Let's at least tell the user what's going on.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
Documentation/gitremote-helpers.txt | 4 ++--
t/t5801-remote-helpers.sh | 6 +++---
transport-helper.c | 5 +++--
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt
index ba7240c..4d26e37 100644
--- a/Documentation/gitremote-helpers.txt
+++ b/Documentation/gitremote-helpers.txt
@@ -162,8 +162,8 @@ Miscellaneous capabilities
For remote helpers that implement 'import' or 'export', this capability
allows the refs to be constrained to a private namespace, instead of
writing to refs/heads or refs/remotes directly.
- It is recommended that all importers providing the 'import' or 'export'
- capabilities use this.
+ It is recommended that all importers providing the 'import'
+ capability use this. It's mandatory for 'export'.
+
A helper advertising the capability
`refspec refs/heads/*:refs/svn/origin/branches/*`
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index cd1873c..3eeb309 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -111,13 +111,13 @@ test_expect_success 'pulling without refspecs' '
compare_refs local2 HEAD server HEAD
'
-test_expect_failure 'pushing without refspecs' '
+test_expect_success 'pushing without refspecs' '
test_when_finished "(cd local2 && git reset --hard origin)" &&
(cd local2 &&
echo content >>file &&
git commit -a -m ten &&
- GIT_REMOTE_TESTGIT_REFSPEC="" git push) &&
- compare_refs local2 HEAD server HEAD
+ GIT_REMOTE_TESTGIT_REFSPEC="" test_must_fail git push 2> ../error) &&
+ grep "remote-helper doesn.t support push; refspec needed" error
'
test_expect_success 'pulling without marks' '
diff --git a/transport-helper.c b/transport-helper.c
index cea787c..4d98567 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -785,6 +785,9 @@ static int push_refs_with_export(struct transport *transport,
struct string_list revlist_args = STRING_LIST_INIT_NODUP;
struct strbuf buf = STRBUF_INIT;
+ if (!data->refspecs)
+ die("remote-helper doesn't support push; refspec needed");
+
helper = get_helper(transport);
write_constant(helper->in, "export\n");
@@ -795,8 +798,6 @@ static int push_refs_with_export(struct transport *transport,
char *private;
unsigned char sha1[20];
- if (!data->refspecs)
- continue;
private = apply_refspecs(data->refspecs, data->refspec_nr, ref->name);
if (private && !get_sha1(private, sha1)) {
strbuf_addf(&buf, "^%s", private);
--
1.8.2.1.679.g509521a
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/6] transport-helper: warn when refspec is not used
2013-04-18 0:05 [PATCH 0/6] transport-helper: some clarifications and a fix Felipe Contreras
` (2 preceding siblings ...)
2013-04-18 0:05 ` [PATCH 3/6] transport-helper: clarify pushing without refspecs Felipe Contreras
@ 2013-04-18 0:05 ` Felipe Contreras
2013-04-18 0:05 ` [PATCH 5/6] transport-helper: trivial code shuffle Felipe Contreras
2013-04-18 0:05 ` [PATCH 6/6] transport-helper: update remote helper namespace Felipe Contreras
5 siblings, 0 replies; 14+ messages in thread
From: Felipe Contreras @ 2013-04-18 0:05 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner, Felipe Contreras
For the modes that need it. In the future we should probably error out,
instead of providing half-assed support.
The reason we want to do this is because if it's not present, the remote
helper might be updating refs/heads/*, or refs/remotes/origin/*,
directly, and in the process fetch will get confused trying to update
refs that are already updated, or older than what they should be. We
shouldn't be messing with the rest of git.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
t/t5801-remote-helpers.sh | 6 ++++--
transport-helper.c | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index 3eeb309..1bb7529 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -100,14 +100,16 @@ test_expect_failure 'push new branch with old:new refspec' '
test_expect_success 'cloning without refspec' '
GIT_REMOTE_TESTGIT_REFSPEC="" \
- git clone "testgit::${PWD}/server" local2 &&
+ git clone "testgit::${PWD}/server" local2 2> error &&
+ grep "This remote helper should implement refspec capability" error &&
compare_refs local2 HEAD server HEAD
'
test_expect_success 'pulling without refspecs' '
(cd local2 &&
git reset --hard &&
- GIT_REMOTE_TESTGIT_REFSPEC="" git pull) &&
+ GIT_REMOTE_TESTGIT_REFSPEC="" git pull 2> ../error) &&
+ grep "This remote helper should implement refspec capability" error &&
compare_refs local2 HEAD server HEAD
'
diff --git a/transport-helper.c b/transport-helper.c
index 4d98567..573eaf7 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -215,6 +215,8 @@ static struct child_process *get_helper(struct transport *transport)
free((char *)refspecs[i]);
}
free(refspecs);
+ } else if (data->import || data->bidi_import || data->export) {
+ warning("This remote helper should implement refspec capability.");
}
strbuf_release(&buf);
if (debug)
--
1.8.2.1.679.g509521a
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 5/6] transport-helper: trivial code shuffle
2013-04-18 0:05 [PATCH 0/6] transport-helper: some clarifications and a fix Felipe Contreras
` (3 preceding siblings ...)
2013-04-18 0:05 ` [PATCH 4/6] transport-helper: warn when refspec is not used Felipe Contreras
@ 2013-04-18 0:05 ` Felipe Contreras
2013-04-18 0:05 ` [PATCH 6/6] transport-helper: update remote helper namespace Felipe Contreras
5 siblings, 0 replies; 14+ messages in thread
From: Felipe Contreras @ 2013-04-18 0:05 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner, Felipe Contreras
Just shuffle the die() part to make it more explicit, and cleanup the
code-style.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
transport-helper.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/transport-helper.c b/transport-helper.c
index 573eaf7..9d31f2d 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -800,6 +800,9 @@ static int push_refs_with_export(struct transport *transport,
char *private;
unsigned char sha1[20];
+ if (ref->deletion)
+ die("remote-helpers do not support ref deletion");
+
private = apply_refspecs(data->refspecs, data->refspec_nr, ref->name);
if (private && !get_sha1(private, sha1)) {
strbuf_addf(&buf, "^%s", private);
@@ -807,13 +810,8 @@ static int push_refs_with_export(struct transport *transport,
}
free(private);
- if (ref->deletion) {
- die("remote-helpers do not support ref deletion");
- }
-
if (ref->peer_ref)
string_list_append(&revlist_args, ref->peer_ref->name);
-
}
if (get_exporter(transport, &exporter, &revlist_args))
--
1.8.2.1.679.g509521a
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 6/6] transport-helper: update remote helper namespace
2013-04-18 0:05 [PATCH 0/6] transport-helper: some clarifications and a fix Felipe Contreras
` (4 preceding siblings ...)
2013-04-18 0:05 ` [PATCH 5/6] transport-helper: trivial code shuffle Felipe Contreras
@ 2013-04-18 0:05 ` Felipe Contreras
2013-04-18 4:14 ` Felipe Contreras
5 siblings, 1 reply; 14+ messages in thread
From: Felipe Contreras @ 2013-04-18 0:05 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner, Felipe Contreras
When pushing, the remote namespace is updated correctly
(e.g. refs/origin/master), but not the remote helper's
(e.g. refs/testgit/origin/master), which currently is only updated while
fetching.
Since the remote namespace is used to tell fast-export which commits to
avoid (because they were already imported/exported), it makes sense to
have them in sync so they don't get generated twice. If the remote
helper was implemented properly, they would be ignored, if not, they
probably would end up repeated (probably).
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
t/t5801-remote-helpers.sh | 12 ++++++++++++
transport-helper.c | 20 ++++++++++++++++----
2 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index 1bb7529..097691c 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -153,4 +153,16 @@ test_expect_success 'push ref with existing object' '
compare_refs local dup server dup
'
+test_expect_success 'push update refs' '
+ (cd local &&
+ git checkout -b update master &&
+ echo update >>file &&
+ git commit -a -m update &&
+ git push origin update
+ git rev-parse --verify testgit/origin/heads/update >expect &&
+ git rev-parse --verify remotes/origin/update >actual
+ test_cmp expect actual
+ )
+'
+
test_done
diff --git a/transport-helper.c b/transport-helper.c
index 9d31f2d..414d6c8 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -11,6 +11,7 @@
#include "thread-utils.h"
#include "sigchain.h"
#include "argv-array.h"
+#include "refs.h"
static int debug;
@@ -620,7 +621,7 @@ static int fetch(struct transport *transport,
return -1;
}
-static void push_update_ref_status(struct strbuf *buf,
+static int push_update_ref_status(struct strbuf *buf,
struct ref **ref,
struct ref *remote_refs)
{
@@ -686,7 +687,7 @@ static void push_update_ref_status(struct strbuf *buf,
*ref = find_ref_by_name(remote_refs, refname);
if (!*ref) {
warning("helper reported unexpected status of %s", refname);
- return;
+ return 1;
}
if ((*ref)->status != REF_STATUS_NONE) {
@@ -695,11 +696,12 @@ static void push_update_ref_status(struct strbuf *buf,
* status reported by the remote helper if the latter is 'no match'.
*/
if (status == REF_STATUS_NONE)
- return;
+ return 1;
}
(*ref)->status = status;
(*ref)->remote_status = msg;
+ return 0;
}
static void push_update_refs_status(struct helper_data *data,
@@ -708,11 +710,21 @@ static void push_update_refs_status(struct helper_data *data,
struct strbuf buf = STRBUF_INIT;
struct ref *ref = remote_refs;
for (;;) {
+ char *private;
+
recvline(data, &buf);
if (!buf.len)
break;
- push_update_ref_status(&buf, &ref, remote_refs);
+ if (push_update_ref_status(&buf, &ref, remote_refs))
+ continue;
+
+ /* propagate back the update to the remote namespace */
+ private = apply_refspecs(data->refspecs, data->refspec_nr, ref->name);
+ if (!private)
+ continue;
+ update_ref("update by helper", private, ref->new_sha1, NULL, 0, 0);
+ free(private);
}
strbuf_release(&buf);
}
--
1.8.2.1.679.g509521a
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 3/6] transport-helper: clarify pushing without refspecs
2013-04-18 0:05 ` [PATCH 3/6] transport-helper: clarify pushing without refspecs Felipe Contreras
@ 2013-04-18 0:14 ` Sverre Rabbelier
2013-04-18 18:56 ` Stefano Lattarini
1 sibling, 0 replies; 14+ messages in thread
From: Sverre Rabbelier @ 2013-04-18 0:14 UTC (permalink / raw)
To: Felipe Contreras
Cc: Git List, Junio C Hamano, John Keeping, Max Horn, Jonathan Nieder,
Florian Achleitner
On Wed, Apr 17, 2013 at 5:05 PM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> This has never worked, since it's inception the code simply skips all
> the refs, essentially telling fast-export to do nothing.
Makes sense.
--
Cheers,
Sverre Rabbelier
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 6/6] transport-helper: update remote helper namespace
2013-04-18 0:05 ` [PATCH 6/6] transport-helper: update remote helper namespace Felipe Contreras
@ 2013-04-18 4:14 ` Felipe Contreras
0 siblings, 0 replies; 14+ messages in thread
From: Felipe Contreras @ 2013-04-18 4:14 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner, Felipe Contreras
On Wed, Apr 17, 2013 at 7:05 PM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> --- a/t/t5801-remote-helpers.sh
> +++ b/t/t5801-remote-helpers.sh
> @@ -153,4 +153,16 @@ test_expect_success 'push ref with existing object' '
> compare_refs local dup server dup
> '
>
> +test_expect_success 'push update refs' '
> + (cd local &&
> + git checkout -b update master &&
> + echo update >>file &&
> + git commit -a -m update &&
> + git push origin update
> + git rev-parse --verify testgit/origin/heads/update >expect &&
> + git rev-parse --verify remotes/origin/update >actual
> + test_cmp expect actual
Slightly confusing and a bit buggy:
- git rev-parse --verify testgit/origin/heads/update >expect &&
- git rev-parse --verify remotes/origin/update >actual
+ git rev-parse --verify remotes/origin/update >expect &&
+ git rev-parse --verify testgit/origin/heads/update >actual &&
> static void push_update_refs_status(struct helper_data *data,
> @@ -708,11 +710,21 @@ static void push_update_refs_status(struct helper_data *data,
> struct strbuf buf = STRBUF_INIT;
> struct ref *ref = remote_refs;
> for (;;) {
> + char *private;
> +
> recvline(data, &buf);
> if (!buf.len)
> break;
>
> - push_update_ref_status(&buf, &ref, remote_refs);
> + if (push_update_ref_status(&buf, &ref, remote_refs))
> + continue;
Actually, since this function is also used by push_with_push:
if (!data->refspecs)
continue;
I had it in my previous series but removed it.
I'll reroll.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] transport-helper: clarify *:* refspec
2013-04-18 0:05 ` [PATCH 1/6] transport-helper: clarify *:* refspec Felipe Contreras
@ 2013-04-18 7:28 ` Thomas Rast
2013-04-18 8:18 ` Felipe Contreras
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Rast @ 2013-04-18 7:28 UTC (permalink / raw)
To: Felipe Contreras
Cc: git, Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner
Felipe Contreras <felipe.contreras@gmail.com> writes:
> The *:* refspec doesn't work, and never has, clarify the code and
> documentation to reflect that. This in effect reverts commit 9e7673e
> (gitremote-helpers(1): clarify refspec behaviour).
[...]
> -test_expect_success 'pulling with straight refspec' '
> - (cd local2 &&
> - GIT_REMOTE_TESTGIT_REFSPEC="*:*" git pull) &&
> - compare_refs local2 HEAD server HEAD
> -'
> -
> -test_expect_failure 'pushing with straight refspec' '
> - test_when_finished "(cd local2 && git reset --hard origin)" &&
> - (cd local2 &&
> - echo content >>file &&
> - git commit -a -m eleven &&
> - GIT_REMOTE_TESTGIT_REFSPEC="*:*" git push) &&
> - compare_refs local2 HEAD server HEAD
> -'
So what's wrong with the tests? Do they fail to test what they claim
(how?), test something that wasn't reasonable to begin with, or
something entirely different?
--
Thomas Rast
trast@{inf,student}.ethz.ch
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] transport-helper: clarify *:* refspec
2013-04-18 7:28 ` Thomas Rast
@ 2013-04-18 8:18 ` Felipe Contreras
2013-04-18 12:39 ` Thomas Rast
0 siblings, 1 reply; 14+ messages in thread
From: Felipe Contreras @ 2013-04-18 8:18 UTC (permalink / raw)
To: Thomas Rast
Cc: git, Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner
On Thu, Apr 18, 2013 at 2:28 AM, Thomas Rast <trast@inf.ethz.ch> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> The *:* refspec doesn't work, and never has, clarify the code and
>> documentation to reflect that. This in effect reverts commit 9e7673e
>> (gitremote-helpers(1): clarify refspec behaviour).
> [...]
>> -test_expect_success 'pulling with straight refspec' '
>> - (cd local2 &&
>> - GIT_REMOTE_TESTGIT_REFSPEC="*:*" git pull) &&
>> - compare_refs local2 HEAD server HEAD
>> -'
>> -
>> -test_expect_failure 'pushing with straight refspec' '
>> - test_when_finished "(cd local2 && git reset --hard origin)" &&
>> - (cd local2 &&
>> - echo content >>file &&
>> - git commit -a -m eleven &&
>> - GIT_REMOTE_TESTGIT_REFSPEC="*:*" git push) &&
>> - compare_refs local2 HEAD server HEAD
>> -'
>
> So what's wrong with the tests? Do they fail to test what they claim
> (how?), test something that wasn't reasonable to begin with, or
> something entirely different?
Look at the code comment, and look at the now updated documentation
that assumes that *:* was reasonable. Given the available information,
it would be reasonable to assume that *:* did work, but it didn't
work, and it's not really possible to fix it, even if we wanted to, it
would be a hack. It's better to accept that fact and stop worrying too
much about what would be the best way to do the wrong thing.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] transport-helper: clarify *:* refspec
2013-04-18 8:18 ` Felipe Contreras
@ 2013-04-18 12:39 ` Thomas Rast
2013-04-18 13:06 ` Felipe Contreras
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Rast @ 2013-04-18 12:39 UTC (permalink / raw)
To: Felipe Contreras
Cc: git, Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner
Felipe Contreras <felipe.contreras@gmail.com> writes:
> On Thu, Apr 18, 2013 at 2:28 AM, Thomas Rast <trast@inf.ethz.ch> wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>
>>> The *:* refspec doesn't work, and never has, clarify the code and
>>> documentation to reflect that. This in effect reverts commit 9e7673e
>>> (gitremote-helpers(1): clarify refspec behaviour).
>> [...]
>>> -test_expect_success 'pulling with straight refspec' '
>>> - (cd local2 &&
>>> - GIT_REMOTE_TESTGIT_REFSPEC="*:*" git pull) &&
>>> - compare_refs local2 HEAD server HEAD
>>> -'
>>> -
>>> -test_expect_failure 'pushing with straight refspec' '
>>> - test_when_finished "(cd local2 && git reset --hard origin)" &&
>>> - (cd local2 &&
>>> - echo content >>file &&
>>> - git commit -a -m eleven &&
>>> - GIT_REMOTE_TESTGIT_REFSPEC="*:*" git push) &&
>>> - compare_refs local2 HEAD server HEAD
>>> -'
>>
>> So what's wrong with the tests? Do they fail to test what they claim
>> (how?), test something that wasn't reasonable to begin with, or
>> something entirely different?
>
> Look at the code comment, and look at the now updated documentation
> that assumes that *:* was reasonable. Given the available information,
> it would be reasonable to assume that *:* did work, but it didn't
> work, and it's not really possible to fix it, even if we wanted to, it
> would be a hack. It's better to accept that fact and stop worrying too
> much about what would be the best way to do the wrong thing.
Ok, you say that the *failing* test set an expectation that is
unrealistic, so let's drop it.
But then what about the successful test? Does it actually work (and by
removing the test, you are saying that we don't care if we subsequently
break that (mis)feature)? Or did it test the wrong thing?
--
Thomas Rast
trast@{inf,student}.ethz.ch
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] transport-helper: clarify *:* refspec
2013-04-18 12:39 ` Thomas Rast
@ 2013-04-18 13:06 ` Felipe Contreras
0 siblings, 0 replies; 14+ messages in thread
From: Felipe Contreras @ 2013-04-18 13:06 UTC (permalink / raw)
To: Thomas Rast
Cc: git, Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner
On Thu, Apr 18, 2013 at 7:39 AM, Thomas Rast <trast@inf.ethz.ch> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> On Thu, Apr 18, 2013 at 2:28 AM, Thomas Rast <trast@inf.ethz.ch> wrote:
>>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>>
>>>> The *:* refspec doesn't work, and never has, clarify the code and
>>>> documentation to reflect that. This in effect reverts commit 9e7673e
>>>> (gitremote-helpers(1): clarify refspec behaviour).
>>> [...]
>>>> -test_expect_success 'pulling with straight refspec' '
>>>> - (cd local2 &&
>>>> - GIT_REMOTE_TESTGIT_REFSPEC="*:*" git pull) &&
>>>> - compare_refs local2 HEAD server HEAD
>>>> -'
>>>> -
>>>> -test_expect_failure 'pushing with straight refspec' '
>>>> - test_when_finished "(cd local2 && git reset --hard origin)" &&
>>>> - (cd local2 &&
>>>> - echo content >>file &&
>>>> - git commit -a -m eleven &&
>>>> - GIT_REMOTE_TESTGIT_REFSPEC="*:*" git push) &&
>>>> - compare_refs local2 HEAD server HEAD
>>>> -'
>>>
>>> So what's wrong with the tests? Do they fail to test what they claim
>>> (how?), test something that wasn't reasonable to begin with, or
>>> something entirely different?
>>
>> Look at the code comment, and look at the now updated documentation
>> that assumes that *:* was reasonable. Given the available information,
>> it would be reasonable to assume that *:* did work, but it didn't
>> work, and it's not really possible to fix it, even if we wanted to, it
>> would be a hack. It's better to accept that fact and stop worrying too
>> much about what would be the best way to do the wrong thing.
>
> Ok, you say that the *failing* test set an expectation that is
> unrealistic, so let's drop it.
>
> But then what about the successful test? Does it actually work (and by
> removing the test, you are saying that we don't care if we subsequently
> break that (mis)feature)? Or did it test the wrong thing?
Yeah, it works, in the sense that peeing in a bottle is a solution; it
might work, but it's not recommendable. So, if suddenly working,
frankly I don't care. I added those tests, and I don't think they are
needed. In a not too distant future it should not be permitted to
"work"; we don't want developers to shoot themselves in the foot, and
heir users too.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/6] transport-helper: clarify pushing without refspecs
2013-04-18 0:05 ` [PATCH 3/6] transport-helper: clarify pushing without refspecs Felipe Contreras
2013-04-18 0:14 ` Sverre Rabbelier
@ 2013-04-18 18:56 ` Stefano Lattarini
1 sibling, 0 replies; 14+ messages in thread
From: Stefano Lattarini @ 2013-04-18 18:56 UTC (permalink / raw)
To: Felipe Contreras
Cc: git, Junio C Hamano, John Keeping, Sverre Rabbelier, Max Horn,
Jonathan Nieder, Florian Achleitner
On 04/18/2013 02:05 AM, Felipe Contreras wrote:
> This has never worked, since it's inception the code simply skips all
>
s/it's/its/ (sorry for nitpicking)
> the refs, essentially telling fast-export to do nothing.
>
> Let's at least tell the user what's going on.
>
> [SNIP]
>
Regards,
Stefano
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2013-04-18 18:57 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-18 0:05 [PATCH 0/6] transport-helper: some clarifications and a fix Felipe Contreras
2013-04-18 0:05 ` [PATCH 1/6] transport-helper: clarify *:* refspec Felipe Contreras
2013-04-18 7:28 ` Thomas Rast
2013-04-18 8:18 ` Felipe Contreras
2013-04-18 12:39 ` Thomas Rast
2013-04-18 13:06 ` Felipe Contreras
2013-04-18 0:05 ` [PATCH 2/6] transport-helper: update refspec documentation Felipe Contreras
2013-04-18 0:05 ` [PATCH 3/6] transport-helper: clarify pushing without refspecs Felipe Contreras
2013-04-18 0:14 ` Sverre Rabbelier
2013-04-18 18:56 ` Stefano Lattarini
2013-04-18 0:05 ` [PATCH 4/6] transport-helper: warn when refspec is not used Felipe Contreras
2013-04-18 0:05 ` [PATCH 5/6] transport-helper: trivial code shuffle Felipe Contreras
2013-04-18 0:05 ` [PATCH 6/6] transport-helper: update remote helper namespace Felipe Contreras
2013-04-18 4:14 ` Felipe Contreras
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 NNTP newsgroup(s).