Git development
 help / color / mirror / Atom feed
* committing empty diffs
@ 2007-02-12 19:49 Don Zickus
  2007-02-12 20:03 ` Shawn O. Pearce
  2007-02-12 20:10 ` Linus Torvalds
  0 siblings, 2 replies; 5+ messages in thread
From: Don Zickus @ 2007-02-12 19:49 UTC (permalink / raw)
  To: git

I was toying around with the idea of keeping track of scripts or
config files in my home directory.  Most of the time my commits would
include a change to the file I was tracking.  However, there are a
couple of cases where I wanted to commit empty diffs.  For example,
ideas or todos about that particular file that I didn't want to embed
in the file itself nor write it in yet another file labeled ideas or
todos.  I thought it would be easier to just to run a 'git log' on the
file and see my whole thought process.

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.

Cheers,
Don

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-12 20:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-12 19:49 committing empty diffs Don Zickus
2007-02-12 20:03 ` Shawn O. Pearce
2007-02-12 20:10   ` Shawn O. Pearce
2007-02-12 20:19   ` Don Zickus
2007-02-12 20:10 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox