All of lore.kernel.org
 help / color / mirror / Atom feed
* Git Stash stages files if there is a conflict
@ 2010-10-15 20:13 Pretty Boy Floyd
  2010-10-18  9:33 ` Tor Arntsen
  2010-10-18 17:18 ` Eric Raible
  0 siblings, 2 replies; 4+ messages in thread
From: Pretty Boy Floyd @ 2010-10-15 20:13 UTC (permalink / raw)
  To: git

Hello!

I am running msysgit 1.7.3.1.  If I run stash apply, and there is a conflict,
all of my stash changes get staged. Is this the correct behaviour? I found it a
little surprising.

Another question: if I have stashed 10 files, and there is a conflict in one of
them, will stash apply abort when it has a conflict, or will it apply all
non-conflicted files.


Finally, if I do the following:

git stash
git pull
git stash apply

and another developer has removed a file that I have stashed, then I am unable
to apply the stash  on this file. How can I retrieve my changes from the stash?


Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Git Stash stages files if there is a conflict
  2010-10-15 20:13 Git Stash stages files if there is a conflict Pretty Boy Floyd
@ 2010-10-18  9:33 ` Tor Arntsen
  2010-10-18 17:18 ` Eric Raible
  1 sibling, 0 replies; 4+ messages in thread
From: Tor Arntsen @ 2010-10-18  9:33 UTC (permalink / raw)
  To: Pretty Boy Floyd; +Cc: git

On Fri, Oct 15, 2010 at 22:13, Pretty Boy Floyd <boxerab@gmail.com> wrote:
> Hello!
>
> I am running msysgit 1.7.3.1.  If I run stash apply, and there is a conflict,
> all of my stash changes get staged. Is this the correct behaviour? I found it a
> little surprising.

I have no answer to the above, just noting that I observed exactly the
same yesterday (git 1.7.1) and was a little surprised too. Not that it
created any problems as such, just raised eyebrows.

[..]

-Tor

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Git Stash stages files if there is a conflict
  2010-10-15 20:13 Git Stash stages files if there is a conflict Pretty Boy Floyd
  2010-10-18  9:33 ` Tor Arntsen
@ 2010-10-18 17:18 ` Eric Raible
  2010-10-18 17:56   ` Aaron Boxer
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Raible @ 2010-10-18 17:18 UTC (permalink / raw)
  To: Pretty Boy Floyd; +Cc: git

On 11:59 AM, Pretty Boy Floyd wrote:
> Hello!
> 
> I am running msysgit 1.7.3.1.  If I run stash apply, and there is a conflict,
> all of my stash changes get staged. Is this the correct behaviour? I found it a
> little surprising.

My tests indicate that the same thing happens as with any conflicted merge.
Namely: non-conflicting changes get staged, and conflicting changes are left
only in the working directory (with conflict markers added as appropriate).

See http://progit.org/book/ch3-2.html#basic_merging,
especially the part on conflicts.

> Another question: if I have stashed 10 files, and there is a conflict in one of
> them, will stash apply abort when it has a conflict, or will it apply all
> non-conflicted files.

Same as above.  In both cases the stash is unaffected, which allows
you to reset and try again.

> Finally, if I do the following:
> 
> git stash
> git pull
> git stash apply
> 
> and another developer has removed a file that I have stashed, then I am unable
> to apply the stash  on this file. How can I retrieve my changes from the stash?

One nice (relatively new feature) is "git stash branch", which makes a new
branch from an existing stash.

HTH - Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Git Stash stages files if there is a conflict
  2010-10-18 17:18 ` Eric Raible
@ 2010-10-18 17:56   ` Aaron Boxer
  0 siblings, 0 replies; 4+ messages in thread
From: Aaron Boxer @ 2010-10-18 17:56 UTC (permalink / raw)
  To: Eric Raible; +Cc: git

Thanks, Eric. The new git stash branch command you mentioned will come in handy.

From a user's perspective, it doesn't make sense to stage unconflicted
changes after stash apply.
When I stash changes, these changes are usually not ready for committing.

I suppose git uses the index to differentiate between conflicted and
unconflicted changes.
So, its not a big deal. Just a bit surprising.

Thanks again for your help!




On Mon, Oct 18, 2010 at 1:18 PM, Eric Raible <raible@nextest.com> wrote:
> On 11:59 AM, Pretty Boy Floyd wrote:
>> Hello!
>>
>> I am running msysgit 1.7.3.1.  If I run stash apply, and there is a conflict,
>> all of my stash changes get staged. Is this the correct behaviour? I found it a
>> little surprising.
>
> My tests indicate that the same thing happens as with any conflicted merge.
> Namely: non-conflicting changes get staged, and conflicting changes are left
> only in the working directory (with conflict markers added as appropriate).
>
> See http://progit.org/book/ch3-2.html#basic_merging,
> especially the part on conflicts.
>
>> Another question: if I have stashed 10 files, and there is a conflict in one of
>> them, will stash apply abort when it has a conflict, or will it apply all
>> non-conflicted files.
>
> Same as above.  In both cases the stash is unaffected, which allows
> you to reset and try again.
>
>> Finally, if I do the following:
>>
>> git stash
>> git pull
>> git stash apply
>>
>> and another developer has removed a file that I have stashed, then I am unable
>> to apply the stash  on this file. How can I retrieve my changes from the stash?
>
> One nice (relatively new feature) is "git stash branch", which makes a new
> branch from an existing stash.
>
> HTH - Eric
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-18 17:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-15 20:13 Git Stash stages files if there is a conflict Pretty Boy Floyd
2010-10-18  9:33 ` Tor Arntsen
2010-10-18 17:18 ` Eric Raible
2010-10-18 17:56   ` Aaron Boxer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.