|
|
Created:
4 years, 6 months ago by anatoly techtonik Modified:
4 years, 5 months ago CC:
chromium-reviews, dpranke+depot_tools_chromium.org, iannucci+depot_tools_chromium.org Base URL:
https://chromium.googlesource.com/chromium/tools/depot_tools.git@master Target Ref:
refs/heads/master Project:
depot_tools Visibility:
Public. |
DescriptionStashing is also an option when copy is dirty for upload
BUG=
Committed: https://chromium.googlesource.com/chromium/tools/depot_tools/+/bf2a34198e6d4ec0c6403da5cf632b37a2ac8478
Patch Set 1 #Patch Set 2 : Freeze is a better stash #Messages
Total messages: 12 (3 generated)
techtonik@gmail.com changed reviewers: + dpranke@chromium.org, iannucci@chromium.org
I might also recommend 'git freeze', which is one of the tools in depot_tools that we added. It's like stash, but it associates the dirty stuff directly with the branch you're on (by committing it with some specially-recognized commit messages). The 'freeze' operation can be undone with `git thaw`, which will return the staged and unstaged changes back to their respective state in the git index. On Sun, May 29, 2016 at 12:55 AM <techtonik@gmail.com> wrote: > Reviewers: Dirk Pranke (slow), iannucci > CL: https://codereview.chromium.org/2019223002/ > > Description: > Stashing is also an option when copy is dirty for upload > > BUG= > > Base URL: > https://chromium.googlesource.com/chromium/tools/depot_tools.git@master > > Affected files (+1, -1 lines): > M git_common.py > > > Index: git_common.py > diff --git a/git_common.py b/git_common.py > index > b7626e8a3ed4d81434443ef15e427c2cae2bf89a..43128efba57b14a59a49cfa7221f7e1829a8fe5e > 100644 > --- a/git_common.py > +++ b/git_common.py > @@ -691,7 +691,7 @@ def get_dirty_files(): > def is_dirty_git_tree(cmd): > dirty = get_dirty_files() > if dirty: > - print 'Cannot %s with a dirty tree. You must commit locally first.' % cmd > + print 'Cannot %s with a dirty tree. You must commit locally or stash.' % > cmd > print 'Uncommitted files: (git diff-index --name-status HEAD)' > print dirty[:4096] > if len(dirty) > 4096: # pragma: no cover > > > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
On 2016/05/29 19:47:17, iannucci wrote: > I might also recommend 'git freeze', which is one of the tools in > depot_tools that we added. It's like stash, but it associates the dirty > stuff directly with the branch you're on (by committing it with some > specially-recognized commit messages). The 'freeze' operation can be undone > with `git thaw`, which will return the staged and unstaged changes back to > their respective state in the git index. I guess the story for that is when you need to split work in single branch to multiple CLs, right? How often is this needed? Because in my use case I would rather move changes to a different "WIP" branch rather than working with stash and freezer (to keep it simple). It is already not simple that there is no single `status` command that show you the state of stash and all branches to ensure that I've committed everything. So my ideal workflow is that I simply commit stuff, but when I push anything to remote server, `push` detects that I am pushing to review server, asks me to squash my changes to CL, prompts for branch name (and proposes itself), moves changes there, assigns an ID, and makes it save from crash, interruptions, and is also idempotent with ability to just "undo" everything.
On 2016/05/30 06:57:16, anatoly techtonik wrote: > On 2016/05/29 19:47:17, iannucci wrote: > > I might also recommend 'git freeze', which is one of the tools in > > depot_tools that we added. It's like stash, but it associates the dirty > > stuff directly with the branch you're on (by committing it with some > > specially-recognized commit messages). The 'freeze' operation can be undone > > with `git thaw`, which will return the staged and unstaged changes back to > > their respective state in the git index. > > I guess the story for that is when you need to split work in single branch to > multiple CLs, right? How often is this needed? Because in my use case I would > rather move changes to a different "WIP" branch rather than working with stash > and freezer (to keep it simple). It is already not simple that there is no > single `status` command that show you the state of stash and all branches to > ensure that I've committed everything. > > So my ideal workflow is that I simply commit stuff, but when I push anything to > remote server, `push` detects that I am pushing to review server, asks me to > squash my changes to CL, prompts for branch name (and proposes itself), moves > changes there, assigns an ID, and makes it save from crash, interruptions, and > is also idempotent with ability to just "undo" everything. Getting back to this after traveling for a while. The general flow that the tools promote is: * start a branch for some new feature/bugfix/whatever * work/commit on it * decide that you want to work on some other bug/whatever (e.g. you get a high-priority bug report), so you freeze the current branch and start a new one. * because the work is frozen to that original branch, this process is repeatable in case you get interrupted more than once, since every branch has an independent freeze state, unlike stash * when you come back to your branch, you can thaw to pick up where you left off. In any event for this CL that you're proposing, I would be happy if the text read: You must commit, freeze or stash your changes first.
PTAL.
lgtm
The CQ bit was checked by techtonik@gmail.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Stashing is also an option when copy is dirty for upload BUG= ========== to ========== Stashing is also an option when copy is dirty for upload BUG= Committed: https://chromium.googlesource.com/chromium/tools/depot_tools/+/bf2a34198e6d4e... ==========
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/tools/depot_tools/+/bf2a34198e6d4e...
Message was sent while issue was closed.
@iannucci it appears that freezing doesn't work as expected https://bugs.chromium.org/p/chromium/issues/detail?id=630822 |