Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    ldeck
    @ldeck
    Thanks @npostavs — is there any way to turn on a profiler to locate the prime cause of slowness?
    John Stevenson
    @jr0cket
    @ldeck Emacs has a profiler to identify cpu and memory usage which can help. M-x profiler-start, run some commands, M-x profiler-report
    For example:
    https://practicalli.github.io/spacemacs/install-spacemacs/troubleshooting.html#profiling-emacs
    fhansen42
    @fhansen42
    can I use magit to diff two different files, one of which lives inside a repo but the other does not? I'm on windows if that matters.
    Ag Ibragimov
    @agzam
    @fhansen42 M-x diff-buffers, ediff-buffers
    fhansen42
    @fhansen42
    @agzam thanks. that gets me a diff, which helps. It's not in the magit interface, however. Any idea how to do it using magit?
    David Masterson
    @DSMasterson
    Looking for help with magit/forge against github. Everything seems to work except any pull/push request asks for username/password. I enter username and github personal token and the push/pull works fine. I've fixed .authinfo and added .authinfo to auth-sources. What am I missing?
    Noam Postavsky
    @npostavs
    @DSMasterson your remote URLs are https://github.com/<repo>/<user> I assume? You can set up git credential caching, or switch to ssh URLs (git@github.com:<repo>/<user>) and rely on ssh-agent for password caching
    David Masterson
    @DSMasterson
    @npostavs hmm. ssh-agent. I'd forgotten about that. I'll look it up. Thanks.
    @npostavs oh, but shouldn't magit/forge be getting the username/password out of ~/.authinfo (which I think I've set up)?
    Noam Postavsky
    @npostavs
    @DSMasterson for pushing, it's git that queries for the password
    Adam Spiers
    @aspiers
    Am I right in thinking that there's no native UI in magit for editing git config variables? From reading magit/magit#2744 I'm not sure whether this is a "we'll never add that" or "we might add that at some point" kind of situation, or maybe that issue is about something else entirely.
    IMHO it would be really helpful to have a native interface for it
    Noam Postavsky
    @npostavs
    @aspiers I think that issue is more about the non-interactive functions that magit uses for git config variables. Some transients allow editing certain git config variables, but there isn't a totally general UI for it. IMO, that sort of thing doesn't really belong in magit, but having a mode more specialized than conf-mode for gitconfig files could be nice.
    Adam Spiers
    @aspiers

    @npostavs Thanks! Curious why you don't feel it belongs in magit? The first paragraph of the manual says

    Magit aspires to be a complete Git porcelain. While we cannot (yet) claim that Magit wraps and improves upon each and every Git command, it is complete enough to allow even experienced Git users
    to perform almost all of their daily version control tasks directly from within Emacs. While many fine Git clients exist, only Magit and Git itself deserve to be called porcelains.

    IMHO git config is one of the more commonly used tasks
    Noam Postavsky
    @npostavs
    Really? I hardly ever need it. And I find editing the config file directly to be the easiest way of doing it.
    Adam Spiers
    @aspiers
    I can imagine a simple transient keymap which allows getting and setting config variables in the three main places (one global and two local).
    There would be significant advantages over editing config files directly, e.g.:
    • Significantly fewer keystrokes, since just opening up the right file involves several keystrokes, and then you have to navigate to the right section
    • Completion of already set (and maybe even known) config variable names
    • No risk of adding duplicate values to the same file
    All very similar to the reasons justifying why it is worth magit allowing configuration of remotes via Transient menus
    Adam Spiers
    @aspiers
    e.g. it's far easier to type M u to alter a remote's URL than to type C-x C-f .git/config RET C-s [remote C-s C-s RET C-s url = RET and then edit the line
    Pankaj Jangid
    @jangid
    After launching magit, how can I add an unstracked file to .gitignore? Is there a function (key-binding) for this in magit
    (magit-insert-ignored-files) is closest but it only applies a filter. The file under point is not added to .gitignore
    Magnus Therning
    @magthe
    I see a slightly strange behaviour in magit. If I
    1. open status
    2. press \ to switch to text-mode
    3. press \ to switch out of text-mode
    4. press p to push
      then I see the message Buffer is read-only: #<buffer magit: proj>.
      Has anyone else seen this behaviour?
    Grant Shangreaux
    @gcentauri
    @magthe - i can recreate your issue (though \ does not switch to text mode for me) ... in my case calling M-x text-mode the second time did not turn off the mode, and i had to manually put myself back into magit-mode
    Jonas Bernoulli
    @tarsius
    @magthe In addition to what @gcentauri said: text-mode and magit-status-mode are both MAJOR modes. You cannot just turn on some random major mode in a buffer and expect things to go back to normal when you switch back to the expected major mode. It might mostly work but other things might also end up broken.
    Magnus Therning
    @magthe

    @tarsius yes, that's my bad, it's a binding that comes from evil-magit, not from magit iself. I'll bring it up there instead.

    It is just very useful to be able to mark and copy text out of the magit buffers in a sane way sometimes.

    Jonas Bernoulli
    @tarsius
    @magthe You should not have to switch modes to sanely copy text out of magit (or any other) buffer. I don't use evil so I cannot tell you how you are supposed to do it and recommend you ask some of its users about it.
    Magnus Therning
    @magthe
    I agree with you, but I suspect there are much smarter people than me working on evil-magit and this is the way they've made it work.
    Julio Borja Barra
    @juboba
    how can I fix this so that characters are displayed correctly? (this is the magit-process buffer)
    image.png
    (something like interpreting those control characters I guess)
    Daniel Martín
    @danielmartin
    @juboba Is there any option in your hook scripts to disable ANSI colors? For example, I see Eslint supports a --no-color argument flag: https://eslint.org/docs/user-guide/command-line-interface
    Julio Borja Barra
    @juboba
    ahh, I'll take a look
    good idea, thanks
    Daniel Martín
    @danielmartin
    Julio Borja Barra
    @juboba
    @danielmartin this last one would allow me to see colors in the magit-process buffer? that would be awesome
    Daniel Martín
    @danielmartin
    It should, I'm not sure about performance, though. It's included by default in recent versions of Emacs.
    Julio Borja Barra
    @juboba
    nice
    Julio Borja Barra
    @juboba
    I tried adding (add-hook 'magit-process-mode-hook 'ansi-color-for-comint-mode-on) but it didn't work 😞
    Noam Postavsky
    @npostavs
    @juboba https://github.com/magit/magit/issues/1878#issuecomment-105963850 "If you really want the colors, or prefer editing Magit instead of the Git hooks, then you'll need to advise magit-process-sentinel, magit-process-filter, or some other related function"
    Magnus Therning
    @magthe

    Is there a way to run the equivalent of git fetch origin master:master from magit?

    (That is, I want to fetch from origin and move my local master _without having to checking it out.)

    Julio Borja Barra
    @juboba
    thank you @npostavs , but I was not able to get it working adding the hooks. It would've been nice to have, but not really needed.
    Julio Borja Barra
    @juboba
    hi all. Is it possible to checkout a specific file from another branch from magit?
    Daniel Martín
    @danielmartin
    @juboba M-x magit-file-checkout. If you just want to visit the file, M-x magit-find-file or M-x magit-find-file-other-window.
    Julio Borja Barra
    @juboba
    thanks!
    fleimgruber
    @fleimgruber
    Using https://github.com/alphapapa/org-rifle on Windows 10 and Emacs compiled with MSYS2 MinGW I get this traceback with errors from magit: https://pastebin.com/F6t8thX6.
    I found https://magit.vc/manual/magit/Microsoft-Windows-Performance.html#Microsoft-Windows-Performance which mentions subprocesses, but only regarding speed, not the limit of maximum number of processes. Any ideas?
    fleimgruber
    @fleimgruber
    I guess it is ultimately related to the official Git release for Windows which presumably runs on a fork of MSYS2 where I could not set the max user processes> This SO question without answer is related, but about lowering and not increasing the number - getting the same error message though: https://unix.stackexchange.com/questions/320494/msys2-ulimit-max-user-processes-cannot-modify-limit-invalid-arguments.
    fleimgruber
    @fleimgruber
    Just for reference, it was obviously not about maximum number of processes, but about maximum number of open files. Increasing it works initially (but very slowly) and then subsequently shows the same error.