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

Re: [PATCH] git push --track

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 14, 2010, 23:46 UTC
Message-ID
<7vr5ps5jx1.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20100114070316.GC1528@rm.endoftheinternet.org>
Rudolf Polzer <divVerent@alientrap.org> writes:
Show 12 quoted lines
> On Thu, Jan 14, 2010 at 09:27:26AM +0800, Tay Ray Chuan wrote:
>> before I put up my comments on the patch, I wonder if git-push is the
>> best place to add this feature, as git-push usually deals with
>> "pushing" data to another repo.
>> 
>> I think git-branch would be a better place to do this.
>
> I think git-branch can already do this: after pushing, you can do git
> branch -f --track origin/mybranch.
>
> But the goal of this is to postponing the decision to track to the push time,
> and adding as little as possible extra commands/options to do this.

Thinking about this again (when was the last time we discussed it?), I like the "git branch -f" suggestion (modulo one small nit).

Yes, "push --track" lets you postpone the decision; branching, working on it, pushing it out _and_ _then_ using your "branch -f" trick will let you postpone the decision even further. And it doesn't add --track to the UI.

The small nit is that "branch -f --track me origin/me" will happily overwrite "me", even when your "me" is not up to date with "origin/me", losing commits.

Perhaps we could teach "branch --track me origin/me" (i.e. no "-f") not to barf even when "me" exists, as long as "me" is a subset of "origin/me", and treat it as a request to re-configure the upstream information for the existing branch "me" and at the same time fast-forward it to "origin/me"?

Previous: Rudolf PolzerNext: Miles Bader
Message 31 of 42 in “git push --track”
  1. git push --trackRudolf Polzer, Jan 13, 2010
  2. Ilari LiusvaaraJan 13, 2010
  3. Rudolf PolzerJan 13, 2010
  4. Ilari LiusvaaraJan 13, 2010
  5. Matthieu MoyJan 13, 2010
  6. Tay Ray ChuanJan 14, 2010
  7. Rudolf PolzerJan 14, 2010
  8. Junio C HamanoJan 14, 2010
  9. Jeff KingJan 14, 2010
  10. Junio C HamanoJan 15, 2010
  11. Rudolf PolzerJan 15, 2010
  12. Miles BaderJan 15, 2010
  13. Junio C HamanoJan 15, 2010
  14. Miles BaderJan 14, 2010
  15. Miles BaderJan 14, 2010
  16. Johannes SchindelinJan 14, 2010
  17. Miles BaderJan 14, 2010
  18. Miles BaderJan 14, 2010
  19. Rudolf PolzerJan 14, 2010
  20. Martin LanghoffJan 14, 2010
  21. Johannes SchindelinJan 14, 2010
  22. Matthieu MoyJan 14, 2010
  23. Martin LanghoffJan 14, 2010
  24. Andreas KreyJan 14, 2010
  25. Tay Ray ChuanJan 14, 2010
  26. Miles BaderJan 14, 2010
  27. Tay Ray ChuanJan 14, 2010
  28. Miles BaderJan 14, 2010
  29. Tay Ray ChuanJan 14, 2010
  30. Rudolf PolzerJan 14, 2010
  31. Junio C HamanoJan 14, 2010
  32. Miles BaderJan 15, 2010
  33. Junio C HamanoJan 15, 2010
  34. Miles BaderJan 15, 2010
  35. Matthieu MoyJan 15, 2010
  36. Nanako ShiraishiJan 14, 2010
  37. Rudolf PolzerJan 14, 2010
  38. Johannes SchindelinJan 14, 2010
  39. Nanako ShiraishiJan 14, 2010
  40. Junio C HamanoJan 14, 2010
  41. Rudolf PolzerJan 15, 2010
  42. Johannes SchindelinJan 15, 2010

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.