News for hackers. Stuff that matters.
Re:Y U NO commit?? by vertex-four on Monday October 20, 2014 @08:26AM (#8481726)
Shouldn't we then have a tool which separates out "published, shared" commits from WIP commits, if they're different "types"?
Re:Y U NO commit?? by jordigh on Monday October 20, 2014 @08:53AM (#8481835)
Yeah, Mercurial phases handles this:

http://mercurial.selenic.com/wiki/Phases

Re:Y U NO commit?? by exDM69 on Monday October 20, 2014 @09:12AM (#8481915)
Why would this be advantageous?

If you're using Git or another version control that can do squash/rebase, what would be the advantage of having a separate concept of "temporary commits" or something?

In addition, git has a staging area (git add), which I use to stage intermediate steps of work.

It's a good idea to have only "clean" commits in your master branch (to allow for easy blame/bisect) but you can easily do feature branches that can remain "dirty" before squashing and merging to master.

Re:Y U NO commit?? by lmm on Monday October 20, 2014 @10:24AM (#8482264)
> If you're using Git or another version control that can do squash/rebase, what would be the advantage of having a separate concept of "temporary commits" or something?

It'd be nice to be able to mark commits as "squashable" as I went along (without actually squashing them yet), rather than finishing my feature branch and then have to go back and remember which commits were the "good" ones.

Re:Y U NO commit?? by krupan on Monday October 20, 2014 @10:46AM (#8482357)
As another poster pointed out, Mercurial phases are the answer to this. I don't know if very many mercurial users actually use them this way consciously or not. Most mercurial people that are deliberately and intensely into this workflow learned to use mercurial patch queues before phases existed (patch queues are basically the git staging area on steroids).
Re:Y U NO commit?? by micampe on Monday October 20, 2014 @10:47AM (#8482359)
You can do that with autosquash https://coderwall.com/p/hh-4ea
Re:Y U NO commit?? by lmm on Tuesday October 21, 2014 @08:55AM (#8487036)
Is there an equivalent with a looser match? Half the time I don't remember what my last commit message was.
Re:Y U NO commit?? by micampe on Tuesday October 21, 2014 @01:35PM (#8488525)
No, but this explains a nice trick to use it without remembering the commit message http://technosorcery.net/blog/2012/08/05/updated-git-rebase-...

With that you can do:

    git fixup HEAD~2
Re:Y U NO commit?? by blablabla123 on Monday October 20, 2014 @08:36AM (#8481765)
It's more of a workflow thing. When working on a difficult feature, or rather difficult ticket, that cannot reasonably split into 2, it makes sense to work on a separate feature branch. This branch is just for yourself and can be polluted with dirty commits. Once your done, your can git rebase the thing into one, beautiful commit.
Re:Y U NO commit?? by SargoDarya on Monday October 20, 2014 @08:44AM (#8481794)
If you're working in a feature branch I don't think it would be that much of a problem to be honest. Just be sure to squash the commits before writing the pull request later on.
Re:Y U NO commit?? by megablast on Monday October 20, 2014 @09:00AM (#8481870)
What do you mean by squashing the commits? Why would it matter if you do a pull request after committing a lot?
Re:Y U NO commit?? by ulisesrmzroche on Monday October 20, 2014 @10:50AM (#8482374)
You can squash or rebase history in Git, which basically means you compress all your changes into a single one. People use this to keep a clean history.