git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Q: How to tag individual files
@ 2008-07-13  4:21 Poojan Wagh
  2008-07-13  5:35 ` Shawn O. Pearce
  0 siblings, 1 reply; 4+ messages in thread
From: Poojan Wagh @ 2008-07-13  4:21 UTC (permalink / raw)
  To: git

The crash course at: http://git.or.cz/course/svn.html says:

> You usually tag commits but if you want, you can tag files (or trees, but that's a bit low-level) as well. 

I've done a bit of searching, and I can't for the life of me figure out 
how to tag an individual file. Help from the group would be much 
appreciated. Thanks.

--
Poojan Wagh
http://www.circuitdesign.info

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

* Re: Q: How to tag individual files
  2008-07-13  4:21 Q: How to tag individual files Poojan Wagh
@ 2008-07-13  5:35 ` Shawn O. Pearce
  2008-07-13  6:14   ` Poojan Wagh
  2008-07-13 10:20   ` Petr Baudis
  0 siblings, 2 replies; 4+ messages in thread
From: Shawn O. Pearce @ 2008-07-13  5:35 UTC (permalink / raw)
  To: Poojan Wagh; +Cc: git

Poojan Wagh <poojanwagh@gmail.com> wrote:
> The crash course at: http://git.or.cz/course/svn.html says:
>
>> You usually tag commits but if you want, you can tag files (or trees, 
>> but that's a bit low-level) as well. 
>
> I've done a bit of searching, and I can't for the life of me figure out  
> how to tag an individual file. Help from the group would be much  
> appreciated. Thanks.

You don't tag individual files.  Git is snapshot based.  You tag
the entire project at once.

The comment you quoted was talking about tagging a single listing of
blobs (a tree) or a single blob (stream of bytes).  This can be handy
in rare cases.  In the linux kernel for example the prior history
was stored by tagging the tree of that prior history, as there was
no git based history preceeding that snapshot, so there were no
commits to tag.  In git.git Junio publishes his GnuPG public key
as a tagged blob, making it available to validate signed tag objects.

So you can't tag individual files.  The comment is a bit misleading
and gets far too low-level for an otherwise high-level conversion
guide.

-- 
Shawn.

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

* Re: Q: How to tag individual files
  2008-07-13  5:35 ` Shawn O. Pearce
@ 2008-07-13  6:14   ` Poojan Wagh
  2008-07-13 10:20   ` Petr Baudis
  1 sibling, 0 replies; 4+ messages in thread
From: Poojan Wagh @ 2008-07-13  6:14 UTC (permalink / raw)
  To: git

Thanks, Shawn, for the clarification. Your explanation--together with 
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#the-object-database-- 
makes it clear.

So, to summarize (with the intent of fixing any misunderstanding on my 
part): You can tag the contents of files (blobs), but not files per se, 
because:
1. Git doesn't store files as an object as such. It stores the contents 
of files ("blobs")
2. Git stores directories (which define their constituent file names and 
contents=>blobs) as "tree" objects. So, the association between a file's 
name and a its contents occurs in a tree object.

One thing I notice about this structure is that a tree object can at 
least theoretically give me what I want: the ability to have files 
organized with labels (a la gmail) rather than folders--I would like to 
be able to have a single file show up under many different labels rather 
than mutually exclusive folders/directories. I know that this won't 
happen automatically, but it's nice to know that I *could* do it if I 
wanted to.

Thanks!

P.S. I also found http://www.gitcasts.com/posts/browsing-git-objects 
useful for as illustration of all the object structure.

Shawn O. Pearce wrote:
> Poojan Wagh <poojanwagh@gmail.com> wrote:
>> The crash course at: http://git.or.cz/course/svn.html says:
>>
>>> You usually tag commits but if you want, you can tag files (or trees, 
>>> but that's a bit low-level) as well. 
>> I've done a bit of searching, and I can't for the life of me figure out  
>> how to tag an individual file. Help from the group would be much  
>> appreciated. Thanks.
> 
> You don't tag individual files.  Git is snapshot based.  You tag
> the entire project at once.
> 
> The comment you quoted was talking about tagging a single listing of
> blobs (a tree) or a single blob (stream of bytes).  This can be handy
> in rare cases.  In the linux kernel for example the prior history
> was stored by tagging the tree of that prior history, as there was
> no git based history preceeding that snapshot, so there were no
> commits to tag.  In git.git Junio publishes his GnuPG public key
> as a tagged blob, making it available to validate signed tag objects.
> 
> So you can't tag individual files.  The comment is a bit misleading
> and gets far too low-level for an otherwise high-level conversion
> guide.
> 

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

* Re: Q: How to tag individual files
  2008-07-13  5:35 ` Shawn O. Pearce
  2008-07-13  6:14   ` Poojan Wagh
@ 2008-07-13 10:20   ` Petr Baudis
  1 sibling, 0 replies; 4+ messages in thread
From: Petr Baudis @ 2008-07-13 10:20 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Poojan Wagh, git

  Hi,

On Sun, Jul 13, 2008 at 05:35:37AM +0000, Shawn O. Pearce wrote:
> Poojan Wagh <poojanwagh@gmail.com> wrote:
> > The crash course at: http://git.or.cz/course/svn.html says:
> >
> >> You usually tag commits but if you want, you can tag files (or trees, 
> >> but that's a bit low-level) as well. 
> >
> > I've done a bit of searching, and I can't for the life of me figure out  
> > how to tag an individual file. Help from the group would be much  
> > appreciated. Thanks.
..snip..
> So you can't tag individual files.  The comment is a bit misleading
> and gets far too low-level for an otherwise high-level conversion
> guide.

  I have tried to make this less misleading, thanks for noticing. I kept
the mention, though, because I think people should not be misled to
thinking that only commits are tagged, and then get confused when they
first meet v2.6.11.

-- 
				Petr "Pasky" Baudis
GNU, n. An animal of South Africa, which in its domesticated state
resembles a horse, a buffalo and a stag. In its wild condition it is
something like a thunderbolt, an earthquake and a cyclone. -- A. Pierce

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

end of thread, other threads:[~2008-07-13 10:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-13  4:21 Q: How to tag individual files Poojan Wagh
2008-07-13  5:35 ` Shawn O. Pearce
2008-07-13  6:14   ` Poojan Wagh
2008-07-13 10:20   ` Petr Baudis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).