Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

git revert inside a -9999 package sources?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
17 posts • Page 1 of 1
Author
Message
M95D
Tux's lil' helper
Tux's lil' helper
Posts: 126
Joined: Fri Jan 03, 2020 9:40 am

git revert inside a -9999 package sources?

  • Quote

Post by M95D » Sun Feb 01, 2026 2:41 pm

Hi.

I'm testing Xlibre. The package is one of those a -9999 packages that clone a git repo and then compile from the master branch and installs it.

1) I found a bug and I wish to revert a commit. What's the easiest way to do that?

2) How about a git bisect? Can I automate a git bisect that runs emerge and a simple bash test command?

I prefer emerge instead of building and installing manually because there is no alternative (that I know of) for "emerge --unmerge" when installing with "make install".

Thanks.
Top
CaptainBlood
Advocate
Advocate
User avatar
Posts: 4237
Joined: Sun Jan 24, 2010 9:38 am

  • Quote

Post by CaptainBlood » Sun Feb 01, 2026 5:56 pm

I recall having successfully set patches as in /etc/portage/patches for 9999 packages.
Maybe this could help?

Thks 4 ur attention, interest & support.
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3527
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sun Feb 01, 2026 6:37 pm

CaptainBlood wrote:I recall having successfully set patches as in /etc/portage/patches for 9999 packages.
Maybe this could help?

Thks 4 ur attention, interest & support.
That's the way to go. You could define EGIT_COMMIT on the command line but that would give you a checkout at that commit, not revert it. If you're OK with syncing the previous commit, you can use it though.

Best Regards,
Georgi
Top
CaptainBlood
Advocate
Advocate
User avatar
Posts: 4237
Joined: Sun Jan 24, 2010 9:38 am

  • Quote

Post by CaptainBlood » Sun Feb 01, 2026 6:59 pm

As logrusx says, EGIT_COMMIT variable can help you to prevent building up to the latest commit, but the one you defined in the variable instead.
Copying the 9999 package to local repository should really help to do so. Once done patch ebuild like

Code: Select all

EGIT_REPO_URI="https://github.com/X11Libre/xserver.git"
EGIT_COMMIT=4d5e5558ba2002847febfd6ff62e5656e50abf2f
Set the commit value accordingly.

/etc/portage/patches can now contain the patche(s) you wish to apply atop.

Thks 4 ur attention, interest & support.
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Top
M95D
Tux's lil' helper
Tux's lil' helper
Posts: 126
Joined: Fri Jan 03, 2020 9:40 am

  • Quote

Post by M95D » Sun Feb 01, 2026 7:15 pm

I know about patches.

So there is no way to somehow do a git revert inside distfiles/git3-src/<package>.git and have portage use the checked out branch as it is?
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3527
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sun Feb 01, 2026 7:47 pm

M95D wrote:I know about patches.

So there is no way to somehow do a git revert inside distfiles/git3-src/<package>.git and have portage use the checked out branch as it is?
Maybe you could ammend src_prepare but to me that looks like going to great lengths just to make it that way.

Best Regards,
Georgi
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Sun Feb 01, 2026 8:05 pm

M95D wrote:I know about patches.

So there is no way to somehow do a git revert inside distfiles/git3-src/<package>.git and have portage use the checked out branch as it is?
This is just "patches" with extra steps.

Besides, reverting whatever commit is in your way doesn't really mean anything unless you upstream it. Emerge is in no position to do that.
[topic=1152524]Make Pipewire a system service[/topic]
Top
SCR4MBL3
n00b
n00b
User avatar
Posts: 19
Joined: Tue Jul 29, 2025 9:56 pm
Location: In Front of My Desk
Contact:
Contact SCR4MBL3
Website

Re: git revert inside a -9999 package sources?

  • Quote

Post by SCR4MBL3 » Sun Feb 01, 2026 8:22 pm

M95D wrote:I prefer emerge instead of building and installing manually because there is no alternative (that I know of) for "emerge --unmerge" when installing with "make install".
Hello,

Can't you just do

Code: Select all

$ make uninstall 'package'
?
See Ya!

---------------------------------------------------------------------------------------------------------------------------

There are 10 types of people, the ones who know the binary system, and the ones who don't.
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3527
Joined: Thu Feb 22, 2018 2:29 pm

Re: git revert inside a -9999 package sources?

  • Quote

Post by logrusx » Sun Feb 01, 2026 8:55 pm

SCR4MBL3 wrote:
M95D wrote:I prefer emerge instead of building and installing manually because there is no alternative (that I know of) for "emerge --unmerge" when installing with "make install".
Hello,

Can't you just do

Code: Select all

$ make uninstall 'package'
?
The problem with that is in Gentoo you don't run make install yourself first place. The second problem is the way its written suggests you're considering make a package manager.
Top
Hu
Administrator
Administrator
Posts: 24380
Joined: Tue Mar 06, 2007 5:38 am

Re: git revert inside a -9999 package sources?

  • Quote

Post by Hu » Sun Feb 01, 2026 9:01 pm

SCR4MBL3 wrote:
M95D wrote:I prefer emerge instead of building and installing manually because there is no alternative (that I know of) for "emerge --unmerge" when installing with "make install".
Hello,

Can't you just do

Code: Select all

$ make uninstall 'package'
?
In the general case, no. Build systems are not obligated to even have an uninstall target, much less have it work correctly. This is one of the major reasons people prefer a package manager, which can collect up all the installed files in a staging area, log where they go, and then clean up later using that machine-readable log.
Top
M95D
Tux's lil' helper
Tux's lil' helper
Posts: 126
Joined: Fri Jan 03, 2020 9:40 am

  • Quote

Post by M95D » Sun Feb 01, 2026 9:03 pm

Thank you for your answers. I'll use a patch.
Top
sam_
Developer
Developer
User avatar
Posts: 2810
Joined: Fri Aug 14, 2020 12:33 am

Re: git revert inside a -9999 package sources?

  • Quote

Post by sam_ » Tue Feb 03, 2026 4:38 pm

M95D wrote: 2) How about a git bisect? Can I automate a git bisect that runs emerge and a simple bash test command?
I wrote this a few years ago: https://wiki.gentoo.org/wiki/Bisecting_ ... ve_ebuilds
Top
M95D
Tux's lil' helper
Tux's lil' helper
Posts: 126
Joined: Fri Jan 03, 2020 9:40 am

  • Quote

Post by M95D » Tue Feb 03, 2026 7:02 pm

Yes, that seems to be what I'm looking for.
But I don't understand the test script used in the examples.

First there's this:
export EGIT_OVERRIDE_COMMIT_OPENZFS_ZFS=$(git rev-parse HEAD)
export EGIT_OVERRIDE_BRANCH_OPENZFS_ZFS=zfs-2.1.5-staging

then:
export EGIT_OVERRIDE_COMMIT_GLIBC=$(git rev-parse HEAD)
export EGIT_OVERRIDE_BRANCH_GLIBC=release/2.35/master

and then:
export EGIT_OVERRIDE_REPO_GCC=file:///home/sam/git/gcc
export EGIT_OVERRIDE_COMMIT_GCC=$(git rev-parse HEAD)

The variables are different for each tested package.
EGIT_OVERRIDE_COMMIT_<something>
EGIT_OVERRIDE_BRANCH_<something>
EGIT_OVERRIDE_REPO_<something>

How do I determine the name of the variables then? How do I know what <something> I should use? It's not the name of the package, it's not the repo name, it's not the branch, what is it then? That "OPENZFS_ZFS" looks like it's completely unrelated to anything.
Where are these variables documented? What do they do? What does "mirror" mean in "EGIT_CLONE_TYPE=mirror"? What does "fatal" in "USE="-pgo" fatal ebuild /var/db/repos/gentoo/sys-devel/binutils/binutils-2.40.ebuild clean compile install" do? I don't have that command installed and I can't find that command anyhere on the internet.

Could you (gentoo devs) please stop using examples as documentation and start writing proper documentation, please? Thank you!
Last edited by M95D on Tue Feb 03, 2026 7:12 pm, edited 1 time in total.
Top
sam_
Developer
Developer
User avatar
Posts: 2810
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Tue Feb 03, 2026 7:08 pm

