Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>git log --format="pick %h %s" --reverse -- dir1/ dir2/ </code></pre> <p>could be written</p> <pre><code>git log --format="pick %h %s" --no-walk \ $(git rev-list --reverse -- dir1/ dir2/) </code></pre> <p>That is, using</p> <pre><code>git rev-list HEAD -- dir1/ dir2/ </code></pre> <p>to get the list of 'raw' revision ids. Now to get the complementary set of revision ids, I suggest something like </p> <pre><code>sort &lt;(git rev-list HEAD) &lt;(git rev-list HEAD -- dir1/ dir2/) | uniq -u </code></pre> <h3>Integrating it all</h3> <p>the complementary set would become</p> <pre><code>git log --format="pick %h %s" --no-walk \ $(git rev-list --no-walk --reverse \ $(sort &lt;(git rev-list HEAD) \ &lt;(git rev-list HEAD -- dir1/ dir2/) | uniq -u)) </code></pre> <p><sub>note both <code>--no-walk</code> parameters there, they are crucial</sub></p> <h3>Recommendations</h3> <ol> <li>I highly recommend making bash functions or scripts to implement the substeps here</li> <li><strong>If you are just looking for a way to split repositories, <a href="http://git-scm.com/docs/git-filter-branch" rel="nofollow">look into git-filter-branch</a></strong> instead! <ul> <li>it will enable you 'mask' (remove) the unwanted part of the tree for each revision</li> <li>allows you to skip <em>effectively empty</em> revisions, like you want</li> <li>the man page contains samples for just that</li> <li>it will work (<em>correctly</em>) if a single commit edited both parts of the repo</li> <li>remember the <code>--tag-name-filter cat</code> option</li> </ul></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload