<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/push.c, branch v2.32.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.32.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.32.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-02-26T00:43:33Z</updated>
<entry>
<title>Merge branch 'jc/push-delete-nothing'</title>
<updated>2021-02-26T00:43:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-26T00:43:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=140045821aa78da3a80a7d7c8f707b955e1ab40d'/>
<id>urn:sha1:140045821aa78da3a80a7d7c8f707b955e1ab40d</id>
<content type='text'>
"git push $there --delete ''" should have been diagnosed as an
error, but instead turned into a matching push, which has been
corrected.

* jc/push-delete-nothing:
  push: do not turn --delete '' into a matching push
</content>
</entry>
<entry>
<title>push: do not turn --delete '' into a matching push</title>
<updated>2021-02-23T23:19:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-23T23:13:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=20e416409fc2bc260faf65a0fc74927ed0d3ca12'/>
<id>urn:sha1:20e416409fc2bc260faf65a0fc74927ed0d3ca12</id>
<content type='text'>
When we added a syntax sugar "git push remote --delete &lt;ref&gt;" to
"git push" as a synonym to the canonical "git push remote :&lt;ref&gt;"
syntax at f517f1f2 (builtin-push: add --delete as syntactic sugar
for :foo, 2009-12-30), we weren't careful enough to make sure that
&lt;ref&gt; is not empty.

Blindly rewriting "--delete &lt;ref&gt;" to ":&lt;ref&gt;" means that an empty
string &lt;ref&gt; results in refspec ":", which is the syntax to ask for
"matching" push that does not delete anything.

Worse yet, if there were matching refs that can be fast-forwarded,
they would have been published prematurely, even if the user feels
that they are not ready yet to be pushed out, which would be a real
disaster.

Noticed-by: Tilman Vogel &lt;tilman.vogel@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sk/force-if-includes'</title>
<updated>2020-10-27T22:09:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-10-27T22:09:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de0a7effc86aadf6177fdcea52b5ae24c7a85911'/>
<id>urn:sha1:de0a7effc86aadf6177fdcea52b5ae24c7a85911</id>
<content type='text'>
"git push --force-with-lease[=&lt;ref&gt;]" can easily be misused to lose
commits unless the user takes good care of their own "git fetch".
A new option "--force-if-includes" attempts to ensure that what is
being force-pushed was created after examining the commit at the
tip of the remote ref that is about to be force-replaced.

* sk/force-if-includes:
  t, doc: update tests, reference for "--force-if-includes"
  push: parse and set flag for "--force-if-includes"
  push: add reflog check for "--force-if-includes"
</content>
</entry>
<entry>
<title>push: parse and set flag for "--force-if-includes"</title>
<updated>2020-10-03T16:59:19Z</updated>
<author>
<name>Srinidhi Kaushik</name>
<email>shrinidhi.kaushik@gmail.com</email>
</author>
<published>2020-10-03T12:10:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b990aa645d1169b7373d12cbf1511ca4633e349'/>
<id>urn:sha1:3b990aa645d1169b7373d12cbf1511ca4633e349</id>
<content type='text'>
The previous commit added the necessary machinery to implement the
"--force-if-includes" protection, when "--force-with-lease" is used
without giving exact object the remote still ought to have. Surface
the feature by adding a command line option and a configuration
variable to enable it.

 - Add a flag: "TRANSPORT_PUSH_FORCE_IF_INCLUDES" to indicate that the
   new option was passed from the command line of via configuration
   settings; update command line and configuration parsers to set the
   new flag accordingly.

 - Introduce a new configuration option "push.useForceIfIncludes", which
   is equivalent to setting "--force-if-includes" in the command line.

 - Update "remote-curl" to recognize and pass this option to "send-pack"
   when enabled.

 - Update "advise" to catch the reject reason "REJECT_REF_NEEDS_UPDATE",
   set when the ref status is "REF_STATUS_REJECT_REMOTE_UPDATED" and
   (optionally) print a help message when the push fails.

 - The new option is a "no-op" in the following scenarios:
    * When used without "--force-with-lease".
    * When used with "--force-with-lease", and if the expected commit
      on the remote side is specified as an argument.

