I've finally re-rolled this. There wasn't consensus for the change to
add DWYM behavior to refs/remotes/*, so I've dropped it, 7/7 is still
there testing the current behavior of what we do with that now, since
we didn't have any tests for that.
This should address all feedback on v3, except I haven't reworded the
"this is what we do, even though you didn't do that now" message Junio
wasn't happy with in
https://public-inbox.org/git/xmqq8t2h5opm@gitster-ct.c.googlers.com/
I agree that the wording he was critiquing doesn't make sense at that
point in the series, but I think if you look over to 5/7 the final
state makes more sense. I.e. our message is of the form:
Error, you tried to do X. Sometimes we DWYM, but only in cases:
- A
- B
hint: Did you mean to do this thing that'll give you DWYM behavior
like what we'd do for "B"?
I think in that case it makes sense to mention "B" in the message to
call out what exactly it is we DWYM on, why we didn't do it now, and
what you should do if that was what you meant. Not mentioning B would
be more confusing.
But maybe there's still disagreement on that and we can work out the
details of the wording, but now that a bunch of bugs have been fixed &
the controversial part ejected that'll be easier.
1: ca8eb6dc28 = 1: a6b6a5bba5 remote.c: add braces in anticipation of a
follow-up change
2: b0e15b6ff1 = 2: 3335fcedc8 i18n: remote.c: mark error(...) messages for
translation
3: 052fc5860e ! 3: 18a5a685e7 push: improve the error shown on unqualified
push
@@ -22,10 +22,10 @@
- Looking for a ref that matches 'newbranch' on the remote side.
- Checking if the being pushed ('v2.19.0^{commit}')
- is a ref in "refs/{heads,tags}/". If so we add a
- corresponding refs/{heads,tags}/ prefix on the remote side.
+ is a ref in "refs/{heads,tags}/". If so we add a corresponding
+ refs/{heads,tags}/ prefix on the remote side.
-Neither worked, so we gave up. You must fully-qualify the ref.
+Neither worked, so we gave up. You must fully qualify the ref.
error: failed to push some refs to 'g...@github.com:avar/git.git'
This improvement is the result of on-list discussion in [1] and [2],
@@ -73,7 +73,7 @@
+ " is a ref in \"refs/{heads,tags}/\". If so we
add a corresponding\n"
+ " refs/{heads,tags}/ prefix on the remote
side.\n"
+ "\n"
-+ "Neither worked, so we gave up. You must
fully-qualify the ref."),
++ "Neither worked, so we gave up. You must fully
qualify the ref."),
+dst_value, matched_src->name);
}
break;
4: e6aa2e360f ! 4: a10d286cf6 push: move unqualified refname error into a
function
@@ -34,7 +34,7 @@
+ " is a ref in \"refs/{heads,tags}/\". If so we add a
corresponding\n"
+ " refs/{heads,tags}/ prefix on the remote side.\n"
+ "\n"
-+ "Neither worked, so we gave up. You must fully-qualify the
ref."),
++ "Neither worked, so we gave up. You must fully qualify the
ref."),
+dst_value, matched_src_name);
+}
+
@@ -59,7 +59,7 @@
- " is a ref in \"refs/{heads,tags}/\". If so we
add a corresponding\n"
- " refs/{heads,tags}/ prefix on the remote
side.\n"
- "\n"
-- "Neither worked, so we gave up. You must
fully-qualify the ref."),
+- "Neither worked, so we gave up. You must fully
qualify the ref."),
-dst_value, matched_src->name);
+ show_push_unqualified_ref_name_error(dst_value,
+ matched_src->name);
5: dcf566e16e ! 5: 6f34c6f753 push: add an advice on unqualified push
@@ -18,7 +18,7 @@
is a ref in "refs/{heads,tags}/". If so we add a corresponding
refs/{heads,tags}/ prefix on the remote side.
-Neither worked, so we gave up. You must fully-qualify the ref.
+Neither worked, so we gave up. You must fully qualify the ref.
hint: The part of the refspec is a commit object.
hint: Did you mean to create a new branch by pushing to
hint: 'v2.19.0^{commit}:refs/heads/newbranch'?
@@ -34,9 +34,9 @@
Signed-off-by: Ævar Arnfjörð Bjarmason
- diff --git a/Documentation/config.txt b/Documentation/config.txt
- --- a/Documentation/config.txt
- +++ b/Documentation/config.txt
+ diff --git a/Documentation/config/advice.txt
b/Documentation/config/advice.txt
+ --- a/Documentation/config/advice.txt
+