threads / discuss / 233

Re: ia64 git pull

Subject: Re: ia64 git pull

## tl;dr

4 messages between Apr 21, 2005 and Apr 22, 2005.

replies: 3people: 3as markdown or json

Petr Baudis· Apr 21, 2005, 22:58 UTC · lore

Dear diary, on Fri, Apr 22, 2005 at 12:29:07AM CEST, I got a letter where Linus Torvalds <torvalds@osdl.org> told me that...

Show 11 quoted lines
> On Thu, 21 Apr 2005 tony.luck@intel.com wrote:
> > 
> > I can't quite see how to manage multiple "heads" in git.  I notice that in
> > your tree on kernel.org that .git/HEAD is a symlink to heads/master ...
> > perhaps that is a clue.
> 
> It's mainly a clue to bad practice, in my opinion. I personally like the 
> "one repository, one head" approach, and if you want multiple heads you 
> just do multiple repositories (and you can then mix just the object 
> database - set your SHA1_FILE_DIRECTORY environment variable to point to 
> the shared object database, and you're good to go). 
There are two points regarding this:
(i) You need to track heads of remote branches anyway.

(ii) I want an easy way for user to refer to head of another working tree on the same repository (so that you can do just git merge testing).

This is why the multiple heads are there, and it's actually everything they _do_. There's nothing more behind it.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Petr Baudis· Apr 22, 2005, 01:53 UTC · lore

Dear diary, on Fri, Apr 22, 2005 at 03:48:35AM CEST, I got a letter where Inaky Perez-Gonzalez <inaky@linux.intel.com> told me that...

Show 12 quoted lines
> >>>>> Petr Baudis <pasky@ucw.cz> writes:
> 
> > I've just added to git-pasky a possibility to refer to branches
> > inside of repositories by a fragment identifier:
> 
> > rsync://rsync.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6.git#testing
> 
> > will refer to your testing branch in that repository.
> 
> Can we use something other than #? we'll have to scape it all the time
> in the shell (or at least also allow some other char, something
> without special meta-character meaning in the shell, like %).

Remember that it's an URL (so you can't use '%'), and '#' is the canonical URL fragment identifier delimiter. (And fragments are perfect for this kind of thing, if you look at the RFC, BTW.)

Still, why would you escape it? My shell will not take # as a comment start if it is immediately after an alphanumeric character.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Inaky Perez-Gonzalez· Apr 22, 2005, 02:06 UTC · re: Petr Baudis · lore
>>>>> Petr Baudis <pasky@ucw.cz> writes:
> Remember that it's an URL (so you can't use '%'), and '#' is the
> canonical URL fragment identifier delimiter. (And fragments are
> perfect for this kind of thing, if you look at the RFC, BTW.)
Ouch, true--rule out %...
> Still, why would you escape it? My shell will not take # as a
> comment start if it is immediately after an alphanumeric character.
Well, you just taught me something about bash I didn't know....
/me goes back to his hole with some more knowledge.
Thanks,
-- 
Inaky
David A. Wheeler· Apr 22, 2005, 03:30 UTC · re: Inaky Perez-Gonzalez · lore
Petr Baudis <pasky@ucw.cz> writes:
>>Still, why would you escape it? My shell will not take # as a
>>comment start if it is immediately after an alphanumeric character.

I guess there MIGHT be some command shell implementation that stupidly _DID_ accept "#" as a comment character, even immediately after an alphanumeric. If that's true, then using # there would be a pain for portability.

But I think that's highly improbable. A quick peek at the Single Unix Specification as posted by the Open Group seems to say that, according to the standards, that's NOT okay: http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02 Basically, the command shell is supposed to tokenize, and "#" only means comment if it's at the beginning of a token.

And as far as I can tell, it's not an issue in practice either. I did a few quick tests on Fedora Core 3 and OpenBSD. On Fedora Core 3, I can say that bash, ash & csh all do NOT consider "#" as a comment start if an alpha precedes it. The same is true for OpenBSD /bin/sh, /bin/csh, and /bin/rksh. If such different shells do the same thing (this stuff isn't even legal C-shell text!), it's likely others do too.

--- David A. Wheeler

← back to recent threads