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

Re: git pull opinion

From
Andreas Ericsson <ae@op5.se>
Date
Nov 6, 2007, 12:08 UTC
Message-ID
<47305925.8020306@op5.se>
In-Reply-To
<Pine.LNX.4.64.0711061204160.4362@racer.site>
Johannes Schindelin wrote:
Show 68 quoted lines
> Hi,
> 
> On Tue, 6 Nov 2007, Andreas Ericsson wrote:
> 
>> Johannes Schindelin wrote:
>>
>>> On Tue, 6 Nov 2007, Andreas Ericsson wrote:
>>>
>>>> Bill Lear wrote:
>>>>> On Monday, November 5, 2007 at 15:33:31 (-0800) Junio C Hamano writes:
>>>>>> Aghiles <aghilesk@gmail.com> writes:
>>>>>>
>>>>>>> Is there an "easier" way to pull into a dirty directory ? I am
>>>>>>> asking this to make sure I understand the problem and not
>>>>>>> because I find it annoying to type those 4 commands to perform
>>>>>>> a pull (although some of my colleagues do find that annoying :).
>>>>>> You need to switch your mindset from centralized SVN workflow.
>>>>>>
>>>>>> The beauty of distributedness is that it redefines the meaning
>>>>>> of "to commit".  In distributed systems, the act of committing
>>>>>> is purely checkpointing and it is not associated with publishing
>>>>>> the result to others as centralized systems force you to.
>>>>>>
>>>>>> Stop thinking like "I need to integrate the changes from
>>>>>> upstream into my WIP to keep up to date."  You first finish what
>>>>>> you are currently doing, at least to the point that it is
>>>>>> stable, make a commit to mark that state, and then start
>>>>>> thinking about what other people did.  You may most likely do a
>>>>>> "git fetch" followed by "git rebase" to update your WIP on top
>>>>>> of the updated work by others.
>>>>>>
>>>>>> Once you get used to that, you would not have "a dirty
>>>>>> directory" problem.
>>>>> I respectfully beg to differ.  I think it is entirely reasonable, and
>>>>> not a sign of "centralized" mindset, to want to pull changes others
>>>>> have made into your dirty repository with a single command.
>>>>>
>>>> I find it much more convenient to just fetch them. I'd rather see
>>>> git-pull being given a --rebase option (which would ultimately mean
>>>> teaching git-merge about it) to rebase already committed changes on
>>>> top of the newly fetched tracking branch. It's being worked on, but
>>>> rather slowly.
>>> git-pull learning about --rebase does not mean teaching git-merge about it.
>>> See my patch, which you (and others) failed to enthusiastically embrace,
>>> which is the sole reason it is stalled.
>>>
>> I must have missed it. Found the thread now though. Gonna try the patch in
>> production for a while and see how it pans out.
>>
>> I'm curious about this hunk though. It seems unaffiliated with the --rebase
>> option as such, but was still in the patch. Would you care to clarify?
>>
>> @@ -86,7 +95,6 @@ merge_head=$(sed -e '/	not-for-merge	/d' \
>>
>> case "$merge_head" in
>> '')
>> -	curr_branch=$(git symbolic-ref -q HEAD)
>> 	case $? in
>> 	  0) ;;
>> 	  1) echo >&2 "You are not currently on a branch; you must
>> explicitly"
>>
> 
> No, it is not unaffiliated.  If you go back to the patch, you will find 
> that this line was not deleted, but moved to the start of git-rebase.sh.  
> We need to know the branch name to get the config settings, and might just 
> as well reuse the branch name for the merge_head case.
> 

Righto. I should learn to not write emails or read patches before 10am. Thanks for clarifying.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Johannes SchindelinNext: Aghiles
Message 18 of 43 in “git pull opinion”
  1. AghilesNov 5, 2007
  2. Jakub NarebskiNov 5, 2007
  3. Johannes SchindelinNov 6, 2007
  4. AghilesNov 6, 2007
  5. Johannes SchindelinNov 6, 2007
  6. Junio C HamanoNov 6, 2007
  7. Johannes SchindelinNov 6, 2007
  8. Alex RiesenNov 5, 2007
  9. Junio C HamanoNov 5, 2007
  10. Bill LearNov 6, 2007
  11. Pierre HabouzitNov 6, 2007
  12. Alex RiesenNov 6, 2007
  13. Pierre HabouzitNov 6, 2007
  14. Andreas EricssonNov 6, 2007
  15. Johannes SchindelinNov 6, 2007
  16. Andreas EricssonNov 6, 2007
  17. Johannes SchindelinNov 6, 2007
  18. Andreas EricssonNov 6, 2007
  19. AghilesNov 6, 2007
  20. Alex RiesenNov 6, 2007
  21. Linus TorvaldsNov 6, 2007
  22. AghilesNov 7, 2007
  23. Johannes SchindelinNov 8, 2007
  24. Linus TorvaldsNov 10, 2007
  25. Steven GrimmNov 6, 2007
  26. AghilesNov 6, 2007
  27. Miklos VajnaNov 5, 2007
  28. AghilesNov 6, 2007
  29. Benoit SigoureNov 6, 2007
  30. Ralf WildenhuesNov 6, 2007
  31. Johannes SchindelinNov 6, 2007
  32. Ralf WildenhuesNov 6, 2007
  33. AghilesNov 6, 2007
  34. Pierre HabouzitNov 6, 2007
  35. Mark 'git stash [message...]' as deprecatedBrian Downing, Nov 7, 2007
  36. Disable implicit 'save' argument for 'git stash'Brian Downing, Nov 7, 2007
  37. Johannes SixtNov 7, 2007
  38. Wincent ColaiutaNov 7, 2007
  39. Junio C HamanoNov 7, 2007
  40. Pierre HabouzitNov 7, 2007
  41. Pascal ObryNov 6, 2007
  42. Uwe Kleine-KönigNov 7, 2007
  43. Pascal ObryNov 7, 2007

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.