Re: committing empty diffs

From: Shawn O. Pearce <spearce@spearce.org>
Date: 2007-02-13 07:03:24
Don Zickus <dzickus@gmail.com> wrote:
> Considering git-commit doesn't allow this (probably for good reason),
> is it technically safe to do the following sequence of events?
> 
> tree=$(git-write-tree)  #basically the same tree HEAD points to
> commit=$(echo $IDEAS | git-commit-tree $tree -p HEAD)
> git-update-ref HEAD $commit HEAD
> 
> I figured all a commit is doing is taking a snapshot of a particular
> tree at a moment in time.  And taking multiple snapshots at that same
> moment and stringing them together (pointed to by HEAD) wouldn't be a
> big deal.
> 
> Am I going to wind up shooting myself in the foot later or will this
> work?  Light testing didn't show any issues.  Thought I would ask the
> experts.  Thanks.

No, it won't break anything.

I do that empty commit myself for a different reason.  I wouldn't
recommend that you do that with public history, and since the file
didn't change in that commit you cannot do `git log -- foo.c` to
see which notes you wrote about foo.c.  But `git log` will still
show you the messages.

-- 
Shawn.
-
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 Tue Feb 13 14:31:24 2007

This archive was generated by hypermail 2.1.8 : 2007-02-13 15:00:23 EST