* Re: email address handling
From: Linus Torvalds @ 2008-08-01 22:52 UTC (permalink / raw)
To: Andrew Morton; +Cc: Theodore Tso, Junio C Hamano, git
In-Reply-To: <20080801154453.921bb50f.akpm@linux-foundation.org>
On Fri, 1 Aug 2008, Andrew Morton wrote:
> > S.__a__lar Onur <caglar@pardus.org.tr>
>
> oh. So .mailmap isn't usable either. Argh.
Btw, your mailer really is broken. It seems to have turned my correct
utf-8 email into US-ASCII.
Or at least it was correct when it came back to me. I don't see the
corruption. But your mailer seems to be unable to handle any complex
character sets and did
X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
and I wonder why?
Yeah, I feel superior, because alpine actually gets things right these
days. I too used to be character-set-confused.
Linus
^ permalink raw reply
* Re: email address handling
From: Linus Torvalds @ 2008-08-01 22:55 UTC (permalink / raw)
To: Andrew Morton; +Cc: Theodore Tso, Junio C Hamano, git
In-Reply-To: <20080801154902.c60717e5.akpm@linux-foundation.org>
On Fri, 1 Aug 2008, Andrew Morton wrote:
>
> Linus, just admit it: copying and pasting from git-log output into the MUA
> is *useful*. And you've made it less reliable.
Oh, I admit it is useful.
But your "solution" is actually MUCH MUCH MUCH worse than what git does.
That's my argument here. Life is tough. Not everthing is going to be
easy. Your solution would "work", but it would be a horrid piece of crap.
Linus
^ permalink raw reply
* Re: email address handling
From: Andrew Morton @ 2008-08-01 23:00 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Theodore Tso, Junio C Hamano, git
In-Reply-To: <alpine.LFD.1.10.0808011550450.6819@nehalem.linux-foundation.org>
On Fri, 1 Aug 2008 15:52:36 -0700 (PDT) Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
>
> On Fri, 1 Aug 2008, Andrew Morton wrote:
> > > S.__a__lar Onur <caglar@pardus.org.tr>
> >
> > oh. So .mailmap isn't usable either. Argh.
>
> Btw, your mailer really is broken. It seems to have turned my correct
> utf-8 email into US-ASCII.
>
> Or at least it was correct when it came back to me. I don't see the
> corruption. But your mailer seems to be unable to handle any complex
> character sets and did
>
> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu)
> Mime-Version: 1.0
> Content-Type: text/plain; charset=US-ASCII
>
> and I wonder why?
>
> Yeah, I feel superior, because alpine actually gets things right these
> days. I too used to be character-set-confused.
>
sylpheed. If you use its internal editor it mostly gets things right.
But if you use its use-external-editor feature it messes up those
things when saving out to its temporary file. And it was written by a
Japanese guy.
I'll often fix it in changelogs by re-editing the changelog and doing
a copy-n-paste from sylpheed's display window into the editor, which
does work. All a bit of a pain though.
^ permalink raw reply
* Re: [PATCH] git-svn now work with crlf convertion enabled.
From: Dmitry Potapov @ 2008-08-01 23:10 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Alexander Litvinov, git, Eric Wong
In-Reply-To: <7vr698qt6w.fsf@gitster.siamese.dyndns.org>
On Fri, Aug 01, 2008 at 03:14:15PM -0700, Junio C Hamano wrote:
>
> Even though the patch was not compile tested, I did check the existing
> call sites are giving only 0 or 1, but I think converting these "please
> write -- I give you 1" callers to pass the bitmask would be a sane thing
> to do.
Here it goes. It turned out that there are only two places that actually
needs correction, while two others use '0'. I have run 'make test' and
it's passed the tests.
-- 8< --
From: Dmitry Potapov <dpotapov@gmail.com>
Date: Sat, 2 Aug 2008 02:56:45 +0400
Subject: [PATCH] convert index_path callers to use bitmask instead of 1
Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
---
builtin-update-index.c | 5 +++--
read-cache.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/builtin-update-index.c b/builtin-update-index.c
index 38eb53c..d3e212c 100644
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
@@ -85,7 +85,7 @@ static int process_lstat_error(const char *path, int err)
static int add_one_path(struct cache_entry *old, const char *path, int len, struct stat *st)
{
- int option, size;
+ int option, flags, size;
struct cache_entry *ce;
/* Was the old index entry already up-to-date? */
@@ -99,7 +99,8 @@ static int add_one_path(struct cache_entry *old, const char *path, int len, stru
fill_stat_cache_info(ce, st);
ce->ce_mode = ce_mode_from_stat(old, st->st_mode);
- if (index_path(ce->sha1, path, st, !info_only))
+ flags = info_only ? 0 : HASH_OBJECT_DO_CREATE;
+ if (index_path(ce->sha1, path, st, flags))
return -1;
option = allow_add ? ADD_CACHE_OK_TO_ADD : 0;
option |= allow_replace ? ADD_CACHE_OK_TO_REPLACE : 0;
diff --git a/read-cache.c b/read-cache.c
index 2c03ec3..afd6005 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -550,7 +550,7 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
alias->ce_flags |= CE_ADDED;
return 0;
}
- if (index_path(ce->sha1, path, st, 1))
+ if (index_path(ce->sha1, path, st, HASH_OBJECT_DO_CREATE))
return error("unable to index file %s", path);
if (ignore_case && alias && different_name(ce, alias))
ce = create_alias_ce(ce, alias);
--
1.6.0.rc1.34.gad373
^ permalink raw reply related
* Re: email address handling
From: Linus Torvalds @ 2008-08-01 23:16 UTC (permalink / raw)
To: Andrew Morton; +Cc: Theodore Tso, Junio C Hamano, git
In-Reply-To: <alpine.LFD.1.10.0808011554350.6819@nehalem.linux-foundation.org>
On Fri, 1 Aug 2008, Linus Torvalds wrote:
>
> That's my argument here. Life is tough. Not everthing is going to be
> easy. Your solution would "work", but it would be a horrid piece of crap.
..and I really think that the
"=?utf-8?q?S=2E=C3=87a=C4=9Flar?= Onur" <caglar@pardus.org.tr>
example should be the one that makes you say "Ok, you're right".
The undeniable fact is, if we kept things in that format, even your broken
mailer wouldn't have corrupted it. You could cut-and-paste things, and
they's show up correctly at the other end, regardless of whether the
problem is with your mailer or with the cut-and-paste, or anything else.
So clearly, "=?utf-8?q?S=2E=C3=87a=C4=9Flar?= Onur" _must_ be the superior
format that git should have used, no?
Because clearly that is the most automation-friendly thing that _never_
requires anybody to think at all, and you can cut-and-paste it between
programs without ever having to worry about anything at all. No special
characters, no special meanings, no need to worry about limitations of
implementation.
So the fact that git completely FUCKS IT UP, and when you do 'git log' git
will have corrupted this to
Author: S.Çağlar Onur <caglar@pardus.org.tr>
is clearly git doing the wrong thing. Right?
WRONG.
The fact is, git does the right thing. And yes, it means that you cannot
just blindly cut-and-paste. And yes, it means that your mailer actually
has to work right for you to even -see- the right email address. And yes,
it means that any number of things can screw up, and corrupt it.
But it is STILL the right thing. Because what matters more than your
ability to cut-and-paste or anything like that is the fact that we should
make things look sane.
The thing is, you can actually get git to output the crazy names. Just do
git show --pretty=email 37a4c940749670671adab211a2d9c9fed9f3f757
and now you get the email-prettified thing for at least the author. No,
git won't corrupt the actual message, so the Signed-off-by: lines will
still show Çağlar's first name, but you can actually get back that odd
format.
(In fact, --pretty=email will do it as
From: =?utf-8?q?S.=C3=87a=C4=9Flar=20Onur?= <caglar@pardus.org.tr>
which is admittedy _even_uglier_, but whatever.. The difference between
really f*cking ugly and really f*cking uglier is not really relevant).
Linus
^ permalink raw reply
* Re: [PATCH] diff: add ruby funcname pattern
From: Kevin Ballard @ 2008-08-02 0:31 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Giuseppe Bilotta, git
In-Reply-To: <7v4p65tadh.fsf@gitster.siamese.dyndns.org>
On Aug 1, 2008, at 1:20 AM, Junio C Hamano wrote:
> "Giuseppe Bilotta" <giuseppe.bilotta@gmail.com> writes:
>
>> On Fri, Aug 1, 2008 at 9:30 AM, Junio C Hamano <gitster@pobox.com>
>> wrote:
>> ...
>>> so I'll wait for a few days to hear any one of the
>>> following happen before deciding what to do with this patch:
>>>
>>> (1) Yeah, this is a sufficient and necessary set of keywords, and it
>>> would make my Ruby life so much better;
>>>
>>> (2) This might be a good start but you need to cover this and that
>>> keywords as well;
>>>
>>> (3) This will misidentify a line that is not the beginning of a
>>> definition, and should not be applied;
>>>
>>> Needless to say, "Here is a better patch" is appreciated if
>>> somebody says
>>> (2) or (3).
>>
>> I wasn't sure about the completeness of the regexp myself, which is
>
> Well, I forgot to say but the above was soliciting third party review;
> original submitter does not count ;-)
>
> ... nah, I am just joking.
>
> All of the things you said in the message I am responding to are good
> background information. It would have been nicer if it were part of
> the
> initial message, perhaps below the three dash lines, which would have
> avoided this extra exchange.
As a Ruby user, the regex for the funcname looks fine to me.
> Thanks again for the patch. Somewhere I heard that there are 10
> Rubyista
> git users for every non Rubyista git user, so I am sure somebody would
> comment on your patch in a day or two. Perhaps we might even get
> Python
> and Perl hunk patterns (although I suspect Perl people are happy
> with the
> default one we stole from GNU diff) to go with it ;-).
I'd like to point out that Python users are called Pythonistas, Ruby
users are called... uh, Ruby users, I guess.
-Kevin Ballard
--
Kevin Ballard
http://kevin.sb.org
kevin@sb.org
http://www.tildesoft.com
^ permalink raw reply
* [PATCH] bash completion: Add completion for 'git grep'
From: Lee Marlow @ 2008-08-02 0:56 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Lee Marlow
Added completions for all long options specified in the docs
--cached
--text --ignore-case --word-regexp --invert-match
--full-name
--extended-regexp --basic-regexp --fixed-strings
--files-with-matches --name-only
--files-without-match
--count
--and --or --not --all-match
Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
---
contrib/completion/git-completion.bash | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 30d8701..b28ac10 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -796,6 +796,29 @@ _git_gc ()
COMPREPLY=()
}
+_git_grep ()
+{
+ __git_has_doubledash && return
+
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --*)
+ __gitcomp "
+ --cached
+ --text --ignore-case --word-regexp --invert-match
+ --full-name
+ --extended-regexp --basic-regexp --fixed-strings
+ --files-with-matches --name-only
+ --files-without-match
+ --count
+ --and --or --not --all-match
+ "
+ return
+ ;;
+ esac
+ COMPREPLY=()
+}
+
_git_help ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -1486,6 +1509,7 @@ _git ()
fetch) _git_fetch ;;
format-patch) _git_format_patch ;;
gc) _git_gc ;;
+ grep) _git_grep ;;
help) _git_help ;;
log) _git_log ;;
ls-remote) _git_ls_remote ;;
--
1.6.0.rc1.27.g9b6bf
^ permalink raw reply related
* [PATCH] bash completion: Add more long options for 'git log'
From: Lee Marlow @ 2008-08-02 0:56 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Lee Marlow
Options added: --parents --children --full-history
Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
---
contrib/completion/git-completion.bash | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 30d8701..7132a68 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -853,6 +853,7 @@ _git_log ()
--stat --numstat --shortstat
--decorate --diff-filter=
--color-words --walk-reflogs
+ --parents --children --full-history
"
return
;;
--
1.6.0.rc1.27.g9b6bf
^ permalink raw reply related
* [PATCH] builtin-revert.c: typofix
From: Stephan Beyer @ 2008-08-02 1:51 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin, gitster, Stephan Beyer
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
---
builtin-revert.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-revert.c b/builtin-revert.c
index e9da870..27881e9 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -180,7 +180,7 @@ static void set_author_ident_env(const char *message)
email++;
timestamp = strchr(email, '>');
if (!timestamp)
- die ("Could not extract author email from %s",
+ die ("Could not extract author time from %s",
sha1_to_hex(commit->object.sha1));
*timestamp = '\0';
for (timestamp++; *timestamp && isspace(*timestamp);
--
1.6.0.rc0.49.gd39f
^ permalink raw reply related
* PHP購物車資料庫網站專案
From: 陳友中 @ 2008-08-02 3:00 UTC (permalink / raw)
To: gitmonth
山鉧科技網頁設計
我們的宗旨:客戶的每ㄧ件小事情,都是山鉧的大事情
我們在推出企業形象網站包含前台網頁美工+後台管理程式
限時限量專案價 只要$29,900
(在送ㄧ年100MB不限流量網站空間)
我們做的不只是網站,而是您企業的入口
ㄧ個好的企業網站資料即時更新的速度是很重要的
企業e化的高品質團隊,打造您的網路門面
選擇山鉧成就您的夢想
~~~~~~~~~~~~~~~~~~~~~~~~~~
PS: 線上購物網站我們還可提供刷卡機制,
與線上列印帳單全省超商+郵局繳費......等金流服務機制
~~~~~~~~~~~~~~~~~~~~~~~~~~
歡迎來電洽詢黃專員(Sam):0980119812 / 0938764395
上網搜尋『 山鉧科技公司網站 』即可找到我們
~~~~~~~~~~~~~~~~~~~~~~~~~~
本公司另外提供關鍵字SEO排序服務
保證將您的網站在Yx / Gx ...排在第一頁
歡迎來電詢問!!!
~~~~~~~~~~~~~~~~~~~~~~~~~~
^ permalink raw reply
* Re: [PATCH] diff: add ruby funcname pattern
From: Junio C Hamano @ 2008-08-02 3:50 UTC (permalink / raw)
To: Kevin Ballard; +Cc: Giuseppe Bilotta, git
In-Reply-To: <0C57339C-50EF-4199-A14B-AFF04C92EF87@sb.org>
Kevin Ballard <kevin@sb.org> writes:
>> "Giuseppe Bilotta" <giuseppe.bilotta@gmail.com> writes:
>>> ...
>>> I wasn't sure about the completeness of the regexp myself, which is
>> ...
> As a Ruby user, the regex for the funcname looks fine to me.
Thanks, will apply.
^ permalink raw reply
* [PATCH] bash completion: remove unused function _git_diff_tree
From: Lee Marlow @ 2008-08-02 4:47 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Lee Marlow
completion for git diff-tree was removed in 5cfb4fe
Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
---
contrib/completion/git-completion.bash | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 30d8701..e32c1f1 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -721,11 +721,6 @@ _git_diff ()
__git_complete_file
}
-_git_diff_tree ()
-{
- __gitcomp "$(__git_refs)"
-}
-
_git_fetch ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
--
1.6.0.rc1.27.g9b6bf
^ permalink raw reply related
* Re: [PATCH] diff: add ruby funcname pattern
From: Giuseppe Bilotta @ 2008-08-02 5:41 UTC (permalink / raw)
To: Kevin Ballard; +Cc: Junio C Hamano, git
In-Reply-To: <0C57339C-50EF-4199-A14B-AFF04C92EF87@sb.org>
On Sat, Aug 2, 2008 at 2:31 AM, Kevin Ballard <kevin@sb.org> wrote:
>
> As a Ruby user, the regex for the funcname looks fine to me.
What is your opinion about the anonymous code blocks?
I've been thinking that another possibility could be to have two ruby
funcnames, a simpler one (the one I presented) that only has 'named'
blocks, and a more thorough one that also matches up anonymous blocks.
User could then choose which one to use in their code by having
gitattributes such as *.rb diff=ruby or *.rb diff=ruby-full (or
whatever else).
I'm not sure this would be a sensible policy though.
--
Giuseppe "Oblomov" Bilotta
^ permalink raw reply
* Re: [PATCH] diff: add ruby funcname pattern
From: Kevin Ballard @ 2008-08-02 5:47 UTC (permalink / raw)
To: Giuseppe Bilotta; +Cc: Junio C Hamano, git
In-Reply-To: <cb7bb73a0808012241s80a06fq1ac54a3350169f6c@mail.gmail.com>
On Aug 1, 2008, at 10:41 PM, Giuseppe Bilotta wrote:
> On Sat, Aug 2, 2008 at 2:31 AM, Kevin Ballard <kevin@sb.org> wrote:
>>
>> As a Ruby user, the regex for the funcname looks fine to me.
>
> What is your opinion about the anonymous code blocks?
>
> I've been thinking that another possibility could be to have two ruby
> funcnames, a simpler one (the one I presented) that only has 'named'
> blocks, and a more thorough one that also matches up anonymous blocks.
> User could then choose which one to use in their code by having
> gitattributes such as *.rb diff=ruby or *.rb diff=ruby-full (or
> whatever else).
>
> I'm not sure this would be a sensible policy though.
If you're going to get into anonymous code blocks, you're going to
have a really tough time deciding which blocks are interesting and
which aren't. And as you stated before, without a stack-based
approach, this could really fall apart, as anonymous blocks are
(almost) always going to be inside a method.
I think it's far simpler to stick with class/module/def.
-Kevin Ballard
--
Kevin Ballard
http://kevin.sb.org
kevin@sb.org
http://www.tildesoft.com
^ permalink raw reply
* Re: [PATCH] diff: add ruby funcname pattern
From: Giuseppe Bilotta @ 2008-08-02 6:06 UTC (permalink / raw)
To: Kevin Ballard; +Cc: Junio C Hamano, git
In-Reply-To: <C871A30D-F2AF-4385-ABD4-C57F474D7F01@sb.org>
On Sat, Aug 2, 2008 at 7:47 AM, Kevin Ballard <kevin@sb.org> wrote:
>
> If you're going to get into anonymous code blocks, you're going to have a
> really tough time deciding which blocks are interesting and which aren't.
> And as you stated before, without a stack-based approach, this could really
> fall apart, as anonymous blocks are (almost) always going to be inside a
> method.
I was just looking for a libxdiff issue tracker but I couldn't find
one, so I guess I'll ask the author directly about the possibility to
implement such a thing. The matchit plugin for vim seems to manage
(even user-defined) code blocks very well, even for multi-state blocks
(if ... else ... end), using regexps; so maybe a reimplementation in C
for libxdiff could be a solution. Of course, one wonders how much
slower such an approach would be as opposed to the current "look back
until the first matching line" solution ...
--
Giuseppe "Oblomov" Bilotta
^ permalink raw reply
* [PATCH] diff: chapter and part in funcname for tex
From: Giuseppe Bilotta @ 2008-08-02 6:35 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Giuseppe Bilotta
This patch enhances the tex funcname by adding support for
chapter and part sectioning commands. It also matches
the starred version of the sectioning commands.
---
I know that technically speaking this should have been two
separate patches because they are two logically separate
changes, but they are really rather braindead so please
accept them as one :)
diff.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/diff.c b/diff.c
index c253015..776bce1 100644
--- a/diff.c
+++ b/diff.c
@@ -1380,7 +1380,7 @@ static struct builtin_funcname_pattern {
"^[ ]*\\(\\([ ]*"
"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
"[ ]*([^;]*\\)$" },
- { "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
+ { "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\?{.*\\)$" },
{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
};
--
1.5.6.3
^ permalink raw reply related
* [PATCH] gitk: Updated German translation.
From: Christian Stimming @ 2008-08-02 8:03 UTC (permalink / raw)
To: git; +Cc: Michele Ballabio, Paul Mackerras
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]
This is an update to gitk's German translation against current master of
gitk.git at git.kernel.org. To my surprise, my submitted patch as of
2008-05-24 hasn't been applied so far. I'm resending it (rebased on current
master) in the hope that by now someone will actually commit it and the
translation goes back to 100%. Thanks a lot!
Christian
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gitk-Updated-German-translation.patch --]
[-- Type: text/x-diff; charset="us-ascii"; name="0001-gitk-Updated-German-translation.patch", Size: 5905 bytes --]
From 47f0b66d090a143a36d1d74592396b43dbbbbea2 Mon Sep 17 00:00:00 2001
From: Christian Stimming <stimming@tuhh.de>
Date: Sat, 24 May 2008 22:42:30 +0200
Subject: [PATCH] gitk: Updated German translation.
This includes suggestions by Stephan Beyer.
Signed-off-by: Christian Stimming <stimming@tuhh.de>
---
po/de.po | 106 ++++++++++++++++++++++++++++++++++++++------------------------
1 files changed, 65 insertions(+), 41 deletions(-)
diff --git a/po/de.po b/po/de.po
index b9867bf..04ee570 100644
--- a/po/de.po
+++ b/po/de.po
@@ -7,19 +7,37 @@ msgid ""
msgstr ""
"Project-Id-Version: git-gui\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-05-01 11:54+0200\n"
-"PO-Revision-Date: 2008-05-02 21:12+0200\n"
+"POT-Creation-Date: 2008-05-24 22:32+0200\n"
+"PO-Revision-Date: 2008-05-24 22:40+0200\n"
"Last-Translator: Christian Stimming <stimming@tuhh.de>\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: gitk:111
-msgid "Error executing git rev-list:"
-msgstr "Fehler beim Ausführen von git-rev-list:"
+#: gitk:102
+msgid "Couldn't get list of unmerged files:"
+msgstr "Liste der nicht-zusammengeführten Dateien nicht gefunden:"
+
+#: gitk:329
+msgid "No files selected: --merge specified but no files are unmerged."
+msgstr ""
+"Keine Dateien ausgewählt: --merge angegeben, es existieren aber keine nicht-"
+"zusammengeführten Dateien."
+
+#: gitk:332
+msgid ""
+"No files selected: --merge specified but no unmerged files are within file "
+"limit."
+msgstr ""
+"Keine Dateien ausgewähle: --merge angegeben, aber keine nicht-"
+"zusammengeführten Dateien sind in der Dateiauswahl."
-#: gitk:124
+#: gitk:354
+msgid "Error executing git log:"
+msgstr "Fehler beim Ausführen von git-log:"
+
+#: gitk:369
msgid "Reading"
msgstr "Lesen"
@@ -56,7 +74,11 @@ msgstr "Datei"
msgid "Update"
msgstr "Aktualisieren"
-#: gitk:664
+#: gitk:1722
+msgid "Reload"
+msgstr "Neu laden"
+
+#: gitk:1723
msgid "Reread references"
msgstr "Zweige neu laden"
@@ -112,7 +134,11 @@ msgstr "Tastenkürzel"
msgid "SHA1 ID: "
msgstr "SHA1:"
-#: gitk:791
+#: gitk:1831
+msgid "Row"
+msgstr "Zeile"
+
+#: gitk:1862
msgid "Find"
msgstr "Suche"
@@ -126,19 +152,19 @@ msgstr "vorige"
#: gitk:794
msgid "commit"
-msgstr "Version"
+msgstr "Version nach"
#: gitk:797 gitk:799 gitk:2356 gitk:2379 gitk:2403 gitk:4306 gitk:4369
msgid "containing:"
-msgstr "enthaltend:"
+msgstr "Beschreibung:"
#: gitk:800 gitk:1778 gitk:1783 gitk:2431
msgid "touching paths:"
-msgstr "Pfad betreffend:"
+msgstr "Dateien:"
#: gitk:801 gitk:2436
msgid "adding/removing string:"
-msgstr "Zeichenkette ändernd:"
+msgstr "Änderungen:"
#: gitk:810 gitk:812
msgid "Exact"
@@ -253,23 +279,25 @@ msgstr "Diesen auch hervorheben"
msgid "Highlight this only"
msgstr "Nur diesen hervorheben"
-#: gitk:1318
+#: gitk:2162
+msgid "External diff"
+msgstr "Externer Vergleich"
+
+#: gitk:2403
msgid ""
"\n"
"Gitk - a commit viewer for git\n"
"\n"
-"Copyright © 2005-2006 Paul Mackerras\n"
+"Copyright © 2005-2008 Paul Mackerras\n"
"\n"
"Use and redistribute under the terms of the GNU General Public License"
msgstr ""
"\n"
"Gitk - eine Visualisierung der Git Historie\n"
"\n"
-"Copyright © 2005-2006 Paul Mackerras\n"
+"Copyright © 2005-2008 Paul Mackerras\n"
"\n"
-"Benutzung und Weiterverbreitung gemäß den Bedingungen der GNU General Public "
-"License\n"
-" "
+"Benutzung und Weiterverbreitung gemäß den Bedingungen der GNU General Public License"
#: gitk:1326 gitk:1387 gitk:6582
msgid "Close"
@@ -450,11 +478,11 @@ msgstr "Name"
msgid "Remember this view"
msgstr "Diese Ansicht speichern"
-#: gitk:1928
-msgid "Commits to include (arguments to git rev-list):"
-msgstr "Versionen anzeigen (Argumente von git-rev-list):"
+#: gitk:3126
+msgid "Commits to include (arguments to git log):"
+msgstr "Versionen anzeigen (Argumente von git-log):"
-#: gitk:1935
+#: gitk:3133
msgid "Command to generate more commits to include:"
msgstr "Versionsliste durch folgendes Kommando erzeugen lassen:"
@@ -566,7 +594,11 @@ msgstr "Kinder"
msgid "Reset %s branch to here"
msgstr "Zweig »%s« hierher zurücksetzen"
-#: gitk:6050
+#: gitk:7204
+msgid "Detached head: can't reset"
+msgstr "Zweigspitze ist abgetrennt: Zurücksetzen nicht möglich"
+
+#: gitk:7236
msgid "Top"
msgstr "Oben"
@@ -798,7 +830,15 @@ msgstr "Naheliegende Überschriften anzeigen"
msgid "Limit diffs to listed paths"
msgstr "Vergleich nur für angezeigte Pfade"
-#: gitk:8045
+#: gitk:9264
+msgid "External diff tool"
+msgstr "Externes Vergleich-(Diff-)Programm"
+
+#: gitk:9266
+msgid "Choose..."
+msgstr "Wählen..."
+
+#: gitk:9271
msgid "Colors: press to choose"
msgstr "Farben: Klicken zum Wählen"
@@ -873,22 +913,6 @@ msgstr "Mehrdeutige Angabe »%s«: Sowohl Version als auch Dateiname existiert."
msgid "Bad arguments to gitk:"
msgstr "Falsche Kommandozeilen-Parameter für gitk:"
-#: gitk:8637
-msgid "Couldn't get list of unmerged files:"
-msgstr "Liste der nicht-zusammengeführten Dateien nicht gefunden:"
-
-#: gitk:8653
-msgid "No files selected: --merge specified but no files are unmerged."
-msgstr "Keine Dateien ausgewählt: --merge angegeben, es existieren aber keine nicht-zusammengeführten Dateien."
-
-#: gitk:8656
-msgid ""
-"No files selected: --merge specified but no unmerged files are within file "
-"limit."
-msgstr ""
-"Keine Dateien ausgewähle: --merge angegeben, aber keine nicht-"
-"zusammengeführten Dateien sind in der Dateiauswahl."
-
-#: gitk:8717
+#: gitk:9915
msgid "Command line"
msgstr "Kommandozeile"
--
1.5.5.1.316.g377d9
^ permalink raw reply related
* [PATCH] Builtin git-help.
From: Miklos Vajna @ 2008-08-02 8:08 UTC (permalink / raw)
To: Junio C Hamano
Cc: Christian Couder, Johannes Schindelin, Kevin Ballard,
Git Mailing List
In-Reply-To: <20080801144121.GU32057@genesis.frugalware.org>
This patch splits out git-help's functions to builtin-help.c and leaves
only functions used by other builtins in help.c.
First this removes git-help's functions from libgit which are not
interesting for other builtins, second this makes 'git help help' work
again.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
This is for 'next'.
Makefile | 3 +-
builtin-help.c | 462 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
help.c | 464 --------------------------------------------------------
help.h | 6 +
4 files changed, 470 insertions(+), 465 deletions(-)
create mode 100644 builtin-help.c
diff --git a/Makefile b/Makefile
index 8431ffd..562e453 100644
--- a/Makefile
+++ b/Makefile
@@ -519,6 +519,7 @@ BUILTIN_OBJS += builtin-for-each-ref.o
BUILTIN_OBJS += builtin-fsck.o
BUILTIN_OBJS += builtin-gc.o
BUILTIN_OBJS += builtin-grep.o
+BUILTIN_OBJS += builtin-help.o
BUILTIN_OBJS += builtin-init-db.o
BUILTIN_OBJS += builtin-log.o
BUILTIN_OBJS += builtin-ls-files.o
@@ -1090,7 +1091,7 @@ git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
$(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
-help.o: help.c common-cmds.h GIT-CFLAGS
+builtin-help.o: builtin-help.c common-cmds.h GIT-CFLAGS
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) \
'-DGIT_HTML_PATH="$(htmldir_SQ)"' \
'-DGIT_MAN_PATH="$(mandir_SQ)"' \
diff --git a/builtin-help.c b/builtin-help.c
new file mode 100644
index 0000000..391f749
--- /dev/null
+++ b/builtin-help.c
@@ -0,0 +1,462 @@
+/*
+ * builtin-help.c
+ *
+ * Builtin help command
+ */
+#include "cache.h"
+#include "builtin.h"
+#include "exec_cmd.h"
+#include "common-cmds.h"
+#include "parse-options.h"
+#include "run-command.h"
+#include "help.h"
+
+static struct man_viewer_list {
+ struct man_viewer_list *next;
+ char name[FLEX_ARRAY];
+} *man_viewer_list;
+
+static struct man_viewer_info_list {
+ struct man_viewer_info_list *next;
+ const char *info;
+ char name[FLEX_ARRAY];
+} *man_viewer_info_list;
+
+enum help_format {
+ HELP_FORMAT_MAN,
+ HELP_FORMAT_INFO,
+ HELP_FORMAT_WEB,
+};
+
+static int show_all = 0;
+static enum help_format help_format = HELP_FORMAT_MAN;
+static struct option builtin_help_options[] = {
+ OPT_BOOLEAN('a', "all", &show_all, "print all available commands"),
+ OPT_SET_INT('m', "man", &help_format, "show man page", HELP_FORMAT_MAN),
+ OPT_SET_INT('w', "web", &help_format, "show manual in web browser",
+ HELP_FORMAT_WEB),
+ OPT_SET_INT('i', "info", &help_format, "show info page",
+ HELP_FORMAT_INFO),
+ OPT_END(),
+};
+
+static const char * const builtin_help_usage[] = {
+ "git help [--all] [--man|--web|--info] [command]",
+ NULL
+};
+
+static enum help_format parse_help_format(const char *format)
+{
+ if (!strcmp(format, "man"))
+ return HELP_FORMAT_MAN;
+ if (!strcmp(format, "info"))
+ return HELP_FORMAT_INFO;
+ if (!strcmp(format, "web") || !strcmp(format, "html"))
+ return HELP_FORMAT_WEB;
+ die("unrecognized help format '%s'", format);
+}
+
+static const char *get_man_viewer_info(const char *name)
+{
+ struct man_viewer_info_list *viewer;
+
+ for (viewer = man_viewer_info_list; viewer; viewer = viewer->next)
+ {
+ if (!strcasecmp(name, viewer->name))
+ return viewer->info;
+ }
+ return NULL;
+}
+
+static int check_emacsclient_version(void)
+{
+ struct strbuf buffer = STRBUF_INIT;
+ struct child_process ec_process;
+ const char *argv_ec[] = { "emacsclient", "--version", NULL };
+ int version;
+
+ /* emacsclient prints its version number on stderr */
+ memset(&ec_process, 0, sizeof(ec_process));
+ ec_process.argv = argv_ec;
+ ec_process.err = -1;
+ ec_process.stdout_to_stderr = 1;
+ if (start_command(&ec_process)) {
+ fprintf(stderr, "Failed to start emacsclient.\n");
+ return -1;
+ }
+ strbuf_read(&buffer, ec_process.err, 20);
+ close(ec_process.err);
+
+ /*
+ * Don't bother checking return value, because "emacsclient --version"
+ * seems to always exits with code 1.
+ */
+ finish_command(&ec_process);
+
+ if (prefixcmp(buffer.buf, "emacsclient")) {
+ fprintf(stderr, "Failed to parse emacsclient version.\n");
+ strbuf_release(&buffer);
+ return -1;
+ }
+
+ strbuf_remove(&buffer, 0, strlen("emacsclient"));
+ version = atoi(buffer.buf);
+
+ if (version < 22) {
+ fprintf(stderr,
+ "emacsclient version '%d' too old (< 22).\n",
+ version);
+ strbuf_release(&buffer);
+ return -1;
+ }
+
+ strbuf_release(&buffer);
+ return 0;
+}
+
+static void exec_woman_emacs(const char* path, const char *page)
+{
+ if (!check_emacsclient_version()) {
+ /* This works only with emacsclient version >= 22. */
+ struct strbuf man_page = STRBUF_INIT;
+
+ if (!path)
+ path = "emacsclient";
+ strbuf_addf(&man_page, "(woman \"%s\")", page);
+ execlp(path, "emacsclient", "-e", man_page.buf, NULL);
+ warning("failed to exec '%s': %s", path, strerror(errno));
+ }
+}
+
+static void exec_man_konqueror(const char* path, const char *page)
+{
+ const char *display = getenv("DISPLAY");
+ if (display && *display) {
+ struct strbuf man_page = STRBUF_INIT;
+ const char *filename = "kfmclient";
+
+ /* It's simpler to launch konqueror using kfmclient. */
+ if (path) {
+ const char *file = strrchr(path, '/');
+ if (file && !strcmp(file + 1, "konqueror")) {
+ char *new = xstrdup(path);
+ char *dest = strrchr(new, '/');
+
+ /* strlen("konqueror") == strlen("kfmclient") */
+ strcpy(dest + 1, "kfmclient");
+ path = new;
+ }
+ if (file)
+ filename = file;
+ } else
+ path = "kfmclient";
+ strbuf_addf(&man_page, "man:%s(1)", page);
+ execlp(path, filename, "newTab", man_page.buf, NULL);
+ warning("failed to exec '%s': %s", path, strerror(errno));
+ }
+}
+
+static void exec_man_man(const char* path, const char *page)
+{
+ if (!path)
+ path = "man";
+ execlp(path, "man", page, NULL);
+ warning("failed to exec '%s': %s", path, strerror(errno));
+}
+
+static void exec_man_cmd(const char *cmd, const char *page)
+{
+ struct strbuf shell_cmd = STRBUF_INIT;
+ strbuf_addf(&shell_cmd, "%s %s", cmd, page);
+ execl("/bin/sh", "sh", "-c", shell_cmd.buf, NULL);
+ warning("failed to exec '%s': %s", cmd, strerror(errno));
+}
+
+static void add_man_viewer(const char *name)
+{
+ struct man_viewer_list **p = &man_viewer_list;
+ size_t len = strlen(name);
+
+ while (*p)
+ p = &((*p)->next);
+ *p = xcalloc(1, (sizeof(**p) + len + 1));
+ strncpy((*p)->name, name, len);
+}
+
+static int supported_man_viewer(const char *name, size_t len)
+{
+ return (!strncasecmp("man", name, len) ||
+ !strncasecmp("woman", name, len) ||
+ !strncasecmp("konqueror", name, len));
+}
+
+static void do_add_man_viewer_info(const char *name,
+ size_t len,
+ const char *value)
+{
+ struct man_viewer_info_list *new = xcalloc(1, sizeof(*new) + len + 1);
+
+ strncpy(new->name, name, len);
+ new->info = xstrdup(value);
+ new->next = man_viewer_info_list;
+ man_viewer_info_list = new;
+}
+
+static int add_man_viewer_path(const char *name,
+ size_t len,
+ const char *value)
+{
+ if (supported_man_viewer(name, len))
+ do_add_man_viewer_info(name, len, value);
+ else
+ warning("'%s': path for unsupported man viewer.\n"
+ "Please consider using 'man.<tool>.cmd' instead.",
+ name);
+
+ return 0;
+}
+
+static int add_man_viewer_cmd(const char *name,
+ size_t len,
+ const char *value)
+{
+ if (supported_man_viewer(name, len))
+ warning("'%s': cmd for supported man viewer.\n"
+ "Please consider using 'man.<tool>.path' instead.",
+ name);
+ else
+ do_add_man_viewer_info(name, len, value);
+
+ return 0;
+}
+
+static int add_man_viewer_info(const char *var, const char *value)
+{
+ const char *name = var + 4;
+ const char *subkey = strrchr(name, '.');
+
+ if (!subkey)
+ return error("Config with no key for man viewer: %s", name);
+
+ if (!strcmp(subkey, ".path")) {
+ if (!value)
+ return config_error_nonbool(var);
+ return add_man_viewer_path(name, subkey - name, value);
+ }
+ if (!strcmp(subkey, ".cmd")) {
+ if (!value)
+ return config_error_nonbool(var);
+ return add_man_viewer_cmd(name, subkey - name, value);
+ }
+
+ warning("'%s': unsupported man viewer sub key.", subkey);
+ return 0;
+}
+
+static int git_help_config(const char *var, const char *value, void *cb)
+{
+ if (!strcmp(var, "help.format")) {
+ if (!value)
+ return config_error_nonbool(var);
+ help_format = parse_help_format(value);
+ return 0;
+ }
+ if (!strcmp(var, "man.viewer")) {
+ if (!value)
+ return config_error_nonbool(var);
+ add_man_viewer(value);
+ return 0;
+ }
+ if (!prefixcmp(var, "man."))
+ return add_man_viewer_info(var, value);
+
+ return git_default_config(var, value, cb);
+}
+
+struct cmdnames main_cmds, other_cmds;
+
+void list_common_cmds_help(void)
+{
+ int i, longest = 0;
+
+ for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
+ if (longest < strlen(common_cmds[i].name))
+ longest = strlen(common_cmds[i].name);
+ }
+
+ puts("The most commonly used git commands are:");
+ for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
+ printf(" %s ", common_cmds[i].name);
+ mput_char(' ', longest - strlen(common_cmds[i].name));
+ puts(common_cmds[i].help);
+ }
+}
+
+static int is_git_command(const char *s)
+{
+ return is_in_cmdlist(&main_cmds, s) ||
+ is_in_cmdlist(&other_cmds, s);
+}
+
+static const char *prepend(const char *prefix, const char *cmd)
+{
+ size_t pre_len = strlen(prefix);
+ size_t cmd_len = strlen(cmd);
+ char *p = xmalloc(pre_len + cmd_len + 1);
+ memcpy(p, prefix, pre_len);
+ strcpy(p + pre_len, cmd);
+ return p;
+}
+
+static const char *cmd_to_page(const char *git_cmd)
+{
+ if (!git_cmd)
+ return "git";
+ else if (!prefixcmp(git_cmd, "git"))
+ return git_cmd;
+ else if (is_git_command(git_cmd))
+ return prepend("git-", git_cmd);
+ else
+ return prepend("git", git_cmd);
+}
+
+static void setup_man_path(void)
+{
+ struct strbuf new_path;
+ const char *old_path = getenv("MANPATH");
+
+ strbuf_init(&new_path, 0);
+
+ /* We should always put ':' after our path. If there is no
+ * old_path, the ':' at the end will let 'man' to try
+ * system-wide paths after ours to find the manual page. If
+ * there is old_path, we need ':' as delimiter. */
+ strbuf_addstr(&new_path, GIT_MAN_PATH);
+ strbuf_addch(&new_path, ':');
+ if (old_path)
+ strbuf_addstr(&new_path, old_path);
+
+ setenv("MANPATH", new_path.buf, 1);
+
+ strbuf_release(&new_path);
+}
+
+static void exec_viewer(const char *name, const char *page)
+{
+ const char *info = get_man_viewer_info(name);
+
+ if (!strcasecmp(name, "man"))
+ exec_man_man(info, page);
+ else if (!strcasecmp(name, "woman"))
+ exec_woman_emacs(info, page);
+ else if (!strcasecmp(name, "konqueror"))
+ exec_man_konqueror(info, page);
+ else if (info)
+ exec_man_cmd(info, page);
+ else
+ warning("'%s': unknown man viewer.", name);
+}
+
+static void show_man_page(const char *git_cmd)
+{
+ struct man_viewer_list *viewer;
+ const char *page = cmd_to_page(git_cmd);
+
+ setup_man_path();
+ for (viewer = man_viewer_list; viewer; viewer = viewer->next)
+ {
+ exec_viewer(viewer->name, page); /* will return when unable */
+ }
+ exec_viewer("man", page);
+ die("no man viewer handled the request");
+}
+
+static void show_info_page(const char *git_cmd)
+{
+ const char *page = cmd_to_page(git_cmd);
+ setenv("INFOPATH", GIT_INFO_PATH, 1);
+ execlp("info", "info", "gitman", page, NULL);
+}
+
+static void get_html_page_path(struct strbuf *page_path, const char *page)
+{
+ struct stat st;
+ const char *html_path = system_path(GIT_HTML_PATH);
+
+ /* Check that we have a git documentation directory. */
+ if (stat(mkpath("%s/git.html", html_path), &st)
+ || !S_ISREG(st.st_mode))
+ die("'%s': not a documentation directory.", html_path);
+
+ strbuf_init(page_path, 0);
+ strbuf_addf(page_path, "%s/%s.html", html_path, page);
+}
+
+/*
+ * If open_html is not defined in a platform-specific way (see for
+ * example compat/mingw.h), we use the script web--browse to display
+ * HTML.
+ */
+#ifndef open_html
+void open_html(const char *path)
+{
+ execl_git_cmd("web--browse", "-c", "help.browser", path, NULL);
+}
+#endif
+
+static void show_html_page(const char *git_cmd)
+{
+ const char *page = cmd_to_page(git_cmd);
+ struct strbuf page_path; /* it leaks but we exec bellow */
+
+ get_html_page_path(&page_path, page);
+
+ open_html(page_path.buf);
+}
+
+int cmd_help(int argc, const char **argv, const char *prefix)
+{
+ int nongit;
+ const char *alias;
+ unsigned int longest = load_command_list("git-", &main_cmds, &other_cmds);
+
+ setup_git_directory_gently(&nongit);
+ git_config(git_help_config, NULL);
+
+ argc = parse_options(argc, argv, builtin_help_options,
+ builtin_help_usage, 0);
+
+ if (show_all) {
+ printf("usage: %s\n\n", git_usage_string);
+ list_commands("git commands", longest, &main_cmds, &other_cmds);
+ printf("%s\n", git_more_info_string);
+ return 0;
+ }
+
+ if (!argv[0]) {
+ printf("usage: %s\n\n", git_usage_string);
+ list_common_cmds_help();
+ printf("\n%s\n", git_more_info_string);
+ return 0;
+ }
+
+ alias = alias_lookup(argv[0]);
+ if (alias && !is_git_command(argv[0])) {
+ printf("`git %s' is aliased to `%s'\n", argv[0], alias);
+ return 0;
+ }
+
+ switch (help_format) {
+ case HELP_FORMAT_MAN:
+ show_man_page(argv[0]);
+ break;
+ case HELP_FORMAT_INFO:
+ show_info_page(argv[0]);
+ break;
+ case HELP_FORMAT_WEB:
+ show_html_page(argv[0]);
+ break;
+ }
+
+ return 0;
+}
diff --git a/help.c b/help.c
index 968f368..1afbac0 100644
--- a/help.c
+++ b/help.c
@@ -1,278 +1,8 @@
-/*
- * builtin-help.c
- *
- * Builtin help-related commands (help, usage, version)
- */
#include "cache.h"
#include "builtin.h"
#include "exec_cmd.h"
-#include "common-cmds.h"
-#include "parse-options.h"
-#include "run-command.h"
#include "help.h"
-static struct man_viewer_list {
- struct man_viewer_list *next;
- char name[FLEX_ARRAY];
-} *man_viewer_list;
-
-static struct man_viewer_info_list {
- struct man_viewer_info_list *next;
- const char *info;
- char name[FLEX_ARRAY];
-} *man_viewer_info_list;
-
-enum help_format {
- HELP_FORMAT_MAN,
- HELP_FORMAT_INFO,
- HELP_FORMAT_WEB,
-};
-
-static int show_all = 0;
-static enum help_format help_format = HELP_FORMAT_MAN;
-static struct option builtin_help_options[] = {
- OPT_BOOLEAN('a', "all", &show_all, "print all available commands"),
- OPT_SET_INT('m', "man", &help_format, "show man page", HELP_FORMAT_MAN),
- OPT_SET_INT('w', "web", &help_format, "show manual in web browser",
- HELP_FORMAT_WEB),
- OPT_SET_INT('i', "info", &help_format, "show info page",
- HELP_FORMAT_INFO),
- OPT_END(),
-};
-
-static const char * const builtin_help_usage[] = {
- "git help [--all] [--man|--web|--info] [command]",
- NULL
-};
-
-static enum help_format parse_help_format(const char *format)
-{
- if (!strcmp(format, "man"))
- return HELP_FORMAT_MAN;
- if (!strcmp(format, "info"))
- return HELP_FORMAT_INFO;
- if (!strcmp(format, "web") || !strcmp(format, "html"))
- return HELP_FORMAT_WEB;
- die("unrecognized help format '%s'", format);
-}
-
-static const char *get_man_viewer_info(const char *name)
-{
- struct man_viewer_info_list *viewer;
-
- for (viewer = man_viewer_info_list; viewer; viewer = viewer->next)
- {
- if (!strcasecmp(name, viewer->name))
- return viewer->info;
- }
- return NULL;
-}
-
-static int check_emacsclient_version(void)
-{
- struct strbuf buffer = STRBUF_INIT;
- struct child_process ec_process;
- const char *argv_ec[] = { "emacsclient", "--version", NULL };
- int version;
-
- /* emacsclient prints its version number on stderr */
- memset(&ec_process, 0, sizeof(ec_process));
- ec_process.argv = argv_ec;
- ec_process.err = -1;
- ec_process.stdout_to_stderr = 1;
- if (start_command(&ec_process)) {
- fprintf(stderr, "Failed to start emacsclient.\n");
- return -1;
- }
- strbuf_read(&buffer, ec_process.err, 20);
- close(ec_process.err);
-
- /*
- * Don't bother checking return value, because "emacsclient --version"
- * seems to always exits with code 1.
- */
- finish_command(&ec_process);
-
- if (prefixcmp(buffer.buf, "emacsclient")) {
- fprintf(stderr, "Failed to parse emacsclient version.\n");
- strbuf_release(&buffer);
- return -1;
- }
-
- strbuf_remove(&buffer, 0, strlen("emacsclient"));
- version = atoi(buffer.buf);
-
- if (version < 22) {
- fprintf(stderr,
- "emacsclient version '%d' too old (< 22).\n",
- version);
- strbuf_release(&buffer);
- return -1;
- }
-
- strbuf_release(&buffer);
- return 0;
-}
-
-static void exec_woman_emacs(const char* path, const char *page)
-{
- if (!check_emacsclient_version()) {
- /* This works only with emacsclient version >= 22. */
- struct strbuf man_page = STRBUF_INIT;
-
- if (!path)
- path = "emacsclient";
- strbuf_addf(&man_page, "(woman \"%s\")", page);
- execlp(path, "emacsclient", "-e", man_page.buf, NULL);
- warning("failed to exec '%s': %s", path, strerror(errno));
- }
-}
-
-static void exec_man_konqueror(const char* path, const char *page)
-{
- const char *display = getenv("DISPLAY");
- if (display && *display) {
- struct strbuf man_page = STRBUF_INIT;
- const char *filename = "kfmclient";
-
- /* It's simpler to launch konqueror using kfmclient. */
- if (path) {
- const char *file = strrchr(path, '/');
- if (file && !strcmp(file + 1, "konqueror")) {
- char *new = xstrdup(path);
- char *dest = strrchr(new, '/');
-
- /* strlen("konqueror") == strlen("kfmclient") */
- strcpy(dest + 1, "kfmclient");
- path = new;
- }
- if (file)
- filename = file;
- } else
- path = "kfmclient";
- strbuf_addf(&man_page, "man:%s(1)", page);
- execlp(path, filename, "newTab", man_page.buf, NULL);
- warning("failed to exec '%s': %s", path, strerror(errno));
- }
-}
-
-static void exec_man_man(const char* path, const char *page)
-{
- if (!path)
- path = "man";
- execlp(path, "man", page, NULL);
- warning("failed to exec '%s': %s", path, strerror(errno));
-}
-
-static void exec_man_cmd(const char *cmd, const char *page)
-{
- struct strbuf shell_cmd = STRBUF_INIT;
- strbuf_addf(&shell_cmd, "%s %s", cmd, page);
- execl("/bin/sh", "sh", "-c", shell_cmd.buf, NULL);
- warning("failed to exec '%s': %s", cmd, strerror(errno));
-}
-
-static void add_man_viewer(const char *name)
-{
- struct man_viewer_list **p = &man_viewer_list;
- size_t len = strlen(name);
-
- while (*p)
- p = &((*p)->next);
- *p = xcalloc(1, (sizeof(**p) + len + 1));
- strncpy((*p)->name, name, len);
-}
-
-static int supported_man_viewer(const char *name, size_t len)
-{
- return (!strncasecmp("man", name, len) ||
- !strncasecmp("woman", name, len) ||
- !strncasecmp("konqueror", name, len));
-}
-
-static void do_add_man_viewer_info(const char *name,
- size_t len,
- const char *value)
-{
- struct man_viewer_info_list *new = xcalloc(1, sizeof(*new) + len + 1);
-
- strncpy(new->name, name, len);
- new->info = xstrdup(value);
- new->next = man_viewer_info_list;
- man_viewer_info_list = new;
-}
-
-static int add_man_viewer_path(const char *name,
- size_t len,
- const char *value)
-{
- if (supported_man_viewer(name, len))
- do_add_man_viewer_info(name, len, value);
- else
- warning("'%s': path for unsupported man viewer.\n"
- "Please consider using 'man.<tool>.cmd' instead.",
- name);
-
- return 0;
-}
-
-static int add_man_viewer_cmd(const char *name,
- size_t len,
- const char *value)
-{
- if (supported_man_viewer(name, len))
- warning("'%s': cmd for supported man viewer.\n"
- "Please consider using 'man.<tool>.path' instead.",
- name);
- else
- do_add_man_viewer_info(name, len, value);
-
- return 0;
-}
-
-static int add_man_viewer_info(const char *var, const char *value)
-{
- const char *name = var + 4;
- const char *subkey = strrchr(name, '.');
-
- if (!subkey)
- return error("Config with no key for man viewer: %s", name);
-
- if (!strcmp(subkey, ".path")) {
- if (!value)
- return config_error_nonbool(var);
- return add_man_viewer_path(name, subkey - name, value);
- }
- if (!strcmp(subkey, ".cmd")) {
- if (!value)
- return config_error_nonbool(var);
- return add_man_viewer_cmd(name, subkey - name, value);
- }
-
- warning("'%s': unsupported man viewer sub key.", subkey);
- return 0;
-}
-
-static int git_help_config(const char *var, const char *value, void *cb)
-{
- if (!strcmp(var, "help.format")) {
- if (!value)
- return config_error_nonbool(var);
- help_format = parse_help_format(value);
- return 0;
- }
- if (!strcmp(var, "man.viewer")) {
- if (!value)
- return config_error_nonbool(var);
- add_man_viewer(value);
- return 0;
- }
- if (!prefixcmp(var, "man."))
- return add_man_viewer_info(var, value);
-
- return git_default_config(var, value, cb);
-}
-
/* most GUI terminals set COLUMNS (although some don't export it) */
static int term_columns(void)
{
@@ -295,14 +25,6 @@ static int term_columns(void)
return 80;
}
-static inline void mput_char(char c, unsigned int num)
-{
- while(num--)
- putchar(c);
-}
-
-struct cmdnames main_cmds, other_cmds;
-
void add_cmdname(struct cmdnames *cmds, const char *name, int len)
{
struct cmdname *ent = xmalloc(sizeof(*ent) + len + 1);
@@ -526,23 +248,6 @@ void list_commands(const char *title, unsigned int longest,
}
}
-void list_common_cmds_help(void)
-{
- int i, longest = 0;
-
- for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
- if (longest < strlen(common_cmds[i].name))
- longest = strlen(common_cmds[i].name);
- }
-
- puts("The most commonly used git commands are:");
- for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
- printf(" %s ", common_cmds[i].name);
- mput_char(' ', longest - strlen(common_cmds[i].name));
- puts(common_cmds[i].help);
- }
-}
-
int is_in_cmdlist(struct cmdnames *c, const char *s)
{
int i;
@@ -552,128 +257,6 @@ int is_in_cmdlist(struct cmdnames *c, const char *s)
return 0;
}
-static int is_git_command(const char *s)
-{
- return is_in_cmdlist(&main_cmds, s) ||
- is_in_cmdlist(&other_cmds, s);
-}
-
-static const char *prepend(const char *prefix, const char *cmd)
-{
- size_t pre_len = strlen(prefix);
- size_t cmd_len = strlen(cmd);
- char *p = xmalloc(pre_len + cmd_len + 1);
- memcpy(p, prefix, pre_len);
- strcpy(p + pre_len, cmd);
- return p;
-}
-
-static const char *cmd_to_page(const char *git_cmd)
-{
- if (!git_cmd)
- return "git";
- else if (!prefixcmp(git_cmd, "git"))
- return git_cmd;
- else if (is_git_command(git_cmd))
- return prepend("git-", git_cmd);
- else
- return prepend("git", git_cmd);
-}
-
-static void setup_man_path(void)
-{
- struct strbuf new_path;
- const char *old_path = getenv("MANPATH");
-
- strbuf_init(&new_path, 0);
-
- /* We should always put ':' after our path. If there is no
- * old_path, the ':' at the end will let 'man' to try
- * system-wide paths after ours to find the manual page. If
- * there is old_path, we need ':' as delimiter. */
- strbuf_addstr(&new_path, GIT_MAN_PATH);
- strbuf_addch(&new_path, ':');
- if (old_path)
- strbuf_addstr(&new_path, old_path);
-
- setenv("MANPATH", new_path.buf, 1);
-
- strbuf_release(&new_path);
-}
-
-static void exec_viewer(const char *name, const char *page)
-{
- const char *info = get_man_viewer_info(name);
-
- if (!strcasecmp(name, "man"))
- exec_man_man(info, page);
- else if (!strcasecmp(name, "woman"))
- exec_woman_emacs(info, page);
- else if (!strcasecmp(name, "konqueror"))
- exec_man_konqueror(info, page);
- else if (info)
- exec_man_cmd(info, page);
- else
- warning("'%s': unknown man viewer.", name);
-}
-
-static void show_man_page(const char *git_cmd)
-{
- struct man_viewer_list *viewer;
- const char *page = cmd_to_page(git_cmd);
-
- setup_man_path();
- for (viewer = man_viewer_list; viewer; viewer = viewer->next)
- {
- exec_viewer(viewer->name, page); /* will return when unable */
- }
- exec_viewer("man", page);
- die("no man viewer handled the request");
-}
-
-static void show_info_page(const char *git_cmd)
-{
- const char *page = cmd_to_page(git_cmd);
- setenv("INFOPATH", GIT_INFO_PATH, 1);
- execlp("info", "info", "gitman", page, NULL);
-}
-
-static void get_html_page_path(struct strbuf *page_path, const char *page)
-{
- struct stat st;
- const char *html_path = system_path(GIT_HTML_PATH);
-
- /* Check that we have a git documentation directory. */
- if (stat(mkpath("%s/git.html", html_path), &st)
- || !S_ISREG(st.st_mode))
- die("'%s': not a documentation directory.", html_path);
-
- strbuf_init(page_path, 0);
- strbuf_addf(page_path, "%s/%s.html", html_path, page);
-}
-
-/*
- * If open_html is not defined in a platform-specific way (see for
- * example compat/mingw.h), we use the script web--browse to display
- * HTML.
- */
-#ifndef open_html
-void open_html(const char *path)
-{
- execl_git_cmd("web--browse", "-c", "help.browser", path, NULL);
-}
-#endif
-
-static void show_html_page(const char *git_cmd)
-{
- const char *page = cmd_to_page(git_cmd);
- struct strbuf page_path; /* it leaks but we exec bellow */
-
- get_html_page_path(&page_path, page);
-
- open_html(page_path.buf);
-}
-
void help_unknown_cmd(const char *cmd)
{
fprintf(stderr, "git: '%s' is not a git-command. See 'git --help'.\n", cmd);
@@ -685,50 +268,3 @@ int cmd_version(int argc, const char **argv, const char *prefix)
printf("git version %s\n", git_version_string);
return 0;
}
-
-int cmd_help(int argc, const char **argv, const char *prefix)
-{
- int nongit;
- const char *alias;
- unsigned int longest = load_command_list("git-", &main_cmds, &other_cmds);
-
- setup_git_directory_gently(&nongit);
- git_config(git_help_config, NULL);
-
- argc = parse_options(argc, argv, builtin_help_options,
- builtin_help_usage, 0);
-
- if (show_all) {
- printf("usage: %s\n\n", git_usage_string);
- list_commands("git commands", longest, &main_cmds, &other_cmds);
- printf("%s\n", git_more_info_string);
- return 0;
- }
-
- if (!argv[0]) {
- printf("usage: %s\n\n", git_usage_string);
- list_common_cmds_help();
- printf("\n%s\n", git_more_info_string);
- return 0;
- }
-
- alias = alias_lookup(argv[0]);
- if (alias && !is_git_command(argv[0])) {
- printf("`git %s' is aliased to `%s'\n", argv[0], alias);
- return 0;
- }
-
- switch (help_format) {
- case HELP_FORMAT_MAN:
- show_man_page(argv[0]);
- break;
- case HELP_FORMAT_INFO:
- show_info_page(argv[0]);
- break;
- case HELP_FORMAT_WEB:
- show_html_page(argv[0]);
- break;
- }
-
- return 0;
-}
diff --git a/help.h b/help.h
index d614e54..3f1ae89 100644
--- a/help.h
+++ b/help.h
@@ -10,6 +10,12 @@ struct cmdnames {
} **names;
};
+static inline void mput_char(char c, unsigned int num)
+{
+ while(num--)
+ putchar(c);
+}
+
unsigned int load_command_list(const char *prefix,
struct cmdnames *main_cmds,
struct cmdnames *other_cmds);
--
1.6.0.rc0.14.g95f8.dirty
^ permalink raw reply related
* [PATCH] git-gui: Update German translation
From: Christian Stimming @ 2008-08-02 7:56 UTC (permalink / raw)
To: git; +Cc: Shawn Pearce
[-- Attachment #1: Type: text/plain, Size: 65 bytes --]
The subject says it all. Thanks for the new features.
Christian
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-git-gui-Update-German-translation.patch --]
[-- Type: text/x-diff; charset="us-ascii"; name="0001-git-gui-Update-German-translation.patch", Size: 5642 bytes --]
From 9d1e970ced1ca4bacfe27901d239cb148b0b87da Mon Sep 17 00:00:00 2001
From: Christian Stimming <stimming@tuhh.de>
Date: Sat, 2 Aug 2008 09:54:51 +0200
Subject: [PATCH] git-gui: Update German translation
---
po/de.po | 102 ++++++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 70 insertions(+), 32 deletions(-)
diff --git a/po/de.po b/po/de.po
index f20955c..fa43947 100644
--- a/po/de.po
+++ b/po/de.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: git-gui\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-03-14 07:18+0100\n"
-"PO-Revision-Date: 2008-05-01 11:51+0200\n"
+"POT-Creation-Date: 2008-08-02 08:58+0200\n"
+"PO-Revision-Date: 2008-08-02 09:09+0200\n"
"Last-Translator: Christian Stimming <stimming@tuhh.de>\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
@@ -134,18 +134,11 @@ msgstr "Konfliktauflösung nötig"
msgid "Starting gitk... please wait..."
msgstr "Gitk wird gestartet... bitte warten."
-#: git-gui.sh:1653
-#, tcl-format
-msgid ""
-"Unable to start gitk:\n"
-"\n"
-"%s does not exist"
-msgstr ""
-"Gitk kann nicht gestartet werden:\n"
-"\n"
-"%s existiert nicht"
+#: git-gui.sh:1698
+msgid "Couldn't find gitk in PATH"
+msgstr "Gitk kann im PATH nicht gefunden werden."
-#: git-gui.sh:1860 lib/choose_repository.tcl:36
+#: git-gui.sh:1948 lib/choose_repository.tcl:36
msgid "Repository"
msgstr "Projektarchiv"
@@ -294,7 +287,15 @@ msgstr "Aus der Bereitstellung herausnehmen"
msgid "Revert Changes"
msgstr "Änderungen verwerfen"
-#: git-gui.sh:2049 git-gui.sh:2368 git-gui.sh:2467
+#: git-gui.sh:2141 git-gui.sh:2702
+msgid "Show Less Context"
+msgstr "Weniger Zeilen anzeigen"
+
+#: git-gui.sh:2145 git-gui.sh:2706
+msgid "Show More Context"
+msgstr "Mehr Zeilen anzeigen"
+
+#: git-gui.sh:2151 git-gui.sh:2470 git-gui.sh:2569
msgid "Sign Off"
msgstr "Abzeichnen"
@@ -314,11 +315,7 @@ msgstr "Zusammenführen abbrechen..."
msgid "Push..."
msgstr "Versenden..."
-#: git-gui.sh:2092 lib/choose_repository.tcl:41
-msgid "Apple"
-msgstr "Apple"
-
-#: git-gui.sh:2095 git-gui.sh:2117 lib/about.tcl:14
+#: git-gui.sh:2197 git-gui.sh:2219 lib/about.tcl:14
#: lib/choose_repository.tcl:44 lib/choose_repository.tcl:50
#, tcl-format
msgid "About %s"
@@ -403,15 +400,11 @@ msgstr "Datei:"
msgid "Apply/Reverse Hunk"
msgstr "Kontext anwenden/umkehren"
-#: git-gui.sh:2595
-msgid "Show Less Context"
-msgstr "Weniger Zeilen anzeigen"
+#: git-gui.sh:2696
+msgid "Apply/Reverse Line"
+msgstr "Zeile anwenden/umkehren"
-#: git-gui.sh:2602
-msgid "Show More Context"
-msgstr "Mehr Zeilen anzeigen"
-
-#: git-gui.sh:2610
+#: git-gui.sh:2711
msgid "Refresh"
msgstr "Aktualisieren"
@@ -427,11 +420,19 @@ msgstr "Schriftgröße vergrößern"
msgid "Unstage Hunk From Commit"
msgstr "Kontext aus Bereitstellung herausnehmen"
-#: git-gui.sh:2648
+#: git-gui.sh:2748
+msgid "Unstage Line From Commit"
+msgstr "Zeile aus der Bereitstellung herausnehmen"
+
+#: git-gui.sh:2750
msgid "Stage Hunk For Commit"
msgstr "Kontext zur Bereitstellung hinzufügen"
-#: git-gui.sh:2667
+#: git-gui.sh:2751
+msgid "Stage Line For Commit"
+msgstr "Zeile zur Bereitstellung hinzufügen"
+
+#: git-gui.sh:2771
msgid "Initializing..."
msgstr "Initialisieren..."
@@ -493,7 +494,11 @@ msgstr "Version:"
msgid "Copy Commit"
msgstr "Version kopieren"
-#: lib/blame.tcl:384
+#: lib/blame.tcl:260
+msgid "Do Full Copy Detection"
+msgstr "Volle Kopie-Erkennung"
+
+#: lib/blame.tcl:388
#, tcl-format
msgid "Reading %s..."
msgstr "%s lesen..."
@@ -514,7 +519,19 @@ msgstr "Annotierungen für ursprünglichen Ort werden geladen..."
msgid "Annotation complete."
msgstr "Annotierung vollständig."
-#: lib/blame.tcl:746
+#: lib/blame.tcl:737
+msgid "Busy"
+msgstr "Verarbeitung läuft"
+
+#: lib/blame.tcl:738
+msgid "Annotation process is already running."
+msgstr "Annotierung läuft bereits."
+
+#: lib/blame.tcl:777
+msgid "Running thorough copy detection..."
+msgstr "Intensive Kopie-Erkennung läuft..."
+
+#: lib/blame.tcl:827
msgid "Loading annotation..."
msgstr "Annotierung laden..."
@@ -759,7 +776,12 @@ msgstr "Schließen"
msgid "Branch '%s' does not exist."
msgstr "Zweig »%s« existiert nicht."
-#: lib/checkout_op.tcl:206
+#: lib/checkout_op.tcl:193
+#, tcl-format
+msgid "Failed to configure simplified git-pull for '%s'."
+msgstr "Fehler beim Einrichten der vereinfachten git-pull für »%s«."
+
+#: lib/checkout_op.tcl:228
#, tcl-format
msgid ""
"Branch '%s' already exists.\n"
@@ -1485,6 +1507,14 @@ msgstr ""
msgid "Failed to stage selected hunk."
msgstr "Fehler beim Bereitstellen des gewählten Kontexts."
+#: lib/diff.tcl:386
+msgid "Failed to unstage selected line."
+msgstr "Fehler beim Herausnehmen der gewählten Zeile aus der Bereitstellung."
+
+#: lib/diff.tcl:394
+msgid "Failed to stage selected line."
+msgstr "Fehler beim Bereitstellen der gewählten Zeile."
+
#: lib/error.tcl:20 lib/error.tcl:114
msgid "error"
msgstr "Fehler"
@@ -1750,6 +1780,14 @@ msgid "Match Tracking Branches"
msgstr "Passend zu Übernahmezweig"
#: lib/option.tcl:126
+msgid "Blame Copy Only On Changed Files"
+msgstr "Kopie-Annotieren nur bei geänderten Dateien"
+
+#: lib/option.tcl:127
+msgid "Minimum Letters To Blame Copy On"
+msgstr "Mindestzahl Zeichen für Kopie-Annotieren"
+
+#: lib/option.tcl:128
msgid "Number of Diff Context Lines"
msgstr "Anzahl der Kontextzeilen beim Vergleich"
--
1.5.5.1.316.g377d9
^ permalink raw reply related
* Re: email address handling
From: Johannes Schindelin @ 2008-08-02 11:03 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Andrew Morton, Linus Torvalds, git
In-Reply-To: <7v4p64sa07.fsf@gitster.siamese.dyndns.org>
Hi,
On Fri, 1 Aug 2008, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > On Fri, 1 Aug 2008, Andrew Morton wrote:
> >
> >> I very very frequently copy and paste name+email address out of git
> >> output and into an MUA. Have done it thousands and thousands of times,
> >> and it has always worked. I'm sure that many others do the same thing.
>
> >
> > $ git log --pretty=email
> >
> > after this patch:
>
> You are quoting only Author: and not Signed-off-by: and Cc: that are used
> for e-mail purposes.
You might have realized that this was not a proper patch with a commit
message and a SOB?
As for Cc: I agree. But not for S-O-B: this is not an email header. And
I was very specific in only changing the behavior for "pretty=email".
At least _I_ was surprised that pretty=email did not behave as if it was
outputting email headers.
I agree with Linus for pretty=non-email, but not at all for pretty=email.
> I already said send-email is the right place to do this kind of thing,
> didn't I?
For the given scenario send-email is completely irrelevant.
Ciao,
Dscho
^ permalink raw reply
* Re: Is there any hope (format-patch)??
From: Matti Kaasinen @ 2008-08-02 11:04 UTC (permalink / raw)
To: git
Thanks Daniel,
some comments
> ------------------------------------------------------------------------
> On Fri, 1 Aug 2008, Matti Kaasinen wrote:
>
> >/ Hi!/
> >/ /
> >/ Is there any hope with following procedure:/
> >/ I took reporitory from linux git:/
> >/ # git clone/
> >/ git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/
> >/ /
> >/ For getting patches to make recent version from v2.6.26-rc3 I executed:/
> >/ # git format-patch -o patchdir v2.6.26-rc3..origin/
>
> format-patch isn't going to work too well with non-linear history. When
> two people make nearby or overlapping changes which get merged later, and
> this gets turned into a linear sequence of changes, there's no
> possible patch that will accurately reflect the change which got ordered
> second.
>
> >/ Then I checked out v2.6.26-rc3 to a new branch and patched it with/
> >/ at91patch/maxim.org.za that was produced against v2.6.26-rc3. That worked out/
> >/ without complaints./
>
> It sounds like you really just want to do "merge origin" now, and skip the
> whole patch series thing.
>
Ok, I'll try how it works, when I get back to my desk. Well, I'm running
out of time and possibly I need to stay in the current version.
> You'll probably get some conflicts (or applying the patch directly to
> origin would have worked),
There came quite a lot of complaints from patching directly the origin.
Strange that some were complaints of trying to re-create files. So, I
just wonder if that patching really is needed. I suppose I should try to
ask that from maxim.org.za
> but they should be relatively easy to resolve.
>
Well, hope so - direct patching to origin gave quite lot of complaints.
-Matti
^ permalink raw reply
* Re: email address handling
From: Johannes Schindelin @ 2008-08-02 11:31 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Andrew Morton, Theodore Tso, Junio C Hamano, git
In-Reply-To: <alpine.LFD.1.10.0808011608150.6819@nehalem.linux-foundation.org>
Hi,
On Fri, 1 Aug 2008, Linus Torvalds wrote:
> The thing is, you can actually get git to output the crazy names. Just
> do
>
> git show --pretty=email 37a4c940749670671adab211a2d9c9fed9f3f757
>
> and now you get the email-prettified thing for at least the author.
Ah, there lies the rub (you forgot that the original complaint was about
a comma, and pretty=email does not handle those):
-- snipsnap --
pretty.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/pretty.c b/pretty.c
index 33ef34a..9db0333 100644
--- a/pretty.c
+++ b/pretty.c
@@ -79,7 +79,8 @@ int non_ascii(int ch)
static int is_rfc2047_special(char ch)
{
- return (non_ascii(ch) || (ch == '=') || (ch == '?') || (ch == '_'));
+ return (non_ascii(ch) || (ch == '=') || (ch == '?') || (ch == '_') ||
+ (ch == ',') || (ch == '"') || (ch == '\''));
}
static void add_rfc2047(struct strbuf *sb, const char *line, int len,
@@ -89,7 +90,7 @@ static void add_rfc2047(struct strbuf *sb, const char *line, int len,
for (i = 0; i < len; i++) {
int ch = line[i];
- if (non_ascii(ch))
+ if (is_rfc2047_special(ch))
goto needquote;
if ((i + 1 < len) && (ch == '=' && line[i+1] == '?'))
goto needquote;
^ permalink raw reply related
* Re: [PATCH] diff: add ruby funcname pattern
From: Johannes Schindelin @ 2008-08-02 11:39 UTC (permalink / raw)
To: Giuseppe Bilotta; +Cc: Kevin Ballard, Junio C Hamano, git
In-Reply-To: <cb7bb73a0808012306y5672dad9nd0a21f861f181e5b@mail.gmail.com>
Hi,
On Sat, 2 Aug 2008, Giuseppe Bilotta wrote:
> On Sat, Aug 2, 2008 at 7:47 AM, Kevin Ballard <kevin@sb.org> wrote:
> >
> > If you're going to get into anonymous code blocks, you're going to have a
> > really tough time deciding which blocks are interesting and which aren't.
> > And as you stated before, without a stack-based approach, this could really
> > fall apart, as anonymous blocks are (almost) always going to be inside a
> > method.
>
> I was just looking for a libxdiff issue tracker but I couldn't find one,
> so I guess I'll ask the author directly about the possibility to
> implement such a thing.
The funcname thing was introduced by us, in Git. I do not know if Davide
picked the changes up; at least for the merge stuff he seemed to be pretty
reluctant.
> The matchit plugin for vim seems to manage (even user-defined) code
> blocks very well, even for multi-state blocks (if ... else ... end),
> using regexps; so maybe a reimplementation in C for libxdiff could be a
> solution.
Bzzt. You say vi manages it with regexps, and then you go on and say that
you therefore do _not_ want to use a regexp?
BTW having funcname calculation in C was shot down by Junio as being too
inflexible, as the user cannot add new languages without recompiling.
That's why we have regexps now.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] diff: add ruby funcname pattern
From: Giuseppe Bilotta @ 2008-08-02 11:50 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Kevin Ballard, Junio C Hamano, git
In-Reply-To: <alpine.DEB.1.00.0808021336050.9611@pacific.mpi-cbg.de.mpi-cbg.de>
Hello,
On Sat, Aug 2, 2008 at 1:39 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> The funcname thing was introduced by us, in Git. I do not know if Davide
> picked the changes up; at least for the merge stuff he seemed to be pretty
> reluctant.
Ah, it's a Git-only thing? didn't know about that. I guess that
knowing that git's libxdiff is already hacked up from the original
means I can think more freely about hacking it up some more, if I can
come up with a proper solution 8-)
>> The matchit plugin for vim seems to manage (even user-defined) code
>> blocks very well, even for multi-state blocks (if ... else ... end),
>> using regexps; so maybe a reimplementation in C for libxdiff could be a
>> solution.
>
> Bzzt. You say vi manages it with regexps, and then you go on and say that
> you therefore do _not_ want to use a regexp?
>
> BTW having funcname calculation in C was shot down by Junio as being too
> inflexible, as the user cannot add new languages without recompiling.
> That's why we have regexps now.
Sorry, I think there's a misunderstanding here ... I have all
intentions to use regexps. What I was planning on reimplementing in C
was the way matchit uses the regexps to determine the blocks (because,
obviously, it being a vim script means it's coded in vim's own
langauge instead of C). The actual definitions for the start and end
of the block would still be done via regexps. 8-)
--
Giuseppe "Oblomov" Bilotta
^ permalink raw reply
* [PATCH] diff: chapter and part in funcname for tex
From: Giuseppe Bilotta @ 2008-08-02 11:55 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Giuseppe Bilotta
In-Reply-To: <1217658945-29908-1-git-send-email-giuseppe.bilotta@gmail.com>
This patch enhances the tex funcname by adding support for
chapter and part sectioning commands. It also matches
the starred version of the sectioning commands.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
Resend, with Signed-off-by: line
diff.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/diff.c b/diff.c
index c253015..776bce1 100644
--- a/diff.c
+++ b/diff.c
@@ -1380,7 +1380,7 @@ static struct builtin_funcname_pattern {
"^[ ]*\\(\\([ ]*"
"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
"[ ]*([^;]*\\)$" },
- { "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
+ { "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\?{.*\\)$" },
{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
};
--
1.5.6.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox