zsh-workers
 help / color / mirror / code / Atom feed
From: Tim Eliseo <tre-zsh@crushedhat.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] Add option like tcsh's dextract
Date: Tue, 8 Aug 2023 15:13:07 -0700	[thread overview]
Message-ID: <7105a328-a753-b5ce-0111-92e1b3fa781b@crushedhat.com> (raw)
In-Reply-To: <CAH+w=7bK_pHyNwC7bF6uVkdFn7==xySpXnjmZhN0npNJv-ECtg@mail.gmail.com>

On 2023-08-05 16:48:07, Bart Schaefer wrote:
> On Fri, Aug 4, 2023 at 9:47 AM Tim Eliseo <tre-zsh@crushedhat.com> wrote:
>> As my sample workaround script illustrates [...]
>> achieving the original tcsh behavior
>> without a builtin option is non-trivial.
> # The chdir/cd builtin, with one argument in [+|-]n form and with
> # the auto_pushd option set, has the desired stack extract behavior,
>
> I believe Mikael's assertion is that the extra nontrivial checks in
> your sample workaround are not needed?  Where are you observing (or
> where is Mikael failing to observe) a difference?
>
What Mikael said was “it seems that the same thing can be accomplished 
with setopt auto_pushd and using cd instead of pushd”. Yes, stack 
extract (as opposed to roll) behavior will happen using cd with a +/- 
argument and with auto_pushd set, a fact I exploit in my workaround 
script, but that does not make cd with auto_pushd set a suitable 
alternative to pushd if one desires stack extract behavior because:

• cd doesn’t print the directory stack afterwards

• cd behaves differently than pushd with no arguments (go to home 
instead of swap the top two)

• With auto_pushd set, there is no longer a command to change directory 
without pushing the current (i.e. replace the top stack directory)

My script works around this and implements a pushd replacement with 
extraction, and also has to deal with the complexity of other conditions 
like command options, pushd_silent, and interactive/non-interactive 
mode. One thing not possible to do correctly is output “pushd” instead 
of “chdir” in error messages.

I wrote this script as a first attempt to implement the behavior I 
desired (which was to duplicate tcsh’s dextract option). I now regret 
even posting it, as it seems to have caused more confusion.

BUT THERE’S A BETTER WAY! The patch in 51958 implements this new option 
(pushd stack extraction instead of rolling) very cleanly, without 
introducing any backward compatibility issues, and includes updates to 
documentation and a test case. I spent significant time trying to get 
this right, and feel it is a valuable (albeit small) addition to the zsh 
codebase which will help some other users making the transition from tcsh.

I have to say that, as a new contributor, I’m not feeling particularly 
welcomed. Do the zsh maintainers have a process for deciding to accept 
contributions? I tried to be polite and patient, and got criticized for 
it. I asked for a second look, and then got asked what *I* didn’t 
understand. What more do I need to do to move this process forward?

Thanks for your consideration.

Tim



  reply	other threads:[~2023-08-08 22:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18  9:54 Tim Eliseo
2023-07-18 15:17 ` Mikael Magnusson
2023-08-04 16:47 ` Tim Eliseo
2023-08-04 16:58   ` Mikael Magnusson
     [not found]     ` <ee258794-761e-8f48-01d2-f0db6d8b6dc7@crushedhat.com>
2023-08-04 18:08       ` Mikael Magnusson
2023-08-05 23:48   ` Bart Schaefer
2023-08-08 22:13     ` Tim Eliseo [this message]
2023-08-09  8:50       ` Peter Stephenson
2023-08-09 13:16       ` Mikael Magnusson
2023-08-09 14:19         ` Tim Eliseo
2023-08-09 16:24           ` Mikael Magnusson
2023-08-09 17:25             ` Bart Schaefer
2023-08-09 23:27               ` Tim Eliseo
2023-08-12  3:42                 ` Bart Schaefer
2023-08-09 22:49             ` Tim Eliseo

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=7105a328-a753-b5ce-0111-92e1b3fa781b@crushedhat.com \
    --to=tre-zsh@crushedhat.com \
    --cc=schaefer@brasslantern.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).