git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Feature request: Please add support to stash specific files
@ 2017-06-06 13:23 rajdeep mondal
  2017-06-06 13:31 ` Randall S. Becker
  2017-06-06 13:42 ` Christian Neukirchen
  0 siblings, 2 replies; 6+ messages in thread
From: rajdeep mondal @ 2017-06-06 13:23 UTC (permalink / raw)
  To: git

git version 2.6.3
OS: RHEL 6

Work around found in:
https://stackoverflow.com/questions/3040833/stash-only-one-file-out-of-multiple-files-that-have-changed-with-git

Workaround is not very optimal. Please add this support to git.

-- 
==============================
Rajdeep
==============================

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

* RE: Feature request: Please add support to stash specific files
  2017-06-06 13:23 Feature request: Please add support to stash specific files rajdeep mondal
@ 2017-06-06 13:31 ` Randall S. Becker
  2017-06-06 18:38   ` rajdeep mondal
  2017-06-06 13:42 ` Christian Neukirchen
  1 sibling, 1 reply; 6+ messages in thread
From: Randall S. Becker @ 2017-06-06 13:31 UTC (permalink / raw)
  To: 'rajdeep mondal', git

-----Original Message-----
On June 6, 2017 9:23 AM, rajdeep mondal wrote:
>Work around found in:
>https://stackoverflow.com/questions/3040833/stash-only-one-file-out-of-multiple-files-that-have-changed-with-git
>Workaround is not very optimal. Please add this support to git.

Instead of using stash as part of your normal process, consider using topic branches instead. Before working, switch to a new topic branch. If you forget, stash, switch, apply, then go forth. While on the topic branch, you can use add and commit on a hunk or file basis to satisfy what appears to be the requirement here. You can then merge the desired commits from your topic branch into wherever you want to merge them either preserving the commit or by squashing commits together.

In my shop, stash is only used for the "I forgot to switch to a topic branch, oops" process. I try to encourage people not to use it. I also discourage squashed commits, but that's because I like knowing what's in my sausages 😊

Cheers,
Randall



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

* Re: Feature request: Please add support to stash specific files
  2017-06-06 13:23 Feature request: Please add support to stash specific files rajdeep mondal
  2017-06-06 13:31 ` Randall S. Becker
@ 2017-06-06 13:42 ` Christian Neukirchen
  1 sibling, 0 replies; 6+ messages in thread
From: Christian Neukirchen @ 2017-06-06 13:42 UTC (permalink / raw)
  To: git

rajdeep mondal <justrajdeep@gmail.com> writes:

> git version 2.6.3
> OS: RHEL 6
>
> Work around found in:
> https://stackoverflow.com/questions/3040833/stash-only-one-file-out-of-multiple-files-that-have-changed-with-git
>
> Workaround is not very optimal. Please add this support to git.

This has been implemented in Git 2.13:

> * "git stash push" takes a pathspec so that the local changes can be
>   stashed away only partially.

-- 
Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org


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

* Re: Feature request: Please add support to stash specific files
  2017-06-06 13:31 ` Randall S. Becker
@ 2017-06-06 18:38   ` rajdeep mondal
  2017-06-06 21:03     ` Mike Hommey
  0 siblings, 1 reply; 6+ messages in thread
From: rajdeep mondal @ 2017-06-06 18:38 UTC (permalink / raw)
  To: Randall S. Becker; +Cc: git

Hi Randall,

I completely agree to what you are saying, but sometimes it just so
happens that in the middle of a change, i feel like if some portion of
the changes are fine I can commit them.  Stashing some of the files
and being able to check the compile/tests at this point would be a
really awesome change.

Stash supports a -p option to deal with this, it becomes cumbersome
when the number of files are many.  Maybe it is something which would
be a good to have feature. People need not use it if they dont want
to.

Thanks
Rajdeep

On Tue, Jun 6, 2017 at 9:31 AM, Randall S. Becker
<rsbecker@nexbridge.com> wrote:
> -----Original Message-----
> On June 6, 2017 9:23 AM, rajdeep mondal wrote:
>>Work around found in:
>>https://stackoverflow.com/questions/3040833/stash-only-one-file-out-of-multiple-files-that-have-changed-with-git
>>Workaround is not very optimal. Please add this support to git.
>
> Instead of using stash as part of your normal process, consider using topic branches instead. Before working, switch to a new topic branch. If you forget, stash, switch, apply, then go forth. While on the topic branch, you can use add and commit on a hunk or file basis to satisfy what appears to be the requirement here. You can then merge the desired commits from your topic branch into wherever you want to merge them either preserving the commit or by squashing commits together.
>
> In my shop, stash is only used for the "I forgot to switch to a topic branch, oops" process. I try to encourage people not to use it. I also discourage squashed commits, but that's because I like knowing what's in my sausages 😊
>
> Cheers,
> Randall
>
>



-- 
==============================
Rajdeep
==============================

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

* Re: Feature request: Please add support to stash specific files
  2017-06-06 18:38   ` rajdeep mondal
@ 2017-06-06 21:03     ` Mike Hommey
  2017-06-06 22:00       ` rajdeep mondal
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Hommey @ 2017-06-06 21:03 UTC (permalink / raw)
  To: rajdeep mondal; +Cc: Randall S. Becker, git

On Tue, Jun 06, 2017 at 02:38:08PM -0400, rajdeep mondal wrote:
> Hi Randall,
> 
> I completely agree to what you are saying, but sometimes it just so
> happens that in the middle of a change, i feel like if some portion of
> the changes are fine I can commit them.  Stashing some of the files
> and being able to check the compile/tests at this point would be a
> really awesome change.
> 
> Stash supports a -p option to deal with this, it becomes cumbersome
> when the number of files are many.  Maybe it is something which would
> be a good to have feature. People need not use it if they dont want
> to.

Git 2.13.0 has that already.

git stash -- file1 file2

Mike

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

* Re: Feature request: Please add support to stash specific files
  2017-06-06 21:03     ` Mike Hommey
@ 2017-06-06 22:00       ` rajdeep mondal
  0 siblings, 0 replies; 6+ messages in thread
From: rajdeep mondal @ 2017-06-06 22:00 UTC (permalink / raw)
  To: Mike Hommey; +Cc: Randall S. Becker, git

Thanks Mike.

On Tue, Jun 6, 2017 at 5:03 PM, Mike Hommey <mh@glandium.org> wrote:
> On Tue, Jun 06, 2017 at 02:38:08PM -0400, rajdeep mondal wrote:
>> Hi Randall,
>>
>> I completely agree to what you are saying, but sometimes it just so
>> happens that in the middle of a change, i feel like if some portion of
>> the changes are fine I can commit them.  Stashing some of the files
>> and being able to check the compile/tests at this point would be a
>> really awesome change.
>>
>> Stash supports a -p option to deal with this, it becomes cumbersome
>> when the number of files are many.  Maybe it is something which would
>> be a good to have feature. People need not use it if they dont want
>> to.
>
> Git 2.13.0 has that already.
>
> git stash -- file1 file2
>
> Mike



-- 
==============================
Rajdeep
==============================

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

end of thread, other threads:[~2017-06-06 22:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06 13:23 Feature request: Please add support to stash specific files rajdeep mondal
2017-06-06 13:31 ` Randall S. Becker
2017-06-06 18:38   ` rajdeep mondal
2017-06-06 21:03     ` Mike Hommey
2017-06-06 22:00       ` rajdeep mondal
2017-06-06 13:42 ` Christian Neukirchen

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).