<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/ref-filter.c, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-02-15T23:18:11Z</updated>
<entry>
<title>Merge branch 'rs/lose-leak-pending' into maint</title>
<updated>2018-02-15T23:18:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-15T23:18:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e17cec27d18c730dae738684d2f5df1dbd54a804'/>
<id>urn:sha1:e17cec27d18c730dae738684d2f5df1dbd54a804</id>
<content type='text'>
API clean-up around revision traversal.

* rs/lose-leak-pending:
  commit: remove unused function clear_commit_marks_for_object_array()
  revision: remove the unused flag leak_pending
  checkout: avoid using the rev_info flag leak_pending
  bundle: avoid using the rev_info flag leak_pending
  bisect: avoid using the rev_info flag leak_pending
  object: add clear_commit_marks_all()
  ref-filter: use clear_commit_marks_many() in do_merge_filter()
  commit: use clear_commit_marks_many() in remove_redundant()
  commit: avoid allocation in clear_commit_marks_many()
</content>
</entry>
<entry>
<title>ref-filter: use clear_commit_marks_many() in do_merge_filter()</title>
<updated>2017-12-28T21:50:05Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-12-25T17:44:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5dee6d6f28370b613ccf945b1ba8cecb0b44c172'/>
<id>urn:sha1:5dee6d6f28370b613ccf945b1ba8cecb0b44c172</id>
<content type='text'>
Signed-off-by: Rene 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 'js/for-each-ref-remote-name-and-ref'</title>
<updated>2017-11-15T03:14:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-11-15T03:14:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=093048b22913be23fe45635e8723d3aa3a185ff3'/>
<id>urn:sha1:093048b22913be23fe45635e8723d3aa3a185ff3</id>
<content type='text'>
The "--format=..." option "git for-each-ref" takes learned to show
the name of the 'remote' repository and the ref at the remote side
that is affected for 'upstream' and 'push' via "%(push:remotename)"
and friends.

* js/for-each-ref-remote-name-and-ref:
  for-each-ref: test :remotename and :remoteref
  for-each-ref: let upstream/push report the remote ref name
  for-each-ref: let upstream/push optionally report the remote name
</content>
</entry>
<entry>
<title>for-each-ref: let upstream/push report the remote ref name</title>
<updated>2017-11-08T01:18:23Z</updated>
<author>
<name>J Wyman</name>
<email>jwyman@microsoft.com</email>
</author>
<published>2017-11-07T16:31:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9700fae5ee93dd0928cb82afb7b2fd49295e28d2'/>
<id>urn:sha1:9700fae5ee93dd0928cb82afb7b2fd49295e28d2</id>
<content type='text'>
There are times when scripts want to know not only the name of the
push branch on the remote, but also the name of the branch as known
by the remote repository.

An example of this is when a tool wants to push to the very same branch
from which it would pull automatically, i.e. the `&lt;remote&gt;` and the `&lt;to&gt;`
in `git push &lt;remote&gt; &lt;from&gt;:&lt;to&gt;` would be provided by
`%(upstream:remotename)` and `%(upstream:remoteref)`, respectively.

This patch offers the new suffix :remoteref for the `upstream` and `push`
atoms, allowing to show exactly that. Example:

	$ cat .git/config
	...
	[remote "origin"]
		url = https://where.do.we.come/from
		fetch = refs/heads/*:refs/remote/origin/*
	[branch "master"]
		remote = origin
		merge = refs/heads/master
	[branch "develop/with/topics"]
		remote = origin
		merge = refs/heads/develop/with/topics
	...

	$ git for-each-ref \
		--format='%(push) %(push:remoteref)' \
		refs/heads
	refs/remotes/origin/master refs/heads/master
	refs/remotes/origin/develop/with/topics refs/heads/develop/with/topics

Signed-off-by: J Wyman &lt;jwyman@microsoft.com&gt;
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tb/show-trailers-in-ref-filter'</title>
<updated>2017-10-11T05:52:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-10-11T05:52:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b03cd16613477d3f9ce2e82f3a9fdb5fa99a8b01'/>
<id>urn:sha1:b03cd16613477d3f9ce2e82f3a9fdb5fa99a8b01</id>
<content type='text'>
"git for-each-ref --format=..." learned a new format element,
%(trailers), to show only the commit log trailer part of the log
message.

* tb/show-trailers-in-ref-filter:
  ref-filter.c: parse trailers arguments with %(contents) atom
  ref-filter.c: use trailer_opts to format trailers
  t6300: refactor %(trailers) tests
  doc: use "`&lt;literal&gt;`"-style quoting for literal strings
  doc: 'trailers' is the preferred way to format trailers
  t4205: unfold across multiple lines
</content>
</entry>
<entry>
<title>for-each-ref: let upstream/push optionally report the remote name</title>
<updated>2017-10-10T04:41:35Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-10-05T12:19:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cc72385fe350d4d7bc64f84e8817dbdfe27b04fe'/>
<id>urn:sha1:cc72385fe350d4d7bc64f84e8817dbdfe27b04fe</id>
<content type='text'>
There are times when e.g. scripts want to know not only the name of the
upstream branch on the remote repository, but also the name of the
remote.

This patch offers the new suffix :remotename for the upstream and for
the push atoms, allowing to show exactly that. Example:

	$ cat .git/config
	...
	[remote "origin"]
		url = https://where.do.we.come/from
		fetch = refs/heads/*:refs/remote/origin/*
	[remote "hello-world"]
		url = https://hello.world/git
		fetch = refs/heads/*:refs/remote/origin/*
		pushURL = hello.world:git
		push = refs/heads/*:refs/heads/*
	[branch "master"]
		remote = origin
		pushRemote = hello-world
	...

	$ git for-each-ref \
	  --format='%(upstream) %(upstream:remotename) %(push:remotename)' \
	  refs/heads/master
	refs/remotes/origin/master origin hello-world

The implementation chooses *not* to DWIM the push remote if no explicit
push remote was configured; The reason is that it is possible to DWIM this
by using

	%(if)%(push:remotename)%(then)
		%(push:remotename)
	%(else)
		%(upstream:remotename)
	%(end)

while it would be impossible to "un-DWIM" the information in case the
caller is really only interested in explicit push remotes.

While `:remote` would be shorter, it would also be a bit more ambiguous,
and it would also shut the door e.g. for `:remoteref` (which would
obviously refer to the corresponding ref in the remote repository).

Note: the dashless, non-CamelCased form `:remotename` follows the
example of the `:trackshort` example.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tb/ref-filter-empty-modifier'</title>
<updated>2017-10-07T07:27:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-10-07T07:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=43c9e7e365d7a8961767d0bd4a305ca378800a2a'/>
<id>urn:sha1:43c9e7e365d7a8961767d0bd4a305ca378800a2a</id>
<content type='text'>
In the "--format=..." option of the "git for-each-ref" command (and
its friends, i.e. the listing mode of "git branch/tag"), "%(atom:)"
(e.g. "%(refname:)", "%(body:)" used to error out.  Instead, treat
them as if the colon and an empty string that follows it were not
there.

* tb/ref-filter-empty-modifier:
  ref-filter.c: pass empty-string as NULL to atom parsers
</content>
</entry>
<entry>
<title>ref-filter.c: pass empty-string as NULL to atom parsers</title>
<updated>2017-10-05T01:41:57Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2017-10-02T16:10:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bea4dbeafda3ddc4404f2e94dce0b66a4105399a'/>
<id>urn:sha1:bea4dbeafda3ddc4404f2e94dce0b66a4105399a</id>
<content type='text'>
Peff points out that different atom parsers handle the empty
"sub-argument" list differently. An example of this is the format
"%(refname:)".

Since callers often use `string_list_split` (which splits the empty
string with any delimiter as a 1-ary string_list containing the empty
string), this makes handling empty sub-argument strings non-ergonomic.

Let's fix this by declaring that atom parser implementations must
not care about distinguishing between the empty string "%(refname:)"
and no sub-arguments "%(refname)".  Current code aborts, either with
"unrecognised arg" (e.g. "refname:") or "does not take args"
(e.g. "body:") as an error message.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter.c: parse trailers arguments with %(contents) atom</title>
<updated>2017-10-02T12:15:30Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2017-10-02T05:25:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7a5edbdb748f58c0ff3f2a459596ad6ddfda0640'/>
<id>urn:sha1:7a5edbdb748f58c0ff3f2a459596ad6ddfda0640</id>
<content type='text'>
The %(contents) atom takes a contents "field" as its argument. Since
"trailers" is one of those fields, extend contents_atom_parser to parse
"trailers"'s arguments when used through "%(contents)", like:

  %(contents:trailers:unfold,only)

A caveat: trailers_atom_parser expects NULL when no arguments are given
(see: `parse_ref_filter_atom`). This is because string_list_split (given
a maxsplit of -1) returns a 1-ary string_list* containing the given
string if the delimiter could not be found using `strchr`.

To simulate this behavior without teaching trailers_atom_parser to
accept strings with length zero, conditionally pass NULL to
trailers_atom_parser if the arguments portion of the argument to
%(contents) is empty.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter.c: use trailer_opts to format trailers</title>
<updated>2017-10-02T12:15:30Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2017-10-02T05:25:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=67a20a0010224255bbd5bb9fa4f95595c3e1ba7c'/>
<id>urn:sha1:67a20a0010224255bbd5bb9fa4f95595c3e1ba7c</id>
<content type='text'>
Fill trailer_opts with "unfold" and "only" to match the sub-arguments
given to the "%(trailers)" atom. Then, let's use the filled trailer_opts
instance with 'format_trailers_from_commit' in order to format trailers
in the desired manner.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
