git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [RFC] Hidden refs
@ 2010-10-13 15:22 Marc Branchaud
  2010-10-13 15:32 ` Stephen Bash
  2010-10-13 17:35 ` Jeff King
  0 siblings, 2 replies; 8+ messages in thread
From: Marc Branchaud @ 2010-10-13 15:22 UTC (permalink / raw)
  To: Git Mailing List

Hi all,

We want to have our build system record, in our repo, which commits
correspond to which builds.

Nominally, this is a job for tags.  But we don't want to have to look at
these tags all the time.  We particularly just want to tag the repo when we
make an actual release -- tags are a Big Deal for us.

Notes are an option, though they feel a bit heavy for this application.  And
although we can store the build notes in their own refspace, it would (I
believe) be a little clunky to make commands like checkout and log work with
the commits that were noted by the build system.

It struck me that it would be neat to have hidden refs in the refs/
directory.  I experimented a bit with a "refs/.builds" directory:

* "git update-ref refs/.builds/One" fails with "Cannot lock the
  ref 'refs/.builds/One'."  So I created a ref the regular way
  (refs/blah/One) and copied the "One" file into refs/.builds/.

* Commands like show, checkout, and log all worked fine with
  "refs/.builds/One"

* "git show-ref" ignores the entries in refs/.builds/.

* So the .builds/ refs don't show up in gitk -- yay!

* "git push origin +refs/.builds/One fails with "remote part of refspec is
not a valid name in +refs/.builds/One".

* Completion in bash doesn't work with entries in refs/.builds/.

So I'm wondering if it makes sense to properly support hidden directories in
refs/, and what it would take to do so.  (I image, for example, that things
would behave quite differently on Windows...)

Thoughts?

		M.

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

* Re: [RFC] Hidden refs
  2010-10-13 15:22 [RFC] Hidden refs Marc Branchaud
@ 2010-10-13 15:32 ` Stephen Bash
  2010-10-13 16:14   ` Marc Branchaud
  2010-10-13 17:35 ` Jeff King
  1 sibling, 1 reply; 8+ messages in thread
From: Stephen Bash @ 2010-10-13 15:32 UTC (permalink / raw)
  To: Marc Branchaud; +Cc: Git Mailing List

> So I'm wondering if it makes sense to properly support hidden
> directories in
> refs/, and what it would take to do so. (I image, for example, that
> things
> would behave quite differently on Windows...)
> 
> Thoughts?

We currently use refs/hidden/heads and refs/hidden/tags for hidden refs.  It does require calling 'gitk --branches --tags' rather than 'gitk --all', but otherwise I like the behavior (git branch only lists refs/heads, git tag only lists ref/tags).  And they never get cloned by default (they can still be fetched when needed).

Stephen

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

* Re: [RFC] Hidden refs
  2010-10-13 15:32 ` Stephen Bash
@ 2010-10-13 16:14   ` Marc Branchaud
  0 siblings, 0 replies; 8+ messages in thread
From: Marc Branchaud @ 2010-10-13 16:14 UTC (permalink / raw)
  To: Stephen Bash; +Cc: Git Mailing List

On 10-10-13 11:32 AM, Stephen Bash wrote:
>> So I'm wondering if it makes sense to properly support hidden 
>> directories in refs/, and what it would take to do so. (I image, for
>> example, that things would behave quite differently on Windows...)
>> 
>> Thoughts?
> 
> We currently use refs/hidden/heads and refs/hidden/tags for hidden refs.
> It does require calling 'gitk --branches --tags' rather than 'gitk --all',
> but otherwise I like the behavior (git branch only lists refs/heads, git
> tag only lists ref/tags).  And they never get cloned by default (they can
> still be fetched when needed).

Hmm, maybe I'm just over-designing.

It's true that we could just use refs/builds (instead of .builds) and that
those refs would need to be explicitly retrieved by anyone who wanted to see
them (which is fine).  And after the builds/ refs are fetched and done with,
it's easy enough to get rid of them with a simple "rm -r .git/refs/builds"

It appears all I'm looking for is a way to avoid that rm command.  Seems a
bit silly in the end.

Thanks for the perspective!

		M.

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

* Re: [RFC] Hidden refs
  2010-10-13 15:22 [RFC] Hidden refs Marc Branchaud
  2010-10-13 15:32 ` Stephen Bash
@ 2010-10-13 17:35 ` Jeff King
  2010-10-13 17:42   ` Junio C Hamano
  1 sibling, 1 reply; 8+ messages in thread
From: Jeff King @ 2010-10-13 17:35 UTC (permalink / raw)
  To: Marc Branchaud; +Cc: Git Mailing List

On Wed, Oct 13, 2010 at 11:22:11AM -0400, Marc Branchaud wrote:

> We want to have our build system record, in our repo, which commits
> correspond to which builds.
> 
> Nominally, this is a job for tags.  But we don't want to have to look at
> these tags all the time.  We particularly just want to tag the repo when we
> make an actual release -- tags are a Big Deal for us.
> 
> Notes are an option, though they feel a bit heavy for this application.  And
> although we can store the build notes in their own refspace, it would (I
> believe) be a little clunky to make commands like checkout and log work with
> the commits that were noted by the build system.

