Skip to content

Drill Commit Guidelines

Paul Rogers edited this page Apr 13, 2020 · 3 revisions

Note: these are out of date after the move to GitBox.

Originally from Sudheesh: Pointers for Committing to Apache Master

In my local repository of drill:

Commit right allows you to push to “master” branch of the “upstream” remote. I am not sure if there is an “ssh” version of the upstream remote. I use “https” so that I am forced to type in password every time (as a final check to avoid mistakes).

These are the steps I follow for committing patches. I put comments in parens. (Paul's notes in italics.)

  • Check out master branch, and pull to ensure local master is in sync with upstream master
  > git checkout master
  > git pull
  • Create a merge branch, e.g. “MERGE-022417-00” which the the first merge branch for the day.
  > git checkout -b MERGE-022417-00

(Alternative label: MERGE-YYMMDD-NN, such as MERGE-170620-01.)

  • From other’s remote branches, cherry pick the to-be-committed patches, making sure that the commit SHAs on branches match commit SHAs on pull requests with +1s from committers

(To get just the remote branch in question:)

  > git fetch <user> <branch>

(Or, use the command line:)

  > git fetch apache pull/ID/head:PR-ID

(Suppose you want PR 123. Use pull/123/head:PR-123. This creates a new branch PR-123 locally.)

(I use SourceTree to track everyone’s remotes.)

  > git cherry-pick dd308af

(Above command changes commit SHAs.)

  • Edit all commit messages to add “closes #PRNO” as the last line, e.g. “closes #713”. This tag hints to the Apache GitHub bot to automatically closes that pull request once committed to master.

(I use SourceTree to interactively rebase from the current master branch, which allows for editing the commit messages in GUI.)

(For a single commit from the command line:)

  > git commit --amend

(Editing commit messages changes commit SHAs.)

  • Push the merge branch to origin
  > git push origin MERGE-022417-00
  • Run pre-commit tests against that branch, and ensure all is green

  • Rebase master onto the merge branch

  > git checkout master

  > git rebase MERGE-022417-00

(Above command preserves commit SHAs.)

  • And then push (no force pushing)
  > git push upstream master
Clone this wiki locally