Hacker News new | past | comments | ask | show | jobs | submit login

I can't actually program all the time. Sometimes I need to study machine learning or think about design. During those times I use commits much like journal entries.

I actually keep a separate journal and sometimes paste from it. I've been using LibreOffice Writer for it and decided to drop it recently because it would take so long to save a file - like 5s or more. Around every 3 month I'd fill in about 1000 pages of it and it was forcing me to move to a new file every time that happened. Now I just use VS Code for this sort of thing. Raw text is the best after all, but it is too bad I can't paste images into the journal anymore.




If you do wish to use commits to simply journal your thoughts, and would like to do so without this requiring code or file changes, you may find the --allow-empty option useful when committing.

This allows you to create a new commit, even if no files have changed.


Or, write your journal entries to a file and commit that? That's what I do. Most of my personal projects have a "notes.txt" at the top level for this purpose. Sometimes I just need to write freeform about the problem I'm trying to solve, from different angles, to work out my strategy. Sometimes I just write the despair that I'll never figure something out.


How would one enable this in Visual Studio?


Unfortunately, as far as I am aware, Visual Studio does not directly expose this option.

However, it is quite likely you can use Visual Studio's "External Tools" feature to be able to achieve this. (https://msdn.microsoft.com/en-us/library/76712d27.aspx)

You could set up an external tool that did something like the following:

Title: Commit with Selected Text as Message

Command: path\to\git.exe

Initial Directory: $(SolutionDir)

Arguments: commit --allow-empty -m "$(CurText)"

This will allow you to create an empty commit, with the selected text becoming the commit message. (Just bear in mind if you have any files staged, they will be committed as well)

I unfortunately do not have Visual Studio currently installed, so please take the above as a rough sketch, and my apologies if it doesn't work as is. But, I hope it is of use to you.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: