Closed pdex closed 11 years ago
Help me out here: I fail to see the possible application for this?
I'm playing around with adding some commands to do something similar to pushd/popd but with a subshell. This may not be for everyone, so I figured doing it as an external command allows more flexibility.
Hold on, that may actually be quite interesting. I once thought of implementing homeshick cd
until I remembered that it runs as a subshell and none of its state goes into the parent shell.
You're thinking of simply invoking $SHELL
?
@mlawren actually cooked something up that looks quite interesting and which may play into that. A pushd/popd feature may in fact obviate the need to implement #27 at all.
I reopened #30 if you'd like to continue discussing it.
Here's the idea that I'm playing with right now:
$ cat ~/bin/homeshick-storm
#!/bin/bash
CASTLE="$HOME/.homesick/repos/$1"
if [[ -n "$1" && -d "$CASTLE" ]]; then
export PS1="(Castle:`basename \"$CASTLE\"`)\n$PS1"
cd $CASTLE
$SHELL
fi
exit 0
The scope of this has changed, do you want me to make a new pull request?
Yeah. maybe with a rebase so the ext_command is not even a commit? I like the "storm" metaphor, retreating into the castle :-) Though I think people may get tired of writing that instead of simply "cd"?
Git allows you to create custom commands by placing an executable with the name
git-"command"
in your path. This follows the same convention and will executehomeshick-"command"
passing in any remaining parameters from the command line. If it can't find the command it will error out.