Command attempted:
hub pull-request
What happened:
PyCharm editor opens up a text file to add the pull request message, but the command line aborts the attempted pull-request within a few seconds, with aborting due to empty pull request title
, leaving no time to write the message in my text editor. PyCharm subsequently closes the text file automatically.
*Steps to reproduce: *
I was simply attempting to replicate the steps for creating a pull request found here: https://hub.github.com/:
hub pull-request
More info:
git version 2.23.0.windows.1
hub version 2.14.2
Windows 10, using Git Bash
Thank you for reporting! This sounds like an issue with the editor process that hub shells out to.
Can you check your git var GIT_EDITOR
? That's the value that hub will invoke as an editor. If it's a graphical application, like PyCharm sounds like it is, it's important to pass in flags that ensure that the process blocks until the file under editing is saved. It sounds like your editor process does not block and exit prematurely before you've even saved the file.
This might be solvable by changing your editor command: `git config --global core.editor "my command --here"
Hi Mislav, yes PyCharm is an IDE, and GIT_EDITOR
does point to it. Let me know if there is any more information you need.
As to your possible work-around, what are you suggesting goes in the "my command --here" spot?
Ah, I see. I can change git's default text editor. I just added sublime text. We'll see if that does any better next time I have to do a PR.
yes PyCharm is an IDE, and
GIT_EDITOR
does point to it.
Would you share with us this value? Or, would you check that the --wait
flag is present?
Example: pycharm64.exe --wait
The Sublime Text workaround is also valid 馃憤 Basically, any editor will do, as long as the process waits until the file has been saved and closed
Okay, forgive my ignorance here. If you couldn't tell, I'm somewhat amateurish. To answer your questions:
GIT_EDITOR
just contained the path to PyCharm: "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\bin\pycharm64.exe"
There was no --wait
flag inside of GIT_EDITOR
. I read how to use the flag here: https://swcarpentry.github.io/git-novice/02-setup/.
I changed GIT_EDITOR
to point at subl --wait
, and will see if it works now :)
GIT_EDITOR
just contained the path to PyCharm: "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\bin\pycharm64.exe"
Thanks for sharing! As I pointed out, if you're going to use PyCharm as your git editor (used by both git commit
and hub pull-request
), you will have to add --wait
at the end of the core.editor
configuration value, the same as you're already adding for Sublime Text. Whatever works for you!
Closing since this turned out to be a configuration issue. 馃檱
@mislav I just want to say thanks. I know this isn't a help forum (and I didn't think I was asking for help), but that's what it turned in to. You kindly obliged to help me and my "bug" which was really just user error, and for that I am thankful. Kudos for being so helpful and non-condescending to a beginner.
You're welcome, @wcneill. Your kind words mean much to me