this post was submitted on 10 Nov 2023
2 points (100.0% liked)
Emacs
314 readers
2 users here now
A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!
Get Emacs
Rules
- Posts should be emacs related
- Be kind please
- Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.
Emacs Resources
Emacs Tutorials
- Beginner’s Guide to Emacs
- Absolute Beginner's Guide to Emacs
- How to Learn Emacs: A Hand-drawn One-pager for Beginners
Useful Emacs configuration files and distributions
Quick pain-saver tip
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Exactly.
When you add the current repository to the forge database, then that also takes care of adding the appropriate fetch refspecs.
When you remove and then clone again a git repository, which was already being tracked in the forge database, then you don't have to add the repository to the forge database again. But that means that the step where the fetch refspecs are added, also won't be run again.
But you can use
M-x forge-add-pullreq-refspec
to add them explicitly. Also see the option by the same name.Thanks u/magthe0 and u/tarsius_, that rang a bell. Unfortunately, that doesn't seem to be the problem. The refspecs have been added to the
.git/config
files of the clones (I usually keep my working copies around and rarely clone from scratch).As a test, I just (freshly) cloned one of my projects in a subdirectory
/tmp
and indeed, after runningM-x forge-add-pullreq-refspec
, the following was added to the.git/config
file:for remote
origin
. This looks fine (and such a line is present in the 'regular' clones of my projects as well). Next, I ranM-x magit-fetch-all
, as well asN f f
to tell Forge to fetch all topics. The Magit status window shows the "Pull requests" and "Issues" sections and both are populated (with proper!123
type coding for the merge requests). However, when I open the magit log screen I am back where I was before: I don't see the MR numbers as refspecs there (I have the-d Show refnames (--decorate)
option turned on.Side note: I'm not a master of the Git plumbing commands, but
git show-ref
doesn't seem to list all MRs. For this test project I have 10 MRs (all merged or closed), but only 9 and 10 show up:However, in the Magit status view, I do see the last 5 and
M-x forge-list-pullreqs
lists them all.This changed with https://github.com/git/git/commit/92156291ca82ae4f4ad09fde8181c5f2b7dba6ca.
You can revert to the old ways with
git config --global log.initialDecorationSet all
. I'll have to think about how to best deal with that in Magit.Thanks a lot for digging that up, u/tarsius_! In the example repo I mentioned above, I now see MRs
!9
and!10
in the Magit log view (well, without the!
, but that is fine).The fact that I don't see older MRs probably has something to do with the corresponding refs not having been downloaded. I'll see if I can figure out how to do that.