Folks, I'm now using the git mirror, but I'm not sure how to commit changes via git, if at all possible. So far, I'm diffing & applying it on an RW svn tree and committing, but that makes me test twice and it's error prone. I read the manual regarding git-svn setup and all it has is the connection to svn to keep svn's linearity, but nothing on commit strategy. With git, I normally issue a pull request, but in LLVM, this won't work. Is there a FAQ/doc/manual on how to do that or what are the best practices when working with git? -- cheers, --renato http://systemcall.org/
Renato Golin <rengolin at systemcall.org> writes:> I'm now using the git mirror, but I'm not sure how to commit changes > via git, if at all possible. So far, I'm diffing & applying it on an > RW svn tree and committing, but that makes me test twice and it's > error prone.git svn dcommit [snip]
On Mon, Dec 31, 2012 at 4:56 PM, Renato Golin <rengolin at systemcall.org> wrote:> With git, I normally issue a pull request, but in LLVM, this won't > work. Is there a FAQ/doc/manual on how to do that or what are the best > practices when working with git?Basically, once you are set up with git-svn (see <http://llvm.org/docs/GettingStarted.html#for-developers-to-work-with-git-svn>), all you have to do is `git svn dcommit`. My workflow when it comes time to commit is basically: 1. checkout master and pull from origin. 2. rebase stuff to be committed onto master. 3. `git svn dcommit --dry-run` to see what is going to be committed. 4. `git svn dcommit --interactive` to doublecheck that the right stuff is being committed as you send it off. steps 3 and 4 can become just `git svn dcommit`, but once I had git-svn get confused (I have no clue why) and try to re-commit other commits that were already checked in, so I've decided to play it safe. Actually, I think that 1 and 2 might be automatically handled by git-svn, but I prefer to be a bit more explicit about it. This probably deserves to be mentioned on a "Workflows" document, listing a sampling of the different development workflows that people use when developing LLVM. I've been wanting to write a document like that for a while now, and this thread might be just the impetus I need (if you're interested in this please say so). -- Sean Silva
On 1 January 2013 00:52, Sean Silva <silvas at purdue.edu> wrote:> Basically, once you are set up with git-svn (see > <http://llvm.org/docs/GettingStarted.html#for-developers-to-work-with-git-svn>), > all you have to do is `git svn dcommit`.Oh, the docs do mention "dcommit" en passant, but nothing explicit.> 1. checkout master and pull from origin. > 2. rebase stuff to be committed onto master.Can you commit directly from branches? Or do you have to merge to master to commit?> 3. `git svn dcommit --dry-run` to see what is going to be committed. > 4. `git svn dcommit --interactive` to doublecheck that the right stuff > is being committed as you send it off.I agree on being explicit. I generally prefer to write small shell scripts that will stop on unwanted situation than hope for git/svn to be safe. From experience, neither is completely trustworthy, though I, too, can't blame the tools without blaming myself. ;)> This probably deserves to be mentioned on a "Workflows" document, > listing a sampling of the different development workflows that people > use when developing LLVM. I've been wanting to write a document like > that for a while now, and this thread might be just the impetus I need > (if you're interested in this please say so).If you're up to writing the docs, I'd be happy to serve as the Guinea pig to test it. -- cheers, --renato http://systemcall.org/