M95D wrote: How do I determine the name of the variables then? How do I know what <something> I should use? It's not the name of the package, it's not the repo name, it's not the branch, what is it then? That "OPENZFS_ZFS" looks like it's completely unrelated to anything.
Where are these variables documented? What do they do? What does "mirror" mean in "EGIT_CLONE_TYPE=mirror"?
It comes from the URL it is cloning from, in this case github.com/openzfs/zfs. The variables to use are all listed when you emerge a package using git-r3.eclass (it tells you what to set and how to override them).

The 'mirror' part could do with a comment or two which I'll add now.
M95D wrote: Could you (gentoo devs) please stop using examples as documentation and start writing proper documentation, please? Thank you!
I think you could phrase that in a way which is less antagonistic. I wrote that article specifically as a guide for somebody who wanted help with bisecting ZFS, and then tried to make it a bit more general. It could be better, though it could be made better by anybody (certainly doesn't have to be me). I'm sorry that didn't meet your expectations.

I agree that the variables should be documented in the eclassdoc for git-r3, see bug 764422.
M95D wrote: What does "fatal" in "USE="-pgo" fatal ebuild /var/db/repos/gentoo/sys-devel/binutils/binutils-2.40.ebuild clean compile install" do? I don't have that command installed and I can't find that command anyhere on the internet.
It's a function defined a few lines above in the same script.
Top
M95D
Tux's lil' helper
Tux's lil' helper
Posts: 126
Joined: Fri Jan 03, 2020 9:40 am

  • Quote

Post by M95D » Tue Feb 03, 2026 7:45 pm

sam_ wrote:The variables to use are all listed when you emerge a package using git-r3.eclass (it tells you what to set and how to override them).
You could have at least write this information under the first example, no? Didn't you think it was relevant?
sam_ wrote: I think you could phrase that in a way which is less antagonistic. I wrote that article specifically as a guide for somebody who wanted help with bisecting ZFS, and then tried to make it a bit more general. It could be better, though it could be made better by anybody (certainly doesn't have to be me). I'm sorry that didn't meet your expectations.
Well, I'm sorry. I find it very annoying. Gives examples of features but no expanation, no nothing. Completely unusable for someone who didn't study that "eclassdoc for git-r3" you're talking about. I don't even know what it is.
No, the article can't be improved by anyone. Only by those who know how it works, which I suspect is just you + 2-5 other people.
sam_ wrote:
M95D wrote: What does "fatal" in "USE="-pgo" fatal ebuild /var/db/repos/gentoo/sys-devel/binutils/binutils-2.40.ebuild clean compile install" do? I don't have that command installed and I can't find that command anyhere on the internet.
It's a function defined a few lines above in the same script.
Yeah, I completely missed it. I got so frustrated by the time I got to that part I simply skipped to the end.

I see that you updated it. Much more usable now. Thank you.
But it's still examples-as-documentation.
Top
sam_
Developer
Developer
User avatar
Posts: 2810
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Tue Feb 03, 2026 7:52 pm

You can be 'annoyed' and still be respectful and ask for a change without implying nobody cares about 'proper' documentation. "Could you explain XYZ more please?" without any implication of laziness or wrongdoing would be just fine.

I wrote that article as a transcription with some edits of some private email I had with a user that asked me for help. I figured having the page was better than no page at all. You may not agree.

The documentation is in the eclass (git-r3.eclass and man git-r3.eclass which is provided by app-doc/eclass-manpages). The article is describing a particular combination of some eclass functionality and some unrelated software, so I think it's hard in this case for that page to not be mostly examples. The combination is also kind of an advanced topic rather than something all users will need to do.

There are certainly (many) users who make use of this functionality often, just not the bisect part.
Top
Hu
Administrator
Administrator
Posts: 24380
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Tue Feb 03, 2026 11:10 pm

M95D wrote:No, the article can't be improved by anyone. Only by those who know how it works, which I suspect is just you + 2-5 other people.
As a Wiki article, anyone who chooses to create a Wiki account can edit it and improve it. While you may not have the expertise today to improve it, there are no procedural barriers to you being the person to improve it after you study the relevant documentation and become more proficient with the feature. This is distinct from other parts of the Gentoo project, where only someone who has been explicitly granted commit permission can change those parts.
Top
Post Reply

17 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy