Any way to revert a commit?

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Any way to revert a commit?

Qu Wenruo
Hi,

Since I'm a newbie to osc and opensuse build system, I'm wondering
what's the correct way to reset a commit in osc?

If it's git it can be quite easy by $ git reset --hard HEAD~1
But what's the correct method to do in osc?

(BTW, currently I'm just deleting my branch in webUI and get a new
branch in osc, pretty stupid)

It would be better if there is some rosetta comparing git with osc.

Thanks,
Qu


signature.asc (515 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Olaf Hering-2
On Tue, Dec 19, Qu Wenruo wrote:

> But what's the correct method to do in osc?

The web UI has a knob 'revert to rev#N' in the 'Revisions' tab. Select
the desired revision, scroll down and click on 'Revert prj/pkg to
revision N'. This happens to work for real source changes, but not for
changes that just update the _link target for devel pkgs.

Good luck.

Olaf

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Qu Wenruo


On 2017年12月19日 20:00, Olaf Hering wrote:
> On Tue, Dec 19, Qu Wenruo wrote:
>
>> But what's the correct method to do in osc?
>
> The web UI has a knob 'revert to rev#N' in the 'Revisions' tab. Select
> the desired revision, scroll down and click on 'Revert prj/pkg to
> revision N'. This happens to work for real source changes, but not for
> changes that just update the _link target for devel pkgs.

WebUI looks pretty good.

Any way to do it in osc?

Thanks,
Qu

>
> Good luck.
>
> Olaf
>


signature.asc (515 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Olaf Hering-2
On Tue, Dec 19, Qu Wenruo wrote:

> Any way to do it in osc?

osc co -u -r N prj/pkg
rm -fvi *
mv -vit . prj/pkg/*
cp -avit . .osc/_link
osc ar
osc commit -m revert

Olaf

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Qu Wenruo


On 2017年12月19日 21:01, Olaf Hering wrote:

> On Tue, Dec 19, Qu Wenruo wrote:
>
>> Any way to do it in osc?
>
> osc co -u -r N prj/pkg
> rm -fvi *
> mv -vit . prj/pkg/*
> cp -avit . .osc/_link
> osc ar
> osc commit -m revert
Emmm, the WebUI seems simpler.

Thanks,
Qu

>
> Olaf
>


signature.asc (515 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Andreas Schwab-2
In reply to this post by Qu Wenruo
On Dez 19 2017, Qu Wenruo <[hidden email]> wrote:

> Any way to do it in osc?

$ osc copypac -rN PRJ PKG PRJ

Andreas.

--
Andreas Schwab, SUSE Labs, [hidden email]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Jan Engelhardt-4
On Tuesday 2017-12-19 14:06, Andreas Schwab wrote:

>On Dez 19 2017, Qu Wenruo <[hidden email]> wrote:
>
>> Any way to do it in osc?
>
>$ osc copypac -rN PRJ PKG PRJ

Still, it only reverts _to_, but not necessarily revert _exactly one_
commit (diff && patch -R style).
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Qu Wenruo


On 2017年12月19日 21:18, Jan Engelhardt wrote:

> On Tuesday 2017-12-19 14:06, Andreas Schwab wrote:
>
>> On Dez 19 2017, Qu Wenruo <[hidden email]> wrote:
>>
>>> Any way to do it in osc?
>>
>> $ osc copypac -rN PRJ PKG PRJ
>
> Still, it only reverts _to_, but not necessarily revert _exactly one_
> commit (diff && patch -R style).
>
Just curious, any way to appending new changes to current commit?
(yep, git commit --amend -a)

For example, if my request get rejected by package maintainer due to
some small problems, I don't really like to go through the checkout
procedure but do something like "git commit --amend"

Thanks,
Qu


signature.asc (515 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Jan Engelhardt-4

On Tuesday 2017-12-19 14:23, Qu Wenruo wrote:

>On 2017年12月19日 21:18, Jan Engelhardt wrote:
>> On Tuesday 2017-12-19 14:06, Andreas Schwab wrote:
>>
>>> On Dez 19 2017, Qu Wenruo <[hidden email]> wrote:
>>>
>>>> Any way to do it in osc?
>>>
>>> $ osc copypac -rN PRJ PKG PRJ
>>
>> Still, it only reverts _to_, but not necessarily revert _exactly one_
>> commit (diff && patch -R style).
>>
>
>Just curious, any way to appending new changes to current commit?
>(yep, git commit --amend -a)

Nope, obs history is as immutable as svn.

>For example, if my request get rejected by package maintainer due to
>some small problems, I don't really like to go through the checkout
>procedure but do something like "git commit --amend"

To do --amend, you'd need a checkout in git ;-)

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Andreas Schwab-2
In reply to this post by Jan Engelhardt-4
On Dez 19 2017, Jan Engelhardt <[hidden email]> wrote:

> On Tuesday 2017-12-19 14:06, Andreas Schwab wrote:
>
>>On Dez 19 2017, Qu Wenruo <[hidden email]> wrote:
>>
>>> Any way to do it in osc?
>>
>>$ osc copypac -rN PRJ PKG PRJ
>
> Still, it only reverts _to_,

Which is what the OP wants.

Andreas.

--
Andreas Schwab, SUSE Labs, [hidden email]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Andreas Schwab-2
In reply to this post by Qu Wenruo
On Dez 19 2017, Qu Wenruo <[hidden email]> wrote:

> Just curious, any way to appending new changes to current commit?

No, all commits are immutable.

> For example, if my request get rejected by package maintainer due to
> some small problems, I don't really like to go through the checkout
> procedure but do something like "git commit --amend"

It doesn't matter, the submit request will only create a single commit
anyway.

Andreas.

--
Andreas Schwab, SUSE Labs, [hidden email]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Qu Wenruo


On 2017年12月19日 21:36, Andreas Schwab wrote:

> On Dez 19 2017, Qu Wenruo <[hidden email]> wrote:
>
>> Just curious, any way to appending new changes to current commit?
>
> No, all commits are immutable.
>
>> For example, if my request get rejected by package maintainer due to
>> some small problems, I don't really like to go through the checkout
>> procedure but do something like "git commit --amend"
>
> It doesn't matter, the submit request will only create a single commit
> anyway.
So even there are more commits fixing up previous problems, as long as
the .changes file only includes one message it will be fine?

Thanks,
Qu

>
> Andreas.
>


signature.asc (515 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Andreas Schwab-2
On Dez 19 2017, Qu Wenruo <[hidden email]> wrote:

> So even there are more commits fixing up previous problems, as long as
> the .changes file only includes one message it will be fine?

You can add more than one entry to the .changes file if you like.  What
matters in the end is the difference to the package in the parent
project.

Andreas.

--
Andreas Schwab, SUSE Labs, [hidden email]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Bernhard M. Wiedemann-5
In reply to this post by Jan Engelhardt-4
On 2017-12-19 14:29, Jan Engelhardt wrote:
>> Just curious, any way to appending new changes to current commit?
>> (yep, git commit --amend -a)
> Nope, obs history is as immutable as svn.

except that it was possible to delete a package, do a new osc branch,
checkin a changed revision and re-use an old SR with the new change
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Adrian Schröter
On Dienstag, 9. Januar 2018, 14:03:54 CET wrote Bernhard M. Wiedemann:
> On 2017-12-19 14:29, Jan Engelhardt wrote:
> >> Just curious, any way to appending new changes to current commit?
> >> (yep, git commit --amend -a)
> > Nope, obs history is as immutable as svn.
>
> except that it was possible to delete a package, do a new osc branch,
> checkin a changed revision and re-use an old SR with the new change

indeed, but where can this be an issue?

--

Adrian Schroeter
email: [hidden email]

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
 
Maxfeldstraße 5                        
90409 Nürnberg
Germany


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Any way to revert a commit?

Dave Plater lst
In reply to this post by Bernhard M. Wiedemann-5


On 09/01/2018 15:03, Bernhard M. Wiedemann wrote:
> On 2017-12-19 14:29, Jan Engelhardt wrote:
>>> Just curious, any way to appending new changes to current commit?
>>> (yep, git commit --amend -a)
>> Nope, obs history is as immutable as svn.
>
> except that it was possible to delete a package, do a new osc branch,
> checkin a changed revision and re-use an old SR with the new change
>
Another trick is to copypac from factory and submit to the devel project
package.
Dave P
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]