Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] push: mention "git pull" in error message for non-fast forwards

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:49:15

Junio C Hamano [off-list ref] writes:
Jonathan Nieder [off-list ref] writes:
quoted
This reminds me: sometimes people blindly “git pull” a rebased history
just to avoid a non-fast-forward push, and it irks me to no end.  So if
I were running the world, the output would be:

 error: rejected non-fast-forward push to '<url>'
 hint: To prevent you from losing history, non-fast-forward updates are
 hint: rejected by default.
 hint: See the 'Note about fast-forwards' section of 'git push --help'
 hint: for details.
I actually like that ;-)

Since we are discussing the "advice" part of the output, I don't think it
is so bad to add the three-bullet list below to it, either, though.
The error message is one that a normal user can see relatively
regularly, as soon as he shares a bare-repository with co-workers, so
I think it should remain short. That's why I took great care to remain
within 3 lines in my patch.

Perhaps the manpage can be improved, but that's a separate topic. My
one-line patch would make a great improvement for beginners, without
harming advanced users, who still get the pointer to the doc.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help