Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    asymmetric
    @asymmetric
    beautiful implementation! :heart:
    Rudi Grinberg
    @rgrinberg
    Is there a way to create a forge PR and immediately set the reviewers?
    s/forge PR/PR created with forge/
    Magnus Therning
    @magthe
    @rgrinberg the only way I know is to use .github/CODEOWNERS
    donahchoo
    @donahchoo
    The org that my GHE repo is in has changed. Is there a way to get magit/forge to use the updated org name without having to reclone the repo?
    donahchoo
    @donahchoo
    I think I did this by renaming origin and then using b u to unset the remote and then set it.
    Rudi Grinberg
    @rgrinberg
    I see. Thanks anyway.
    Is there a way to change log settings for the current log buffer?
    For example, I'd like to add the diff stat to the current log with -s
    Kévin Le Gouguec
    @peniblec

    Hi! Sorry for the repost, but I still haven't figured this out:

    Quick question (hopefully): when global-magit-file-mode is t (the default), does one still need to (require 'magit) in their init file in order to enable magit-file-mode bindings?
    My .emacs does not (require 'magit) ATM and C-x g and other shortcuts do not seem to work until I manually call M-x magit-status once. Adding (require 'magit) in the init file fixes this. Is this expected?
    The installation node in the manual explicitly says to (require 'magit) when installing from the Git repository, but no such step is mentioned in "Installing from Melpa" nor in "Post-Installation Tasks".
    (Tested with Emacs 28)

    (My curiosity was renewed by Stefan's recent message on emacs-devel explaining why one shouldn't, in principle, (require 'foo) in their init file)

    @rgrinberg

    For example, I'd like to add the diff stat to the current log with -s

    Butting in without having read the rest; does L -s g in a log buffer do what you want?

    Kévin Le Gouguec
    @peniblec

    @rgrinberg

    Is there a way to change log settings for the current log buffer?

    L (uppercase) allows you to change the current log buffer's settings; once you've (un)set the parameters, hit g to refresh.

    Rudi Grinberg
    @rgrinberg
    Thanks peniblec
    Kévin Le Gouguec
    @peniblec

    @tarsius I'd appreciate it if you could weigh in on my question above; tl;dr must a user add (require 'magit) to their init file to make C-x g work without first running magit-status, even though global-magit-file-mode is t?

    It's not terribly important so no rush though. I don't know if Gitter is the best place to ask; my impression is that this is too trivial to warrant a Github issue or a post on StackExchange…

    Oliver
    @or
    Howdy, folks. I'm trying to add an extra switch to magit-rebase, finally found transient-append-suffix and it does what I want. But I can't figure out how to set the default value of a switch (also of existing switches). The docs I found only talk about magit-popup. I did see there's :value in define-transient-command, but can I set that for an existing transient command?
    Jonas Bernoulli
    @tarsius
    @peniblec That should not be necessary but Magit's autoloads file has to be loaded.
    Oliver
    @or
    @tarsius: Marvellous, thank you!
    Kévin Le Gouguec
    @peniblec

    @tarsius Mmm; is that something that package.el is supposed to handle automatically? I can see magit-autoloads.el under ~/.emacs.d/elpa/magit-2020..., and I guess something is autoloaded, because magit-status shows up right from the start when I M-x magit- TAB, but magit-file-mode-map bindings are not loaded until I run magit-status or (require 'magit) :/

    If that helps, I'm running Emacs 28 (but I've observed this behaviour with previous Emacs versions too), I don't have any customization on package.el-related variables (that I know of), and I installed magit from MELPA using package.el...

    Let me know if you want me to make a proper issue out of this.

    Jonas Bernoulli
    @tarsius
    Once in a blue moon I have to explicitly invoke magit-status before I can use magit-file-dispatch too. I have tried investigating it before and eventually I will give it another try. For now you might occasionally (or in your case always?) invoke magit-status first. Sorry.
    Kévin Le Gouguec
    @peniblec
    @tarsius Yup, in my case it's always. I've never been able to invoke C-x g and friends without first invoking magit-status, so I'd say it's 100% reproducible over here. I'll see if I can figure things out; in the meantime, if you have any specific ideas of stuff I could look for, feel free to ask! No rush though, since the workaround ((require 'magit) in .emacs) is simple enough.
    Noam Postavsky
    @npostavs
    I guess it's related to this note about intialization: https://github.com/magit/magit/blob/d27d6e467857ed4a78c7cf7d609561df789e2a6c/lisp/magit-files.el#L346-L352
    The code there isn't autoloaded; it's not applied until magit is actually loaded. I guess (global-magit-file-mode 1) in your .emacs should work.
    Jonas Bernoulli
    @tarsius
    I think I was wrong about this usually working for me. It's more likely that I usually show show a status buffer very early on so I only very seldomly run into this issue.
    @npostavs You are on to something but if we do autoload that, then loading the autoloads has essentially the same effect as (require 'magit) in the init file. It would be better to discuss this in an issue than here.
    Noam Postavsky
    @npostavs
    Yeah, the only thing that calling global-magit-file-mode helps with is to satisfy the "require should not be needed in init file" principle; it doesn't make any practical difference though.
    Jonas Bernoulli
    @tarsius
    We would need a separate file (name suggestions?) that only defined the key-binding-only modes and did not depend on other parts of Magit. We could then either tell users to require that library or we could "autoload-require" it.
    Kévin Le Gouguec
    @peniblec

    OK, I've stared long and hard at magit-files.el, define-(globalized-)minor-mode, and the documentation for autoload, and I'm now convinced I'm out of my depth "^^

    Should I file an issue about this then? ("This" being "enabling magit-file-mode-map without first requiring 'magit")

    The keybinding-only modes you mention are magit-file-mode and magit-blob-mode, right? I can't come up with a single all-encompassing name (magit-file-commands.el?), the most obvious idea that comes to mind being two distinct files (magit-file.el or magit-dispatch.el, and magit-blob.el).

    dyereh
    @dyereh

    Hey guys - I'm trying to link a custom command into magit that will ultimately run git reset --hard @{u} in one go (the exact command/bindings rn don't really matter.. more the idea of adding a specific command that calls git "for effect" as it says in the user manual.

    Done a decent amount of reading in the manual but I'm stuck (also an elisp/emacs newbie) my code sofar

    
    (defun magit-reset-hard-upstream ()
      (magit-run-git "reset --hard @{u}"))
    
    (define-transient-command magit-reset-hard-upstream ())
    
    (with-eval-after-load 'magit
      (transient-append-suffix 'magit-commit "c"
                              '("n" "Reset hard upstream" magit-reset-hard-upstream))
    )

    FYI this is in my init.el
    Am I on the right track? any help would be appreciated!

    Jonas Bernoulli
    @tarsius
    Use one string per argument.
    Generally search magit for uses of these functions so you can learn from examples.
    dyereh
    @dyereh
    Thanks @tarsius - yes I have definitely been looking thru magit source - totally new to elisp. Looks like I really wanted to 'define-suffix-command' and make that command (interactive)
    Jonas Bernoulli
    @tarsius
    You probably don't need define-suffix-command and can just use regular defun instead. transient-append-suffix probably is unnecessary as well and you can just define the bindings+description inside the define-transient-command call.
    dyereh
    @dyereh

    @tarsius - don't I need to use transient-append-suffix to add it to an existing transient? When I just use defun I get fixup-head is not defined or autoloaded as command

    Here's an example of working code that does what I was hoping (add a custom command to an already existing transient)

    (define-suffix-command fixup-head ()
      "Make current commit a fixup to HEAD"
      (interactive)
      (magit-run-git "commit" "--fixup" "HEAD")
      )
    
    (with-eval-after-load 'magit
     (transient-append-suffix 'magit-commit "c"
                             '("h" "fixup head" fixup-head))
    )
    Jonas Bernoulli
    @tarsius
    Yes you right.
    dyereh
    @dyereh
    Thanks for the help!
    Ferruccio Aceves
    @SrAceves
    Hello
    is there a way to get the tree hash of a particular ref (tag)?
    asymmetric
    @asymmetric
    is there a way to show the hash of the current HEAD, without having to open magit status window?
    Kévin Le Gouguec
    @peniblec
    @tarsius Should I create an issue for the autoloading of magit-file-mode-map? (Whether the solution ends up being "moving the keybindings-only modes to another file", "banging on the autoload specs until they do TRT", or "document that one must (require 'magit-files))
    @asymmetric off the top of my head, all I can think of is M-: (magit-rev-hash "HEAD")
    Kévin Le Gouguec
    @peniblec
    @SrAceves not sure, but does (magit-rev-parse "REF:PATH") do what you want?
    Nick Anderson
    @nickanderson_gitlab
    Is there some difference between github/gitlab with respect to pushing and leveraging credentials stored in ~/.authinfo.gpg? I am able to push to my github repositories, but pushing to gitlab requires me to type my password each time.
    James Elliott
    @brunchboy
    Did you remember to add your public key on GitLab?
    Nick Anderson
    @nickanderson_gitlab
    Hum, perhaps not. I will check, but I wouldn't expect GitLab to need my public key for emacs to find the credentials in ~/.authinfo.gpg.
    Yep, GitLab has my public gpg key.
    James Elliott
    @brunchboy
    I don’t know then…
    Nick Anderson
    @nickanderson_gitlab
    Yeah, it's been plaguing me for quite some time. Strange and annoying. I will get it figured out one of these days.
    Noam Postavsky
    @npostavs

    Yep, GitLab has my public gpg key.

    Wasn't the question about public ssh key?

    Nick Anderson
    @nickanderson_gitlab
    Maybe it was. I should have indicated that I was cloning via https not ssh.
    Roland Everaert
    @montaropdf
    @nickanderson_gitlab, Did you define your gitlab instance in the alist forge-alist?