Thread (9 messages) 9 messages, 5 authors, 2016-06-15

Re: [PATCH 2/3] push: add --current

From: Björn Steinbrink <hidden>
Date: 2016-06-15 22:47:04

On 2009.07.20 08:36:59 +0200, Paolo Bonzini wrote:
quoted hunk ↗ jump to hunk
+--current::
+	Independent of the other options, restrict pushing to the current
+	HEAD.
To me, this sounds like there are multiple HEADs and this selects the
current one to be pushed, which would be wrong. Maybe this could be
written as:

	Restrict pushing to the currently checked out branch head.

Which is also in line with the error message that is produced when
you're on a detached HEAD.
quoted hunk ↗ jump to hunk
+Refspecs given in the configuration are still used to find the
+destination name of the current branch.  However, this option cannot
+be specified if an explicit refspec is given on the command line,
+because it would be useless and possibly confusing.
Hm, this only talks about refspecs in the config, but your patch series
is especially about push.default=tracking, which is not a refspec set in
the config, but causes a refspec to be generated on the fly. Maybe:

	With this option, defaults given in the configuration, either as
	push refspecs for the remote or as a global push default, are
	still evaluated, but only the currently checked out branch is
	pushed. This means that this option, unlike the `HEAD` refspec,
	supports a destination name that differs from the source name.
	However, this option cannot be specified if an explicit refspec
	is given on the command line, because it would be useless and
	possibly confusing.

Which also explains a bit how this option differs from using the HEAD
refspec.
quoted hunk ↗ jump to hunk
++
+Additionally, if there is no refspec in the configuration and no
+`push.default` configuration either, with this option git will use a
+default refspec of `HEAD` rather than `:`.
Hm, this looks kind of funny with my rewrite of the previous paragraph,
so:

	Additionally, if there are no push defaults given in the
	configuration at all, this option makes git default to `HEAD`
	instead of `:`.

Björn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help