Paul C. Anagnostopoulos via llvm-dev
2020-Aug-10 13:30 UTC
[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.
Robinson, Paul via llvm-dev
2020-Aug-10 14:07 UTC
[llvm-dev] How to deal with multiple patches to the same file
> -----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
Paul C. Anagnostopoulos via llvm-dev
2020-Aug-10 14:36 UTC
[llvm-dev] How to deal with multiple patches to the same file
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
James Henderson via llvm-dev
2020-Aug-11 11:33 UTC
[llvm-dev] How to deal with multiple patches to the same file
Just chiming in to mention that there are two ways I know of in Phabricator to say that two patches are dependent on one another. 1) In the patch description, put "Depends on DXXXXXX" (where XXXXXX is the patch number the new patch depends on). 2) In the Phabricator UI, there's an "Edit Related Objects" option on the right of the description, which you can use to enter other revisions that either rely on the patch, or that the patch relies on. Note that this doesn't affect the diff at all, so you usually will want a diff of the commit versus the previous commit in your chain, rather than against the head of master, when doing that, to avoid things showing up that were changed earlier in the series. You can view the patch series/tree by the "Stack" option in the UI, which appears when a patch either has dependent revisions, or it depends on them. The text for this option will appear in red with a number if there are any patches that need to land before that one does, according to the hierarchy - it's very easy to mix up the order, so it's good to check out the tab to make sure things look right. On Mon, 10 Aug 2020 at 15:07, Robinson, Paul via llvm-dev < llvm-dev at lists.llvm.org> 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 > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200811/66db82c3/attachment.html>