I love Brackets and as a user, I'd like a way to associate him as Git text editor.
Already realized the following to the Brackets with no success:
https://help.github.com/articles/associating-text-editors-with-git/
Thank you.
Nice idea :+1:
After configuring core.editor:
git config --global core.editor "brackets"
Brackets already correctly opens the COMMIT_EDITMSG file, so only thing needed to implement in brackets-shell / cmd-line integration this would be "don't return until Brackets exits" behavior behind a -w or -wait flag
Exactly!
tagging @zaggino
there scripts would need to be modified: https://github.com/adobe/brackets-shell/tree/master/scripts
for windows, it should be easy, just remove the start bit from https://github.com/adobe/brackets-shell/blob/master/scripts/brackets.bat
for mac/linux, it's this file: https://github.com/adobe/brackets-shell/blob/master/scripts/brackets but it has been a while since I've done any shell scripts
i'm guessing you guys could try to find those script files on your drives using which and try to alter them to support the -w flag?
@zaggino I was going to do the Windows part myself but didn't get around to do it because something (I think the folder being in PATH?) locks the files from editing. I can try again later today.
there's no reason it should be locked ... but I'm not familiar where installer places those, maybe UAC is blocking it?
@zaggino yeah it's an UAC problem, might have been too sleepy to figure that out :hamster:
Some progress:
Modifying the brackets.cmd like this can be used to wait for exit:
@echo off
SET WAIT_FOR_EXIT=
FOR %%a IN (%*) DO (
IF /I "%%a"=="-w" SET WAIT_FOR_EXIT=YES
IF /I "%%a"=="--wait" SET WAIT_FOR_EXIT=YES
)
echo "waiiiit"
IF "%WAIT_FOR_EXIT%"=="YES" (
echo "waiiiit"
start /WAIT Brackets.exe %*
) ELSE (
start Brackets.exe %*
)
However, associating it with core.editor won't work. Why? Because running git commit launches the core.editor in the MinGW context, which means that this block will be run from brackets-file:
if [ "$OS_NAME" == "MinGW" ]; then
# Suprisingly MING32 platform recognizes
# windows "start" command. Use this against
# launching .exe as the later is blocking.
start "Brackets.exe" "$@"
else
But that start command won't accept the /wait parameter.
Investigating...
I don't think you need to pass /wait parameter to Brackets.exe. You just need to get rid of the start keyword in case you want the script to wait.
git config --global core.editor "brackets -n -W"
works for me using git version 2.13.1 and Brackets 1.9
Most helpful comment
Nice idea :+1:
After configuring
core.editor:Brackets already correctly opens the COMMIT_EDITMSG file, so only thing needed to implement in
brackets-shell/ cmd-line integration this would be "don't return until Brackets exits" behavior behind a-wor-waitflag