News for hackers. Stuff that matters.
Re:Please help improve Magit by Y_Y on Sunday February 26, 2023 @08:15AM (#34945276)
I like ve magit, but I often enough find that I end up in a sticky situation that I can't resolve without retreating back to the CLI. I don't know if that's a deficiency in magit or just a matter of me not knowing well enough how to use it. Typically I just call the magit equivalent of whatever git base command I want and helm gets me the rest of the way with setting parameters.
Re:Please help improve Magit by agumonkey on Sunday February 26, 2023 @08:28AM (#34945356)
Curious about that, I think I can count these events on one finger a year (and maybe the absence of direct `git push --tags --force`). For me it's some strange state where creating a branch from a remote doesn't linked the two. That's about it.

Usually :

- reset - rebase - fetch / pull / push - cherry pick - stash

and then magit-blame, git-timemachine etc.. all work smoothly

But we all have our own usage, what did you try that made magit get stuck ?

Re:Please help improve Magit by Y_Y on Sunday February 26, 2023 @08:50AM (#34945520)
Lots of little things, but the last I remember one issue was with modifying the URL of a remote, as well as getting lfs and submodules to sync up properly.
Re:Please help improve Magit by jorams on Sunday February 26, 2023 @10:53AM (#34946436)
You can change the URL of a remote easily with either "M u" for the primary remote, or "M C [choose] u" for any other.
Re:Please help improve Magit by andreareina on Sunday February 26, 2023 @08:26AM (#34945345)
What kind of stuff are you doing that gets you in a sticky situation, and how are you getting out of it? IME I've generally been able to do most complex things I need with some combination of the stash, rebase, cherry pick/apply and if I've stuffed things up the reflog, all done from within magit.
Re:Please help improve Magit by throwanem on Sunday February 26, 2023 @09:19AM (#34945720)
Same. About the only thing I durably haven't figured out how to do with it is move a branch tag.
Re:Please help improve Magit by andreareina on Sunday February 26, 2023 @09:45AM (#34945913)
Branch or tag?

branch: b x

tag: t -f t

Tags aren't meant to be "moved", that's why you need to --force it.

Re:Please help improve Magit by BaculumMeumEst on Sunday February 26, 2023 @08:26AM (#34945343)
it mostly works super well for me, but sometimes while i’m using magit i manage to get emacs stuck in a weird state where i cant close the minibuffer or enter any commands. mashing c-g or esc in each open split doesnt help, and i end up having to force close.

probably not magit’s fault, and it happens rarely, but it’s one of several problems i cant escape from that give me a sense of dread every time i open emacs.

mostly switched away from emacs result

Re:Please help improve Magit by yuuuzzzzzz on Sunday February 26, 2023 @08:29AM (#34945364)
Enacs shouldn't freeze like that tbh, I've been using Emacs + Magit for a while now and it doesn't freeze ever.
Re:Please help improve Magit by umanwizard on Sunday February 26, 2023 @08:45AM (#34945482)
The exact described behavior has happened to me as well.
Re:Please help improve Magit by precompute on Sunday February 26, 2023 @08:49AM (#34945517)
C-x 0 is the way out. That happens sometimes when focus shifts while the Transient hasn't properly exited.
Re:Please help improve Magit by BaculumMeumEst on Sunday February 26, 2023 @10:23AM (#34946207)
ahhh that sounds like it would work, thanks
Re:Please help improve Magit by tarsius on Monday February 27, 2023 @05:50PM (#34963109)
That's an issue with Transient, a dependency of Magit and also authored by me. It's complicated, but essentially the problem is that post-command-hook is not guaranteed to be run after the command. And the second problem is that I tried working around that for too long (and instead resorted to increasingly sophisticated and desperate heuristics), instead of getting it changed in Emacs. I've done that now, so maybe in Emacs 30.

But I have also switched to handling part of it using an around advice, which does work reliably. I've done that about two weeks ago, so changes are that if you update Transient now, you won't ever see that again.

Re:Please help improve Magit by spit2wind on Sunday February 26, 2023 @08:58AM (#34945579)
This happens with me, too, sometimes. Are you aware of how to execute git cli commands through Magit? (From memory, it's exclamation, !)

As for whether it's Magit or you, I suspect it's git. Git is complicated.

Re:Please help improve Magit by iib on Sunday February 26, 2023 @09:36AM (#34945849)
There is also the documented way of running git commands straight from magit [1]. I am leaving this here, in case it may help you with those times that you have to go to the command-line.

[1] https://magit.vc/manual/magit/Running-Git-Manually.html

Re:Please help improve Magit by TacticalCoder on Sunday February 26, 2023 @10:30AM (#34946266)
Ah that's intriguing, I'm using Magit since forever and had no idea! When I need to do it I like to do it from a regular prompt: I just switch to an actual terminal (i.e. not from Emacs: not an eshell, not an libvterm, not anything like that: just the "real thing"). Then I just hit 'g' (which runs magit-refresh) when I go back to Emacs.
Re:Please help improve Magit by ParetoOptimal on Sunday February 26, 2023 @01:35PM (#34948029)
> When I need to do it I like to do it from a regular prompt: I just switch to an actual terminal

You might like exploring using async-shell-command for these things.

If you like that, you may also like detached.el for command rerunning and command output history.

Re:Please help improve Magit by lordgrenville on Sunday February 26, 2023 @09:46AM (#34945919)
I often get stuck with Magit and have to resort to the CLI to fix things. But what I find is that using the CLI, I only have a vague idea of what I did, whereas if I take the time to understand how to do it with Magit functions, I end up with a clear understanding of what's happened.
Re:Please help improve Magit by SirensOfTitan on Sunday February 26, 2023 @10:29AM (#34946255)
I find myself in the opposite situation: I've used magit for so long I don't quite remember how to do things in the CLI. Magit is such muscle memory for me at this point that my git experience has largely become subconscious.