Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get COMMIT_EDITMSG to open from the correct location?
    primarykey
    data
    text
    <p>I'm new to GIT. I downloaded GIT for Windows from a GitHub link a few days ago. I'm using the command line tool <em>MinGW32</em>. I'm not comfortable with the default editor so I've been trying to set up my favourite editor.</p> <p>I followed the instructions <a href="https://stackoverflow.com/a/7549705/1862009">here</a> to use EditPad Pro as my editor. But I keep getting the following message:</p> <p><code>Aborting commit due to empty commit message.</code></p> <p>EditPad Pro opens a new instance. MinGW32 is waiting because I don't get the abort message until after I close EditPad Pro. When the editor opens, it opens with a blank file called <code>COMMIT_EDITMSG</code>. When I close the editor, the file saves to the main directory for the repo.</p> <p>I found a clue in <a href="https://stackoverflow.com/a/2988154/1862009">this answer</a>, specifically this phrase:</p> <blockquote> <p>[Vim] saves the file to .git/COMMIT_EDITMSG by default</p> </blockquote> <p>If I do a <em>Save As</em> to save the file to the .git directory before closing the editor, then it works. However, there are two problems with that:</p> <ol> <li>I have to remember to <em>Save As</em></li> <li>I don't get the helpful comments that Git adds by default to COMMIT_EDITMSG</li> </ol> <p>The current config setting for <code>core.editor</code> is:</p> <pre><code>"'D:\Program Files\JGsoft\EditPadPro5\EditPad Pro.exe' //newinstance" </code></pre> <p>I'm not sure what the <code>$*</code> mentioned in the instructions is for, but I tried it with and without that and also assorted variations with and without single/double quotes. I tried setting the value in a shell script as well. At worst, it doesn't work at all (e.g. won't even open the editor) and at best it opens a blank file.</p> <p>How do I get my editor to open with the file that Git created in the .git directory?</p> <p><strong>EDIT:</strong> I get the exact same results whether I use <code>$*</code> or not, and <a href="https://stackoverflow.com/a/1083830/1862009">this answer</a> says it's not needed. <a href="http://git-scm.com/book/en/Customizing-Git-Git-Configuration" rel="nofollow noreferrer">This <em>Git Pro</em> page</a> makes mention of it when explaining how to set up external merge and diff tools, but makes no mention of it when explaining the <code>core.editor</code> config setting. Note: I also tried <code>%*</code>.</p> <p>If the <code>$*</code> variable was needed (and missing), I would think that EditPad Pro would open with a blank <em>Untitled</em> file rather than a blank COMMIT_EDITMSG file in the current directory. The problem seems to be the path.</p> <p><strong>EDIT:</strong> I've done more experimenting. I have spaces in my file path and I thought that might be causing a problem. I cloned my repo into a new directory with no spaces in the name and fixed my config variables. It didn't solve the problem. But I noticed another problem. In some of my tests, the blank file that was loaded into the editor was named <code>$@</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload