From: Paul C. Anagnostopoulos <paul@windfall.com>
Sent: Monday, August 10, 2020 2:13 PM
To: Robinson, Paul <paul.robinson@sony.com>
Cc: 'llvm-dev@lists.llvm.org' <llvm-dev@lists.llvm.org>
Subject: RE: [llvm-dev] How to deal with multiple patches to the same file
I owe you a gala dinner at your favorite restaurant. Really.
A few questions:
Why did you 'git pull --rebase' when the branch was up-to-date? Is this
just a safety habit?
Yes. Frequently I put my patches on my local master branch, rather
than create a separate patch branch, and always rebasing keeps my
commits at the HEAD of the branch. It's harmless when you have no
local commits, so it's a good habit to form.
I don't understand the pushing upstream. Since we use Phabricator, isn't
that the job of the person who commits the patch?
Soon enough (if you keep contributing) you'll get commit access and
be doing that yourself. LLVM is a lot more liberal about commit
privileges than many open-source projects.
Does git keep all my branches up-to-date with the origin? Say I come in
tomorrow and start working on a branch. Should I make sure I do a checkout
on it again?
Git is designed to run "disconnected" and does nothing automatically
to keep your clone up-to-date with its origin. You need to decide for
yourself often to update your local master branch from origin. I
have a nightly cron job on Linux, and the Windows equivalent. Some
people do it weekly, some don't automate it and just pull manually
whenever it's convenient. Partly this depends on how long your build
takes and whether you leave your computers on overnight.
Any branch you create locally will stay until you explicitly delete it.
This project does not want you pushing your branches to origin; that
will change if/when we move to pull requests, but for now, keep them
local.
Is it sufficient to do a 'git show' and submit with Arcanist, or is there
an intermediate step to format the patch file?
I've never used Arcanist so I don't really know, but I expect it's fine.
'git show' works for uploading directly to Phab, as would 'git diff' and
'git format-patch'. There might be an 'arc diff' I don't know.
Note that 'git show' by default only shows you the HEAD commit; if you
add commits to your patch branch, you'll need to specify the range of
commits to diff/show/whatever. Phab doesn't keep track, the revisions
aren't cumulative.
I should say that we want "full context" diffs in Phab, meaning for any
of these commands you should use `-U999999` so people can see all the
context directly in the GUI.
--paulr