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

Re: [PATCH] Avoid bug in Solaris xpg4/sed as used in submodule

From
Ben Walton <bwalton@artsci.utoronto.ca>
Date
Apr 13, 2012, 00:46 UTC
Message-ID
<1334274951-sup-6013@pinkfloyd.chass.utoronto.ca>
In-Reply-To
<7vhawrqzue.fsf@alter.siamese.dyndns.org>
Excerpts from Junio C Hamano's message of Tue Apr 10 12:10:22 -0400 2012:
Show 16 quoted lines
> Andreas Schwab <schwab@linux-m68k.org> writes:
> 
> > Junio C Hamano <gitster@pobox.com> writes:
> >
> >> FWIW, it bothers me a lot more that expression does not anchor
> >> matches against path elements with explicit '/' than the issue your patch
> >> addresses, i.e.
> >>
> >>     sed -e 's|[^/][^/]*/|../|g'
> >
> > Note that this requires readding a trailing slash to the path, which
> > complicates the whole thing a bit.
> 
> Or simply swapping order of the stripping and sed invocation, which
> is not a big deal.  I personally find the pattern with trailing '/'
> easier to grok but it is also not a big deal.

Sorry for the delay here, I haven't had a chance to look at this in a few days. I tried the version with [^/][^/]*/ tonight and it was more invasive than required for such a simple fix, I think.

Switching the order of the calls is ok, but then you need to use a rela and relb as the second substitution relies on $a being /-terminated and the creation of gitdir:... requires the opposite. So now, you're switching the order, moving other lines, renaming variables and also altering the lines used to spit out the paths in order to avoid also stripping the / from the rel* variables.

Updated patch to follow, but please don't hesitate to request the alternate version if it really is what you'd like to see. (I've done the work already.)

Thanks -Ben -- Ben Walton Systems Programmer - CHASS University of Toronto C:416.407.5610 | W:416.978.4302

Previous: Junio C HamanoNext: Ben Walton
Message 16 of 17 in “Avoid bug in Solaris xpg4/sed as used in submodule”
  1. Avoid bug in Solaris xpg4/sed as used in submoduleBen Walton, Apr 9, 2012
  2. Andreas SchwabApr 9, 2012
  3. Ben WaltonApr 9, 2012
  4. Andreas SchwabApr 9, 2012
  5. Junio C HamanoApr 9, 2012
  6. Ben WaltonApr 9, 2012
  7. Avoid bug in Solaris xpg4/sed as used in submoduleBen Walton, Apr 9, 2012
  8. Andreas SchwabApr 9, 2012
  9. Junio C HamanoApr 9, 2012
  10. Avoid bug in Solaris xpg4/sed as used in submoduleBen Walton, Apr 10, 2012
  11. Junio C HamanoApr 10, 2012
  12. Ben WaltonApr 10, 2012
  13. Junio C HamanoApr 10, 2012
  14. Andreas SchwabApr 10, 2012
  15. Junio C HamanoApr 10, 2012
  16. Ben WaltonApr 13, 2012
  17. Avoid bug in Solaris xpg4/sed as used in submoduleBen Walton, Apr 13, 2012

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.