1

I am using Emacs on Mac OS with the package Magit. Everything works fine except when I try to do a commit (shortcut: c c). Magit hangs with this message in the bottom bar: "running git commit". What is weird is that when I stop the command (Ctrl-g), magit shows me the buffer to write my commit message and everything works fine. I don't know why this happens.

with-editor-emacsclient-executable

is set to /usr/local/Cellar/emacs/HEAD/bin/emacsclient.

and calling /usr/local/Cellar/emacs/HEAD/bin/emacsclient filename directly from the console seems to work.

Thank you for your help!

TheGeorgeous
  • 3,927
  • 2
  • 20
  • 33
maroxe
  • 2,057
  • 4
  • 22
  • 30

1 Answers1

1

It seems to be a common problem when dealing with a large repo or a repo that has been around for a long time. Try cleaning up the repo. You can use these:

git remote prune origin
git gc

From the official docs:

git remote prune origin

Deletes all stale remote-tracking branches under name. These stale branches have already been removed from the remote repository referenced by name, but are still locally available in "remotes/name".

git gc

Runs a number of housekeeping tasks within the current repository, such as compressing file revisions (to reduce disk space and increase performance) and removing unreachable objects which may have been created from prior invocations of git add.

Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance.

Could be an issue with large diffs too:

https://github.com/magit/magit/issues/2048

TheGeorgeous
  • 3,927
  • 2
  • 20
  • 33
  • could you please expand on what that commnand does exactly? This didn't work for me. – maroxe Feb 24 '16 at 03:07
  • @maroxe, have added the details – TheGeorgeous Feb 24 '16 at 03:13
  • @maroxe, also what worked for me is cleaning up my remotes to reduce the number of branches. Like I said seems to be common for large repos like Linux. See https://github.com/magit/magit/issues/2097 – TheGeorgeous Feb 24 '16 at 03:16
  • I think here the problem is related to the magit tries to reach the editor and loops for something to happen. If I abort that process then I have access to the commit buffer an I can commit as usual. Committing from the command line woks fine. – maroxe Feb 24 '16 at 03:22
  • @maroxe, actually if you press `c` instead of `C-g` it will work just the same – TheGeorgeous Feb 24 '16 at 03:22
  • what do you mean by that? just pressin `c` does nothing for me – maroxe Feb 25 '16 at 14:33
  • I meant I don't think it is because a process is hanging if it is stuck, I usually press `c` again and I get the commit msg window – TheGeorgeous Feb 25 '16 at 14:37