<div dir="ltr">That would be somewhat tricky to implement in the svn conversion pipeline, as the current process is not based on, and does not interact in any way with the "split" svn2git-based repository generation process. It would require linking or merging the two processes.<div><br></div><div>I'd have to:</div><div>1. Ensure I have an updated set of svn2git repositories with the correct hashes for the newest commit, by either:</div><div> a. Integrating the svn2git generation pipeline and the monorepo generation pipeline together.</div><div> b. Polling the github/<a href="http://git.llvm.org">git.llvm.org</a> repositories waiting for the required commits to appear in all the right projects.</div><div>2. After getting the finished svn2git hashes, extract the new mappings, and pass that into the monorepo conversion script.</div><div><br></div><div>On the other hand, modifying migrate-downstream-fork.py to put the original hash into the description for the git-only (NON-upstream-svn) commits would be easy. Having the original hash in the description for those git-only commits might be 95% of the value for people anyways?</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 6, 2018 at 2:26 PM Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 6, 2018 at 7:29 AM Joseph Tremoulet via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_5124739928473958933m_2960341723079229591WordSection1">
<p class="MsoNormal">Would it help to include the llvm-mirror commit hashes in the new commit messages?  Currently the conversion injects “llvm-svn:<revision>” into the commit messages; it seems like with a bit of work it could also inject “llvm-mirror/<subproject>:<hash>”,
 couldn’t it?  I realize that’s still just providing a way to manually look up new hashes from old hashes, and Justin has explained why that’s still painful, but I’m wondering if it would be more palatable with the mapping a bit more discoverable that way,
 and consistent across different projects in this boat, and with no more tooling required than `git log --grep <old_hash>` to look up a new hash…</p></div></div></blockquote><div><br></div><div>FWIW, I think adding the "official" git mirror hashes along side the svn revision to the commit messages would be great if it can be implemented reasonably easily.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_5124739928473958933m_2960341723079229591WordSection1"><p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b>From:</b> llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>> <b>On Behalf Of
</b>James Y Knight via llvm-dev<br>
<b>Sent:</b> Friday, November 2, 2018 5:56 PM<br>
<b>To:</b> Justin Bogner <<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>><br>
<b>Cc:</b> llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></p></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_5124739928473958933m_2960341723079229591WordSection1"><p class="MsoNormal"><br>
<b>Subject:</b> Re: [llvm-dev] RFC: Dealing with out of tree changes and the LLVM git monorepo<u></u><u></u></p></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_5124739928473958933m_2960341723079229591WordSection1"><p class="MsoNormal"></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Fri, Nov 2, 2018 at 2:11 PM Justin Bogner <<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>> wrote:<u></u><u></u></p>
</div></div></div></div></div></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_5124739928473958933m_2960341723079229591WordSection1"><div><div><div><div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">James Y Knight <<a href="mailto:jyknight@google.com" target="_blank">jyknight@google.com</a>> writes:<br>
> Thanks for writing this up. I think it's a really important point which<br>
> deserves discussion.<br>
><br>
> Ultimately, I think it is a question as to whether to prioritize the easy<br>
> switchover for existing out of tree forks, or to prioritize having the best<br>
> conversion we can make. I feel very strongly that the latter should be the<br>
> priority for the official repository conversion, and that, therefore, we<br>
> should not use the zipper method for the official repository going forward.<br>
<br>
How do you define "best conversion" here? I may be missing something,<br>
but I really don't see any actual advantage to re-writing the git<br>
history from scratch rather than leveraging the existing git mirrors to<br>
build a monorepo.<br>
<br>
The re-generated history approach gives us an artificial alternate<br>
history where we developed in a git monorepo from the beginning of time.<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I note that "we", where "we" = llvm upstream developers, *have* been developing in a monorepo -- an SVN monorepo, with a linear history. The llvm-git-prototype repository better matches this actual development history.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">It throws away a bunch of information for the sake of making a<br>
"pristine" conversion with fewer branches, even though those branches<br>
have almost zero cost.<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">You mean "merge commits" here, not "branches", I believe, since your repository has a single branch, "master".<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">The zipper approach gives us the best of both worlds - it provides a<br>
monorepo view for all time for anyone who wants it, but also preserves<br>
the history that people have been using and relying on for a number of<br>
years.<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">I'd like to hear what you think are the actual disadvantages of the<br>
zipper approach. I've spoken to quite a few people about it in the last<br>
few days and I haven't really found any yet.<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">The downside, generally, is that it makes the history _very_ complex. Which is not necessarily bad, in of it self, but it's not really representative of the development history of llvm, and it turns out that it causes problems.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Two concrete disadvantages have been mentioned on this thread, already:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">1. gitk cannot be used -- it just falls over when given the history with 300000 merges.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">2. git bisect becomes somewhat trickier.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I'd add a couple more to that:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">3. "git log -u llvm/" no longer works (for any file/path), because the commits which *actually* changed the files don't occur at that path, and the default is to omit diffs arising in a merge commit. (The actual content change happened
 at a different path -- the root of the tree, not under "llvm/", and is just moved under llvm/ in the merge commit.)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">You can work around this, via "git log -u -m --first-parent llvm/" to get the diffs from the merge commit itself. But this is a large annoyance -- looking at path histories is a very common task. Making matters worse right now is that the
 zipper merge-commit doesn't have the full commit message, only the first line. That, at least, can be fixed.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">4. Other commands like "git log -u -S CFGStackify" become trickier -- it returns the individual project commit, not the merge commit, and gives the "wrong" pathnames (without the subproject prefix). So every time you look at one of these,
 you need to map it back yourself.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Those are just the first things I tried -- I think there will be *more* variants of these sorts of issues which will show up with further attempts to use a repository built in this style. Certainly none of this is FATAL problems, but will
 be a constant irritation.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Consider a world where I convert all of my branches as-if they were<br>
based on the monorepo. Now, something comes up and I need to hot fix<br>
last year's branch. I probably can't actually submit this fix from the<br>
monorepo, since it would be too disruptive to also hot fix the<br>
configuration changes to submit from a new layout of repositories. Now I<br>
need to maintain two copies of my code and manage merging between them<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I can't speak to your exact problem, not knowing anything about your infrastructure or workflows. But, if you were to want to keep using your old separated repositories for your old branches, and to switch only master and future branches
 over to the new monorepo, "git format-patch" and "git apply" do make copying commits or stacks of commits between completely different repositories (even between split and mono repositories) relatively straightforward.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">[...]<u></u><u></u></p>
</blockquote>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal"> <u></u><u></u></p>
</blockquote>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">So, we publish two competing versions of the git history and let people<br>
choose? This sounds like a splitting the baby type solution to me ;)<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">The point here is not to offer "competing" versions -- the llvm-git-prototype monorepo (with the linear history) would be the official repository, recommended by default for everyone.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">The technique outlined above simply offers a solution for those who may desire to have their historical commits appear in the zipper-merge fashion, to do so up to the point in history where they last pulled from the split git repositories
 into their private forks, and to then switch to the official monorepo afterward.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I'd still recommend avoiding that, generally, because of the issues caused by the more complex structure of the zipper-repository. But if that's the path that is best for your repository and infrastructure, I believe it's feasible to do
 so without needing to impact others.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div></div></div></div>

_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>
</blockquote></div>