From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: Simon Ruderich <simon@ruderich.org>
Cc: zsh-workers@zsh.org
Subject: Re: version.h and ChangeLog
Date: Tue, 9 Apr 2013 16:18:52 -0400 [thread overview]
Message-ID: <20130409201852.GA58314@redoubt.spodhuis.org> (raw)
In-Reply-To: <20130409164722.GA24778@ruderich.org>
[-- Attachment #1: Type: text/plain, Size: 1321 bytes --]
On 2013-04-09 at 18:47 +0200, Simon Ruderich wrote:
> Appending something like "-local-<ref>" is difficult because
> what's considered local depends on how Git is used. We could
> check "origin"/master but what if I call the remote branch
> "upstream"?
At some point, the onus of work shifts to the person who is violating
convention. I mean, I might have used stty to remap intr to ^R. Most
tools are entitled to assume that intr is ^C without bothering to check.
Still, robust tooling might support the unusual.
My normal approach here is to use a variable which can be overriden from
the environment:
: ${ZSH_GIT_ORIGIN_REMOTENAME:=origin}
Then if someone really wants to work with a different name, for another
tooling environment, they can `export ZSH_GIT_ORIGIN_REMOTENAME=upstream`
A more git-like approach is be to stash the config in a zsh section of
the git config, so that it can be set on a per-repo basis or "globally"
if needed for an environment. This might be more to taste, avoiding
25-character environment variable names?
% git config zsh.master origin
% git config --get-regexp zsh\..+
zsh.master origin
% git config --get zsh.master
origin
% tail -2 .git/config
[zsh]
master = origin
%
Since this config is not sync'd from any remote, it's entirely available
for local overrides.
-Phil
[-- Attachment #2: Type: application/pgp-signature, Size: 163 bytes --]
next prev parent reply other threads:[~2013-04-09 20:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-07 17:38 Bart Schaefer
2013-04-07 18:23 ` Peter Stephenson
2013-04-07 19:33 ` Bart Schaefer
2013-04-08 12:30 ` Frank Terbeck
2013-04-08 19:34 ` Peter Stephenson
2013-04-08 21:02 ` Peter Stephenson
2013-04-09 16:47 ` Simon Ruderich
2013-04-09 20:18 ` Phil Pennock [this message]
2013-04-10 0:23 ` Simon Ruderich
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=20130409201852.GA58314@redoubt.spodhuis.org \
--to=zsh-workers+phil.pennock@spodhuis.org \
--cc=simon@ruderich.org \
--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).