<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/remote.c, branch v1.8.2.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.8.2.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.8.2.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2013-02-04T18:25:04Z</updated>
<entry>
<title>Merge branch 'jc/push-reject-reasons'</title>
<updated>2013-02-04T18:25:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-02-04T18:25:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=370855e967e21d9c5b70df7b5cd3756c7bed5c7c'/>
<id>urn:sha1:370855e967e21d9c5b70df7b5cd3756c7bed5c7c</id>
<content type='text'>
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"
</content>
</entry>
<entry>
<title>push: introduce REJECT_FETCH_FIRST and REJECT_NEEDS_FORCE</title>
<updated>2013-01-24T22:37:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-23T21:55:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=75e5c0dc5529aed42122b3a774e6b17383e51b66'/>
<id>urn:sha1:75e5c0dc5529aed42122b3a774e6b17383e51b66</id>
<content type='text'>
When we push to update an existing ref, if:

 * the object at the tip of the remote is not a commit; or
 * the object we are pushing is not a commit,

it won't be correct to suggest to fetch, integrate and push again,
as the old and new objects will not "merge".  We should explain that
the push must be forced when there is a non-committish object is
involved in such a case.

If we do not have the current object at the tip of the remote, we do
not even know that object, when fetched, is something that can be
merged.  In such a case, suggesting to pull first just like
non-fast-forward case may not be technically correct, but in
practice, most such failures are seen when you try to push your work
to a branch without knowing that somebody else already pushed to
update the same branch since you forked, so "pull first" would work
as a suggestion most of the time.  And if the object at the tip is
not a commit, "pull first" will fail, without making any permanent
damage.  As a side effect, it also makes the error message the user
will get during the next "push" attempt easier to understand, now
the user is aware that a non-commit object is involved.

In these cases, the current code already rejects such a push on the
client end, but we used the same error and advice messages as the
ones used when rejecting a non-fast-forward push, i.e. pull from
there and integrate before pushing again.

Introduce new rejection reasons and reword the messages
appropriately.

[jc: with help by Peff on message details]

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>push: further simplify the logic to assign rejection reason</title>
<updated>2013-01-24T22:37:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-23T21:14:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0f4d498dbecbc1b6da66f926df3bc12446bd44dd'/>
<id>urn:sha1:0f4d498dbecbc1b6da66f926df3bc12446bd44dd</id>
<content type='text'>
First compute the reason why this push would fail if done without
"--force", and then fail it by assigning that reason when the push
was not forced (or if there is no reason to require force, allow it
to succeed).

Record the fact that the push was forced in the forced_update field
only when the push would have failed without the option.

The code becomes shorter, less repetitive and easier to read this
way, especially given that the set of rejection reasons will be
extended in a later patch.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>push: further clean up fields of "struct ref"</title>
<updated>2013-01-24T22:37:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-22T04:24:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5ece083fc7ffd60d38b9abf7797fbf00decd2bcc'/>
<id>urn:sha1:5ece083fc7ffd60d38b9abf7797fbf00decd2bcc</id>
<content type='text'>
The "nonfastforward" and "update" fields are only used while
deciding what value to assign to the "status" locally in a single
function.  Remove them from the "struct ref".

The "requires_force" field is not used to decide if the proposed
update requires a --force option to succeed, or to record such a
decision made elsewhere.  It is used by status reporting code that
the particular update was "forced".  Rename it to "forced_update",
and move the code to assign to it around to further clarify how it
is used and what it is used for.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cr/push-force-tag-update'</title>
<updated>2013-01-24T05:16:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-24T05:16:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d82dd26964b9d7b39fb74367e5fcc3e3f4593324'/>
<id>urn:sha1:d82dd26964b9d7b39fb74367e5fcc3e3f4593324</id>
<content type='text'>
Regression fix to stop "git push" complaining "target ref already
exists", when it is not the real reason the command rejected the
request (e.g. non-fast-forward).

* cr/push-force-tag-update:
  push: fix "refs/tags/ hierarchy cannot be updated without --force"
</content>
</entry>
<entry>
<title>push: fix "refs/tags/ hierarchy cannot be updated without --force"</title>
<updated>2013-01-16T21:03:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-16T21:02:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=256b9d70a497534338f0c22101cb6566ab3f1665'/>
<id>urn:sha1:256b9d70a497534338f0c22101cb6566ab3f1665</id>
<content type='text'>
When pushing to update a branch with a commit that is not a
descendant of the commit at the tip, a wrong message "already
exists" was given, instead of the correct "non-fast-forward", if we
do not have the object sitting in the destination repository at the
tip of the ref we are updating.

The primary cause of the bug is that the check in a new helper
function is_forwardable() assumed both old and new objects are
available and can be checked, which is not always the case.

The way the caller uses the result of this function is also wrong.
If the helper says "we do not want to let this push go through", the
caller unconditionally translates it into "we blocked it because the
destination already exists", which is not true at all in this case.

Fix this by doing these three things:

 * Remove unnecessary not_forwardable from "struct ref"; it is only
   used inside set_ref_status_for_push();

 * Make "refs/tags/" the only hierarchy that cannot be replaced
   without --force;

 * Remove the misguided attempt to force that everything that
   updates an existing ref has to be a commit outside "refs/tags/"
   hierarchy.

The policy last one tried to implement may later be resurrected and
extended to ensure fast-forwardness (defined as "not losing
objects", extending from the traditional "not losing commits from
the resulting history") when objects that are not commit are
involved (e.g. an annotated tag in hierarchies outside refs/tags),
but such a logic belongs to "is this a fast-forward?" check that is
done by ref_newer(); is_forwardable(), which is now removed, was not
the right place to do so.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/fetch-ignore-symref'</title>
<updated>2013-01-06T07:41:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-06T07:41:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=245d6d006408898613cdad35700d456e5d265722'/>
<id>urn:sha1:245d6d006408898613cdad35700d456e5d265722</id>
<content type='text'>
Avoid false error from an attempt to update local symbolic ref via
fetch.

* jc/fetch-ignore-symref:
  fetch: ignore wildcarded refspecs that update local symbolic refs
</content>
</entry>
<entry>
<title>Merge branch 'cr/push-force-tag-update'</title>
<updated>2013-01-06T07:41:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-06T07:41:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9a2c83d24cb547c49e320d2498863b0ef297acd4'/>
<id>urn:sha1:9a2c83d24cb547c49e320d2498863b0ef297acd4</id>
<content type='text'>
Require "-f" for push to update a tag, even if it is a fast-forward.

* cr/push-force-tag-update:
  push: allow already-exists advice to be disabled
  push: rename config variable for more general use
  push: cleanup push rules comment
  push: clarify rejection of update to non-commit-ish
  push: require force for annotated tags
  push: require force for refs under refs/tags/
  push: flag updates that require force
  push: keep track of "update" state separately
  push: add advice for rejected tag reference
  push: return reject reasons as a bitset
</content>
</entry>
<entry>
<title>fetch: ignore wildcarded refspecs that update local symbolic refs</title>
<updated>2012-12-11T22:53:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-12-11T21:00:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8fb971eace6ed6fb0f350ade8af6fdd3599272d'/>
<id>urn:sha1:f8fb971eace6ed6fb0f350ade8af6fdd3599272d</id>
<content type='text'>
In a repository cloned from somewhere else, you typically have a
symbolic ref refs/remotes/origin/HEAD pointing at the 'master'
remote-tracking ref that is next to it.  When fetching into such a
repository with "git fetch --mirror" from another repository that
was similarly cloned, the implied wildcard refspec refs/*:refs/*
will end up asking to update refs/remotes/origin/HEAD with the
object at refs/remotes/origin/HEAD at the remote side, while asking
to update refs/remotes/origin/master the same way.  Depending on the
order the two updates happen, the latter one would find that the
value of the ref before it is updated has changed from what the code
expects.

When the user asks to update the underlying ref via the symbolic ref
explicitly without using a wildcard refspec, e.g. "git fetch $there
refs/heads/master:refs/remotes/origin/HEAD", we should still let him
do so, but when expanding wildcard refs, it will result in a more
intuitive outcome if we simply ignore local symbolic refs.

As the purpose of the symbolic ref refs/remotes/origin/HEAD is to
follow the ref it points at (e.g. refs/remotes/origin/master), its
value would change when the underlying ref is updated.

Earlier commit da3efdb (receive-pack: detect aliased updates which
can occur with symrefs, 2010-04-19) fixed a similar issue for "git
push".

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mm/status-push-pull-advise'</title>
<updated>2012-12-03T17:28:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-12-03T17:27:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=90ae9f259eb55adf54bec6442fe9e2fe223ef80c'/>
<id>urn:sha1:90ae9f259eb55adf54bec6442fe9e2fe223ef80c</id>
<content type='text'>
Finishing touch to allow the new advice message squelched
with an advice.* configuration variable.

* mm/status-push-pull-advise:
  status: respect advice.statusHints for ahead/behind advice
</content>
</entry>
</feed>
