Comments (9)
Fair. I might have been a bit too strict with this one. (It regularly itches me, too.)
from gitflow.
Maybe not stash the changes away, but simply remove the check for local changes and let git determine if it can switch branches itself?
from gitflow.
Looking into the specific commands it looks like this basic idea would work:
git stash
... do stuff ...
git stash pop
if it dies while 'doing stuff' we may want to do a git stash pop
before exiting to get it back to where it was before it was started.
from gitflow.
That is true, git will give its own error if it can't branch.
from gitflow.
I'm tempted to have a very conservative additude against these kind of implementations. Think worst case: what if git stash
fails (somehow)? And what if git stash pop
fails? That's two more sanity checks and remembering state in between. Not to mention that Git's porcelain does not provide the best ways to do these sanity checks in the first place.
If this can be tackled by removing one of our sanity checks and leaving the figuring out of whether branching is currently possible to Git, we have a solid implementation. If Git is unable to start a new branch somehow, we should quit and let the user deal with it. This is probably for the better anyway, since that should be an exceptional case.
from gitflow.
Agreed, it would be difficult for gitflow to maintain the state. I'm all for just removing the extra check.
from gitflow.
Heh, this is a bit lame: looking at the source code, I apparently added the option -f
(force) for this already. The question now is: should this become the default behaviour or just keep it this way?
from gitflow.
From my ignorant view it would seem better to have it try the branch and fail with the git message than have to fail, then force, then fail again.
But we may need to look into what other actions occur between when the check for a 'dirty' workspace and the branch code. Is there anything that gets stored between the check and the branch creation that would mess up the process?
from gitflow.
Yeah, you're absolutely right. Fixed in 4132de9.
from gitflow.
Related Issues (20)
- Feature Proposal: Add A Subcommand, "Start"
- sorry
- README link 404
- Is it possible to make custom message during MERGE
- [BUG] "Fatal" error of "Working tree contains unstaged changes" returns zero error code HOT 2
- Branch and all commits lost from local machine and server when interrupting "git flow feature finish" and re-running. HOT 1
- How can I suppress "Summary of actions"
- Is it possible to make git flow merge the master branch into develop instead of the hotfix one on finish? HOT 1
- Error when install from `gitflow-installer.sh` HOT 2
- Will git flow be configurable?such as change the hotfix merging direction from Master&develop to Master&realease HOT 1
- Multiline release tag messages cause problems
- ry 2
- Windows gitflow install link has malware HOT 2
- why can't I clone the gitflow folder? HOT 3
- Can't install in Fedora 36
- Link to probably virus in Wiki
- Dead project: Archiv state and link to replacement HOT 3
- how to work gitflow together with github HOT 1
- RFC: Improving Git Workflow Using Versioning Patterns
- Error install git-flow Rocky Linux 9.3 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitflow.