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

Re: [PATCH 1/3] branch: introduce --set-upstream-to

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jul 10, 2012, 17:08 UTC
Message-ID
<vpq394zo86k.fsf@bauges.imag.fr>
In-Reply-To
<1341939181-8962-2-git-send-email-cmn@elego.de>
Carlos Martín Nieto <cmn@elego.de> writes:
> The new options allows us to type
>
>     git branch --set-upstream-to origin/master
This is cool :-).
>  Documentation/git-branch.txt |    9 ++++++++-
>  builtin/branch.c             |   15 +++++++++++++--
I think this deserves a few new tests (probably in t/t3200-branch.sh).
Show 5 quoted lines
> +-u <upstream>::
> +--set-upstream-to=<upstream>::
> +	Set up <branchname>'s tracking information so <upstream> is
> +	considered <branchname>'s upstream branch. If no branch is
> +	specified it defaults to the current branch.

Perhaps "if <branchname> is not specified, then it defaults to the current branch.". The current wording does not make it very clear if "no branch is specified" refers to <branchname> or <upstream> (although the second option would be plain silly).

Show 5 quoted lines
> +	} else if (new_upstream) {
> +		struct branch *branch = branch_get(argv[0]);
> +
> +		if (!ref_exists(branch->refname))
> +		  die(_("branch '%s' does not exist"), branch->name);
Indentation (2 spaces -> tab).
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Carlos Martín NietoNext: Junio C Hamano
Message 3 of 29 in “A better way of handling upstream information in git-branch”
  1. 0/3 A better way of handling upstream information in git-branchCarlos Martín Nieto, Jul 10, 2012
  2. 1/3 branch: introduce --set-upstream-toCarlos Martín Nieto, Jul 10, 2012
  3. Matthieu MoyJul 10, 2012
  4. Junio C HamanoJul 10, 2012
  5. Jonathan NiederJul 10, 2012
  6. Junio C HamanoJul 10, 2012
  7. Jonathan NiederJul 10, 2012
  8. Junio C HamanoJul 10, 2012
  9. Jonathan NiederJul 10, 2012
  10. Junio C HamanoJul 10, 2012
  11. Jonathan NiederJul 10, 2012
  12. Junio C HamanoJul 11, 2012
  13. Jonathan NiederJul 11, 2012
  14. Miles BaderJul 12, 2012
  15. Junio C HamanoJul 12, 2012
  16. 2/3 branch: suggest how to undo a --set-upstream when given one branchCarlos Martín Nieto, Jul 10, 2012
  17. Matthieu MoyJul 10, 2012
  18. Carlos Martín NietoJul 11, 2012
  19. Junio C HamanoJul 10, 2012
  20. Carlos Martín NietoJul 11, 2012
  21. Jonathan NiederJul 10, 2012
  22. Junio C HamanoJul 10, 2012
  23. Jonathan NiederJul 10, 2012
  24. Carlos Martín NietoJul 11, 2012
  25. 3/3 branch: add --unset-upstream optionCarlos Martín Nieto, Jul 10, 2012
  26. Junio C HamanoJul 10, 2012
  27. Carlos Martín NietoJul 11, 2012
  28. Junio C HamanoJul 11, 2012
  29. Carlos Martín NietoJul 12, 2012

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.