{"thread":{"id":"46126","subject":"Feature request: Please add support to stash specific files","startedAt":"2017-06-06T13:23:36Z","lastAt":"2017-06-06T22:01:05Z","messageCount":6,"participants":["rajdeep mondal","Randall S. Becker","Christian Neukirchen","Mike Hommey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"321616","messageId":"CACkx65CDzw64wsQ_t3YJUm_UP27fBf50n4r7mcMe1wZPW0TSjg@mail.gmail.com","threadId":"46126","inReplyTo":null,"subject":"Feature request: Please add support to stash specific files","fromName":"rajdeep mondal","fromEmail":"justrajdeep@gmail.com","sentAt":"2017-06-06T13:23:09Z","receivedAt":"2017-06-06T13:23:36Z","isPatch":false,"sender":{"key":"justrajdeep@gmail.com","avatar":null},"body":"git version 2.6.3\nOS: RHEL 6\n\nWork around found in:\nhttps://stackoverflow.com/questions/3040833/stash-only-one-file-out-of-multiple-files-that-have-changed-with-git\n\nWorkaround is not very optimal. Please add this support to git.\n\n-- \n==============================\nRajdeep\n==============================\n"},{"id":"321617","messageId":"002801d2dec9$2cd49dd0$867dd970$@nexbridge.com","threadId":"46126","inReplyTo":"CACkx65CDzw64wsQ_t3YJUm_UP27fBf50n4r7mcMe1wZPW0TSjg@mail.gmail.com","subject":"RE: Feature request: Please add support to stash specific files","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2017-06-06T13:31:11Z","receivedAt":"2017-06-06T13:32:02Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"-----Original Message-----\nOn June 6, 2017 9:23 AM, rajdeep mondal wrote:\n>Work around found in:\n>https://stackoverflow.com/questions/3040833/stash-only-one-file-out-of-multiple-files-that-have-changed-with-git\n>Workaround is not very optimal. Please add this support to git.\n\nInstead 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.\n\nIn 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 😊\n\nCheers,\nRandall\n\n\n"},{"id":"321618","messageId":"87o9u1cjvg.fsf@gmail.com","threadId":"46126","inReplyTo":"CACkx65CDzw64wsQ_t3YJUm_UP27fBf50n4r7mcMe1wZPW0TSjg@mail.gmail.com","subject":"Re: Feature request: Please add support to stash specific files","fromName":"Christian Neukirchen","fromEmail":"chneukirchen@gmail.com","sentAt":"2017-06-06T13:42:59Z","receivedAt":"2017-06-06T13:43:11Z","isPatch":false,"sender":{"key":"chneukirchen@gmail.com","avatar":"https://avatars.githubusercontent.com/u/139?v=4"},"body":"rajdeep mondal <justrajdeep@gmail.com> writes:\n\n> git version 2.6.3\n> OS: RHEL 6\n>\n> Work around found in:\n> https://stackoverflow.com/questions/3040833/stash-only-one-file-out-of-multiple-files-that-have-changed-with-git\n>\n> Workaround is not very optimal. Please add this support to git.\n\nThis has been implemented in Git 2.13:\n\n> * \"git stash push\" takes a pathspec so that the local changes can be\n>   stashed away only partially.\n\n-- \nChristian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org\n\n"},{"id":"321634","messageId":"CACkx65CRfZ-Se6oPzy6fHtC7R19UWc-EDopudHQY3JiwV-hAAw@mail.gmail.com","threadId":"46126","inReplyTo":"002801d2dec9$2cd49dd0$867dd970$@nexbridge.com","subject":"Re: Feature request: Please add support to stash specific files","fromName":"rajdeep mondal","fromEmail":"justrajdeep@gmail.com","sentAt":"2017-06-06T18:38:08Z","receivedAt":"2017-06-06T18:41:33Z","isPatch":false,"sender":{"key":"justrajdeep@gmail.com","avatar":null},"body":"Hi Randall,\n\nI completely agree to what you are saying, but sometimes it just so\nhappens that in the middle of a change, i feel like if some portion of\nthe changes are fine I can commit them.  Stashing some of the files\nand being able to check the compile/tests at this point would be a\nreally awesome change.\n\nStash supports a -p option to deal with this, it becomes cumbersome\nwhen the number of files are many.  Maybe it is something which would\nbe a good to have feature. People need not use it if they dont want\nto.\n\nThanks\nRajdeep\n\nOn Tue, Jun 6, 2017 at 9:31 AM, Randall S. Becker\n<rsbecker@nexbridge.com> wrote:\n> -----Original Message-----\n> On June 6, 2017 9:23 AM, rajdeep mondal wrote:\n>>Work around found in:\n>>https://stackoverflow.com/questions/3040833/stash-only-one-file-out-of-multiple-files-that-have-changed-with-git\n>>Workaround is not very optimal. Please add this support to git.\n>\n> 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.\n>\n> 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 😊\n>\n> Cheers,\n> Randall\n>\n>\n\n\n\n-- \n==============================\nRajdeep\n==============================\n"},{"id":"321647","messageId":"20170606210318.e2ey4pwxhxsuvizi@glandium.org","threadId":"46126","inReplyTo":"CACkx65CRfZ-Se6oPzy6fHtC7R19UWc-EDopudHQY3JiwV-hAAw@mail.gmail.com","subject":"Re: Feature request: Please add support to stash specific files","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2017-06-06T21:03:18Z","receivedAt":"2017-06-06T21:03:34Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Tue, Jun 06, 2017 at 02:38:08PM -0400, rajdeep mondal wrote:\n> Hi Randall,\n> \n> I completely agree to what you are saying, but sometimes it just so\n> happens that in the middle of a change, i feel like if some portion of\n> the changes are fine I can commit them.  Stashing some of the files\n> and being able to check the compile/tests at this point would be a\n> really awesome change.\n> \n> Stash supports a -p option to deal with this, it becomes cumbersome\n> when the number of files are many.  Maybe it is something which would\n> be a good to have feature. People need not use it if they dont want\n> to.\n\nGit 2.13.0 has that already.\n\ngit stash -- file1 file2\n\nMike\n"},{"id":"321648","messageId":"CACkx65BrZv3bVmYZ1s03GGe-eqfzvgKQbzoLN0WD6by3Zn16og@mail.gmail.com","threadId":"46126","inReplyTo":"20170606210318.e2ey4pwxhxsuvizi@glandium.org","subject":"Re: Feature request: Please add support to stash specific files","fromName":"rajdeep mondal","fromEmail":"justrajdeep@gmail.com","sentAt":"2017-06-06T22:00:36Z","receivedAt":"2017-06-06T22:01:05Z","isPatch":false,"sender":{"key":"justrajdeep@gmail.com","avatar":null},"body":"Thanks Mike.\n\nOn Tue, Jun 6, 2017 at 5:03 PM, Mike Hommey <mh@glandium.org> wrote:\n> On Tue, Jun 06, 2017 at 02:38:08PM -0400, rajdeep mondal wrote:\n>> Hi Randall,\n>>\n>> I completely agree to what you are saying, but sometimes it just so\n>> happens that in the middle of a change, i feel like if some portion of\n>> the changes are fine I can commit them.  Stashing some of the files\n>> and being able to check the compile/tests at this point would be a\n>> really awesome change.\n>>\n>> Stash supports a -p option to deal with this, it becomes cumbersome\n>> when the number of files are many.  Maybe it is something which would\n>> be a good to have feature. People need not use it if they dont want\n>> to.\n>\n> Git 2.13.0 has that already.\n>\n> git stash -- file1 file2\n>\n> Mike\n\n\n\n-- \n==============================\nRajdeep\n==============================\n"}]}