From: "Alexey I. Froloff" <raorn@altlinux.ru>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: [devel] Q: использование git-config как хранилище дефолтных опций для gear
Date: Mon, 8 Sep 2008 18:09:12 +0400
Message-ID: <20080908140912.GM8478@altlinux.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1688 bytes --]
Я немного накоммитил в gear в ветке git-config. Основная идея в
том, чтобы некоторые опции для некоторых команд держать в
.git/config. Например шаблон тега для gear-create-tag (если из
одного репозитария собираются несколько пакетов имеет смысл
добавлять @name@ к имени тега).
Работает оно так:
gear_config_option VARIABLE_NAME OPTION_NAME "значение по умолчанию"
1. проверяется gear.SUBCOMMAND.OPTION_NAME
2. если не задано, проверяется gear.OPTION_NAME
3. если и оно не задано, переменной VARIABLE_NAME присваивается
"значение по умолчанию"
SUBCOMMAND это имя команды без префикса "gear-".
Примеры использования:
$ git config --add gear.create-tag.name '@name@-@version@-@release@'
$ git config --global --add gear.changelog.name 'My Cool Name'
$ git config --global --add gear.changelog.email 'my@cool.email'
$ git config --global --add gear.verbose -v
$ git config --global --add gear.merge.verbose ''
Чтобы начать это использовать надо пропатчить соответствующие
команды, примеры опять же у меня в git.
Существует множество способов выстрелить самому себе в ногу:
$ git config --add gear.changelog.name 'My Cool Name'
$ git config --add gear.changelog.name 'My Another Name'
$ gear-changelog --no-rules
error: More than one value for the key gear.changelog.name: My Another Name
* Mon Sep 08 2008 My Cool Name <my@cool.email> 1.5.0-alt1
Теоретически могут быть пересечения по именам опций, например
gear.changelog.rules (не реализовано) и gear.rules (реализовано).
Значения разные, но если gear.changelog.rules не определён, будет
fallback на gear.rules и в результате получится фигня.
Комментарии?
--
Regards,
Sir Raorn.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2008-09-08 14:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-08 14:09 Alexey I. Froloff [this message]
2008-09-08 16:25 ` Damir Shayhutdinov
2008-09-08 16:45 ` Alexey I. Froloff
2008-09-08 18:32 ` Damir Shayhutdinov
2008-09-08 18:59 ` Alexey I. Froloff
2008-09-08 19:03 ` Damir Shayhutdinov
2008-09-08 19:33 ` Alexey I. Froloff
2008-09-09 7:28 ` Damir Shayhutdinov
2008-09-09 9:13 ` Alexey I. Froloff
2008-09-08 20:08 ` Alexey Gladkov
2008-09-08 20:37 ` Alexey I. Froloff
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=20080908140912.GM8478@altlinux.org \
--to=raorn@altlinux.ru \
--cc=devel@lists.altlinux.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
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git