Keep in mind that notes and tags are basically inverses as far as
efficient lookup goes. If you want to map a build name or number to a
commit, you would use a ref which points to a commit. But if you want to
map a commit sha1 to a build number, you would use notes.

> It struck me that it would be neat to have hidden refs in the refs/
> directory.  I experimented a bit with a "refs/.builds" directory:
> 
> * "git update-ref refs/.builds/One" fails with "Cannot lock the
>   ref 'refs/.builds/One'."  So I created a ref the regular way
>   (refs/blah/One) and copied the "One" file into refs/.builds/.

Yeah, I believe "." at the front of a directory component is explicitly
forbidden by check_ref_format. I don't recall whether there was a
specific rationale, or whether it was simply a can of worms we didn't
want to explore.

...

Look like it blames to 03feddd (git-check-ref-format: reject funny ref
names., 2005-10-13).  This looks like the relevant thread:

  http://article.gmane.org/gmane.comp.version-control.git/9874

but I didn't read through it carefully.

-Peff

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

* Re: [RFC] Hidden refs
  2010-10-13 17:35 ` Jeff King
@ 2010-10-13 17:42   ` Junio C Hamano
  2010-10-13 17:46     ` Jeff King
  0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2010-10-13 17:42 UTC (permalink / raw)
  To: Jeff King; +Cc: Marc Branchaud, Git Mailing List

Jeff King <peff@peff.net> writes:

> Yeah, I believe "." at the front of a directory component is explicitly
> forbidden by check_ref_format. I don't recall whether there was a
> specific rationale, or whether it was simply a can of worms we didn't
> want to explore.

Is "log foo...bar" a symmetric difference between foo and bar, or is it an
assymmetric one from foo and .bar?

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

* Re: [RFC] Hidden refs
  2010-10-13 17:42   ` Junio C Hamano
@ 2010-10-13 17:46     ` Jeff King
  2010-10-13 17:51       ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff King @ 2010-10-13 17:46 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Marc Branchaud, Git Mailing List

On Wed, Oct 13, 2010 at 10:42:41AM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > Yeah, I believe "." at the front of a directory component is explicitly
> > forbidden by check_ref_format. I don't recall whether there was a
> > specific rationale, or whether it was simply a can of worms we didn't
> > want to explore.
> 
> Is "log foo...bar" a symmetric difference between foo and bar, or is it an
> assymmetric one from foo and .bar?

Thanks, I was sure there was a simple example of how it would make
things ambiguous, but for some reason I couldn't think of one.

-Peff

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

* Re: [RFC] Hidden refs
  2010-10-13 17:46     ` Jeff King
@ 2010-10-13 17:51       ` Junio C Hamano
  2010-10-13 17:53         ` Jonathan Nieder
  0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2010-10-13 17:51 UTC (permalink / raw)
  To: Jeff King; +Cc: Marc Branchaud, Git Mailing List

Jeff King <peff@peff.net> writes:

> On Wed, Oct 13, 2010 at 10:42:41AM -0700, Junio C Hamano wrote:
>
>> Jeff King <peff@peff.net> writes:
>> 
>> > Yeah, I believe "." at the front of a directory component is explicitly
>> > forbidden by check_ref_format. I don't recall whether there was a
>> > specific rationale, or whether it was simply a can of worms we didn't
>> > want to explore.
>> 
>> Is "log foo...bar" a symmetric difference between foo and bar, or is it an
>> assymmetric one from foo and .bar?
>
> Thanks, I was sure there was a simple example of how it would make
> things ambiguous, but for some reason I couldn't think of one.

Of course, it points at an existing bug as well.  --- the example could
mean an asymmetric difference from foo. to bar ;-)

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

* Re: [RFC] Hidden refs
  2010-10-13 17:51       ` Junio C Hamano
@ 2010-10-13 17:53         ` Jonathan Nieder
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Nieder @ 2010-10-13 17:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, Marc Branchaud, Git Mailing List

Junio C Hamano wrote:
>> On Wed, Oct 13, 2010 at 10:42:41AM -0700, Junio C Hamano wrote:

>>> Is "log foo...bar" a symmetric difference between foo and bar, or is it an
[...]
> Of course, it points at an existing bug as well.  --- the example could
> mean an asymmetric difference from foo. to bar ;-)

Fixed about a year ago, I think. :)  (cbdffe4, check_ref_format():
tighten refname rules, 2009-03-21, part of v1.6.3)

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

end of thread, other threads:[~2010-10-13 17:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-13 15:22 [RFC] Hidden refs Marc Branchaud
2010-10-13 15:32 ` Stephen Bash
2010-10-13 16:14   ` Marc Branchaud
2010-10-13 17:35 ` Jeff King
2010-10-13 17:42   ` Junio C Hamano
2010-10-13 17:46     ` Jeff King
2010-10-13 17:51       ` Junio C Hamano
2010-10-13 17:53         ` Jonathan Nieder

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).