From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25064 invoked by alias); 4 Jan 2015 08:31:21 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19688 Received: (qmail 21590 invoked from network); 4 Jan 2015 08:31:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=PYxIXZlY c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=YNv0rlydsVwA:10 a=S_RizhID1aQNgpgIZx0A:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <150104003130.ZM24261@torch.brasslantern.com> Date: Sun, 04 Jan 2015 00:31:30 -0800 In-reply-to: <54A8B4EE.30908@eastlink.ca> Comments: In reply to Ray Andrews "Re: symlink chain." (Jan 3, 7:35pm) References: <549E3A7B.9010209@eastlink.ca> <20150102170307.7d2e644a@ntlworld.com> <54A6E6B1.6070201@eastlink.ca> <20150102212422.3a761af5@ntlworld.com> <54A7136C.1060102@eastlink.ca> <20150102222140.1303a633@ntlworld.com> <54A72CEF.9090102@eastlink.ca> <54A740F3.4040902@eastlink.ca> <150102210337.ZM22099@torch.brasslantern.com> <54A783C3.3000006@eastlink.ca> <150102231734.ZM22168@torch.brasslantern.com> <54A82374.1030208@eastlink.ca> <150103120252.ZM23074@torch.brasslantern.com> <54A85B6C.4020103@eastlink.ca> <150103164002.ZM23676@torch.brasslantern.com> <54A8B4EE.30908@eastlink.ca> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: symlink chain. MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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.