Closed trivikr closed 3 years ago
It will fail when you run git node land --final
though (that's when core-validate-commit
gets invoked). Have you run that? Or just run git node land --continue
until it invokes the validations?
Also, if I understand correctly, you are suggesting that git node
should do the validation before the squashing happens? But then the tool cannot know which commit will stay and need to be validate at the point, can it?
I don't think I ran git node land --final
before landing.
I'd just run the command which was suggested for squashing commits. I remember it as I didn't have to manually replace pick
to f
as I'd to do in the past.
The validation should be done after the squashing happens, either the user:
git node land --final
git node land --final
runs automatically after squashingThis quick issue was created for logging purposes, I'll recreate a scenario to provide details.
If you don't use ncu every day, it's easy to forget to run git node land --continue
(or --final
which I didn't know was a thing!). I'm not sure what a good solution would be unless we think it's a good idea to have it launch git rebase -i
for you rather than drop you into a shell. The idea is that if it launched it for you, it can automatically continue when the rebase is done. (I'd be for it running git rebase -i
for you rather than dropping you into a shell, but I'm not sure it would work with everyone else's workflow.)
(Also: I'm glad to be having these kinds of issues. Like, this is way better than the issues we were dealing with in the pre-ncu days!)
Tested with landing fake change https://github.com/nodejs/node/pull/23235, and noticed that git node land --final
does catch issues with commit as @joyeecheung mentioned in her comment
Outputs while trying to land:
```
✔ Done loading data for nodejs/node/pull/23235
----------------------------------- PR info ------------------------------------
Title [DO NOT LAND] Testing squashing while landing with git-node (#23235)
⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch trivikr:trivikr-patch-1 -> nodejs:master
Labels doc
Commits 4
- Testing squashing while landing with git-node
- Another commit to add to the PR
- One more commit!
- Adding sample text
Committers 2
- GitHub
``` Executing: git node land --amend --------------------------------- New Message ---------------------------------- Testing squashing while landing with git-node commit for testing squashing with node-core-utils https://github.com/nodejs/node-core-utils/issues/283 PR-URL: https://github.com/nodejs/node/pull/23235 -------------------------------------------------------------------------------- ? Use this message? [Y/n] Y interactive rebase in progress; onto 37e8381150 Last commands done (2 commands done): pick 90d381469a Testing squashing while landing with git-node exec git node land --amend Next commands to do (6 remaining commands): fixup b6bf7f3daf Another commit to add to the PR exec git node land --amend You are currently editing a commit while rebasing branch 'master' on '37e8381150'. No changes You asked to amend the most recent commit, but doing so would make it empty. You can repeat your command with --allow-empty, or you can remove the commit entirely with "git reset HEAD^". warning: execution failed: git node land --amend You can fix the problem, and then run git rebase --continue ```
``` Executing: git node land --amend --------------------------------- New Message ---------------------------------- Testing squashing while landing with git-node commit for testing squashing with node-core-utils https://github.com/nodejs/node-core-utils/issues/283 PR-URL: https://github.com/nodejs/node/pull/23235 -------------------------------------------------------------------------------- ? Use this message? [Y/n] Y [detached HEAD ad4220cde3] Testing squashing while landing with git-node Author: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue Oct 2 22:30:06 2018 -0700 1 file changed, 1 insertion(+) Executing: git node land --amend ⚠ Found PR-URL: https://github.com/nodejs/node/pull/23235, skipping.. --------------------------------- New Message ---------------------------------- Testing squashing while landing with git-node commit for testing squashing with node-core-utils https://github.com/nodejs/node-core-utils/issues/283 PR-URL: https://github.com/nodejs/node/pull/23235 -------------------------------------------------------------------------------- ? Use this message? [Y/n] Y [detached HEAD 38de6289e4] Testing squashing while landing with git-node Author: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue Oct 2 22:30:06 2018 -0700 1 file changed, 2 insertions(+) Executing: git node land --amend ⚠ Found PR-URL: https://github.com/nodejs/node/pull/23235, skipping.. --------------------------------- New Message ---------------------------------- Testing squashing while landing with git-node commit for testing squashing with node-core-utils https://github.com/nodejs/node-core-utils/issues/283 PR-URL: https://github.com/nodejs/node/pull/23235 -------------------------------------------------------------------------------- ? Use this message? [Y/n] Y [detached HEAD 9be43a85e0] Testing squashing while landing with git-node Author: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue Oct 2 22:30:06 2018 -0700 1 file changed, 3 insertions(+) Successfully rebased and updated refs/heads/master. ```
``` ✖ 9be43a85e02d105dac07ed77c6e287162e25bacb ✔ 0:0 skipping fixes-url fixes-url ✔ 0:0 blank line after title line-after-title ✖ 1:72 Line should be <= 72 columns. line-length ✔ 0:0 metadata is at end of message metadata-end ✖ 0:0 Commit must have at least 1 reviewer. reviewers ✖ 0:0 Missing subsystem. subsystem ✔ 0:0 Title is formatted correctly. title-format ✔ 0:0 Title is <= 50 columns. title-length ```
Is there a way to inform the remind the collaborator to run git node land --final
after git rebase --continue
is done?
If not, can we add the reminder at the end of the output of first command git node land <PR-ID>
just after:
Please run the following command to complete landing
$ git rebase upstream/master -i -x "git node land --amend"
For example:
Once you're done rebasing, ensure to run the following command (and fix issues if any) before landing:
$ git node land --final
Adding another hint is a good idea!
(I was thinking if there is a command that adds git node land --final
to the end of the sequence but not sure if there is a flag to git rebase
for that)
(Also, probably a good time to record another demo again..)
Maybe we can use git hooks (i.e., the post-rewrite hook)? I never used them, so I'm not sure if that would work.
We have the following message today:
$ git rebase upstream/master -i -x "git node land --amend" --autosquash
$ git node land --continue
--continue
will run --final
, so I think we're good. Feel free to reopen if you believe we should do something else though (or feel free to open another issue)
Hi,
I faced this issue while landing commit https://github.com/nodejs/node/commit/a82ac6eedf925b8922ca2e577d0364a62dea5ad7
Creating quick issue for follow-up, will add details later. Summary: When there are multiple commits to land and node-core-utils suggests squashing, it doesn't fail if subsystem prefix (and probably other requirements) is missing.
I'll reproduce the steps and add details later.
Regards, Trivikram