-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stg repair
can throw away commits
#163
Comments
Hey @smoofra, yes unfortunately this is one of the shortcomings of Working with Phab I have come up with a workaround for the trivial case of "oops I (or **cough** This will get you out of the pickle, but only if the amend touched the topmost commit. That will not save you from interactive rebase.
@jpgrayson Do you have any workarounds if the user accidentally done |
A thing I'm noticing about the above amend scenario is that it only seems to be a problem when operating on the first applied patch. Consider the following scenario: $ stg branch --create test-branch
$ stg new -m p0
$ vi README
$ stg refresh
$ stg new -m p1
$ vi README
$ stg refresh
$ git commit --amend -m "p1 amended"
$ stg repair
Creating 1 new patch ...
Creating patch p1-amended from commit a4cba3c316942cb99267baa9f83e85bd6d27a1aa
done
Checking patch appliedness ...
p1-amended is now applied
p1 is now unapplied
done
Now at patch "p1-amended"
$ stg series
+ p0
> p1-amended
- p1 In this scenario, I think we get satisfactory behavior from So it seems like |
When `stg repair` searches for commits to "patchify", it looks for commits that are children of known patch commits. This left an unhandled edge case where if only one patch was applied, and that patch was amended with `git commit --amend`, the amended commit would not be patchified and, worse, that commit would become orphaned. `stg repair` is modified to look for the last known stack base commit in addition to known patch commits such that children of the base commit will now be patchified. An added benefit of identifying the stack's base commit is that it signals the point beyond which no patches will be found and thus allows searching to stop and a potentially large amount of work avoided. This can have a significant impact on the performance of running `stg repair` in a repositories with long histories. Repairs #163 Signed-off-by: Peter Grayson <pete@jpgrayson.net>
I've modified I have not attempted to resolve any repair scenarios involving |
To Reproduce:
Results.
The amended commit has not been turned into a patch, and instead has been silently left behind.
Expected results.
Ideally stg repair would recognize that only the patch message has changed and update that. In any case though it should't abandon the commit, it should patchily the amended commit resulting in two, now conflicting identical unapplied patches in the
series.
Why would I do that anyway?
I use stgit to maintain my queue of ongoing patches while contributing to llvm-project, which uses Phabricator as a code review platform. Phabricators client wants to amend the commit messages to add its own information to them, which makes the workflow with stgit awkward.
The text was updated successfully, but these errors were encountered: