Joan Lluch via llvm-dev
2019-Nov-08 16:28 UTC
[llvm-dev] Workflow to commit changes using git alone (?)
Hi Melanie, Thanks for your reply, but if I understand it well, this implies making changes to the local ‘main’ branch, and push from that, which is what I want to avoid. But still, if I push from ‘main’, how do I fold a number of local commits into a single one, with a single comment, as appropriate for LLVM?. My workflow consists on creating different local branches to avoid changes on the ‘main’ branch. This allows me a couple of things: First, I always keep my local ‘main’ branch in sync with the remote one, so it’s very easy to spot differences with my working ones by just running diff between them. Second, I can do an undo things, or test them in my working branches as many times as I want and commit often. I can even start from scratch from main again by just creating a new branch from that, without ever messing with the ‘main’ branch. Also, separating work into branches allows for implementing another patch while a previous one is waiting review, (while still never touching ‘main’). In the past, I worked using a similar environment on a small team. Everyone's local changes were pushed to the remote repo at the end of the day by first merging into our local ‘main’ and then pushing to the remote ‘master’. This works on a small team because it doesn’t matter if a number of local commits get pushed together. Also everybody is happy to fix conflicts created by others if they happen, as there’s no ‘reviews’ to begin with. In the case of LLVM it’s desirable that every reviewed patch is pushed as a single commit with the appropriate comment. Ideally, I would want to commit and push the difference between a local working branch and the ‘main’ branch, which is what I can’t figure out how do do. I would be surprised if there’s not a simple solution for that. Thanks. John> On 8 Nov 2019, at 16:24, Blower, Melanie <melanie.blower at intel.com> wrote: > > > >> -----Original Message----- >> From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Joan Lluch via >> llvm-dev >> Sent: Friday, November 8, 2019 6:35 AM >> To: llvm-dev <llvm-dev at lists.llvm.org> >> Subject: [llvm-dev] Workflow to commit changes using git alone (?) >> >> Hi all, >> >> I have recently given commit access to LLVM and successfully pushed a test >> commit from my local master branch. >> >> However, I can’t find which is the recommended workflow for committing more >> serious stuff using git alone. I have read the docs but everything seems to still >> require svn before bridging to github. I want to use git alone to commit a patch >> that I got reviewed. > [Blower, Melanie] > I recently made my first commit to llvm using git, I can't speak to whether this is recommended flow. First get code review and approval, then: > git clone https://github.com/llvm/llvm-project.git ## get the llvm tree > ## apply your patch, test your patch > Git add ... files > Git commit ... commit message should include url to the phabricator review > Git pull --rebase ## if your clone is behind master, do this to pull in the changes neatly > Git push ## This will prompt you to provide github identity > >> >> I currently have a local 'master' branch that I keep identical to the upstream >> branch. I also have another local branch (let's call it 'patchbranch' for the >> purposes of this question) where I committed the changes for the patch I want >> to push. I created the diff file by running git diff to compare my local 'master' >> with 'patchbranch’ branches and uploaded the file to Phabricator. I got the >> patch reviewed and I want to commit it now to the upstream master. I make >> sure my 'patchbranch' catches all the upstream changes by pulling from >> 'master', merging 'master' into my 'patchbranch and running the relevant tests. >> >> I want to push my local 'patchbranch' to the upstream ‘master’ in GitHub >> without affecting my local master branch. I also need to make sure that my >> patch is pushed as a single commit. I do not want to merge my local >> 'patchbranch' into my local 'master' because I want to keep my local 'master' >> clean and always identical to, or only slightly behind, the upstream branch. >> >> I have read the documentation but all the described workflows seem to imply >> the use of svn at some point, which I do not want to, or know how to use. I >> understand this is a basic question but I used git before with small teams only, so >> a detailed workflow for LLVM commits using git alone would be appreciated. >> >> Thanks, >> >> John >> >> >> >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Robinson, Paul via llvm-dev
2019-Nov-14 18:55 UTC
[llvm-dev] Workflow to commit changes using git alone (?)
Sigh... okay now it's my turn to wonder what obvious mistake I made.> git push -vPushing to https://github.com/llvm/llvm-project.git remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/llvm/llvm-project.git/' I was kind of expecting it to prompt me... here are some possibly relevant git-config settings: user.name=Paul Robinson user.email=paul.robinson at sony.com remote.origin.url=https://github.com/llvm/llvm-project.git I haven't put my github account name in anywhere, am I supposed to? I do have a key set on the account, but I might have messed up when trying to put it in a right place on my Windows system. FTR the website instructions still talk about using "git llvm push" which IIUC is Not A Thing anymore. Thanks, --paulr
Shoaib Meenai via llvm-dev
2019-Nov-14 19:02 UTC
[llvm-dev] Workflow to commit changes using git alone (?)
If you want to use your key to authenticate, you need to set your remote URL to the SSH one: git remote set-url --push origin git at github.com:llvm/llvm-project.git You can get the SSH URL by going to https://github.com/llvm/llvm-project/ and clicking on Clone or download to get the appropriate URL ... it should give you the option to Clone with SSH. I've not had a ton of luck with HTTPS authentication, but SSH has worked pretty well. I don't know how true that holds for Windows though. On 11/14/19, 10:55 AM, "llvm-dev on behalf of Robinson, Paul via llvm-dev" <llvm-dev-bounces at lists.llvm.org on behalf of llvm-dev at lists.llvm.org> wrote: Sigh... okay now it's my turn to wonder what obvious mistake I made. > git push -v Pushing to https://github.com/llvm/llvm-project.git remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/llvm/llvm-project.git/' I was kind of expecting it to prompt me... here are some possibly relevant git-config settings: user.name=Paul Robinson user.email=paul.robinson at sony.com remote.origin.url=https://github.com/llvm/llvm-project.git I haven't put my github account name in anywhere, am I supposed to? I do have a key set on the account, but I might have messed up when trying to put it in a right place on my Windows system. FTR the website instructions still talk about using "git llvm push" which IIUC is Not A Thing anymore. Thanks, --paulr _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=tCtJZFKXR6ZBxmqfdPPc5Rlq4KrHFSfF_msBLD5CM2o&s=U15_l_8dpYafFF0VYL29EfMczDnlvdqYxNhsE17KZos&e=