Files
git/Documentation
J Wyman 9700fae5ee for-each-ref: let upstream/push report the remote ref name
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 `<remote>` and the `<to>`
in `git push <remote> <from>:<to>` 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 <jwyman@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-08 10:18:23 +09:00
..
2017-10-05 13:49:07 +09:00
2016-07-13 11:24:14 -07:00
2016-10-10 14:03:51 -07:00
2017-10-03 15:42:48 +09:00
2017-04-13 16:15:25 -07:00
2017-09-10 17:08:22 +09:00
2017-01-18 15:12:12 -08:00
2015-07-21 14:08:14 -07:00
2016-08-11 14:35:42 -07:00
2017-06-27 10:35:49 -07:00
2015-10-05 12:30:13 -07:00
2017-10-03 15:42:50 +09:00
2017-01-18 15:12:18 -08:00
2017-05-01 11:01:52 +09:00
2017-06-22 15:25:25 -07:00