Re: What's in git.git (stable)

From: Carl Worth <cworth@cworth.org>
Date: 2006-12-16 09:54:30
> The 'can of worms' is that switching to an existing branch could
> fail with conflicts.

One fix for this would be the idea I've proposed to have a new flag
for "git checkout" to 'stash' the dirty state in the current branch
before switching.

Then, there wouldn't be a problem to implement "commit -b <anybranch>"
on top of the stashing checkout.

I think the only real problem with the idea of having dirty changes
stashed in a branch is that git already allows dirty changes to be
carried while switching to a branch, (with or without -m). And doing
both of those at once would lead to an ugly new conflict situation,
(where _neither_ of the conflicted states exist as exposed tree
objects). Even if there were no conflict, it would mingle two
different sets of local modifications, and that could be unkind as it
might be hard for the user to separate them if they didn't want them
mingled.

If someone were to pursue this idea, I think it would be reasonable to
just make that case an error, "Cannot carry local modifications when
checking out a branch with stashed modifications." That message could
even suggest the user use the stash option to leave the local
modifications behind when doing the checkout.

-Carl

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Received on Sat Dec 16 09:56:21 2006

This archive was generated by hypermail 2.1.8 : 2006-12-16 09:57:57 EST