[llvm-dev] How to deal with accidental directory tree deletes, downstream?

Mike Edwards via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 17 08:51:52 PDT 2019

Hey Paul,
Maybe use a pull request type model for merging in upstream commits to your
internal repository?  I know it is not the cleanest method of merging
upstream commits, but it would allow you to gate your upstream merges on a
quick and dirty merge test and then you could alert an engineer to the
merge problem before it hits your mainline branch?  In the scenario you
described below, r358546 would have come in on a separate branch and
attempted to merge with master (assuming your main dev branch is called
master).  When the merge failed an engineer could have been notified and
begun to work through the issue to see what the best course of action would
be.  I'm really over simplifying here, but the point is, when possible,
test each commit coming from upstream in as much isolation as possible,
prior to merging.  I'm a big fan of pre-commit testing and of pull
requests.  If there is a way, which works for you to integrate automated
pull requests into the upstream merging workflow, it may be of benefit.
Hope this helps.


On Wed, Apr 17, 2019 at 5:36 AM via llvm-dev <llvm-dev at lists.llvm.org>

> Hello fellow downstream residents,
> I see that r358546 accidentally deleted an entire subtree, which was
> reverted in r358552.  This of course caused a big merge conflict in
> our local repo, and internally we've been debating tactics for dealing
> with it, hopefully without losing our original history.
> Has anyone else handled this in a way that they are happy with?  We
> found a StackOverflow post that is potentially helpful:
> https://stackoverflow.com/questions/44990103/how-to-undelete-file-in-git-and-keep-his-original-blame-history
> Doing this on our local copy of the upstream repo means we would not
> have an exact copy anymore, which seems like a Bad Idea.
> Is there a smooth way to resolve the merge conflict that does *not*
> delete our local tree? I suppose we can somehow not accept the
> accidental deletes, and then when we run forward to r358552 it will
> decide we already have those files and it will Just Work?
> Tips and hints welcome.
> Thanks,
> --paulr
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190417/43da5bcd/attachment.html>

More information about the llvm-dev mailing list