git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Jul 20, 2009, 07:14 UTC
Message-ID
<20090720071413.GA29915@atjola.homenet>
In-Reply-To
<1248071820-18289-3-git-send-email-bonzini@gnu.org>
On 2009.07.20 08:36:59 +0200, Paolo Bonzini wrote:
> +--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.

> +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.

> ++
> +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
Previous: Paolo BonziniNext: Paolo Bonzini
Message 4 of 9 in “add push --current and remote.*.pushHeadOnly”
  1. 0/3 add push --current and remote.*.pushHeadOnlyPaolo Bonzini, Jul 20, 2009
  2. 1/3 reintroduce PUSH_DEFAULT_UNSPECIFIEDPaolo Bonzini, Jul 20, 2009
  3. 2/3 push: add --currentPaolo Bonzini, Jul 20, 2009
  4. Björn SteinbrinkJul 20, 2009
  5. Paolo BonziniJul 20, 2009
  6. Tay Ray ChuanJul 20, 2009
  7. Paolo BonziniJul 20, 2009
  8. demerphqJul 20, 2009
  9. 3/3 push: add remote.*.pushHeadOnly configurationPaolo Bonzini, Jul 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.