Skip to content

Conversation

@ahh-docker
Copy link
Contributor

Signed-off-by: Anne Henmi anne.henmi@docker.com

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@ahh-docker
Copy link
Contributor Author

@andrewhsu PTAL.

@ahh-docker
Copy link
Contributor Author

Related to docker/docs#7281

@ahh-docker
Copy link
Contributor Author

ahh-docker commented Dec 17, 2018

Issue is in docker.github.io: docker/docs#7281

@codecov-io
Copy link

codecov-io commented Dec 17, 2018

Codecov Report

Merging #1578 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1578   +/-   ##
=======================================
  Coverage   55.25%   55.25%           
=======================================
  Files         289      289           
  Lines       19395    19395           
=======================================
  Hits        10716    10716           
  Misses       7983     7983           
  Partials      696      696

@codecov-io
Copy link

Codecov Report

Merging #1578 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1578      +/-   ##
==========================================
- Coverage   55.26%   55.24%   -0.02%     
==========================================
  Files         289      289              
  Lines       19385    19381       -4     
==========================================
- Hits        10713    10707       -6     
- Misses       7977     7978       +1     
- Partials      695      696       +1

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "promote-node-7281" git@github.com:ahh-docker/cli.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354056936
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

@ahh-docker
Copy link
Contributor Author

@thaJeztah PTAL. Merge if it's ready.

@thaJeztah
Copy link
Member

@ahh-docker can you squash your commits, and make sure it has a sign-off? Otherwise CI will fail

@ahh-docker
Copy link
Contributor Author

@thaJeztah I think I did it. Can you check and see if it's gtg?

@thaJeztah
Copy link
Member

Hmm. It think something went wrong, as I see a merge commit in there, and four commits total.

Let me try describe the steps;

Checkout your branch

git checkout promote-node-7281

Make sure your remotes are up-to-date (in my case the "upstream" points to docker/cli, and "origin" points to my fork (thaJeztah/cli));

git fetch upstream -v; git fetch origin -v; 

Start an interactive rebase against the "upstream master"; the "merge" commit should already dissappear, but to combine the changes of the other commits, we'll have to "squash" them;

git rebase -i upstream/master

Doing the above should open your editor with something like below:

pick f58964ed Fixed wording per https://github.com/docker/docker.github.io/issues/7281
pick c0f6aab4 Fixed wording per https://github.com/docker/docker.github.io/issues/7281
pick 581b7684 Update node_promote.md

# Rebase 6deb4f1f..150c3294 onto 6deb4f1f (3 commands)
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out

Looks like the first commit actually has a merge conclict, so we'll drop that one (which can be done either by changing pick to drop, or by removing the line)
and you want to squash the last two commits so edit the last line and change pick to squash (or s);

drop f58964ed Fixed wording per https://github.com/docker/docker.github.io/issues/7281
pick c0f6aab4 Fixed wording per https://github.com/docker/docker.github.io/issues/7281
squash 581b7684 Update node_promote.md

Once you save the file, and exit your editor, another file is opened, allowing you to update the commit message of the combined commits;

# This is a combination of 2 commits.
# This is the 1st commit message:

Fixed wording per https://github.com/docker/docker.github.io/issues/7281

Signed-off-by: Anne Henmi <anne.henmi@docker.com>

# This is the commit message #2:

Update node_promote.md

You could change it to, e.g.

docs: clarify that node promote/demote must be executed from a manager

Fixed wording per https://github.com/docker/docker.github.io/issues/7281

Signed-off-by: Anne Henmi <anne.henmi@docker.com>

After you saved the description, the rebase/squash should be succesful, now you need to force push your changes to update the PR (assuming the remote pointing to your fork is named "origin");

git push -f origin

@ahh-docker
Copy link
Contributor Author

ahh-docker commented Dec 21, 2018

@thaJeztah

So I got this far:

$ git checkout promote-node-7281
Already on 'promote-node-7281'
Your branch is up to date with 'origin/promote-node-7281'.
$ git fetch upstream -v; git fetch origin -v; 
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
From github.com:ahh-docker/cli
 = [up to date]        promote-node-7281       -> origin/promote-node-7281
 = [up to date]        18.06                   -> origin/18.06
 = [up to date]        18.09                   -> origin/18.09
 = [up to date]        extra_greater_than_7220 -> origin/extra_greater_than_7220
 = [up to date]        master                  -> origin/master
AH-MBP13-2017:/Users/annehenmi/repos/ahh-fork-cli- git remote
origin
upstreamengcli
$ git remote -v
origin	git@github.com:ahh-docker/cli.git (fetch)
origin	git@github.com:ahh-docker/cli.git (push)
upstreamengcli	git@github.com:docker/cli.git (fetch)
upstreamengcli	git@github.com:docker/cli.git (push)
$ git rebase -i upstream/master
fatal: Needed a single revision
invalid upstream 'upstream/master'

Got some help.. moving on.

Fixed wording per docker/docs#7281

Signed-off-by: Anne Henmi <anne.henmi@docker.com>

Update node_promote.md
@ahh-docker
Copy link
Contributor Author

@thaJeztah Ok, I went through the steps and fixed it. Let me know if there's anything else it needs. PTAL again. Sorry.

@thaJeztah
Copy link
Member

$ git remote -v
origin	git@github.com:ahh-docker/cli.git (fetch)
origin	git@github.com:ahh-docker/cli.git (push)
upstreamengcli	git@github.com:docker/cli.git (fetch)
upstreamengcli	git@github.com:docker/cli.git (push)

Ah, yes, that's why I usually recommend to use consistent names for your remotes, then you can work in any repository and always use the same commands (e.g.upstream for the upstream repository, and origin to reference your own fork of the repository)

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! changes LGTM, but I was looking at other commands, and it looks like there's more to address. I did a quick attempt for an alternative in #1590 @ahh-docker let me know what you think of that approach (also left some comments on it that I could use some input on)

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐯

@vdemeester vdemeester merged commit 5d3906c into docker:master Dec 24, 2018
@GordonTheTurtle GordonTheTurtle added this to the 19.03.0 milestone Dec 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants