Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: symlink chain.



On Jan 3,  7:35pm, Ray Andrews wrote:
}
} I take the more superficial view and don't want -m killing a search
} that would work fine without it. I expect -m to *just* *add* the
} ability to search for patterns, not to kill otherwise acceptable
} searches.

There are a couple of ways in which this is eventually going to get
you into trouble.

First, whence is not the only command where some switches are mutually
exclusive rather than cumulative, or where switches change many details
of the action performed even when they can be combined.

Second, pattern matching really isn't the same thing as simple string
comparison, and it's also not exactly the same thing as globbing even
though for the shell the same metacharacters are used.  I think we
discussed that last part in a different thread.

} Well, one analogy is as good as another. With so many of these issues,
} it comes down to how you look at it. For me, switches add features,
} they don't invalidate arguments ... but is that really a rule? ...

Switches often change the meaning of arguments.  Look at the example
we just went through with (print '\e') vs. (print -r '\e').

} As we were saying it's not really about the slash, I'd say it's more
} a test for an existing, specific file, no?

Well, no, it's not about that, actually.  It's about the difference
between a file path and a pattern.  Slashes mean something in a file
path, but in a pattern (as opposed to a glob!) they're just another
character; they might as well be dots or colons or "x" for all that
the pattern matching code cares.

Explicitly telling "whence" to interpret the arguments as patterns
ought to imply you understand what the patterns are being compared
against.  And what they're compared against is NOT the full path name
as if composed from the root of the file system.  (I explained it in
terms of hash keys because there's no more succinct way to refer to
aliases + builtins + functions + reserved-words + "only the last path
component of a command, i.e. does not include a `/';" not because I
actually think about it as hash keys when using it.)

You're expecting the -m switch to mean "try this as a pattern, but if
that doesn't seem to work, then ignore that I used -m and try it the
other way too, but only if it actually IS a file path, because file
paths work when they aren't patterns."

You think the current interpretation sabotages the output.

I think your expected interpretation sabotages the inputs.

Which is why I'm spending all this time trying to explain myself.

} I hafta learn how to do this patching (I don't want to blow something up 
} doing it wrong) and I have to learn how to ask git to preserve any local 
} changes while still pulling whatever needs to be pulled.

If you "git commit" your changes and then use "git pull --rebase" you
should have what you want most of the time, unless some of the changes
in origin/master are in direct conflict with what you committed.

You just have to be careful about "git push" in that case, if you have
permission to do so.  If you have changes you never want to be pushed
to the master, create a branch and commit them there.



Messages sorted by: Reverse Date, Date, Thread, Author