git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [StGIT PATCH 2/2] Don't touch ref files manually

From
Johannes Sixt <j.sixt@eudaptics.com>
Date
Aug 21, 2007, 16:12 UTC
Message-ID
<46CB0EEE.D46769FE@eudaptics.com>
In-Reply-To
<20070821155845.GA16221@diana.vm.bytemark.co.uk>
Karl Hasselström wrote:
Show 19 quoted lines
> On 2007-08-21 14:23:29 +0100, Catalin Marinas wrote:
> > On 10/08/07, Karl Hasselström <kha@treskal.com> wrote:
> > > @@ -294,14 +301,16 @@ def set_head_file(ref):
> > >      # head cache flushing is needed since we might have a different value
> > >      # in the new head
> > >      __clear_head_cache()
> > > -    if __run('git-symbolic-ref HEAD',
> > > -             [os.path.join('refs', 'heads', ref)]) != 0:
> > > +    if __run('git-symbolic-ref HEAD', ['refs/heads/%s' % ref]) != 0:
> > >          raise GitException, 'Could not set head to "%s"' % ref
> >
> > Why replacing os.path.join with a single string? I think the former
> > is more portable if, in the future, someone will try to run StGIT on
> > Windows (and GIT would be compiled directly, without cygwin).
> 
> Yes, that's the case iff it is a pathname in the file system. But I
> think forward slashes are used even on Windows in this case --
> otherwise too mmuch configuration would have to be changed. This is
> what I _think_, however; I haven't actually checked.

There are some instances where the MinGW port accepts backslashes in ref names, but you are on the safe side with forward slashes.

-- Hannes
Previous: Karl HasselströmNext: Karl Hasselström
Message 7 of 11 in “Teach StGIT to survive git-gc”
  1. 0/2 Teach StGIT to survive git-gcKarl Hasselström, Aug 10, 2007
  2. 1/2 New test: make sure that StGIT can handle packed refsKarl Hasselström, Aug 10, 2007
  3. 2/2 Don't touch ref files manuallyKarl Hasselström, Aug 10, 2007
  4. Catalin MarinasAug 21, 2007
  5. Karl HasselströmAug 21, 2007
  6. Karl HasselströmAug 21, 2007
  7. Johannes SixtAug 21, 2007
  8. Karl HasselströmAug 21, 2007
  9. Karl HasselströmAug 21, 2007
  10. Karl HasselströmAug 21, 2007
  11. Catalin MarinasAug 23, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.