[llvm-dev] How to revert a change properly

via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 26 03:33:31 PDT 2019


The "Revert [tag] message" is the default message generated by the 'git revert' command.  Of course you would have to be using a git clone of LLVM instead of an SVN checkout in order to run 'git revert'.  This command is the equivalent of 'svn merge –r' run from the top-level directory.  I believe svn commands will operate only on the directories below the current working directory, so I speculate that you ran the svn command from the lib subdirectory instead of from the top level, and thus missed the tests that were part of your original commit.
--paulr

From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Don Hinton via llvm-dev
Sent: Tuesday, March 26, 2019 4:57 AM
To: Xing GUO
Cc: LLVM Development List
Subject: Re: [llvm-dev] How to revert a change properly

Hi Xing:

There's too much activity to automatically revert anything, so you need to commit a new change that effectively reverts the original patch -- keeping in mind that someone else might have changed some of the same files, and/or lines, in the interim.  Here's how I do it.

Update your local master, and extract the change using svn diff or git diff to a patch file.  Then use patch to apply it locally, using the '-R' flag for reverse, and fix any merge conflicts.  If your tests run clean, update your source one last time just in case, then commit with a new message indicating that you reverted it with a note on why, etc...

hth...
don

On Tue, Mar 26, 2019 at 12:08 AM Xing GUO via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote:
Hi folks,

Several days ago, I made a bad change in llvm, and I reverted it using following command
```
$ svn merge -r <bad change revision>:<previous revision>
```
However, this command seemed not working properly. I would like to know, what's the right way to revert a bad change. I notice that there are some reverting change with proper message, e.g. "Revert: [some tag] commit message". Shall I type this message manually? Or is there some useful tool that I could use?

Best Regards,
Xing

_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org<mailto: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/20190326/cf472075/attachment.html>


More information about the llvm-dev mailing list