Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you send code review requests with git when devs do not have public work repositories?

Tags:

git

Normally in Git, each developer will clone from the origin into a personal tracking repo, make some changes, then send a fetch request to the manager referencing his personal machine which has a git-daemon, or web server, or allows the manager to connect to it with ssh.

For some changes its alright for the dev to check in stuff himself. For larger ones, other people like to look at it before it gets checked into master. So the dev does have the privilege to check into the repository.

But what if the manager couldn't connect to other devs work machines, and only had access to the origin git repo, or email? What is the best way to send the diffs to him for review?

We could send patches in an email or the dev could push his branch out to origin and tell the manager to git fetch origin; git diff master..case223. Or is there another better way?

like image 988
Jake Avatar asked Jun 07 '11 20:06

Jake


1 Answers

I would use

git format-patch <branch-to-compare-against> --cover-letter -o patches/

which will essentially create the appropriate patches for your commits and then

git send-email --to <[email protected]> --annotate patches/*

Check the man pages:

  • format-patch
  • send-email and the example section
like image 115
c00kiemon5ter Avatar answered Sep 30 '22 05:09

c00kiemon5ter