Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git commands terminate mid operation #278

Closed
un1versal opened this issue Aug 17, 2015 · 19 comments
Closed

git commands terminate mid operation #278

un1versal opened this issue Aug 17, 2015 · 19 comments
Labels

Comments

@un1versal
Copy link

When Im using Windows I use github desktop whatever the latest release is, Ive reported this to them and was suggested it is a gt issue rather than a github desktop application issue.

Windows 7 Sp1
Notepad++ 6.8.1 as default editor
Github Desktop 3.0.3
(any more information requested please specify and let me know how to retrieve it).

This issue happens when using cmd/poweshell terminal and running commands like git rebase -i HEAD~# and am squashing a few commits into one.

Notepad++ is triggered 1st time and file opens and Im midway into editing file e.g which commits to squash/reword and before I get a chance to finish in cmd terminal it skips the operation to end. whatever the file I was editing is left as a uncommitted change and has to be discarded or deleted.

This repeats sometimes 3 or 4 times in a row before it sticks.

Ive noticed this also happens in other operation like git commit --amend so anything that opens the editor to edit some file save and close.

Expected behavior is edit whats needed when files trigger open, save changes & close notepad++ and wait for git to takeover and finish operation to the end.

@GuentherVIII
Copy link

Try setting your editor to "notepad++ -multiInst". Plain notepad++ will only tell the already running instance to open the file before exiting, which looks as if you finished editing the file in record time.

@un1versal
Copy link
Author

Thx, Lets see if that nugget is gold!
git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst"

Ill report back with results.

@dscho
Copy link
Member

dscho commented Aug 18, 2015

@UniversaI any news?

@dscho dscho added the question label Aug 18, 2015
@un1versal
Copy link
Author

I wanted to test more in depth with a few actual operations but a superficial test is yielding positive results at this time, so its encouraging.

@dscho
Copy link
Member

dscho commented Aug 18, 2015

Good! I plan to move msysgit/msysgit#218 to the new Git for Windows org.

Would you be interested in working on the installer so it can detect notepad and auto-configure it as commit message (and rebase -i and ...) editor?

@un1versal
Copy link
Author

Good! I plan to move msysgit/msysgit#218 to the new Git for Windows org.

Would you be interested in working on the installer so it can detect notepad and auto-configure it as commit message (and rebase -i and ...) editor?

who moi?

@dscho
Copy link
Member

dscho commented Aug 19, 2015

@UniversaI yep, I think you

  • have the need
  • have the knowledge
  • have my support

so... what could go wrong? 😃

@un1versal
Copy link
Author

have the need ✔️
have the knowledge ❌
have my support 🍒

@dscho I appreciate the vote of confidence 😄
But, no idea what I would be doing there to begin with, not familiar with installers or the source code, so Im hardly the right person for this task.
However if I were it would already be done. 😁

@dscho
Copy link
Member

dscho commented Aug 19, 2015

Well, okay. I am sure you don't mind that I close this ticket now, given that it is not a Git for Windows bug (yet, because the installer does not autodetect Notepad yet).

@dscho dscho closed this as completed Aug 19, 2015
@un1versal
Copy link
Author

@dscho Well it is a issue even if not a bug at this time, but close it I dont mind even though there really was no opportunity to test the _fix_ properly.

Ide be willing to have a look at fixing this properly if you point me in right direction

For now I suggest some sort of documentation on how to fix the issue would be done, somewhere like in http://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration how to add notepad++ as default editor with -Multiinst etc would be a start.

@dscho
Copy link
Member

dscho commented Aug 20, 2015

there really was no opportunity to test the fix properly

Yes there was... Teach the Git for Windows installer to be more user-friendly and offer to configure Notepad++ as the default editor...

That would have the benefit of not having to clutter the ProGit book with information relevant only to a tiny fraction of users...

@un1versal
Copy link
Author

Yes there was... Teach the Git for Windows installer to be more user-friendly and offer to configure Notepad++ as the default editor...

No there wasnt, I dont know how.
If only. In an ideal world that would be true.

And since neither you or I know what we doing with that, that much is clear else your msysgit/msysgit#218 wouldn't be over a year old. Right?

Im putting forth a remedial solution which is teh best I can do.

Anything else, as you have realized by now is to have someone who knows how to fix it properly do it, thus far its been over a year and no one has come forth.

I opened a issue for discussion to gain feedback from gitpro book maintainers, If they feel its appropriate and provide feedback, Ill do PR, else nothing will ever happen and then we wait.

@dscho
Copy link
Member

dscho commented Aug 20, 2015