Signed-off-by: Srinidhi Kaushik &lt;shrinidhi.kaushik@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>push: drop unused repo argument to do_push()</title>
<updated>2020-09-30T19:53:47Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-09-30T12:29:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5b9427e0ac4d4b6c96f23fc5eb9b047a27563c65'/>
<id>urn:sha1:5b9427e0ac4d4b6c96f23fc5eb9b047a27563c65</id>
<content type='text'>
We stopped using the "repo" argument in 8e4c8af058 (push: disallow --all
and refspecs when remote.&lt;name&gt;.mirror is set, 2019-09-02), which moved
the pushremote handling to its caller.

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>refspec: add and use refspec_appendf()</title>
<updated>2020-09-06T20:15:46Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2020-09-05T14:49:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1af8b8c0a570ee0b12a19fdd920a3ea09fb22a75'/>
<id>urn:sha1:1af8b8c0a570ee0b12a19fdd920a3ea09fb22a75</id>
<content type='text'>
Add a function for building a refspec using printf-style formatting.  It
frees callers from managing their own buffer.  Use it throughout the
tree to shorten and simplify its callers.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>push: release strbufs used for refspec formatting</title>
<updated>2020-09-06T20:15:45Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2020-09-05T14:47:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=30035d9c66bc2a52352e3ad42b56047f06c20326'/>
<id>urn:sha1:30035d9c66bc2a52352e3ad42b56047f06c20326</id>
<content type='text'>
map_refspec() either returns the passed in ref string or a detached
strbuf.  This makes it hard for callers to release the possibly
allocated memory, and set_refspecs() consequently leaks it.

Let map_refspec() append any refspecs directly and release its own
strbufs after use.  Rename it to refspec_append_mapped() and don't
return anything to reflect its increased responsibility.

set_refspecs() also leaks its strbufs.  Do the same here and directly
call refspec_append() in each if branch instead of holding onto a
detached strbuf, then dispose of the allocated memory after use.  We
need to add an else branch for the final call because all the other
conditional branches already add their formatted refspec now.

setup_push_upstream() and setup_push_current() forgot to release their
strbufs as well; plug these leaks, too, while at it.

None of these leaks were likely to impact users, because the number
and sizes of refspecs are usually small and the allocations are only
done once per program run.  Clean them up nevertheless, as another
step on the long road towards zero memory leaks.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'dl/push-recurse-submodules-fix'</title>
<updated>2020-05-05T21:54:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-05-05T21:54:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b75dc16ae3aa325941d64a3d0cfc1690a164786a'/>
<id>urn:sha1:b75dc16ae3aa325941d64a3d0cfc1690a164786a</id>
<content type='text'>
Code cleanup.

* dl/push-recurse-submodules-fix:
  push: unset PARSE_OPT_OPTARG for --recurse-submodules
</content>
</entry>
<entry>
<title>Merge branch 'dl/opt-callback-cleanup'</title>
<updated>2020-05-05T21:54:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-05-05T21:54:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=66527162008d2792c0000096dd7a41d6d5797df3'/>
<id>urn:sha1:66527162008d2792c0000096dd7a41d6d5797df3</id>
<content type='text'>
Code cleanup.

* dl/opt-callback-cleanup:
  Use OPT_CALLBACK and OPT_CALLBACK_F
</content>
</entry>
<entry>
<title>push: anonymize URLs in error messages and warnings</title>
<updated>2020-04-28T22:17:45Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2020-04-24T14:20:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d192fa50067d1630312a966aba22c90139812fc5'/>
<id>urn:sha1:d192fa50067d1630312a966aba22c90139812fc5</id>
<content type='text'>
Just like 47abd85ba0 (fetch: Strip usernames from url's before storing
them, 2009-04-17) and later 882d49ca5c (push: anonymize URL in status
output, 2016-07-13), and even later c1284b21f243 (curl: anonymize URLs
in error messages and warnings, 2019-03-04) this change anonymizes URLs
(read: strips them of user names and especially passwords) in
user-facing error messages and warnings.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Reviewed-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
