zsh-workers
 help / color / mirror / code / Atom feed
From: Julian Prein <druckdev@protonmail.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Roman Perepelitsa <roman.perepelitsa@gmail.com>,
	"zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [PATCH] cd: Append 2nd argument to CWD if 1st is empty
Date: Fri, 01 Dec 2023 15:05:42 +0000	[thread overview]
Message-ID: <Z6kSpD0aYXTRvld9-pv7KQchBpNavzbiTifqbBgxJx9Onq05CPwdhQ6_1HpcsG0h6kWgzdVOfP4ghKpsK6l7NFM_wBkiPyNKGHxw8E4iMwI=@protonmail.com> (raw)
In-Reply-To: <CAHYJk3Ru9dN0URPg-bipUP1RV7cw=vJ4xUyh0ksHxkrhE2wh=g@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 852 bytes --]

On Friday, December 1st, 2023 at 14:51, Mikael Magnusson <mikachu@gmail.com> wrote:
> 

> I'm not opposed to the patch, but you could just cd $PWD-branchname in
> this case.

True. For me personally though, typing $PWD always feels a bit clunky and
unergonomic as I have to hold shift constantly.

> It's also easy to get the desired functionality with a
> wrapper function (admittedly slightly less easy if you also want to
> handle edge cases like cd -L '' foo but you probably don't):
> cd() {
>   if [[ $# == 2 ]] && [[ $1 = "" ]]; then
>     builtin cd $PWD$2
>   else
>     builtin cd "$@"
>   fi
> }

Yes, that is probably what I'll do, if the patch gets rejected. But I am not a
big fan of wrapper functions that have to parse arguments and tend to not want
to break existing functionality through them.

Thanks,
Julian

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

  reply	other threads:[~2023-12-01 15:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01  3:11 Julian Prein
2023-12-01  9:21 ` Roman Perepelitsa
2023-12-01 13:32   ` Julian Prein
2023-12-01 13:51     ` Mikael Magnusson
2023-12-01 15:05       ` Julian Prein [this message]
2023-12-01 18:21     ` Lawrence Velázquez
2023-12-01 18:27       ` Roman Perepelitsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='Z6kSpD0aYXTRvld9-pv7KQchBpNavzbiTifqbBgxJx9Onq05CPwdhQ6_1HpcsG0h6kWgzdVOfP4ghKpsK6l7NFM_wBkiPyNKGHxw8E4iMwI=@protonmail.com' \
    --to=druckdev@protonmail.com \
    --cc=mikachu@gmail.com \
    --cc=roman.perepelitsa@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).