[llvm-dev] How to revert a change properly

Don Hinton via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 26 11:13:29 PDT 2019


Yes, thanks Paul.  Out of the 9 or 10 I’ve used, git’s definitely the best.

On Tue, Mar 26, 2019 at 3:38 AM Xing GUO <higuoxing at gmail.com> wrote:

> Hi, Paul and Don
>
> Thanks a lot, I haven't change my version control tool from svn to git. I
> would like to have a try. Thanks a lot!
>
> Regards,
> Xing
>
> <paul.robinson at sony.com> 於 2019年3月26日 週二 下午6:33 寫道:
>
>> 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> 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
>> 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/597c6124/attachment.html>


More information about the llvm-dev mailing list