@UniversaI just ask and I tell you what to do.

First of all, follow the description on our wiki how to build your own installer: https://github.com/git-for-windows/git/wiki/Making-an-installer

Then patch /usr/src/build-extra/installer/install.iss.in to add a new installer page similar to git-for-windows/build-extra@cbcf69b

After that, you can easily add code to detect the presence of Notepad++:

if DirExists(ExpandConstant('{pf}\Notepad++')) then begin
    ...
end;

(see http://www.jrsoftware.org/ishelp/index.php?topic=isxfunc_direxists and http://www.jrsoftware.org/ishelp/index.php?topic=consts for more information)

You probably also want to replace the use of TCheckBox by TRadioButton because we want to allow the user to choose one of several editors, not multiple editors.

You will want to imitate the fscache code to configure the editor in the end.

And then test, test, test.

After that: Pull Request and eternal fame.

@un1versal
Copy link
Author

You seriously give me too much credit and assume Im interested in wasting hours on end for a 2 second gain. Im not even a developer just some low level curious person. I briefly use git on windows to begin with.

I should have said this from the beginning. Sorry for wasting your time. Your ticket will have to wait for another year or for someone who can, has the knowledge and is willing to spend that time. Since neither you or I are.

However re-read my first post it all is clear there, -I'll will put the request forward to whoever is currently building the installer for github for desktop application which is the application which Im using temporarily when using in Windows for a short period of time.

Thanks again

@un1versal
Copy link
Author

GuentherVIII commented 3 days ago
Try setting your editor to "notepad++ -multiInst". Plain notepad++ will only tell the already running instance to open the file before exiting, which looks as if you finished editing the file in record time.

thx for that solved it with

git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst"

@PhilipOakley
Copy link

You seriously give me too much credit and assume Im interested in wasting hours on end for a 2 second gain.

It wouldn't be a "waste". It would save the hours of many in their similar searches for the right invocation for the notepadd++ editor (been there...).

I should have said this from the beginning. Sorry for wasting your time.

Hopefully you will have some spare time eventually that can be fed back into a suitable FOSS project. All the best.

Philip

@un1versal
Copy link
Author

It wouldn't be a "waste". It would save the hours of many in their similar searches for the right invocation for the notepadd++ editor (been there...).

Yes sure, I have no interest in learning about windows installers, I dont use it often, I am willing to contribute to documentation and hopefully help people find a solution faster assuming they RTFM.

Hopefully you will have some spare time eventually that can be fed back into a suitable FOSS project. All the best.

Even with time, there's no interest, people who seemingly more interested for over a year haven't touched it, and while I appreciated being canvassed for the task its not going to happen just because.

Im not discarding it you never know, but dont count on those eggs being in that basket.

Ultimately its Github Desktop application who make the installer and they have pushed this problem to git developers, I can report the issue and the solution to them and contribute to docs in meanwhile if thats what gitpro2 book people want.

All the best Philip thank you for reply.

@dscho
Copy link
Member

dscho commented Aug 21, 2015

@UniversaI please note that what you just said several times is a big slap into the face of all the contributors who made Git for Windows possible. Essentially, what you said -- repeatedly, to add insult to injury -- is: "You worked hard to make my life easier. Now I will not do anything for you in return. Not a single thing."

I am sure that was not your intention, yet that is exactly what everybody else understands, loud and clear.

If that is the message you are comfortable sending, then I guess I have nothing else to add to this conversation.

@un1versal
Copy link
Author

Not at all, I dont have time to learn the necessary knowledge and skills Im not a programmer even so there's an unreasonable expectation from your part for me to to contribute here on something I incidentally used a couple of times when Im using Windows OS.

"You worked hard to make my life easier. Now I will not do anything for you in return. Not a single thing."

Not true, Not true at all. I actually feel nothing but reverence for the skilled developers and contributors who make tools like this possible.

I'll be happy to spend some time in documentation and opened progit/progit2#365 for discussion on which way is best to go about that.

If you just wont accept anything else but a pound of flesh here then Im sorry. 😄

@dscho you come across impatient - you jumped down my throat half way into this and expected I immediately devote my every waking moment to this task and you feel offended when I state my reasons for not doing it.

Im also sure you didnt mean that but there it is... Thats how you coming across

If you cant understand what Im saying, then I regret it immensity and will terminate this now uncomfortable repartee here and now.

Accept my apologies and goodbye now.

To all Git developers and contributors: A huge thank you for your efforts and I hope one day Im able to contribute in a meaningful and all satisfying way.

@git-for-windows git-for-windows locked and limited conversation to collaborators Aug 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants