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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Excerpts from Junio C Hamano's message of Tue Apr 10 12:10:22 -0400 2012:
> Andreas Schwab <schwab@xxxxxxxxxxxxxx> writes:
> > Junio C Hamano <gitster@xxxxxxxxx> 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.)

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

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[Newbies FAQ]     [Linux Kernel Development]     [Free Online Dating]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Free Online Dating]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]     [Linux Resources]

Add to Google