<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/push.c, branch v2.29.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.29.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.29.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-09-30T19:53:47Z</updated>
<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>
<entry>
<title>push: unset PARSE_OPT_OPTARG for --recurse-submodules</title>
<updated>2020-04-28T17:47:42Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-04-27T06:44:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ce9baf234f04d2f1d183edbdc14e4ee9da46d895'/>
<id>urn:sha1:ce9baf234f04d2f1d183edbdc14e4ee9da46d895</id>
<content type='text'>
When the usage for `git push` is shown, it includes the following
lines

	--recurse-submodules[=(check|on-demand|no)]
			      control recursive pushing of submodules

which seem to indicate that the argument for --recurse-submodules is
optional. However, we cannot actually run that optiion without an
argument:

	$ git push --recurse-submodules
	fatal: recurse-submodules missing parameter

Unset PARSE_OPT_OPTARG so that it is clear that this option requires an
argument. Since the parse-options machinery guarantees that an argument
is present now, assume that `arg` is set in the else of
option_parse_recurse_submodules().

Reported-by: Andrew White &lt;andrew.white@audinate.com&gt;
Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Use OPT_CALLBACK and OPT_CALLBACK_F</title>
<updated>2020-04-28T17:47:10Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-04-28T08:36:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=203c85339fb51bb8b83aae8f0adde44d6e55e018'/>
<id>urn:sha1:203c85339fb51bb8b83aae8f0adde44d6e55e018</id>
<content type='text'>
In the codebase, there are many options which use OPTION_CALLBACK in a
plain ol' struct definition. However, we have the OPT_CALLBACK and
OPT_CALLBACK_F macros which are meant to abstract these plain struct
definitions away. These macros are useful as they semantically signal to
developers that these are just normal callback option with nothing fancy
happening.

Replace plain struct definitions of OPTION_CALLBACK with OPT_CALLBACK or
OPT_CALLBACK_F where applicable. The heavy lifting was done using the
following (disgusting) shell script:

	#!/bin/sh

	do_replacement () {
		tr '\n' '\r' |
			sed -e 's/{\s*OPTION_CALLBACK,\s*\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\),\s*0,\(\s*[^[:space:]}]*\)\s*}/OPT_CALLBACK(\1,\2,\3,\4,\5,\6)/g' |
			sed -e 's/{\s*OPTION_CALLBACK,\s*\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\),\(\s*[^[:space:]}]*\)\s*}/OPT_CALLBACK_F(\1,\2,\3,\4,\5,\6,\7)/g' |
			tr '\r' '\n'
	}

	for f in $(git ls-files \*.c)
	do
		do_replacement &lt;"$f" &gt;"$f.tmp"
		mv "$f.tmp" "$f"
	done

The result was manually inspected and then reformatted to match the
style of the surrounding code. Finally, using
`git grep OPTION_CALLBACK \*.c`, leftover results which were not handled
by the script were manually transformed.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>push: use skip_prefix() instead of starts_with()</title>
<updated>2019-11-27T02:18:39Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2019-11-26T15:18:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1768aaf01d3f57af8c4182d5887d219456f4a094'/>
<id>urn:sha1:1768aaf01d3f57af8c4182d5887d219456f4a094</id>
<content type='text'>
Get rid of a magic number by using skip_prefix().

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Acked-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 'js/trace2-fetch-push'</title>
<updated>2019-10-15T04:48:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-10-15T04:48:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b9ec279191b70e9e5ecde15910991f7c5669a17'/>
<id>urn:sha1:3b9ec279191b70e9e5ecde15910991f7c5669a17</id>
<content type='text'>
Dev support.

* js/trace2-fetch-push:
  transport: push codepath can take arbitrary repository
  push: add trace2 instrumentation
  fetch: add trace2 instrumentation
</content>
</entry>
</feed>
