[llvm-dev] How to deal with multiple patches to the same file

Paul C. Anagnostopoulos via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 10 07:36:32 PDT 2020


I think I understand the concepts, but I sure would appreciate a specific example, and I appreciate the offer. To make your life harder, could you start with what I should do given that I have not created a branch for the first patch? I just have the six files staged.

I have GitHub Desktop installed, if that makes any of the steps easier.

Thanks again, and no rush!

At 8/10/2020 10:07 AM, Robinson, Paul wrote:

>> -----Original Message-----
>> From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Paul C.
>> Anagnostopoulos via llvm-dev
>> Sent: Monday, August 10, 2020 9:30 AM
>> To: llvm-dev at lists.llvm.org
>> Subject: [llvm-dev] How to deal with multiple patches to the same file
>> 
>> I have submitted a patch to Phabricator that includes the TableGen file
>> TGparser.cpp. Now I want to fix a bug in that file. What is the proper
>> procedure so that the two patches don't get screwed up, either in my
>> repository or in the master repository? Please answer as if I'm a
>> git/Phabricator idiot, because, well, I am.
>> 
>> I should note that all I did in my repository for the first patch was
>> stage the files and then do a diff --staged. Those files remain staged
>> because I'm not sure what to do with them given that we use Phabricator
>> and not pull requests.
>
>(I'm not completely giving you recipes; if you need more explicit steps
>then let me know and I'll do a full-on example.)
>
>Even though we don't use pull requests, I still tend to commit my patches
>to branches off of master, in my local clone.  This allows `git show` to
>generate the diff.  As master advances, you update your master branch and
>then on the patch branch, a simple `git rebase master` updates it.
>
>Assuming the patch is approved, on master you can `git merge --ff-only`
>to move the patch to your local master, and then push it from there.
>
>If the bugfix is not near your other changes, and can be made independently,
>then you can treat it as a fully independent patch on its own branch.
>
>If the bugfix is near your other changes or is dependent on it, then I'd
>create a second patch branch based on the first patch branch.  As before,
>`git show` generates the diff, and in Phabricator there's a way to mark
>the second patch as dependent on the first patch.  I haven't done this
>personally so I'm unclear about the exact steps, but I see people doing
>"patch series" all the time.
>
>HTH and again let me know if you need a more explicit example.
>--paulr
>
>> 
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


----------------------------------------------------------------
Windfall               Paul C. Anagnostopoulos 
      ----------------------------------------------------------
   Software            978 369-0839
                             www.windfall.com
----------------------------------------------------------------
My life has been filled with calamities,
some of which actually happened.
---Mark Twain 

Guga 'mzimba, sala 'nhliziyo  



More information about the llvm-dev mailing list