Closed dmitrijus closed 10 years ago
I've accidentally misclicked and closed, reopening.
I can confirm the issue.
@ktf , maybe we can wrap the git-cms-addpkg internals with a git stash ? I.e. something like
git stash save --keep-index --include-untracked "prepare for git cms-addpkg" ...do whatever git cms-addpkg was doing git stash pop stash@{0}
?
I don't think stashing is a good solution and it just might cause complex bugs in the future.
A simple check would be enough, quick-n-dirty: [[ -z $(git status --porcelain) ]] || exit 1
Note: read-tree already fails with unmerged files.
Hey, I just jumped into the very same problem and I'd vote for the stash solution. @dmitrijus what are the drawbacks of this approach you see?
M.
I have nothing against stashing except that it adds complexity to the wrapper script.
My solution is just to check for staged files, without doing any damage. I believe developers who are hit by this bug will know how to resolve this issue.
Additionally, this bug might appear outside the situation I've described. I've seen it while doing merging and/or rebasing (if you have a conflict, git puts already merged files into staging). I am not sure if you can stash unfinished merges/rebases correctly, I don't know git that well.
I've added the simple check to both git-cms-addpkg and git-cms-merge-topic in #65 .
Okay, thanks.
Hi,
If you do git-cms-addpkg, all staged (but not yet committed) changes will be reset without a warning.
Dmitrijus