ezyang / ghstack

Submit stacked diffs to GitHub on the command line

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Omitting `--no-skip` reverts local commit message

driazati opened this issue · comments

I ran into this bug when trying to submit a change to the commit message without using --no-skip, the commit message on my local repo got reverted to the one from GitHub

[mac] ~/D/pytorch > git log --pretty='%s' | head -n 1
[Skip CI] Document '[Skip CI]'

[mac] ~/D/pytorch > git commit --amend --allow-empty
[master 9860f92d62] A different title
 Author: Your Name <you@example.com>
 Date: Tue Apr 6 16:08:01 2021 -0700
 1 file changed, 2 insertions(+)

[mac] ~/D/pytorch > git log --pretty='%s' | head -n 1
A different title

[mac] ~/D/pytorch > ghstack submit  
...
# Summary of changes (ghstack 0.4.1)

 - Skipped https://github.com/pytorch/pytorch/pull/55418
...

[mac] ~/D/pytorch > git log --pretty='%s' | head -n 1
[Skip CI] Document '[Skip CI]'

We need more clever logic for detecting when the tree hash hasn't changed, but the commit message has changed, so we don't reconstruct the wrong commit. Also note that -u probably doesn't work without --no-skip if the tree hasn't changed.

This is fixed on master