[Openmp-dev] Splitting version changes

Hal Finkel hfinkel at anl.gov
Thu Oct 9 14:23:04 PDT 2014

----- Original Message -----
> From: "James H Cownie" <james.h.cownie at intel.com>
> To: openmp-dev at dcs-maillist2.engr.illinois.edu
> Cc: "Hal Finkel (hfinkel at anl.gov)" <hfinkel at anl.gov>
> Sent: Wednesday, October 8, 2014 2:51:44 AM
> Subject: Splitting version changes
> Over on the commits list Hal pointed out that
> > These things, and the license headers, should really be committed
> > separately.
> > There are several different ways to separate a patch file into
> > separate commits
> > (and at least several of us here who have experience doing surgery
> > on patches).
> > Feel free to ask for advice (might as well do it on the dev list:
> > it is a common problem), and you shall receive it.
> So, Hal, please enlighten us.

I'll preface this by saying that there may yet be better ways, but here's what I've used...

First, I'd be remiss were I to neglect to mention that emacs has a really-nice patch-editing mode. Here's some documentation:
and if you really need to do some non-trivial surgery directly on a patch file, I've not found a better alternative (I normally use vim, but this is the one thing for which I use emacs). To use this for splitting, you'd make several copies of the patch file and, in each, delete the non-relevant parts from each.

Next, I'll strongly recommend that you use 'git svn' to manage your interaction with the upstream subversion repository instead of using svn directly. I should mention that, since the OpenMP repository does not have much history, you can just do a full clone:
  git svn clone https://llvm.org/svn/llvm-project/openmp/trunk openmp-trunk
if you try this with LLVM or Clang, it will take a *long* time because it tries to replay the remote repository one commit at a time. For this, add -r HEAD so that it will just start at the latest commit. There's lots of information out there on using git svn, including:

To the topic at hand, once you're using git locally, you can read "Splitting up commits the easy way" (http://cbx33.github.io/gitt/afterhours5-1.html) which talks about how to use git's interactive staging feature to split up a large patch file and commit it in separate pieces. This can be done both using command-line tools and also using 'git gui' if you'd prefer the GUI-based interface.

If you'd like more information and/or help on any of these, please feel free to ask.

Thanks again,

> -- Jim
> James Cownie <james.h.cownie at intel.com>
> SSG/DPD/TCAR (Technical Computing, Analyzers and Runtimes)
> Tel: +44 117 9071438
> ---------------------------------------------------------------------
> Intel Corporation (UK) Limited
> Registered No. 1134945 (England)
> Registered Office: Pipers Way, Swindon SN3 1RJ
> VAT No: 860 2173 47
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.

Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory

More information about the Openmp-dev mailing list