Merge branch 'jc/push-reject-reasons'
authorJunio C Hamano <gitster@pobox.com>
Mon, 4 Feb 2013 18:25:04 +0000 (4 10:25 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Feb 2013 18:25:04 +0000 (4 10:25 -0800)
Improve error and advice messages given locally when "git push"
refuses when it cannot compute fast-forwardness by separating these
cases from the normal "not a fast-forward; merge first and push
again" case.

* jc/push-reject-reasons:
  push: finishing touches to explain REJECT_ALREADY_EXISTS better
  push: introduce REJECT_FETCH_FIRST and REJECT_NEEDS_FORCE
  push: further simplify the logic to assign rejection reason
  push: further clean up fields of "struct ref"

1  2 
Documentation/config.txt
builtin/push.c
cache.h
remote.c
transport.c
transport.h

@@@ -162,12 -163,20 +163,21 @@@ advice.*:
        pushAlreadyExists::
                Shown when linkgit:git-push[1] rejects an update that
                does not qualify for fast-forwarding (e.g., a tag.)
+       pushFetchFirst::
+               Shown when linkgit:git-push[1] rejects an update that
+               tries to overwrite a remote ref that points at an
+               object we do not have.
+       pushNeedsForce::
+               Shown when linkgit:git-push[1] rejects an update that
+               tries to overwrite a remote ref that points at an
+               object that is not a committish, or make the remote
+               ref point at an object that is not a committish.
        statusHints::
                Show directions on how to proceed from the current
 -              state in the output of linkgit:git-status[1] and in
 +              state in the output of linkgit:git-status[1], in
                the template shown when writing commit messages in
 -              linkgit:git-commit[1].
 +              linkgit:git-commit[1], and in the help message shown
 +              by linkgit:git-checkout[1] when switching branch.
        commitBeforeMerge::
                Advice shown when linkgit:git-merge[1] refuses to
                merge to avoid overwriting local changes.
diff --cc builtin/push.c
Simple merge
diff --cc cache.h
Simple merge
diff --cc remote.c
Simple merge
diff --cc transport.c
Simple merge
diff --cc transport.h
Simple merge