Phabricator workflow with Git

From: Danilo G. Baio <dbaio_at_FreeBSD.org>
Date: Sat, 28 Aug 2021 17:44:34 -0300
Hi.

I'm currently using this workflow:

- - - - - - - - - - - - - - - - - - - - - - - - -

// Create a new branch
$ git checkout -b FEATURE

// Change stuff and git commit
// Note that you already can include the Review information in
// Phabricator format.

```
  <<Replace this line with your Revision Title>>

  Summary:

  Test Plan:

  Reviewers:

  Subscribers:
```

// Open a review with the first commit
$ arc diff --create HEAD~


// If it's accepted, fix the commit log message, rebase with main
// branch, and push

$ git commit --amend
$ git rebase -i main
$ git push remote_name FEATURE:main


// If it's NOT accepted
// Change stuff and add a second git commit

// Update review with the two commits
$ arc diff --update DXXXXX HEAD~2

// If it's accepted, you can soft reset both commits and do a new one
// or, just use `git merge and squash`.

// merge/squash way
// Set the second commit to be squashed

$ git rebase -i main

```
  pick   954c5d4626 Readme: First commit
  squash 7231873f23 Makefile: Second commit
```

or

$ git reset --soft HEAD~2
// And add a final commit



// Submit
$ git push remote_name FEATURE:main

// Delete FEATURE branch

$ git checkout main
$ git pull origin main --no-ff
$ git branch -d FEATURE

- - - - - - - - - - - - - - - - - - - - - - - - -


That is it.

I know there are git-arc (tools/tools/git-arc) on base, but I still
didn't use it.

I just want to check if there are other ways to do that (that you
recommend), or if can I document it, at least for now, on our
Phabricator Wiki page [1].


1 - https://wiki.freebsd.org/Phabricator

Regards.
-- 
Danilo G. Baio (dbaio)

Received on Sat Aug 28 2021 - 20:44:34 UTC

Original text of this message