Hacker News new | comments | show | ask | jobs | submit login
Using 'git stash' as a todo list (vwelch.com)
23 points by timf on Nov 29, 2010 | hide | past | web | favorite | 11 comments



I just use

    git add -p
That way I can code at my leisure and worry less about the bookkeeping until I am ready to publish.


I do that as well, but I don't really like that I'm actually committing untested code, since I might forget a needed part.


You can test exactly what you're about to commit by doing a `git stash save --keep-index`, then test, commit, and `git stash pop` to get your working tree back.


There's also

  git stash -p
:)


Nice, I had no idea that existed. Now to learn what all the non-obvious letters mean :)

Definitions: http://www.kernel.org/pub/software/scm/git/docs/git-add.html...


I learned it because of the general -i; the -p was the only portion of -i that I really use with "git add". The -i is what makes "git rebase" more than just a patch pusher.


Isn't this what branches are for? This seems ridiculous.

I applaud the ingenuity but I think the author would be better off making a shortcut/alias to create a branch from the current head with some interesting name and commit message and commit the changes to the new branch, then switch back to the current one.

One accidental "git stash clear" and this dude's setup is wiped!


Interesting idea, I played with branches and added a simple script to the end of my blog post to show what it would take - it's a half dozen lines of git if you want so skip the click, with the tricky bit being figuring out what branch you start from so you can return to it.

Seems workable, though by the time you're done working out the details, seems like you should just use a real issue tracker.

I think of my approach as the moral equivalent of post-it notes on the monitor, I wouldn't want to base any important system on it, but it's useful at times.


I believe you're describing creating a branch with one commit that only contains a selection of the changes in the index. What are the commands to do that?


Ah I think I missed that nugget when I read the article... he is committing just a partial with his one TODO diff only. I didn't notice that.

Still he should use an issue tracker, and then some branches :)

In fact a guy at our company hacked out a really cool git-pivotal integration that lets you create a branch to work on a specific story from the CLI https://github.com/ardell/Git-Pivotal I think it'd be trivial to write a simple CLI script to add a TODO to an issue tracker this way as well.


Hmmm, a CLI that created a branch and an issue on github and tied them together in some magical way would be way cool.




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

Search: