On Tue, Jan 06, 2009 at 05:40:52PM +0900, Stephen J. Turnbull wrote:
Michael Sperber writes:
> > git reset leaves the working copy alone. No patches applied or
> > reversed, just an in-memory operation on the index, and a change of
> > HEAD.
>
> What's a situation where you'd want that? (I'm not doubting it
exists,
> just wondering.)
Fixing a typo or something in the last (unpublished commit) commit (so
you don't care if the ID changes, there are no references to it.
Forgetting a series of commits and mashing the whole thing into one
commit (I do this *a lot* because I forget to commit the ChangeLog).
git commit --amend is nice for that too.
In some aspects, git is a little perlish. There's more than one way
to do what you want. I think that's in part the reason for its
success, and the reason for its reputation as hard to learn: git gives
you a set of tools but does not impose a specific workflow. That
freedom is seen in the myriad of git tutorials you can find, they more
often than not present different workflows rather than different
commands. And it's very much by design. Hg seems to me (but I can be
wrong) to have been designed with one specific workflow in mind
(mostly centralized development with quality offline work support,
branches as directories, ), and support for others feels a little
tacked on after the fact. The revision numbers look like a symptom.
Git is very much about powerful elementary tools (DAG of revisions,
unique naming, merge), usually called plumbing, and higher level tools
in support of a variety of workflows on top of it (pull, rebase,
branch, tag...) usually called porcelain. Which makes it useful both
for me on my projects nobody else sees and for large scale things like
Xorg or the linux kernel. But more often than not encountering git is
being given a compiler when what you need is software design courses.
OG.
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta