<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/push.c, branch v2.3.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-12-12T22:31:40Z</updated>
<entry>
<title>Merge branch 'jk/push-simple'</title>
<updated>2014-12-12T22:31:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-12T22:31:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=23c0956441a101b2e8eca7e063e71bdc69a0c415'/>
<id>urn:sha1:23c0956441a101b2e8eca7e063e71bdc69a0c415</id>
<content type='text'>
Git 2.0 was supposed to make the "simple" mode for the default of
"git push", but it didn't.

* jk/push-simple:
  push: truly use "simple" as default, not "upstream"
</content>
</entry>
<entry>
<title>Merge branch 'rt/push-recurse-submodule-usage-string'</title>
<updated>2014-12-12T22:31:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-12T22:31:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bb87344a74119abeb2ca8c7f42f89ccad1ba6e32'/>
<id>urn:sha1:bb87344a74119abeb2ca8c7f42f89ccad1ba6e32</id>
<content type='text'>
* rt/push-recurse-submodule-usage-string:
  builtin/push.c: fix description of --recurse-submodules option
</content>
</entry>
<entry>
<title>push: truly use "simple" as default, not "upstream"</title>
<updated>2014-12-01T02:11:25Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-11-27T03:43:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=00a6fa0720283b93eb011adcfea850fe21345548'/>
<id>urn:sha1:00a6fa0720283b93eb011adcfea850fe21345548</id>
<content type='text'>
The plan for the push.default transition had all along been
to use the "simple" method rather than "upstream" as a
default if the user did not specify their own push.default
value. Commit 11037ee (push: switch default from "matching"
to "simple", 2013-01-04) tried to implement that by moving
PUSH_DEFAULT_UNSPECIFIED in our switch statement to
fall-through to the PUSH_DEFAULT_SIMPLE case.

When the commit that became 11037ee was originally written,
that would have been enough. We would fall through to
calling setup_push_upstream() with the "simple" parameter
set to 1. However, it was delayed for a while until we were
ready to make the transition in Git 2.0.

And in the meantime, commit ed2b182 (push: change `simple`
to accommodate triangular workflows, 2013-06-19) threw a
monkey wrench into the works. That commit drops the "simple"
parameter to setup_push_upstream, and instead checks whether
the global "push_default" is PUSH_DEFAULT_SIMPLE. This is
right when the user has explicitly configured push.default
to simple, but wrong when we are a fall-through for the
"unspecified" case.

We never noticed because our push.default tests do not cover
the case of the variable being totally unset; they only
check the "simple" behavior itself.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/push.c: fix description of --recurse-submodules option</title>
<updated>2014-11-18T19:19:16Z</updated>
<author>
<name>Ralf Thielow</name>
<email>ralf.thielow@gmail.com</email>
</author>
<published>2014-11-18T17:57:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eedc4be54f41c49000b628a48c4926451986f121'/>
<id>urn:sha1:eedc4be54f41c49000b628a48c4926451986f121</id>
<content type='text'>
The description of the option for argument "recurse-submodules"
is marked for translation even if it expects the untranslated
string and it's missing the option "on-demand" which was introduced
in eb21c73 (2014-03-29, push: teach --recurse-submodules the on-demand
option). Fix this by unmark the string for translation and add the
missing option.

Signed-off-by: Ralf Thielow &lt;ralf.thielow@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>push: heed user.signingkey for signed pushes</title>
<updated>2014-10-24T17:50:05Z</updated>
<author>
<name>Michael J Gruber</name>
<email>git@drmicha.warpmail.net</email>
</author>
<published>2014-10-22T14:57:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b9459019bbb7b864cf59fa307953834996ab4dbe'/>
<id>urn:sha1:b9459019bbb7b864cf59fa307953834996ab4dbe</id>
<content type='text'>
push --signed promises to take user.signingkey as the signing key but
fails to read the config.

Make it do so.

Signed-off-by: Michael J Gruber &lt;git@drmicha.warpmail.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>push: the beginning of "git push --signed"</title>
<updated>2014-09-15T20:23:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-12T18:17:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a85b377d0419a9dfaca8af2320cc33b051cbed04'/>
<id>urn:sha1:a85b377d0419a9dfaca8af2320cc33b051cbed04</id>
<content type='text'>
While signed tags and commits assert that the objects thusly signed
came from you, who signed these objects, there is not a good way to
assert that you wanted to have a particular object at the tip of a
particular branch.  My signing v2.0.1 tag only means I want to call
the version v2.0.1, and it does not mean I want to push it out to my
'master' branch---it is likely that I only want it in 'maint', so
the signature on the object alone is insufficient.

The only assurance to you that 'maint' points at what I wanted to
place there comes from your trust on the hosting site and my
authentication with it, which cannot easily audited later.

Introduce a mechanism that allows you to sign a "push certificate"
(for the lack of better name) every time you push, asserting that
what object you are pushing to update which ref that used to point
at what other object.  Think of it as a cryptographic protection for
ref updates, similar to signed tags/commits but working on an
orthogonal axis.

The basic flow based on this mechanism goes like this:

 1. You push out your work with "git push --signed".

 2. The sending side learns where the remote refs are as usual,
    together with what protocol extension the receiving end
    supports.  If the receiving end does not advertise the protocol
    extension "push-cert", an attempt to "git push --signed" fails.

    Otherwise, a text file, that looks like the following, is
    prepared in core:

	certificate version 0.1
	pusher Junio C Hamano &lt;gitster@pobox.com&gt; 1315427886 -0700

	7339ca65... 21580ecb... refs/heads/master
	3793ac56... 12850bec... refs/heads/next

    The file begins with a few header lines, which may grow as we
    gain more experience.  The 'pusher' header records the name of
    the signer (the value of user.signingkey configuration variable,
    falling back to GIT_COMMITTER_{NAME|EMAIL}) and the time of the
    certificate generation.  After the header, a blank line follows,
    followed by a copy of the protocol message lines.

    Each line shows the old and the new object name at the tip of
    the ref this push tries to update, in the way identical to how
    the underlying "git push" protocol exchange tells the ref
    updates to the receiving end (by recording the "old" object
    name, the push certificate also protects against replaying).  It
    is expected that new command packet types other than the
    old-new-refname kind will be included in push certificate in the
    same way as would appear in the plain vanilla command packets in
    unsigned pushes.

    The user then is asked to sign this push certificate using GPG,
    formatted in a way similar to how signed tag objects are signed,
    and the result is sent to the other side (i.e. receive-pack).

    In the protocol exchange, this step comes immediately before the
    sender tells what the result of the push should be, which in
    turn comes before it sends the pack data.

 3. When the receiving end sees a push certificate, the certificate
    is written out as a blob.  The pre-receive hook can learn about
    the certificate by checking GIT_PUSH_CERT environment variable,
    which, if present, tells the object name of this blob, and make
    the decision to allow or reject this push.  Additionally, the
    post-receive hook can also look at the certificate, which may be
    a good place to log all the received certificates for later
    audits.

Because a push certificate carry the same information as the usual
command packets in the protocol exchange, we can omit the latter
when a push certificate is in use and reduce the protocol overhead.
This however is not included in this patch to make it easier to
review (in other words, the series at this step should never be
released without the remainder of the series, as it implements an
interim protocol that will be incompatible with the final one).
As such, the documentation update for the protocol is left out of
this step.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refactor skip_prefix to return a boolean</title>
<updated>2014-06-20T17:44:43Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-06-18T19:44:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cf4fff579e02d8585d59f6c8739534b7b0d617dd'/>
<id>urn:sha1:cf4fff579e02d8585d59f6c8739534b7b0d617dd</id>
<content type='text'>
The skip_prefix() function returns a pointer to the content
past the prefix, or NULL if the prefix was not found. While
this is nice and simple, in practice it makes it hard to use
for two reasons:

  1. When you want to conditionally skip or keep the string
     as-is, you have to introduce a temporary variable.
     For example:

       tmp = skip_prefix(buf, "foo");
       if (tmp)
	       buf = tmp;

  2. It is verbose to check the outcome in a conditional, as
     you need extra parentheses to silence compiler
     warnings. For example:

       if ((cp = skip_prefix(buf, "foo"))
	       /* do something with cp */

Both of these make it harder to use for long if-chains, and
we tend to use starts_with() instead. However, the first line
of "do something" is often to then skip forward in buf past
the prefix, either using a magic constant or with an extra
strlen(3) (which is generally computed at compile time, but
means we are repeating ourselves).

This patch refactors skip_prefix() to return a simple boolean,
and to provide the pointer value as an out-parameter. If the
prefix is not found, the out-parameter is untouched. This
lets you write:

  if (skip_prefix(arg, "foo ", &amp;arg))
	  do_foo(arg);
  else if (skip_prefix(arg, "bar ", &amp;arg))
	  do_bar(arg);

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cc/starts-n-ends-with-endgame'</title>
<updated>2014-03-07T23:18:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-07T23:18:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e3f118594683b075d70fb479a81613f614a7b1f1'/>
<id>urn:sha1:e3f118594683b075d70fb479a81613f614a7b1f1</id>
<content type='text'>
prefixcmp/suffixcmp are gone.
</content>
</entry>
<entry>
<title>Merge branch 'gj/push-more-verbose-advice'</title>
<updated>2014-03-07T23:17:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-07T23:17:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=289ca27deefab9b145a156a30571d9d25a9ad17c'/>
<id>urn:sha1:289ca27deefab9b145a156a30571d9d25a9ad17c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge branch 'jc/push-2.0-default-to-simple'</title>
<updated>2014-03-07T23:13:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-07T23:13:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=009055f3ecd8d9b4eb140429cb5ce5d2088174c7'/>
<id>urn:sha1:009055f3ecd8d9b4eb140429cb5ce5d2088174c7</id>
<content type='text'>
Finally update the "git push" default behaviour to "simple".
</content>
</entry>
</feed>
