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

Re: Using the --track option when creating a branch

From
Samuel Tardieu <sam@rfc1149.net>
Date
Oct 30, 2008, 15:04 UTC
Message-ID
<2008-10-30-16-04-08+trackit+sam@rfc1149.net>
In-Reply-To
<4909CABD.1040708@op5.se>
* Andreas Ericsson <ae@op5.se> [2008-10-30 15:54:53 +0100]
Show 5 quoted lines
> Correct me if I'm wrong, but wouldn't my suggestion of not trying to
> push (even matching) branches that haven't been updated since we last
> fetched from the remote do exactly the same thing for your particular
> use-case, but without syntax change and all the annoying minor parts
> that it entails?

Not exactly. I often do some work on a branch which does not mandate a topic branch and have to switch branches to fix a bug for example. This would continue to push unterminated changes as well.

Typical use case, which happens (to me) quite frequently:
  % git checkout master
  [start new feature, estimated implementation time 15 minutes]
  % git commit -m "Reorganize foobar in previous of xyzzy."
    (note that I'm not sure that I will keep it, I'll know that later
    when my next commit is ready, maybe in 10 minutes, no need for
    a topic branch)
  [mail from a customer, "I noticed some strange behaviour here" --
   let's fix it]
  % git checkout 2.0-beta1-release-candidate
  [fix strange behaviour and add new test]
  [test locally]
  % git commit -m "Fix strange behaviour baz."
  % git push
    (so that it goes to the buildfarm for QA testing)
Argh, "master" has been pushed as well. Ok, I could have done
  % git branch
    (because I know I am on the right branch but do not necessarily
     remember its full name all the time)
  % git push origin 2.0-beta1-release-candidate

or I could have started a topic branch, but I often push 2 or 3 commits at a time instead, the first one being a refactoring of existing code to ease the subsequent one.

>From what I have seen, people I am working with often have the

same workflow (do not systematically start a topic branch when in active development mode)

Show 6 quoted lines
> Define "many". Perhaps as often as 2-3 times per day. Not very often,
> but frequent enough that I definitely want some short sweet way of
> doing it. OTOH, I also find the "rejected" messages annoying, and I
> definitely feel one could do something about them. However, it's my
> birthday today and I plan on being far too drunk/hungover the entire
> weekend for me to take any actions in that direction.
Happy birthday :)
Previous: Andreas EricssonNext: Andreas Ericsson
Message 15 of 23 in “Using the --track option when creating a branch”
  1. Bill LearOct 29, 2008
  2. Santi BéjarOct 29, 2008
  3. Bill LearOct 29, 2008
  4. Sam VilainOct 30, 2008
  5. Bill LearOct 30, 2008
  6. Bill LearOct 30, 2008
  7. Andreas EricssonOct 30, 2008
  8. Samuel TardieuOct 30, 2008
  9. Andreas EricssonOct 30, 2008
  10. Samuel TardieuOct 30, 2008
  11. Pierre HabouzitOct 30, 2008
  12. Samuel TardieuOct 30, 2008
  13. Sam VilainOct 30, 2008
  14. Andreas EricssonOct 30, 2008
  15. Samuel TardieuOct 30, 2008
  16. Andreas EricssonOct 30, 2008
  17. Bill LearOct 30, 2008
  18. Marc BranchaudOct 30, 2008
  19. Sam VilainOct 30, 2008
  20. Jakub NarebskiOct 30, 2008
  21. Jeff KingNov 2, 2008
  22. Sam VilainOct 30, 2008
  23. Santi BéjarOct 30, 2008

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.