Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] reset package to upstream state #10

Open
LW-archlinux opened this issue Apr 19, 2020 · 5 comments
Open

[Enhancement] reset package to upstream state #10

LW-archlinux opened this issue Apr 19, 2020 · 5 comments

Comments

@LW-archlinux
Copy link

Sometimes adding changes goes wrong and people have trouble reverting to a known good state.
A simple way to solve this with a single git repo is to remove the local git repo and re-clone the upstream repo .

having a command to do this in the aurpublish combined repo would be a good thing.
possible invocation aurpublish -reset PACKAGE

@eli-schwartz
Copy link
Owner

remove the local git repo and re-clone the upstream repo

That sounds kind of awkward if you ask me.

...

What kind trouble are we talking about here? If there are AUR commits which are not locally present and local commits which are not remotely present, -p PACKAGE should pull those changes and activate the git merge machinery if needed. Otherwise, shouldn't git checkout HEAD PACKAGE/ be sufficient?

@LW-archlinux
Copy link
Author

example :
add files for one package to the folder for another package
add a commit message, push .
push is rejected because of missing files or other imcompatibilities , realise the mistake and try to correct it.

Does git checkout HEAD remove the incorrect commit(s) ?

@eli-schwartz
Copy link
Owner

If the conflicting commit is the most recent one, you could use git commit --amend.

You can also use git rebase and choose one or more commits to checkout, edit for correctness, and turn into a series of commits which the AUR will accept. Note that you cannot rebase commits which you have already published with aurpublish, since the AUR does not permit force pushes.

@alerque
Copy link
Contributor

alerque commented May 5, 2020

What if I accidentally rebased local commits after pushing to AUR? How do I get back to a workable situation where my local work is on top of what the AUR already knows about? I.e. rebase anything I have that touches that subtree onto the remote commits.

@eli-schwartz
Copy link
Owner

You could use the reflog to find the last good commit. In general, rebase is a powerful tool which you should treat with care; standard advice for git is to not force push public history, subtrees just make that cause conflicts visible to the repository owner instead of only to downstream people who have cloned it.

If you really just want to delete it from git, then re-add the package from scratch, it's probably as simple as 'git rm -r pkg/; git commit; aurpublish -p pkg'. But I haven't experimented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants