Re: [PATCH/RFC] Add [] as an alias for a reference to the empty tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 10, 2010 at 11:51:05AM +0200, Sverre Rabbelier wrote:

> On Mon, May 10, 2010 at 11:20, Jeff King <peff@xxxxxxxx> wrote:
> >> However, if INDEX, WORKTREE and EMPTY are preferred as syntactic sugar
> >> tokes, then that is fine by me.
> 
> Must it be ALL CAPS? In Mercurial the fairly elegant 'nil' is used for
> the empty commit, why can't we do the same?

[Please watch your quoting, which is a bit misleading there].

I think the intent was that because they clash in the normal refs
namespace, we would set them apart with caps (and we have already
sort-of claimed the all-caps namespace with things like HEAD,
FETCH_HEAD, etc).

> > So certainly if you want to do EMPTY, I wouldn't let the lack of the
> > other two hold you back. The only reason they are related at all is that
> > they would probably share a syntax, if the other two ever even get
> > implemented.
> 
> I still don't see the point in having INDEX and WORKTREE, especially
> since they're so CAPSY. Almost as if they're supposed to be
> environment variables.

The point was to make a more obvious and verbose alternative for people
who find "git diff" a little confusing. E.g.:

  # diff index to working tree
  # (now)
  git diff
  # (verbose)
  git diff INDEX..WORKTREE

  # diff HEAD to index
  # (now)
  git diff --cached
  # (verbose)
  git diff HEAD..INDEX

  # diff HEAD to working tree
  # (now)
  git diff HEAD
  # (verbose)
  git diff HEAD..WORKTREE

I think the original proposal is from this post-GitTogether 2008 thread:

  http://thread.gmane.org/gmane.comp.version-control.git/99376/focus=100729

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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]