Git development
 help / color / mirror / Atom feed
* [PATCH] rebase -i: call editor just once for a multi-squash
From: Johannes Schindelin @ 2007-07-21 17:09 UTC (permalink / raw)
  To: skimo; +Cc: git, gitster
In-Reply-To: <20070713103025.GR1528MdfPADPa@greensroom.kotnet.org>


Sometimes you want to squash more than two commits.  Before this patch,
the editor was fired up for each squash command.  Now the editor is
started only with the last squash command.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---

	On Fri, 13 Jul 2007, Sven Verdoolaege wrote:

	> If I squash a whole series of commits, how do I prevent 
	> git-rebase -i from firing up an editor after every single commit 
	> in the series?

	By applying this patch ;-)

 git-rebase--interactive.sh    |   56 +++++++++++++++++++++++++++++++++-------
 t/t3404-rebase-interactive.sh |    9 ++++++
 2 files changed, 55 insertions(+), 10 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index a2d4d09..579a45e 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -19,6 +19,8 @@ require_work_tree
 DOTEST="$GIT_DIR/.dotest-merge"
 TODO="$DOTEST"/todo
 DONE="$DOTEST"/done
+MSG="$DOTEST"/message
+SQUASH_MSG="$DOTEST"/message-squash
 REWRITTEN="$DOTEST"/rewritten
 PRESERVE_MERGES=
 STRATEGY=
@@ -158,6 +160,38 @@ pick_one_preserving_merges () {
 	esac
 }
 
+nth_string () {
+	case "$1" in
+	*1[0-9]|*[04-9]) echo "$1"th;;
+	*1) echo "$1"st;;
+	*2) echo "$1"nd;;
+	*3) echo "$1"rd;;
+	esac
+}
+
+make_squash_message () {
+	if [ -f "$SQUASH_MSG" ]; then
+		COUNT=$(($(sed -n "s/^# This is [^0-9]*\([0-9]\+\).*/\1/p" \
+			< "$SQUASH_MSG" | tail -n 1)+1))
+		echo "# This is a combination of $COUNT commits."
+		sed -n "2,\$p" < "$SQUASH_MSG"
+	else
+		COUNT=2
+		echo "# This is a combination of two commits."
+		echo "# The first commit's message is:"
+		echo
+		git cat-file commit HEAD | sed -e '1,/^$/d'
+		echo
+	fi
+	echo "# This is the $(nth_string $COUNT) commit message:"
+	echo
+	git cat-file commit $1 | sed -e '1,/^$/d'
+}
+
+peek_next_command () {
+	sed -n "1s/ .*$//p" < "$TODO"
+}
+
 do_next () {
 	test -f "$DOTEST"/message && rm "$DOTEST"/message
 	test -f "$DOTEST"/author-script && rm "$DOTEST"/author-script
@@ -194,17 +228,19 @@ do_next () {
 			die "Cannot 'squash' without a previous commit"
 
 		mark_action_done
-		MSG="$DOTEST"/message
-		echo "# This is a combination of two commits." > "$MSG"
-		echo "# The first commit's message is:" >> "$MSG"
-		echo >> "$MSG"
-		git cat-file commit HEAD | sed -e '1,/^$/d' >> "$MSG"
-		echo >> "$MSG"
+		make_squash_message $sha1 > "$MSG"
+		case "$(peek_next_command)" in
+		squash)
+			EDIT_COMMIT=
+			cp "$MSG" "$SQUASH_MSG"
+		;;
+		*)
+			EDIT_COMMIT=-e
+			test -f "$SQUASH_MSG" && rm "$SQUASH_MSG"
+		esac
+
 		failed=f
 		pick_one -n $sha1 || failed=t
-		echo "# And this is the 2nd commit message:" >> "$MSG"
-		echo >> "$MSG"
-		git cat-file commit $sha1 | sed -e '1,/^$/d' >> "$MSG"
 		git reset --soft HEAD^
 		author_script=$(get_author_ident_from_commit $sha1)
 		echo "$author_script" > "$DOTEST"/author-script
@@ -213,7 +249,7 @@ do_next () {
 			# This is like --amend, but with a different message
 			eval "$author_script"
 			export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
-			git commit -F "$MSG" -e
+			git commit -F "$MSG" $EDIT_COMMIT
 			;;
 		t)
 			cp "$MSG" "$GIT_DIR"/MERGE_MSG
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 43a6675..8206436 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -65,6 +65,7 @@ cat > fake-editor.sh << EOF
 #!/bin/sh
 test "\$1" = .git/COMMIT_EDITMSG && {
 	test -z "\$FAKE_COMMIT_MESSAGE" || echo "\$FAKE_COMMIT_MESSAGE" > "\$1"
+	test -z "\$FAKE_COMMIT_AMEND" || echo "\$FAKE_COMMIT_AMEND" >> "\$1"
 	exit
 }
 test -z "\$FAKE_LINES" && exit
@@ -212,4 +213,12 @@ test_expect_success 'verbose flag is heeded, even after --continue' '
 	grep "^ file1 |    2 +-$" output
 '
 
+test_expect_success 'multi-squash only fires up editor once' '
+	base=$(git rev-parse HEAD~4) &&
+	FAKE_COMMIT_AMEND="ONCE" FAKE_LINES="1 squash 2 squash 3 squash 4" \
+		git rebase -i $base &&
+	test $base = $(git rev-parse HEAD^) &&
+	test 1 = $(git show | grep ONCE | wc -l)
+'
+
 test_done
-- 
1.5.3.rc1.16.g9d6f-dirty

^ permalink raw reply related

* Re: [PATCH] Internationalization of git-gui
From: Brett Schwarz @ 2007-07-21 16:29 UTC (permalink / raw)
  To: Christian Stimming
  Cc: Paolo Ciarrocchi, Shawn O. Pearce, Johannes Schindelin, git


> ----- Original Message ----
> From: Christian Stimming <stimming@tuhh.de>
> To: Brett Schwarz <brett_schwarz@yahoo.com>
> Cc: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>; Shawn O. Pearce <spearce@spearce.org>; Johannes Schindelin <Johannes.Schindelin@gmx.de>; git@vger.kernel.org
> Sent: Friday, July 20, 2007 2:40:27 PM
> Subject: Re: [PATCH] Internationalization of git-gui
> 
> Am Freitag, 20. Juli 2007 20:34 schrieb Brett Schwarz:
> > After the glossary of terms has been create, it is easy to create the
> > catalog file (assuming we use Tcl's standard mechanism). Each locale should
> > have it's own file, named <locale_name>.msg (for example, es.msg for
> > spanish). Inside that file, you just create entries for each glossary term
> > (the below assumes that the msgcat namespace was imported):
> >
> >   mcset es Hello Hola
> >   mcset es "Hello %s" "Hola %s"
> 
> I beg your pardon, but I think you grossly misunderstood what I meant
> by "glossary". So before we end up in further confusion, let me clarify how
> the general translation approach works. I'll use gettext wording because
> that's what I know (from being the i18n guy in the gnucash project), but you
> can easily insert any other wording you like here.
> 

Ok, perhaps I did misunderstand you. From below, now I do understand...thanks.

 
> #1 For the translation in general, there is the set of all user-visible
> strings in the source language (here: english). In gettext terms this is
> called the "PO template file", git-gui.pot, also called the message template
> file. This set of to-be-translated strings needs to be extracted from the
> source code, which can be done by the xgettext program.
> 
> #2 For each target language, there is a human-readable mapping file that maps
> each source string (english) into the target language. In gettext terms this
> is the "PO file", de.po and it.po and ja.po and whatnot, also called the
> translation file. This is the *only* file translators actually work with.
> Gettext uses its PO file format here and a plethora of different tools exist
> to help translators editing these files. (Examples: emacs po-mode,
> KBabel, ...)
> 
> #3 For each target language, the translation files are converted to a
> (potentially not human-readable) "compiled" mapping file, which is then read
> at program runtime and used for the actual translation. For the gettext po
> file format, the msgfmt program can convert this to Tcl's .msg files.
> 
> If I understand correctly, your above suggestion implies that for Tcl msgcat,
> the file in #2 and #3 are one and the same? In my opinion this might make
> sense if and only if that file format is supported by at least as many
> translation tools and offers as flexible translation updates as gettext's po
> file format does. From my experience the po file format indeed offers a bunch
> of features that other translation file formats are missing but which are of
> significant help to the translator. That's why I would strongly suggest to do
> the actual translation inside a po file, and have it converted to the msg
> file afterwards.
> 

Yes, for the msgcat files, you create just the mapping files...that's it. No intermediate steps. So, a workflow would look something like this:

1) Somebody creates the initial "template" file. This is usually in the source's language (i.e. english). This too is just a msgcat file. Note that this file is not strictly necessary, but helps other translators.

2) A translator copies the template file, to their target language file, and edits the text:
    # cp en.msg es.msg
    # vi es.msg
    this
        mcset en Hello Hello
    get's changed to this
        mcset es Hello Hola
    etc

That's it. There is no compilation needed, and no need for a makefile entry.

Now, even though I think this approach is alot more simplier and straight forward, I do recognize that alot of people are probably accustomed to the po format, and since the actual generation of the msgcat files are only done by the maintainer, I don't really have anything against using the po format.

I know it's already been decided to use the po format, but I just wanted to make sure to follow up on this email.

Thanks,
    --brett




       
____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  

^ permalink raw reply

* Re: [PATCH 3/5] Internationalization of git-gui
From: Simon 'corecode' Schubert @ 2007-07-21 16:27 UTC (permalink / raw)
  To: David Kastrup; +Cc: git
In-Reply-To: <85ps2l98eq.fsf@lola.goethe.zz>

David Kastrup wrote:
>> +#: git-gui.sh:1798 git-gui.sh:2130 git-gui.sh:2228
>> +msgid "Sign Off"
>> +msgstr "Freizeichnen"
> 
> Gegenzeichnen?

Abzeichnen!

^ permalink raw reply

* Re: [RFC PATCH] Re: Empty directories...
From: Linus Torvalds @ 2007-07-21 15:53 UTC (permalink / raw)
  To: David Kastrup; +Cc: git
In-Reply-To: <85odi69vgt.fsf@lola.goethe.zz>



On Sat, 21 Jul 2007, David Kastrup wrote:

> Linus Torvalds <torvalds@linux-foundation.org> writes:
> 
> > Of course, it seldom matters, but basically, you should test a directory 
> > structure that has the files
> >
> > 	dir.c
> > 	dir/test
> >
> > in it, and the "dir" directory should always sort _after_ "dir.c".
> >
> > And yes, having the index entry with a '/' at the end would handle
> > that automatically.
> 
> You completely lost me here.  I guess I'll be able to pick this up
> only after investing considerable more time into the data structures.

So the basic issue is that not only does git obviously think that only 
content matters, but it describes it with a single SHA1. 

That's not an issue at all for a single file, but if you want to describe 
*multiple* files with a single SHA1 (which git obviously very much wants 
to do), the way you generate the SHA1 matters a lot.

In particular, the order.

So git is very very strict about the ordering of tree structures. A tree 
structure is not just a random list of

	<ASCII mode> + <space> + <filename> + <NUL> + <SHA1>

it's very much an _ordered_ list of those things, because we want the SHA1 
of the tree to be well-specified by the contents, and that means that the 
contents of a tree object has have absolutely _zero_ ambiguity.

This means, for example, that git is very fundamentally case sensitive. 
There's no sane way *not* to be, because if you're case insensitive in any 
way at all, you'll end up having two trees that are "the same", but end up 
having different SHA1's.

It also means that git objects have absolutely zero "localization". There 
is no locale at all, and there very fundamnetally *must*not* be. Again, 
for the same reason: if you can describe the same filename with two 
different encodings, you'd have two different SHA1's for the same content.

So git filenames are very much a "stream of bytes", not anything else. And 
they need to sort 100% reliably, always the same way, and never with any 
localized meaning.

And, partly because it seemed most natural, and partly for historical 
reasons, the way git sorts filenames is by sorting by *pathname*. So if 
you have three files named

	a.c
	a/c
	abc

then they sort in that exact order, and no other! They sort as a "memcmp" 
in the full pathname, and that's really nice when you see whole 
collections of files, and you know the list is globally sorted.

So that "global pathname sorting" has nice properties, and it seems 
"obvious", but it means that because git actually *encodes* those three 
files hierarchically as two different trees (because there's a 
subdirectory there), the tree objects themselves sort a bit oddly. The 
tree obejcts themselves will look like

 top-level tree:
	100644 a.c -> blob1
	040000 a   -> tree2
	100644 abc -> blob3

 sub-tree:
	100644 c    -> blob2

and notice how the *tree* is not sorted alphabetically at all. It has a 
subtly different sort, where the entry "a" sorts *after* the entry "a.c", 
because we know that it's a tree entry, and thus will (in the *global* 
order) sort as if it had a "/" at the end!

Traditionally, when we have the index, the index sorting has been very 
simple: you just sort the names as memcmp() would sort them. But note how 
that changes, if "a" is an empty directory. Now the index needs to sort as

	file a.c
	dir  a
	file abc

because when we create the tree entry, it needs to be sorted the same way 
all tree entries are always sorted - as if "a" had a slash at the end!

[ Yeah, yeah, we could make a special case and just say "the empty tree 
  sorts differently", but that actually results in huge problems when 
  doing a "diff" between two trees: our diff machinery very much depends 
  on the fact that the index and the trees always sort the same way, and 
  if we sorted the "a" entry (when it is an empty directory) differently 
  from the "a" entry (when it has entries in it), that would just be 
  insane and cause no end of trouble for comparing two trees - one with an 
  empty directory and one with content added to that directory.

  So the sorting is doubly important: it's what makes "one content" always 
  have the same SHA1, but it is also much easier and efficient to compare 
  directories when we know they are sorted the same way. ]

In other words, introducing tree entries in the index ended up also 
introducing all the issues that we already had with the tree objects since 
they got split up hierarchically, but that the code didn't use to have to 
care about.

The easiest way to solve this really does seem to be to add the rule that 
the index entry for an empty directory has to have the "/" at the end of 
the name - then the "sort mindlessly by name" will just continue to work.

But that was what I said was broken: my patches I sent out didn't actually 
do that.

It's *probably* just a few lines of code, and it actually would result in 
some nice changes ("git ls-files" would show a '/' at the end of an empty 
directory entry, for example), so this is not a big deal, but it's an 
example of how subtly different a directory is from a file when it comes 
to git.

			Linus

^ permalink raw reply

* segfault in diff-delta.c on mac os x (commit 8433669)
From: Steffen Prohaska @ 2007-07-21 15:15 UTC (permalink / raw)
  To: Git Mailing List

843366961cf14aad6490fbeb30f7b98f37f8833a may cause segfaults on
Mac OS X. See backtrace below. I only observed the segfault with
-O2 builds.

I was not yet able to understand the reason causing the segfault.
The situation is kind of strange. The for loop in line 302 shouldn't
allow entry == 0 to ever happen. But maybe some more intricate
corruption is taking place.

Unfortunately I'm no longer able to reproduce the exact call stack
because I wasn't aware of the details of when pruning takes place;
and the repository changed in such a way that the segfault no
longer happens.

However, I experienced suspicious behaviour on other repositories
during packing as well. I can probably create similar call stacks
if needed.

For now, I reverted 843366961cf14aad6490fbeb30f7b98f37f8833a for me.

	Steffen


gcc --version
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build  
5250)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There  
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR  
PURPOSE.


Counting objects: 7530
Done counting 56361 objects.
Deltifying 56361 objects...
   69% (38890/56361) done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00048526 in create_delta (index=0x35d5000, trg_buf=0x35a0000,  
trg_size=214109, delta_size=0xbfffe83c, max_size=104893) at diff- 
delta.c:303
303                                     const unsigned char *ref =  
entry->ptr;
(gdb) bt
#0  0x00048526 in create_delta (index=0x35d5000, trg_buf=0x35a0000,  
trg_size=214109, delta_size=0xbfffe83c, max_size=104893) at diff- 
delta.c:303
#1  0x0002beb7 in prepare_pack (window=10, depth=50) at builtin-pack- 
objects.c:1293
#2  0x0002cd6e in cmd_pack_objects (argc=16, argv=0xbfffef78,  
prefix=0x0) at builtin-pack-objects.c:1709
#3  0x000020c9 in handle_internal_command (argc=16, argv=0xbfffef78,  
envp=0x84) at git.c:324
#4  0x00002669 in main (argc=16, argv=0xbfffef78, envp=0xbfffefbc) at  
git.c:393
(gdb) l
298                             struct index_entry *entry;
299                             val ^= U[data[-RABIN_WINDOW]];
300                             val = ((val << 8) | *data) ^ T[val >>  
RABIN_SHIFT];
301                             i = val & index->hash_mask;
302                             for (entry = index->hash[i]; entry;  
entry = entry->next) {
303                                     const unsigned char *ref =  
entry->ptr;
304                                     const unsigned char *src = data;
305                                     unsigned int ref_size =  
ref_top - ref;
306                                     if (entry->val != val)
307                                             continue;
(gdb) p entry
$1 = (struct index_entry *) 0x0

^ permalink raw reply

* Re: [PATCH 1/5] Internationalization of git-gui
From: Johannes Schindelin @ 2007-07-21 14:22 UTC (permalink / raw)
  To: Christian Stimming; +Cc: Shawn O. Pearce, Brett Schwarz, git, Paul Mackerras
In-Reply-To: <200707211433.29318.stimming@tuhh.de>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 6232 bytes --]

Hi,

On Sat, 21 Jul 2007, Christian Stimming wrote:

> This patch starts over from before the first i18n patch has been applied 
> and takes into account all discussion with Shawn. Currently I don't 
> quite know how to apply these patches to the "mob" branch because one 
> would have to first revert those patches from me that have been applied 
> there... Thanks.

Usually you solve this by forcing a non-fastforwarding push.  IOW you 
really revert part of the history.  You would not even have had to call 
"git revert" or "git reset", since you started from a defined commit, 
d36cd968378cd3e509434b1b9f43f1417fdba57e.

_However_: Junio already pushed into the 'mob' branch, and if you would 
have forced a non-fastforwarding push, this commit would have been lost.  
At least from the repo's POV.

So the only real option that makes sense is for you to register as a user 
at repo.or.cz, send me your user name, and for me to add you as user so 
that you can push into your own branch easily.

FWIW, this is what I did with your patch series:

- I looked at the first diff to find out which version of git-gui.sh it 
  was based on:

	diff --git a/git-gui.sh b/git-gui.sh
	index c5ff7c8..0c5ca46 100755
	--- a/git-gui.sh
	+++ b/git-gui.sh

  Ah, okay, git-gui.sh was at c5ff7c8.  What commit was that?  Ask "git 
  log --raw":

	...
	commit d36cd968378cd3e509434b1b9f43f1417fdba57e
	Author: Shawn O. Pearce <spearce@spearce.org>
	Date:   Thu Jul 19 00:43:16 2007 -0400

	    git-gui: Avoid unnecessary global statements when possible

	    [commit message]

	:100755 100755 0aabfba... c5ff7c8... M  git-gui.sh

  Good.  So it is based on d36cd968.  (If my decorate patch would be in 
  'master', I could have told you an easy name like "shawn/master~3" or 
  some such).

- I started a new branch:

  git checkout -b christian-new d36cd968

- Then I saved all your mails into an own mbox with my mail program.  I 
  had to edit that mbox a little, since you sent the complete headers in 
  the body, not in the mail header.  So I just stripped all the 
  mail headers and only left the ones from the mail bodies.

- After that I applied the patches with

  git am -i <mbox-file>

  I like the interactive mode, especially since Pine likes to add a dummy 
  mail at the beginning of the mbox file, which I do not want to commit, 
  of course ;-)

- There were no conflicts at all, and just to see that nothing untoward 
  happened, I compared the diffstats with "git log --stat shawn/master.."

  Come to think of it, it's even easier to check the object name of the 
  new git-gui.sh: "git ls-files --stage" says

	...
	100755 95dac55[...] 0       git-gui.sh

  Worked.  (I could also have said "git log --raw" to see that.)

- Just a quick "make && ./git-gui" test.  Ooops:

	$ LC_ALL=C make
	Generating catalog po/de.msg
	msgfmt --statistics --tcl po/de.po -l de -d po/
	po/de.po:32:9: invalid multibyte sequence
	po/de.po:36:18: invalid multibyte sequence
	po/de.po:48:32: invalid multibyte sequence
	...

  Looking into line 32 I see an ISO-8859-1 'ü'.  But in the header it says 
  that it's UTF-8.  Just a quick try: change that to ISO-8859-1, and 
  'make' says:

	$ LC_ALL=C make
	Generating catalog po/de.msg
	msgfmt --statistics --tcl po/de.po -l de -d po/
	62 translated messages.

  Much better.

  Okay, let's fix that up.  First stash the changes:

	$ git stash encoding fix

  Then find out which commit added po/de.msg:

	$ git log -1 po/de.po
	...
	    Initial German translation [...]

  Now on to editing the patch series:

	$ git rebase -i HEAD~5

  Mark "Initial German translation [...]" with the command "edit" instead 
  of "pick".  Save, and wait for half a second.

	...
	You can amend the commit now, with

	        git commit --amend

  Apply the stashed changes, and make sure that it's what I want:

	$ git stash apply
	...
	$ git diff
	...
	-"Content-Type: text/plain; charset=UTF-8\n"
	+"Content-Type: text/plain; charset=ISO-8859-1\n"
	...

  Yes!  Amend the commit, and for good measure, sign off on it (after 
  reading it, of course):

	$ git commit --amend -s po/de.po

  Mention that the encoding was changed by me, so if it is wrong, it is 
  all my fault, not yours.

  Now finish "rebasing"...

	$ git rebase --continue

  Make sure that it works now:

	$ make libdir=$(pwd)/lib && ./git-gui

  Yep.  Everything's fine.

  (Usually I go through this procedure in less than 3 minutes, but today I 
  took more than double that, since I wrote this email explaining my 
  actions...)

- Push to repo.or.cz (which is my 'origin' remote):

	$ git push origin HEAD:refs/heads/christian-new

- Now for the real fun: rebase it on top of Shawn's new master:

	# I have installed a remote 'shawn' pointing to git-gui.git
	$ git fetch shawn
	$ git rebase shawn/master
	...

  Worked.  Just like that.  Brilliant.

- Let's just cherry-pick Junio's change, which is the latest commit in 
  origin/mob:

	$ git cherry-pick origin/mob
	Auto-merged Makefile
	CONFLICT (content): Merge conflict in Makefile
	Automatic cherry-pick failed.  After resolving the conflicts,
	mark the corrected paths with 'git-add <paths>'
	and commit the result.
	When commiting, use the option '-c 2d29ab2' to retain authorship 
	and message.

  Conflict in Makefile.  Okay, no problem, edit it.  Ah, of course, Shawn 
  asked for automatic inferring of the available languages, while Junio 
  added "ja".  Just take the current version (the version between "<<<<" 
  and "====").

	$ git add -u
	$ git commit -c 2d29ab2

- Make the current revision my new 'master'.  That branch already exists, 
  and I am on 'christian-new', though.  No problem:

	$ git branch -M christian-new master

  (But if you do that with "-M", which means _force_ rename, make sure 
  twice that this is really what you want.)

- Push it.

	$ git push origin +master
	...
	refs/heads/master: da7b699[...] -> cc2b761b[...]

  The "+" is necessary, since I rebased it...

  If there were more pushers than just me, I'd verify that da7b699 is 
  indeed the old state of my master:

	$ git reflog
	...
	d36cd96... HEAD@{20}: checkout: moving from master to christian-new
	da7b699... HEAD@{21}: commit [...]

  Yep.

Good.  Happy.

Ciao,
Dscho



^ permalink raw reply

* Re: [PATCH 3/5] Internationalization of git-gui
From: David Kastrup @ 2007-07-21 13:46 UTC (permalink / raw)
  To: git
In-Reply-To: <200707211437.43524.stimming@tuhh.de>

Christian Stimming <stimming@tuhh.de> writes:

> And a new German translation, so far 100% but many more strings are to come.
>
>  po/de.po |  265 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 265 insertions(+), 0 deletions(-)
>  create mode 100644 po/de.po

I have somewhat different proposals which sound less awkward, I
think.  Of course, it is always a matter of taste whether a technical
term should really be translated always, but assuming that, I'll make
some German proposals.  Some may be tongue in cheek.

> +#: git-gui.sh:1627 git-gui.sh:1802 git-gui.sh:2134
> +msgid "Commit"
> +msgstr "Übertragen"

Einpflegen ist als Verb gebräuchlich, aber dann ist es schwer, ein
passendes Substantiv zu finden.  "Sendung"?

> +#: git-gui.sh:1631
> +msgid "Fetch"
> +msgstr "Holen"

Importieren (hauptsächlich, weil es zu Exportieren paßt und Schieben
häßlich ist)

> +#: git-gui.sh:1632 git-gui.sh:2140
> +msgid "Push"
> +msgstr "Schieben"

Exportieren

> +#: git-gui.sh:1641
> +msgid "Browse Current Branch"
> +msgstr "Aktuellen Zweig durchblättern"

Im aktuellen Zweig stöbern.

> +#: git-gui.sh:1659
> +msgid "Compress Database"
> +msgstr "Datenbank komprimieren"

Ganz Deutsch: verdichten.

> +
> +#: git-gui.sh:1662
> +msgid "Verify Database"
> +msgstr "Datenbank prüfen"

überprüfen (prüfen wäre eher zu "checking")

> +#: git-gui.sh:1669 git-gui.sh:1673 git-gui.sh:1677
> +msgid "Create Desktop Icon"
> +msgstr "Desktop-Icon erstellen"

Da gibt es sicher einen neudeutschen Ausdruck, aber als
Nichtwindowsnutzer mit Amilokale...

> +#: git-gui.sh:1689
> +msgid "Undo"
> +msgstr "Rückgängig"

Ach nein.

> +#: git-gui.sh:1692
> +msgid "Redo"
> +msgstr "Wiederholen"

Jetzt doch.

> +#: git-gui.sh:1709 git-gui.sh:2217 git-gui.sh:2354
> +msgid "Select All"
> +msgstr "Alle auswählen"

Alles auswählen zöge ich vor.

> +#: git-gui.sh:1724
> +msgid "Checkout..."
> +msgstr "Auschecken..."

Ausspielung.

> +#: git-gui.sh:1752 git-gui.sh:2151
> +msgid "New Commit"
> +msgstr "Neu übertragen"

Neue Sendung

> +#: git-gui.sh:1760 git-gui.sh:2158
> +msgid "Amend Last Commit"
> +msgstr "Letzte Übertragung ergänzen"

Letzte Sendung korrigieren.

> +#: git-gui.sh:1775
> +msgid "Add To Commit"
> +msgstr "Zur Bereitstellung hinzufügen"

Der Sendung hinzufügen.

> +#: git-gui.sh:1780
> +msgid "Add Existing To Commit"
> +msgstr "Existierendes zur Bereitstellung hinzufügen"

Der Sendung hinzufügen.

> +#: git-gui.sh:1786
> +msgid "Unstage From Commit"
> +msgstr "Aus der Bereitstellung herausnehmen"

Aus der Sendung entfernen.

> +#: git-gui.sh:1798 git-gui.sh:2130 git-gui.sh:2228
> +msgid "Sign Off"
> +msgstr "Freizeichnen"

Gegenzeichnen?

> +#: git-gui.sh:2057
> +msgid "Staged Changes (Will Be Committed)"
> +msgstr "Bereitgestellte Änderungen (werden übertragen)"

Einzupflegende Änderungen

> +#: git-gui.sh:2077
> +msgid "Unstaged Changes (Will Not Be Committed)"
> +msgstr "Nicht bereitgestellte Änderungen (werden nicht übertragen)"

Nicht einzupflegende Änderungen

So, jetzt geht mir die Luft aus.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply

* Re: [PATCH] Internationalization of git-gui
From: Johannes Schindelin @ 2007-07-21 13:21 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: しらいしななこ,
	Paolo Ciarrocchi, Shawn O. Pearce, Christian Stimming, git
In-Reply-To: <7vr6n2upwv.fsf@assigned-by-dhcp.cox.net>

Hi,

On Sat, 21 Jul 2007, Junio C Hamano wrote:

> As Johannes announced the 'mob' stuff, I think it would be easiest to 
> work there as others --- for this type of work, there probably won't be 
> much stepping on each other's toes involved as long as there are not 
> more than one translator per language.

Already merged into git-gui-i18n's master.

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH] builtin-tag.c: Fix two memory leaks and minor notation changes.
From: Johannes Schindelin @ 2007-07-21 13:08 UTC (permalink / raw)
  To: Carlos Rica; +Cc: git, Junio C Hamano
In-Reply-To: <46A1F858.7080405@gmail.com>

Hi,

On Sat, 21 Jul 2007, Carlos Rica wrote:

> A repeated call to read_sha1_file was not freing memory
> when the buffer was allocated but returned size was zero.
> 
> Also, now the program does not allow many -F or -m options,
> which was a bug too because it was not freing the memory
> allocated for any previous -F or -m options.
> 
> Tests are provided for ensuring that only one option
> -F or -m is given. Also, another test is shipped here,
> to check that "git tag" fails when a non-existing file
> is passed to the -F option, something that git-tag.sh
> allowed creating the tag with an empty message.
> 
> Signed-off-by: Carlos Rica <jasampler@gmail.com>

Thank you very much!

Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH 5/5] Internationalization of git-gui
From: Christian Stimming @ 2007-07-21 12:41 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Brett Schwarz, git, Paul Mackerras
In-Reply-To: <200707211437.43524.stimming@tuhh.de>

From f074190d3bf1c08cd833afaa7ba42731b1e7f572 Mon Sep 17 00:00:00 2001
From: Christian Stimming <stimming@tuhh.de>
Date: Sat, 21 Jul 2007 14:39:24 +0200
Subject: [PATCH] Add glossary to ensure consistent translations.


Signed-off-by: Christian Stimming <stimming@tuhh.de>
---
And last but not least an initial list of the most important terms throughout git 
and git-gui; out of convenience I've already included my decisions on German 
translation wordings but in the future those translations will probably be collected 
elsewhere.

 po/glossary.csv |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 po/glossary.csv

diff --git a/po/glossary.csv b/po/glossary.csv
new file mode 100644
index 0000000..e6ffe46
--- /dev/null
+++ b/po/glossary.csv
@@ -0,0 +1,24 @@
+"English Term"	"de translation"
+"amend"	"ergänzen"
+"annotate"	"annotieren"
+"branch"	"Zweig, verzweigen"
+"checkout"	"Auschecken"
+"commit"	"übertragen (senden?, übergeben?)"
+"diff"	"vergleichen"
+"fetch"	"holen"
+"merge"	"zusammenführen"
+"message"	"Meldung"
+"pull"	"ziehen (übernehmen?)"
+"push"	"schieben (hochladen? verschicken?)"
+"redo"	"Wiederholen"
+"repository"	"Projektarchiv"
+"reset"	"Zurücksetzen"
+"revert"	"zurückkehren"
+"revision"	"Revision"
+"sign off"	"freizeichnen"
+"staging area"	"Bereitstellung"
+"status"	"Status"
+"tag"	"Markierung, markieren"
+"undo"	"Rückgängig"
+"update"	"aktualisieren"
+"working copy"	"Arbeitskopie"
-- 
1.5.2

^ permalink raw reply related

* Re: [PATCH 3/5] Internationalization of git-gui
From: Christian Stimming @ 2007-07-21 12:37 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Brett Schwarz, git, Paul Mackerras
In-Reply-To: <200707211436.44672.stimming@tuhh.de>

From 37241c4142c6bfe18e94a1891dbf1a9d1ee2953d Mon Sep 17 00:00:00 2001
From: Christian Stimming <chs@ckiste.goetheallee>
Date: Sat, 21 Jul 2007 14:18:14 +0200
Subject: [PATCH] Initial German translation for testing of i18n.


Signed-off-by: Christian Stimming <stimming@tuhh.de>
---
And a new German translation, so far 100% but many more strings are to come.

 po/de.po |  265 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 265 insertions(+), 0 deletions(-)
 create mode 100644 po/de.po

diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..0592836
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,265 @@
+# Translation of git-gui to German.
+# Copyright (C) 2007 Linux Torvalds
+# This file is distributed under the same license as the git package.
+# Christian Stimming <stimming@tuhh.de>, 2007
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: git-gui\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-07-19 15:10+0200\n"
+"PO-Revision-Date: 2007-07-19 15:11+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"
+
+#: git-gui.sh:1621
+msgid "Repository"
+msgstr "Projektarchiv"
+
+#: git-gui.sh:1622
+msgid "Edit"
+msgstr "Bearbeiten"
+
+#: git-gui.sh:1624
+msgid "Branch"
+msgstr "Zweig"
+
+#: git-gui.sh:1627 git-gui.sh:1802 git-gui.sh:2134
+msgid "Commit"
+msgstr "Übertragen"
+
+#: git-gui.sh:1630
+msgid "Merge"
+msgstr "Zusammenführen"
+
+#: git-gui.sh:1631
+msgid "Fetch"
+msgstr "Holen"
+
+#: git-gui.sh:1632 git-gui.sh:2140
+msgid "Push"
+msgstr "Schieben"
+
+#: git-gui.sh:1641
+msgid "Browse Current Branch"
+msgstr "Aktuellen Zweig durchblättern"
+
+#: git-gui.sh:1647
+msgid "Visualize Current Branch"
+msgstr "Aktuellen Zweig darstellen"
+
+#: git-gui.sh:1651
+msgid "Visualize All Branches"
+msgstr "Alle Zweige darstellen"
+
+#: git-gui.sh:1656
+msgid "Database Statistics"
+msgstr "Datenbankstatistik"
+
+#: git-gui.sh:1659
+msgid "Compress Database"
+msgstr "Datenbank komprimieren"
+
+#: git-gui.sh:1662
+msgid "Verify Database"
+msgstr "Datenbank prüfen"
+
+#: git-gui.sh:1669 git-gui.sh:1673 git-gui.sh:1677
+msgid "Create Desktop Icon"
+msgstr "Desktop-Icon erstellen"
+
+#: git-gui.sh:1682
+msgid "Quit"
+msgstr "Beenden"
+
+#: git-gui.sh:1689
+msgid "Undo"
+msgstr "Rückgängig"
+
+#: git-gui.sh:1692
+msgid "Redo"
+msgstr "Wiederholen"
+
+#: git-gui.sh:1696 git-gui.sh:2204
+msgid "Cut"
+msgstr "Ausschneiden"
+
+#: git-gui.sh:1699 git-gui.sh:2207 git-gui.sh:2278 git-gui.sh:2350
+msgid "Copy"
+msgstr "Kopieren"
+
+#: git-gui.sh:1702 git-gui.sh:2210
+msgid "Paste"
+msgstr "Einfügen"
+
+#: git-gui.sh:1705 git-gui.sh:2213
+msgid "Delete"
+msgstr "Löschen"
+
+#: git-gui.sh:1709 git-gui.sh:2217 git-gui.sh:2354
+msgid "Select All"
+msgstr "Alle auswählen"
+
+#: git-gui.sh:1718
+msgid "Create..."
+msgstr "Erstellen..."
+
+#: git-gui.sh:1724
+msgid "Checkout..."
+msgstr "Auschecken..."
+
+#: git-gui.sh:1730
+msgid "Rename..."
+msgstr "Umbenennen..."
+
+#: git-gui.sh:1735 git-gui.sh:1833
+msgid "Delete..."
+msgstr "Löschen..."
+
+#: git-gui.sh:1740
+msgid "Reset..."
+msgstr "Zurücksetzen..."
+
+#: git-gui.sh:1752 git-gui.sh:2151
+msgid "New Commit"
+msgstr "Neu übertragen"
+
+#: git-gui.sh:1760 git-gui.sh:2158
+msgid "Amend Last Commit"
+msgstr "Letzte Übertragung ergänzen"
+
+#: git-gui.sh:1769 git-gui.sh:2118
+msgid "Rescan"
+msgstr "Neu laden"
+
+#: git-gui.sh:1775
+msgid "Add To Commit"
+msgstr "Zur Bereitstellung hinzufügen"
+
+#: git-gui.sh:1780
+msgid "Add Existing To Commit"
+msgstr "Existierendes zur Bereitstellung hinzufügen"
+
+#: git-gui.sh:1786
+msgid "Unstage From Commit"
+msgstr "Aus der Bereitstellung herausnehmen"
+
+#: git-gui.sh:1791
+msgid "Revert Changes"
+msgstr "Änderungen verwerfen"
+
+#: git-gui.sh:1798 git-gui.sh:2130 git-gui.sh:2228
+msgid "Sign Off"
+msgstr "Freizeichnen"
+
+#: git-gui.sh:1813
+msgid "Local Merge..."
+msgstr "Lokales Zusammenführen..."
+
+#: git-gui.sh:1817
+msgid "Abort Merge..."
+msgstr "Zusammenführen abbrechen..."
+
+#: git-gui.sh:1830
+msgid "Push..."
+msgstr "Schieben..."
+
+#: git-gui.sh:1840
+msgid "Apple"
+msgstr "Apple"
+
+#: git-gui.sh:1843 git-gui.sh:1888
+#, tcl-format
+msgid "About %s"
+msgstr "Über %s"
+
+#: git-gui.sh:1845 git-gui.sh:1851 git-gui.sh:2396
+msgid "Options..."
+msgstr "Optionen..."
+
+#: git-gui.sh:1873
+msgid "Tools"
+msgstr "Werkzeuge"
+
+#: git-gui.sh:1875
+msgid "Migrate"
+msgstr "Migrieren"
+
+#: git-gui.sh:1884
+msgid "Help"
+msgstr "Hilfe"
+
+#: git-gui.sh:1925
+msgid "Online Documentation"
+msgstr "Online-Dokumentation"
+
+#: git-gui.sh:2036
+msgid "Current Branch:"
+msgstr "Aktueller Zweig:"
+
+#: git-gui.sh:2057
+msgid "Staged Changes (Will Be Committed)"
+msgstr "Bereitgestellte Änderungen (werden übertragen)"
+
+#: git-gui.sh:2077
+msgid "Unstaged Changes (Will Not Be Committed)"
+msgstr "Nicht bereitgestellte Änderungen (werden nicht übertragen)"
+
+#: git-gui.sh:2124
+msgid "Add Existing"
+msgstr "Existierendes hinzufügen"
+
+#: git-gui.sh:2170
+msgid "Initial Commit Message:"
+msgstr "Erstmalige Übertragungsmeldung"
+
+#: git-gui.sh:2171
+msgid "Amended Commit Message:"
+msgstr "Zur Übertragungsmeldung hinzufügen:"
+
+#: git-gui.sh:2172
+msgid "Amended Initial Commit Message:"
+msgstr "Zur erstmaligen Übertragungsmeldung hinzufügen:"
+
+#: git-gui.sh:2173
+msgid "Amended Merge Commit Message:"
+msgstr "Zur Zusammenführungs-Übertragungsmeldung hinzufügen:"
+
+#: git-gui.sh:2174
+msgid "Merge Commit Message:"
+msgstr "Übertragungsmeldung Zusammenführung:"
+
+#: git-gui.sh:2175
+msgid "Commit Message:"
+msgstr "Übertragungsmeldung:"
+
+#: git-gui.sh:2220 git-gui.sh:2358
+msgid "Copy All"
+msgstr "Alle kopieren"
+
+#: git-gui.sh:2346
+msgid "Refresh"
+msgstr "Aktualisieren"
+
+#: git-gui.sh:2367
+msgid "Apply/Reverse Hunk"
+msgstr "Änderung anwenden/umkehren"
+
+#: git-gui.sh:2373
+msgid "Decrease Font Size"
+msgstr "Schriftgröße verkleinern"
+
+#: git-gui.sh:2377
+msgid "Increase Font Size"
+msgstr "Schriftgröße vergrößern"
+
+#: git-gui.sh:2382
+msgid "Show Less Context"
+msgstr "Weniger Kontext anzeigen"
+
+#: git-gui.sh:2389
+msgid "Show More Context"
+msgstr "Mehr Kontext anzeigen"
-- 
1.5.2

^ permalink raw reply related

* Re: [PATCH 3/5] Internationalization of git-gui
From: Christian Stimming @ 2007-07-21 12:36 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Brett Schwarz, git, Paul Mackerras
In-Reply-To: <200707211434.56622.stimming@tuhh.de>

>From cf68c8b36399d46f63e417e99c6783411213a55a Mon Sep 17 00:00:00 2001
From: Christian Stimming <chs@ckiste.goetheallee>
Date: Sat, 21 Jul 2007 14:17:07 +0200
Subject: [PATCH] Makefile rules for translation catalog generation and installation.


Signed-off-by: Christian Stimming <stimming@tuhh.de>
---
As discussed I've replaced the shell for() by the GNU make foreach. Also, there 
isn't an ALL_LINGUAS variable anymore; we simply use all *.po files under po/.

 Makefile |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 1bac6fe..52975a7 100644
--- a/Makefile
+++ b/Makefile
@@ -103,6 +103,21 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
 $(GITGUI_BUILT_INS): git-gui
 	$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
 
+XGETTEXT   ?= xgettext
+msgsdir    ?= $(libdir)/msgs
+msgsdir_SQ  = $(subst ','\'',$(msgsdir))
+PO_TEMPLATE = po/git-gui.pot
+ALL_POFILES = $(wildcard po/*.po)
+ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
+
+$(PO_TEMPLATE): $(SCRIPT_SH) $(ALL_LIBFILES)
+	$(XGETTEXT) -kmc -LTcl -o $@ $(SCRIPT_SH) $(ALL_LIBFILES)
+update-po:: $(PO_TEMPLATE)
+	$(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) )
+$(ALL_MSGFILES): %.msg : %.po
+	@echo Generating catalog $@
+	msgfmt --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
+
 lib/tclIndex: $(ALL_LIBFILES)
 	$(QUIET_INDEX)if echo \
 	  $(foreach p,$(PRELOAD_FILES),source $p\;) \
@@ -136,7 +151,7 @@ GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
 		echo 1>$@ "$$VARS"; \
 	fi
 
-all:: $(ALL_PROGRAMS) lib/tclIndex
+all:: $(ALL_PROGRAMS) lib/tclIndex $(ALL_MSGFILES)
 
 install: all
 	$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)
@@ -145,6 +160,8 @@ install: all
 	$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(INSTALL_D1)
 	$(QUIET)$(INSTALL_R0)lib/tclIndex $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)'
 	$(QUIET)$(foreach p,$(ALL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true
+	$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
+	$(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
 
 dist-version:
 	@mkdir -p $(TARDIR)
-- 
1.5.2

^ permalink raw reply related

* Re: [PATCH 2/5] Internationalization of git-gui
From: Christian Stimming @ 2007-07-21 12:34 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Brett Schwarz, git, Paul Mackerras
In-Reply-To: <200707211433.29318.stimming@tuhh.de>

>From d2d2dde44790c3d239d69d7250e9949b6ff002c2 Mon Sep 17 00:00:00 2001
From: Christian Stimming <chs@ckiste.goetheallee>
Date: Sat, 21 Jul 2007 14:21:34 +0200
Subject: [PATCH] Mark strings for translation.

The procedure [mc ...] will translate the strings through msgcat.
Strings must be enclosed in quotes, not in braces, because otherwise
xgettext cannot extract them properly, although on the Tcl side both
delimiters would work fine.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
---

Here I marked much more strings than in the previous patch, and as discussed
the procedure [mc ...] is used for translation. Actually I think this pretty much 
caught all occurrences of user-visible strings in *this* file; there will be many
more strings in all the other files, of course.

 git-gui.sh |  170 ++++++++++++++++++++++++++++++------------------------------
 1 files changed, 85 insertions(+), 85 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index 0c5ca46..95dac55 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1653,18 +1653,18 @@ set ui_comm {}
 # -- Menu Bar
 #
 menu .mbar -tearoff 0
-.mbar add cascade -label Repository -menu .mbar.repository
-.mbar add cascade -label Edit -menu .mbar.edit
+.mbar add cascade -label [mc Repository] -menu .mbar.repository
+.mbar add cascade -label [mc Edit] -menu .mbar.edit
 if {[is_enabled branch]} {
-	.mbar add cascade -label Branch -menu .mbar.branch
+	.mbar add cascade -label [mc Branch] -menu .mbar.branch
 }
 if {[is_enabled multicommit] || [is_enabled singlecommit]} {
-	.mbar add cascade -label Commit -menu .mbar.commit
+	.mbar add cascade -label [mc Commit] -menu .mbar.commit
 }
 if {[is_enabled transport]} {
-	.mbar add cascade -label Merge -menu .mbar.merge
-	.mbar add cascade -label Fetch -menu .mbar.fetch
-	.mbar add cascade -label Push -menu .mbar.push
+	.mbar add cascade -label [mc Merge] -menu .mbar.merge
+	.mbar add cascade -label [mc Fetch] -menu .mbar.fetch
+	.mbar add cascade -label [mc Push] -menu .mbar.push
 }
 . configure -menu .mbar
 
@@ -1673,7 +1673,7 @@ if {[is_enabled transport]} {
 menu .mbar.repository
 
 .mbar.repository add command \
-	-label {Browse Current Branch's Files} \
+	-label [mc "Browse Current Branch's Files"] \
 	-command {browser::new $current_branch}
 trace add variable current_branch write ".mbar.repository entryconf [.mbar.repository index last] -label \"Browse \$current_branch's Files\" ;#"
 .mbar.repository add command \
@@ -1682,69 +1682,69 @@ trace add variable current_branch write ".mbar.repository entryconf [.mbar.repos
 .mbar.repository add separator
 
 .mbar.repository add command \
-	-label {Visualize Current Branch's History} \
+	-label [mc "Visualize Current Branch's History"] \
 	-command {do_gitk $current_branch}
 trace add variable current_branch write ".mbar.repository entryconf [.mbar.repository index last] -label \"Visualize \$current_branch's History\" ;#"
 .mbar.repository add command \
-	-label {Visualize All Branch History} \
+	-label [mc "Visualize All Branch History"] \
 	-command {do_gitk --all}
 .mbar.repository add separator
 
 if {[is_enabled multicommit]} {
-	.mbar.repository add command -label {Database Statistics} \
+	.mbar.repository add command -label [mc "Database Statistics"] \
 		-command do_stats
 
-	.mbar.repository add command -label {Compress Database} \
+	.mbar.repository add command -label [mc "Compress Database"] \
 		-command do_gc
 
-	.mbar.repository add command -label {Verify Database} \
+	.mbar.repository add command -label [mc "Verify Database"] \
 		-command do_fsck_objects
 
 	.mbar.repository add separator
 
 	if {[is_Cygwin]} {
 		.mbar.repository add command \
-			-label {Create Desktop Icon} \
+			-label [mc "Create Desktop Icon"] \
 			-command do_cygwin_shortcut
 	} elseif {[is_Windows]} {
 		.mbar.repository add command \
-			-label {Create Desktop Icon} \
+			-label [mc "Create Desktop Icon"] \
 			-command do_windows_shortcut
 	} elseif {[is_MacOSX]} {
 		.mbar.repository add command \
-			-label {Create Desktop Icon} \
+			-label [mc "Create Desktop Icon"] \
 			-command do_macosx_app
 	}
 }
 
-.mbar.repository add command -label Quit \
+.mbar.repository add command -label [mc Quit] \
 	-command do_quit \
 	-accelerator $M1T-Q
 
 # -- Edit Menu
 #
 menu .mbar.edit
-.mbar.edit add command -label Undo \
+.mbar.edit add command -label [mc Undo] \
 	-command {catch {[focus] edit undo}} \
 	-accelerator $M1T-Z
-.mbar.edit add command -label Redo \
+.mbar.edit add command -label [mc Redo] \
 	-command {catch {[focus] edit redo}} \
 	-accelerator $M1T-Y
 .mbar.edit add separator
-.mbar.edit add command -label Cut \
+.mbar.edit add command -label [mc Cut] \
 	-command {catch {tk_textCut [focus]}} \
 	-accelerator $M1T-X
-.mbar.edit add command -label Copy \
+.mbar.edit add command -label [mc Copy] \
 	-command {catch {tk_textCopy [focus]}} \
 	-accelerator $M1T-C
-.mbar.edit add command -label Paste \
+.mbar.edit add command -label [mc Paste] \
 	-command {catch {tk_textPaste [focus]; [focus] see insert}} \
 	-accelerator $M1T-V
-.mbar.edit add command -label Delete \
+.mbar.edit add command -label [mc Delete] \
 	-command {catch {[focus] delete sel.first sel.last}} \
 	-accelerator Del
 .mbar.edit add separator
-.mbar.edit add command -label {Select All} \
+.mbar.edit add command -label [mc "Select All"] \
 	-command {catch {[focus] tag add sel 0.0 end}} \
 	-accelerator $M1T-A
 
@@ -1753,29 +1753,29 @@ menu .mbar.edit
 if {[is_enabled branch]} {
 	menu .mbar.branch
 
-	.mbar.branch add command -label {Create...} \
+	.mbar.branch add command -label [mc "Create..."] \
 		-command branch_create::dialog \
 		-accelerator $M1T-N
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
 
-	.mbar.branch add command -label {Checkout...} \
+	.mbar.branch add command -label [mc "Checkout..."] \
 		-command branch_checkout::dialog \
 		-accelerator $M1T-O
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
 
-	.mbar.branch add command -label {Rename...} \
+	.mbar.branch add command -label [mc "Rename..."] \
 		-command branch_rename::dialog
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
 
-	.mbar.branch add command -label {Delete...} \
+	.mbar.branch add command -label [mc "Delete..."] \
 		-command branch_delete::dialog
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
 
-	.mbar.branch add command -label {Reset...} \
+	.mbar.branch add command -label [mc "Reset..."] \
 		-command merge::reset_hard
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
@@ -1787,7 +1787,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 	menu .mbar.commit
 
 	.mbar.commit add radiobutton \
-		-label {New Commit} \
+		-label [mc "New Commit"] \
 		-command do_select_commit_type \
 		-variable selected_commit_type \
 		-value new
@@ -1795,7 +1795,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
 	.mbar.commit add radiobutton \
-		-label {Amend Last Commit} \
+		-label [mc "Amend Last Commit"] \
 		-command do_select_commit_type \
 		-variable selected_commit_type \
 		-value amend
@@ -1804,40 +1804,40 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 
 	.mbar.commit add separator
 
-	.mbar.commit add command -label Rescan \
+	.mbar.commit add command -label [mc Rescan] \
 		-command do_rescan \
 		-accelerator F5
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
-	.mbar.commit add command -label {Add To Commit} \
+	.mbar.commit add command -label [mc "Add To Commit"] \
 		-command do_add_selection
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
-	.mbar.commit add command -label {Add Existing To Commit} \
+	.mbar.commit add command -label [mc "Add Existing To Commit"] \
 		-command do_add_all \
 		-accelerator $M1T-I
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
-	.mbar.commit add command -label {Unstage From Commit} \
+	.mbar.commit add command -label [mc "Unstage From Commit"] \
 		-command do_unstage_selection
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
-	.mbar.commit add command -label {Revert Changes} \
+	.mbar.commit add command -label [mc "Revert Changes"] \
 		-command do_revert_selection
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
 	.mbar.commit add separator
 
-	.mbar.commit add command -label {Sign Off} \
+	.mbar.commit add command -label [mc "Sign Off"] \
 		-command do_signoff \
 		-accelerator $M1T-S
 
-	.mbar.commit add command -label Commit \
+	.mbar.commit add command -label [mc Commit] \
 		-command do_commit \
 		-accelerator $M1T-Return
 	lappend disable_on_lock \
@@ -1848,12 +1848,12 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 #
 if {[is_enabled branch]} {
 	menu .mbar.merge
-	.mbar.merge add command -label {Local Merge...} \
+	.mbar.merge add command -label [mc "Local Merge..."] \
 		-command merge::dialog \
 		-accelerator $M1T-M
 	lappend disable_on_lock \
 		[list .mbar.merge entryconf [.mbar.merge index last] -state]
-	.mbar.merge add command -label {Abort Merge...} \
+	.mbar.merge add command -label [mc "Abort Merge..."] \
 		-command merge::reset_hard
 	lappend disable_on_lock \
 		[list .mbar.merge entryconf [.mbar.merge index last] -state]
@@ -1865,28 +1865,28 @@ if {[is_enabled transport]} {
 	menu .mbar.fetch
 
 	menu .mbar.push
-	.mbar.push add command -label {Push...} \
+	.mbar.push add command -label [mc "Push..."] \
 		-command do_push_anywhere \
 		-accelerator $M1T-P
-	.mbar.push add command -label {Delete...} \
+	.mbar.push add command -label [mc "Delete..."] \
 		-command remote_branch_delete::dialog
 }
 
 if {[is_MacOSX]} {
 	# -- Apple Menu (Mac OS X only)
 	#
-	.mbar add cascade -label Apple -menu .mbar.apple
+	.mbar add cascade -label [mc Apple] -menu .mbar.apple
 	menu .mbar.apple
 
-	.mbar.apple add command -label "About [appname]" \
+	.mbar.apple add command -label [mc "About %s" appname] \
 		-command do_about
-	.mbar.apple add command -label "Options..." \
+	.mbar.apple add command -label [mc "Options..."] \
 		-command do_options
 } else {
 	# -- Edit Menu
 	#
 	.mbar.edit add separator
-	.mbar.edit add command -label {Options...} \
+	.mbar.edit add command -label [mc "Options..."] \
 		-command do_options
 
 	# -- Tools Menu
@@ -1921,11 +1921,11 @@ if {[is_MacOSX]} {
 
 # -- Help Menu
 #
-.mbar add cascade -label Help -menu .mbar.help
+.mbar add cascade -label [mc Help] -menu .mbar.help
 menu .mbar.help
 
 if {![is_MacOSX]} {
-	.mbar.help add command -label "About [appname]" \
+	.mbar.help add command -label [mc "About %s" appname] \
 		-command do_about
 }
 
@@ -1962,7 +1962,7 @@ if {[file isfile $doc_path]} {
 }
 
 if {$browser ne {}} {
-	.mbar.help add command -label {Online Documentation} \
+	.mbar.help add command -label [mc "Online Documentation"] \
 		-command [list exec $browser $doc_url &]
 }
 unset browser doc_path doc_url
@@ -2078,7 +2078,7 @@ frame .branch \
 	-borderwidth 1 \
 	-relief sunken
 label .branch.l1 \
-	-text {Current Branch:} \
+	-text [mc "Current Branch:"] \
 	-anchor w \
 	-justify left
 label .branch.cb \
@@ -2099,7 +2099,7 @@ pack .vpane -anchor n -side top -fill both -expand 1
 # -- Index File List
 #
 frame .vpane.files.index -height 100 -width 200
-label .vpane.files.index.title -text {Staged Changes (Will Be Committed)} \
+label .vpane.files.index.title -text [mc "Staged Changes (Will Be Committed)"] \
 	-background lightgreen
 text $ui_index -background white -borderwidth 0 \
 	-width 20 -height 10 \
@@ -2119,7 +2119,7 @@ pack $ui_index -side left -fill both -expand 1
 # -- Working Directory File List
 #
 frame .vpane.files.workdir -height 100 -width 200
-label .vpane.files.workdir.title -text {Unstaged Changes (Will Not Be Committed)} \
+label .vpane.files.workdir.title -text [mc "Unstaged Changes (Will Not Be Committed)"] \
 	-background lightsalmon
 text $ui_workdir -background white -borderwidth 0 \
 	-width 20 -height 10 \
@@ -2160,29 +2160,29 @@ label .vpane.lower.commarea.buttons.l -text {} \
 pack .vpane.lower.commarea.buttons.l -side top -fill x
 pack .vpane.lower.commarea.buttons -side left -fill y
 
-button .vpane.lower.commarea.buttons.rescan -text {Rescan} \
+button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
 	-command do_rescan
 pack .vpane.lower.commarea.buttons.rescan -side top -fill x
 lappend disable_on_lock \
 	{.vpane.lower.commarea.buttons.rescan conf -state}
 
-button .vpane.lower.commarea.buttons.incall -text {Add Existing} \
+button .vpane.lower.commarea.buttons.incall -text [mc "Add Existing"] \
 	-command do_add_all
 pack .vpane.lower.commarea.buttons.incall -side top -fill x
 lappend disable_on_lock \
 	{.vpane.lower.commarea.buttons.incall conf -state}
 
-button .vpane.lower.commarea.buttons.signoff -text {Sign Off} \
+button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \
 	-command do_signoff
 pack .vpane.lower.commarea.buttons.signoff -side top -fill x
 
-button .vpane.lower.commarea.buttons.commit -text {Commit} \
+button .vpane.lower.commarea.buttons.commit -text [mc Commit] \
 	-command do_commit
 pack .vpane.lower.commarea.buttons.commit -side top -fill x
 lappend disable_on_lock \
 	{.vpane.lower.commarea.buttons.commit conf -state}
 
-button .vpane.lower.commarea.buttons.push -text {Push} \
+button .vpane.lower.commarea.buttons.push -text [mc Push] \
 	-command do_push_anywhere
 pack .vpane.lower.commarea.buttons.push -side top -fill x
 
@@ -2193,14 +2193,14 @@ frame .vpane.lower.commarea.buffer.header
 set ui_comm .vpane.lower.commarea.buffer.t
 set ui_coml .vpane.lower.commarea.buffer.header.l
 radiobutton .vpane.lower.commarea.buffer.header.new \
-	-text {New Commit} \
+	-text [mc "New Commit"] \
 	-command do_select_commit_type \
 	-variable selected_commit_type \
 	-value new
 lappend disable_on_lock \
 	[list .vpane.lower.commarea.buffer.header.new conf -state]
 radiobutton .vpane.lower.commarea.buffer.header.amend \
-	-text {Amend Last Commit} \
+	-text [mc "Amend Last Commit"] \
 	-command do_select_commit_type \
 	-variable selected_commit_type \
 	-value amend
@@ -2212,12 +2212,12 @@ label $ui_coml \
 proc trace_commit_type {varname args} {
 	global ui_coml commit_type
 	switch -glob -- $commit_type {
-	initial       {set txt {Initial Commit Message:}}
-	amend         {set txt {Amended Commit Message:}}
-	amend-initial {set txt {Amended Initial Commit Message:}}
-	amend-merge   {set txt {Amended Merge Commit Message:}}
-	merge         {set txt {Merge Commit Message:}}
-	*             {set txt {Commit Message:}}
+	initial       {set txt [mc "Initial Commit Message:"]}
+	amend         {set txt [mc "Amended Commit Message:"]}
+	amend-initial {set txt [mc "Amended Initial Commit Message:"]}
+	amend-merge   {set txt [mc "Amended Merge Commit Message:"]}
+	merge         {set txt [mc "Merge Commit Message:"]}
+	*             {set txt [mc "Commit Message:"]}
 	}
 	$ui_coml conf -text $txt
 }
@@ -2246,23 +2246,23 @@ pack .vpane.lower.commarea.buffer -side left -fill y
 set ctxm .vpane.lower.commarea.buffer.ctxm
 menu $ctxm -tearoff 0
 $ctxm add command \
-	-label {Cut} \
+	-label [mc Cut] \
 	-command {tk_textCut $ui_comm}
 $ctxm add command \
-	-label {Copy} \
+	-label [mc Copy] \
 	-command {tk_textCopy $ui_comm}
 $ctxm add command \
-	-label {Paste} \
+	-label [mc Paste] \
 	-command {tk_textPaste $ui_comm}
 $ctxm add command \
-	-label {Delete} \
+	-label [mc Delete] \
 	-command {$ui_comm delete sel.first sel.last}
 $ctxm add separator
 $ctxm add command \
-	-label {Select All} \
+	-label [mc "Select All"] \
 	-command {focus $ui_comm;$ui_comm tag add sel 0.0 end}
 $ctxm add command \
-	-label {Copy All} \
+	-label [mc "Copy All"] \
 	-command {
 		$ui_comm tag add sel 0.0 end
 		tk_textCopy $ui_comm
@@ -2270,7 +2270,7 @@ $ctxm add command \
 	}
 $ctxm add separator
 $ctxm add command \
-	-label {Sign Off} \
+	-label [mc "Sign Off"] \
 	-command do_signoff
 bind_button3 $ui_comm "tk_popup $ctxm %X %Y"
 
@@ -2320,7 +2320,7 @@ pack .vpane.lower.diff.header.path -fill x
 set ctxm .vpane.lower.diff.header.ctxm
 menu $ctxm -tearoff 0
 $ctxm add command \
-	-label {Copy} \
+	-label [mc Copy] \
 	-command {
 		clipboard clear
 		clipboard append \
@@ -2388,19 +2388,19 @@ $ui_diff tag raise sel
 set ctxm .vpane.lower.diff.body.ctxm
 menu $ctxm -tearoff 0
 $ctxm add command \
-	-label {Refresh} \
+	-label [mc Refresh] \
 	-command reshow_diff
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label {Copy} \
+	-label [mc Copy] \
 	-command {tk_textCopy $ui_diff}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label {Select All} \
+	-label [mc "Select All"] \
 	-command {focus $ui_diff;$ui_diff tag add sel 0.0 end}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label {Copy All} \
+	-label [mc "Copy All"] \
 	-command {
 		$ui_diff tag add sel 0.0 end
 		tk_textCopy $ui_diff
@@ -2409,44 +2409,44 @@ $ctxm add command \
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add separator
 $ctxm add command \
-	-label {Apply/Reverse Hunk} \
+	-label [mc "Apply/Reverse Hunk"] \
 	-command {apply_hunk $cursorX $cursorY}
 set ui_diff_applyhunk [$ctxm index last]
 lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state]
 $ctxm add separator
 $ctxm add command \
-	-label {Decrease Font Size} \
+	-label [mc "Decrease Font Size"] \
 	-command {incr_font_size font_diff -1}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label {Increase Font Size} \
+	-label [mc "Increase Font Size"] \
 	-command {incr_font_size font_diff 1}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add separator
 $ctxm add command \
-	-label {Show Less Context} \
+	-label [mc "Show Less Context"] \
 	-command {if {$repo_config(gui.diffcontext) >= 1} {
 		incr repo_config(gui.diffcontext) -1
 		reshow_diff
 	}}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label {Show More Context} \
+	-label [mc "Show More Context"] \
 	-command {if {$repo_config(gui.diffcontext) < 99} {
 		incr repo_config(gui.diffcontext)
 		reshow_diff
 	}}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add separator
-$ctxm add command -label {Options...} \
+$ctxm add command -label [mc "Options..."] \
 	-command do_options
 bind_button3 $ui_diff "
 	set cursorX %x
 	set cursorY %y
 	if {\$ui_index eq \$current_diff_side} {
-		$ctxm entryconf $ui_diff_applyhunk -label {Unstage Hunk From Commit}
+		$ctxm entryconf $ui_diff_applyhunk -label [mc {Unstage Hunk From Commit}]
 	} else {
-		$ctxm entryconf $ui_diff_applyhunk -label {Stage Hunk For Commit}
+		$ctxm entryconf $ui_diff_applyhunk -label [mc {Stage Hunk For Commit}]
 	}
 	tk_popup $ctxm %X %Y
 "
-- 
1.5.2

^ permalink raw reply related

* Re: [PATCH 1/5] Internationalization of git-gui
From: Christian Stimming @ 2007-07-21 12:33 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Brett Schwarz, git, Paul Mackerras
In-Reply-To: <20070721080338.GT32566@spearce.org>

>From 18d783abd85e074c302c5e7979dfb242b3c6c386 Mon Sep 17 00:00:00 2001
From: Christian Stimming <chs@ckiste.goetheallee>
Date: Sat, 21 Jul 2007 13:51:48 +0200
Subject: [PATCH] Initialize msgcat (gettext).

Use [mc ...] as function name for translating user messages.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
---

This patch starts over from before the first i18n patch has been applied and 
takes into account all discussion with Shawn. Currently I don't quite know 
how to apply these patches to the "mob" branch because one would have
to first revert those patches from me that have been applied there... Thanks.

 git-gui.sh |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index c5ff7c8..0c5ca46 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -108,6 +108,12 @@ if {$idx ne {}} {
 }
 unset -nocomplain oguirel idx fd
 
+## Internationalization (i18n) through msgcat and gettext. See
+## http://www.gnu.org/software/gettext/manual/html_node/Tcl.html
+package require msgcat
+::msgcat::mcload [file join $oguilib msgs]
+namespace import ::msgcat::mc
+
 ######################################################################
 ##
 ## read only globals
-- 
1.5.2

^ permalink raw reply related

* Re: [PATCH] builtin-tag.c: Fix two memory leaks and minor notation changes.
From: Carlos Rica @ 2007-07-21 12:18 UTC (permalink / raw)
  To: git, Junio C Hamano, Johannes Schindelin
In-Reply-To: <46A1F858.7080405@gmail.com>

Carlos Rica escribió:
>   Those were commented in the responses to my previous patch:
>   http://article.gmane.org/gmane.comp.version-control.git/53138

A little error here when copying the link, the thread is:
http://thread.gmane.org/gmane.comp.version-control.git/53036

^ permalink raw reply

* [PATCH] builtin-tag.c: Fix two memory leaks and minor notation changes.
From: Carlos Rica @ 2007-07-21 12:13 UTC (permalink / raw)
  To: git, Junio C Hamano, Johannes Schindelin

A repeated call to read_sha1_file was not freing memory
when the buffer was allocated but returned size was zero.

Also, now the program does not allow many -F or -m options,
which was a bug too because it was not freing the memory
allocated for any previous -F or -m options.

Tests are provided for ensuring that only one option
-F or -m is given. Also, another test is shipped here,
to check that "git tag" fails when a non-existing file
is passed to the -F option, something that git-tag.sh
allowed creating the tag with an empty message.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
---

  Those were commented in the responses to my previous patch:
  http://article.gmane.org/gmane.comp.version-control.git/53138

  I committed them on top of that my other patch already in "next".
  Unfortunately, I was not able to commit before the patches
  from Johannes supporting the EDITOR environment variable
  in builtin-tag.c and fixing its bug with a non-initialized buffer.

 builtin-tag.c  |   38 ++++++++++++++++++++++----------------
 t/t7004-tag.sh |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+), 16 deletions(-)

diff --git a/builtin-tag.c b/builtin-tag.c
index 507f510..9231d72 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -85,14 +85,19 @@ static int show_reference(const char *refname, const unsigned char *sha1,
 		printf("%-15s ", refname);

 		sp = buf = read_sha1_file(sha1, &type, &size);
-		if (!buf || !size)
+		if (!buf)
 			return 0;
+		if (!size) {
+			free(buf);
+			return 0;
+		}
 		/* skip header */
 		while (sp + 1 < buf + size &&
 				!(sp[0] == '\n' && sp[1] == '\n'))
 			sp++;
 		/* only take up to "lines" lines, and strip the signature */
-		for (i = 0, sp += 2; i < filter->lines && sp < buf + size &&
+		for (i = 0, sp += 2;
+				i < filter->lines && sp < buf + size &&
 				prefixcmp(sp, PGP_SIGNATURE "\n");
 				i++) {
 			if (i)
@@ -133,10 +138,10 @@ static int list_tags(const char *pattern, int lines)
 	return 0;
 }

-typedef int (*func_tag)(const char *name, const char *ref,
+typedef int (*each_tag_name_fn)(const char *name, const char *ref,
 				const unsigned char *sha1);

-static int do_tag_names(const char **argv, func_tag fn)
+static int for_each_tag_name(const char **argv, each_tag_name_fn fn)
 {
 	const char **p;
 	char ref[PATH_MAX];
@@ -191,7 +196,7 @@ static ssize_t do_sign(char *buffer, size_t size, size_t max)

 	if (!*signingkey) {
 		if (strlcpy(signingkey, git_committer_info(1),
-				sizeof(signingkey)) >= sizeof(signingkey))
+				sizeof(signingkey)) > sizeof(signingkey) - 1)
 			return error("committer info too long.");
 		bracket = strchr(signingkey, '>');
 		if (bracket)
@@ -254,7 +259,7 @@ static void create_tag(const unsigned char *object, const char *tag,
 	unsigned long size;

 	type = sha1_object_info(object, NULL);
-	if (type <= 0)
+	if (type <= OBJ_NONE)
 	    die("bad object type.");

 	header_len = snprintf(header_buf, sizeof(header_buf),
@@ -267,7 +272,7 @@ static void create_tag(const unsigned char *object, const char *tag,
 			  tag,
 			  git_committer_info(1));

-	if (header_len >= sizeof(header_buf))
+	if (header_len > sizeof(header_buf) - 1)
 		die("tag header too big.");

 	if (!message) {
@@ -362,6 +367,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 			i++;
 			if (i == argc)
 				die("option -m needs an argument.");
+			if (message)
+				die("only one -F or -m option is allowed.");
 			message = xstrdup(argv[i]);
 			continue;
 		}
@@ -373,6 +380,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 			i++;
 			if (i == argc)
 				die("option -F needs an argument.");
+			if (message)
+				die("only one -F or -m option is allowed.");

 			if (!strcmp(argv[i], "-"))
 				fd = 0;
@@ -401,15 +410,12 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 				die("argument to option -u too long");
 			continue;
 		}
-		if (!strcmp(arg, "-l")) {
+		if (!strcmp(arg, "-l"))
 			return list_tags(argv[i + 1], lines);
-		}
-		if (!strcmp(arg, "-d")) {
-			return do_tag_names(argv + i + 1, delete_tag);
-		}
-		if (!strcmp(arg, "-v")) {
-			return do_tag_names(argv + i + 1, verify_tag);
-		}
+		if (!strcmp(arg, "-d"))
+			return for_each_tag_name(argv + i + 1, delete_tag);
+		if (!strcmp(arg, "-v"))
+			return for_each_tag_name(argv + i + 1, verify_tag);
 		usage(builtin_tag_usage);
 	}

@@ -427,7 +433,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 	if (get_sha1(object_ref, object))
 		die("Failed to resolve '%s' as a valid ref.", object_ref);

-	if (snprintf(ref, sizeof(ref), "refs/tags/%s", tag) >= sizeof(ref))
+	if (snprintf(ref, sizeof(ref), "refs/tags/%s", tag) > sizeof(ref) - 1)
 		die("tag name too long: %.*s...", 50, tag);
 	if (check_ref_format(ref))
 		die("'%s' is not a valid tag name.", tag);
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index a0be164..c4fa446 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -332,6 +332,33 @@ test_expect_success 'creating an annotated tag with -F - should succeed' '
 	git diff expect actual
 '

+test_expect_success \
+	'trying to create a tag with a non-existing -F file should fail' '
+	! test -f nonexistingfile &&
+	! tag_exists notag &&
+	! git-tag -F nonexistingfile notag &&
+	! tag_exists notag
+'
+
+test_expect_success \
+	'trying to create tags giving many -m or -F options should fail' '
+	echo "message file 1" >msgfile1 &&
+	echo "message file 2" >msgfile2 &&
+	! tag_exists msgtag &&
+	! git-tag -m "message 1" -m "message 2" msgtag &&
+	! tag_exists msgtag &&
+	! git-tag -F msgfile1 -F msgfile2 msgtag &&
+	! tag_exists msgtag &&
+	! git-tag -m "message 1" -F msgfile1 msgtag &&
+	! tag_exists msgtag &&
+	! git-tag -F msgfile1 -m "message 1" msgtag &&
+	! tag_exists msgtag &&
+	! git-tag -F msgfile1 -m "message 1" -F msgfile2 msgtag &&
+	! tag_exists msgtag &&
+	! git-tag -m "message 1" -F msgfile1 -m "message 2" msgtag &&
+	! tag_exists msgtag
+'
+
 # blank and empty messages:

 get_tag_header empty-annotated-tag $commit commit $time >expect
@@ -648,6 +675,14 @@ test_expect_success 'creating a signed tag with -F - should succeed' '
 	git diff expect actual
 '

+test_expect_success \
+	'trying to create a signed tag with non-existing -F file should fail' '
+	! test -f nonexistingfile &&
+	! tag_exists nosigtag &&
+	! git-tag -s -F nonexistingfile nosigtag &&
+	! tag_exists nosigtag
+'
+
 test_expect_success 'verifying a signed tag should succeed' \
 	'git-tag -v signed-tag'

-- 
1.5.0

^ permalink raw reply related

* Re: gitk problems: can't unset "idinlist(...)"
From: Paul Mackerras @ 2007-07-21 11:42 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Git Mailing List, Junio C Hamano
In-Reply-To: <alpine.LFD.0.999.0707201554540.27249@woody.linux-foundation.org>

Linus Torvalds writes:

> Somebody who knows 
> tcl/tk, and gitk?

That sounds like me. :)  I see from the following messages that the
bug turned out to be elsewhere in git, but it looks like gitk should
be more robust and do something sensible rather than just throwing a
Tcl error.  I'll look at it.

Paul.

^ permalink raw reply

* Re: pointer to pointer
From: David Kastrup @ 2007-07-21  9:44 UTC (permalink / raw)
  To: git
In-Reply-To: <85k5su9k59.fsf_-_@lola.goethe.zz>

David Kastrup <dak@gnu.org> writes:

    Content-Type: text/x-csrc
    Content-Disposition: attachment
    Content-Description: Stable Mergesort on linked lists

Sorry, this was supposed to be inline.  I apologize for the
inconvenience.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply

* pointer to pointer (was: gitk problems: can't unset "idinlist(...)")
From: David Kastrup @ 2007-07-21  9:32 UTC (permalink / raw)
  To: git
In-Reply-To: <alpine.LFD.0.999.0707202335570.27249@woody.linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 1445 bytes --]

Linus Torvalds <torvalds@linux-foundation.org> writes:

> Anyway, just because this is actually something I've noticed a lot
> of people do wrong, I actually do tend to think that when you
> traverse a singly-linked list and remove entries, you should *never*
> traverse the list itself, you should only ever traverse the "pointer
> to the pointer".

When I have doubly-linked lists where there is only forward traversal
(the backlink being for convenient deletions without context), I make
the backlink a pointer to pointer.  This also means that one can
remove at the front of the list without needing to know the head
separately.

Anyway, here is some really, really ancient code of mine (file date is
of 1990 but it's older than that) which sorts linked lists stably
without extra storage and makes heavy use of pointer to pointer
traversal in both code and interface.  There is also a strictly
non-recursive variant with the same data flow (except for never making
a redundant assignment) and just one instead of two functions which
consistently beats good qsort implementations, but this old version is
quite more fun to read.

Basically, if head is the pointer to a sorted list of at least n
elements, mergesort(&head, n) will sort the first n elements and
return a pointer to that link which contains the tail of the list.  So
if you did not already 0-terminate your list, *mergesort(&head,n)=0;
will both sort and terminate your list.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Stable Mergesort on linked lists --]
[-- Type: text/x-csrc, Size: 1007 bytes --]

#include "mergesrt.h"
int (*mergecompare)(void *p1, void *p2);
int mergelink;
#define getlink(adr) (*(void**)((char*)(adr)+mergelink))

static void **merge(void **head1, void **tail1, void **tail2, unsigned n1, unsigned n2)
{
	register void *p1 = *head1, *p2 = *tail1;
	for(;;) {
		if ((*mergecompare)(p1, p2) <= 0) {
			p1 = *(head1 = &getlink(*head1 = p1));
			if (--n1 == 0)
				return *head1 = p2, tail2;
		} else {
			p2 = *(head1 = &getlink(*head1 = p2));
			if (--n2 == 0)
				return *tail1 = p2, *head1 = p1, tail1;
		}
	}
}


void **mergesort(void **head, unsigned n)
{
	switch (n) {
	case 0:
		return head;
	case 1:
		return &getlink(*head);
	case 2:
		{
			register void *p1, *p2;

			p2 = getlink(p1 = *head);
			if ((*mergecompare)(p1, p2) <= 0)
				return &getlink(p2);
			getlink(p1) = getlink(*head=p2);
			return &getlink(getlink(p2) = p1);
		}
	default:
		{
			unsigned m;
			void **h2;
			n -= m = n / 2;
			h2 = mergesort(head, n);
			return merge(head,h2,mergesort(h2,m),n,m);
		}
	}
}

[-- Attachment #3: Type: text/plain, Size: 52 bytes --]



-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply

* Re: [PATCH] Internationalization of git-gui
From: Junio C Hamano @ 2007-07-21  8:22 UTC (permalink / raw)
  To: しらいしななこ
  Cc: Paolo Ciarrocchi, Shawn O. Pearce, Johannes Schindelin,
	Christian Stimming, git
In-Reply-To: <200707210815.l6L8F2Da032066@mi0.bluebottle.com>

しらいしななこ  <nanako3@bluebottle.com> writes:

> Quoting Junio C Hamano <gitster@pobox.com>:
>
>> Ah, am I expected to volunteer for Japanese part?
>>
>> Unless yashi, yoshifuji, or nanako3 volunteer, although I do not
>> mind doing that myself,...
>
> I can help.  What's involved?

Wonderful.

As Johannes announced the 'mob' stuff, I think it would be
easiest to work there as others --- for this type of work, there
probably won't be much stepping on each other's toes involved as
long as there are not more than one translator per language.

What's involved to get a new language 'xy' started is roughly:

 - Run 'make' once, to get po/git-gui.pot generated;

 - Copy po/git-gui.pot to po/xy.po;

 - Update the placeholder strings at the beginning of the
   po/xy.po file appropriately.

 - Add 'xy' to the list of languages to ALL_LINGUAS list in the
   Makefile.

After that, add translations to the (initially empty) string on
the lines that begin with 'msgstr'.  Set of msgid's need to be
kept in sync with the source as the translated software evolve,
but gettext framework hopefully will take care of most of the
chore.

I'll get on the 'mob' bandwagon and try to push out something
like the attached patch, so that you do not necessarily have to
have the whole gettext toolchain.

-- >8 --

This gets the ball started for Japanese translation, but as I am
lazy, I only translated three words.  I took credit by placing
my name on the "Last-Translator" line, but shifted most of the
remaining work to Nana, who showed interest on the list, by
naming her at the beginnign of the file ;-)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Makefile |    2 +-
 po/ja.po |  250 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 251 insertions(+), 1 deletions(-)
 create mode 100644 po/ja.po

diff --git a/Makefile b/Makefile
index f6a6ce3..85d2c00 100644
--- a/Makefile
+++ b/Makefile
@@ -107,7 +107,7 @@ XGETTEXT   ?= xgettext
 msgsdir    ?= $(libdir)/msgs
 msgsdir_SQ  = $(subst ','\'',$(msgsdir))
 PO_TEMPLATE = po/git-gui.pot
-ALL_LINGUAS = de
+ALL_LINGUAS = de ja
 
 $(PO_TEMPLATE): $(SCRIPT_SH) $(ALL_LIBFILES)
 	$(XGETTEXT) -k_ -LTcl -o $@ $(SCRIPT_SH) $(ALL_LIBFILES)
diff --git a/po/ja.po b/po/ja.po
new file mode 100644
index 0000000..abfd4f1
--- /dev/null
+++ b/po/ja.po
@@ -0,0 +1,250 @@
+# Translation of git-gui to Japanese
+# Copyright (C) 2007 Shawn Pearce
+# This file is distributed under the same license as the git-gui package.
+# しらいし ななこ <nanako3@bluebottle.com>, 2007.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: git-gui\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-07-21 01:23-0700\n"
+"PO-Revision-Date: 2007-07-21 01:23-0700\n"
+"Last-Translator: Junio C Hamano <gitster@pobox.com>\n"
+"Language-Team: Japanese\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: git-gui.sh:1656
+msgid "Repository"
+msgstr "レポジトリ"
+
+#: git-gui.sh:1657
+msgid "Edit"
+msgstr "編集"
+
+#: git-gui.sh:1659
+msgid "Branch"
+msgstr "分岐"
+
+#: git-gui.sh:1662 git-gui.sh:1840
+msgid "Commit"
+msgstr ""
+
+#: git-gui.sh:1665
+msgid "Merge"
+msgstr ""
+
+#: git-gui.sh:1666
+msgid "Fetch"
+msgstr ""
+
+#: git-gui.sh:1667
+msgid "Push"
+msgstr ""
+
+#: git-gui.sh:1676
+msgid "Browse Current Branch's Files"
+msgstr ""
+
+#: git-gui.sh:1685
+msgid "Visualize Current Branch's History"
+msgstr ""
+
+#: git-gui.sh:1689
+msgid "Visualize All Branch History"
+msgstr ""
+
+#: git-gui.sh:1694
+msgid "Database Statistics"
+msgstr ""
+
+#: git-gui.sh:1697
+msgid "Compress Database"
+msgstr ""
+
+#: git-gui.sh:1700
+msgid "Verify Database"
+msgstr ""
+
+#: git-gui.sh:1707 git-gui.sh:1711 git-gui.sh:1715
+msgid "Create Desktop Icon"
+msgstr ""
+
+#: git-gui.sh:1720
+msgid "Quit"
+msgstr ""
+
+#: git-gui.sh:1727
+msgid "Undo"
+msgstr ""
+
+#: git-gui.sh:1730
+msgid "Redo"
+msgstr ""
+
+#: git-gui.sh:1734 git-gui.sh:2249
+msgid "Cut"
+msgstr ""
+
+#: git-gui.sh:1737 git-gui.sh:2252 git-gui.sh:2323 git-gui.sh:2395
+msgid "Copy"
+msgstr ""
+
+#: git-gui.sh:1740 git-gui.sh:2255
+msgid "Paste"
+msgstr ""
+
+#: git-gui.sh:1743 git-gui.sh:2258
+msgid "Delete"
+msgstr ""
+
+#: git-gui.sh:1747 git-gui.sh:2262 git-gui.sh:2399
+msgid "Select All"
+msgstr ""
+
+#: git-gui.sh:1756
+msgid "Create..."
+msgstr ""
+
+#: git-gui.sh:1762
+msgid "Checkout..."
+msgstr ""
+
+#: git-gui.sh:1768
+msgid "Rename..."
+msgstr ""
+
+#: git-gui.sh:1773 git-gui.sh:1871
+msgid "Delete..."
+msgstr ""
+
+#: git-gui.sh:1778
+msgid "Reset..."
+msgstr ""
+
+#: git-gui.sh:1790
+msgid "New Commit"
+msgstr ""
+
+#: git-gui.sh:1798
+msgid "Amend Last Commit"
+msgstr ""
+
+#: git-gui.sh:1807
+msgid "Rescan"
+msgstr ""
+
+#: git-gui.sh:1813
+msgid "Add To Commit"
+msgstr ""
+
+#: git-gui.sh:1818
+msgid "Add Existing To Commit"
+msgstr ""
+
+#: git-gui.sh:1824
+msgid "Unstage From Commit"
+msgstr ""
+
+#: git-gui.sh:1829
+msgid "Revert Changes"
+msgstr ""
+
+#: git-gui.sh:1836 git-gui.sh:2273
+msgid "Sign Off"
+msgstr ""
+
+#: git-gui.sh:1851
+msgid "Local Merge..."
+msgstr ""
+
+#: git-gui.sh:1856
+msgid "Abort Merge..."
+msgstr ""
+
+#: git-gui.sh:1868
+msgid "Push..."
+msgstr ""
+
+#: git-gui.sh:1878
+msgid "Apple"
+msgstr ""
+
+#: git-gui.sh:1881 git-gui.sh:1928
+#, tcl-format
+msgid "About %s"
+msgstr ""
+
+#: git-gui.sh:1883 git-gui.sh:1889 git-gui.sh:2441
+msgid "Options..."
+msgstr ""
+
+#: git-gui.sh:1913
+msgid "Tools"
+msgstr ""
+
+#: git-gui.sh:1915
+msgid "Migrate"
+msgstr ""
+
+#: git-gui.sh:1924
+msgid "Help"
+msgstr ""
+
+#: git-gui.sh:1965
+msgid "Online Documentation"
+msgstr ""
+
+#: git-gui.sh:2215
+msgid "Initial Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2216
+msgid "Amended Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2217
+msgid "Amended Initial Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2218
+msgid "Amended Merge Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2219
+msgid "Merge Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2220
+msgid "Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2265 git-gui.sh:2403
+msgid "Copy All"
+msgstr ""
+
+#: git-gui.sh:2391
+msgid "Refresh"
+msgstr ""
+
+#: git-gui.sh:2412
+msgid "Apply/Reverse Hunk"
+msgstr ""
+
+#: git-gui.sh:2418
+msgid "Decrease Font Size"
+msgstr ""
+
+#: git-gui.sh:2422
+msgid "Increase Font Size"
+msgstr ""
+
+#: git-gui.sh:2427
+msgid "Show Less Context"
+msgstr ""
+
+#: git-gui.sh:2434
+msgid "Show More Context"
+msgstr ""
-- 
1.5.3.rc2.22.g69a9b

^ permalink raw reply related

* Re: [PATCH] Internationalization of git-gui
From: しらいしななこ @ 2007-07-21  8:12 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Paolo Ciarrocchi, Shawn O. Pearce, Johannes Schindelin,
	Christian Stimming, git
In-Reply-To: <7vodi7vtct.fsf@assigned-by-dhcp.cox.net>

Quoting Junio C Hamano <gitster@pobox.com>:

> "Paolo Ciarrocchi" <paolo.ciarrocchi@gmail.com> writes:
>
>> I volunteer to translate all the git-gui messages in Italian.
>>
>> Just let me if you are interested and please give me an hint on how to
>> produce the translation so that you can incorporate it.
>
> Ah, am I expected to volunteer for Japanese part?
>
> Unless yashi, yoshifuji, or nanako3 volunteer, although I do not
> mind doing that myself, that is (if there are any Japanese
> people I forgot, I apologize).  I wonder how many people outside
> English zone are regularly on the list...

I can help.  What's involved?

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

----------------------------------------------------------------------
Free pop3 email with a spam filter.
http://www.bluebottle.com/tag/5

^ permalink raw reply

* Re: [PATCH] Internationalization of git-gui
From: Shawn O. Pearce @ 2007-07-21  8:03 UTC (permalink / raw)
  To: Christian Stimming; +Cc: Brett Schwarz, git, Paul Mackerras
In-Reply-To: <200707210951.00210.stimming@tuhh.de>

Christian Stimming <stimming@tuhh.de> wrote:
> Thanks for the detailed feedback.

Thanks for working on this!  Its something I knew we need to do,
but hadn't brought myself to do, because I speak English, and pretty
much only English.  Unless Tcl counts.  ;-)
 
> Am Samstag, 21. Juli 2007 04:17 schrieb Shawn O. Pearce:
> >
> > Please send one patch per email message, inline and not attached.
> > This way they are easy to review, respond to and comment on.
> 
> I'll try to do that, but at the workplace where I work on this issue I'm 
> forced to use a webmailer and I have to check whether this leaves the patches 
> intact.

Can you push to the mob branch on repo.or.cz?  Or setup your own
git-gui fork repository there?  Or someplace?  If so you can still
copy and paste the message into email for quick review and comment,
but I can actually pull the Git objects from a repository, and I
know Git won't corrupt things.
 
> > Dscho recently created a fork of git-gui.git here:
> >
> >   http://repo.or.cz/w/git-gui/git-gui-i18n.git
> >
> > and added your patch series into it.  But I'd like to see some
> > cleanups before it merges in, and I want to hold off on actually
> > applying it into git-gui 0.8.0 is released, 
> 
> Was this meant to say "hold off until git-gui 0.8.0 is released"? Sure, no 
> problem.

More or less.  I'm interested in this series, so I'm happy to get the
patches.  But I won't put them into 0.8.0, as I think it is too late
in the development period.  Especially for a build system change.
I've had too many bugs because of changes to the Makefile in prior
versions of git-gui.  But I am hoping that they will be among the
very first things applied after I tag 0.8.0 and start the 0.9.0
development cycle.  :-)
 
> I'll submit an updated set of patches by beginning of next week. Thank you 
> very much for the feedback.

Thanks.

-- 
Shawn.

^ permalink raw reply

* Re: [PATCH] Internationalization of git-gui
From: Christian Stimming @ 2007-07-21  7:50 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Brett Schwarz, git, Paul Mackerras
In-Reply-To: <20070721021717.GS32566@spearce.org>

Thanks for the detailed feedback.

Am Samstag, 21. Juli 2007 04:17 schrieb Shawn O. Pearce:
> Christian Stimming <stimming@tuhh.de> wrote:
> > I used (and prefer) "_" because that's the standard function name for
> > i18n'd strings when using gettext (talking about a "standard" way).
>
> but I don't think its worth the CPU cycles in
> Tcl to eval mc via _ every time we need a string when it only is
> saving us one keystroke on a function name, 

The actual lookup of the string in the translation catalog far outweighs the 
discussion of one extra function evaluation, but if that's what you prefer -

> *and* we are breaking  tradition with Tcl.
>
> So when in Rome, wear a toga.  Or in this case, use [mc ...].

Ok.

> > Do you want to have patches
> > submitted after some further changes (which ones?)
>
> Yes.  Here's a few to get started with and that are really obvious.
> Some I'm just asking for more information on.
>
>  - Import msgcat::mc and use [mc] instead of [_].

Will do.

>  - Please combine the second and third patches into a single change.
>  There is no reason to switch to [mc {}] only to switch to [mc ""].

Will do.

>  - Please use mc's formatting support, rather than [format].
>  Its shorter code.

Didn't know about that (you know, C gettext doesn't have that), and I'll have 
to check whether this might confuse xgettext on string extraction, but will 
probably be done.

>  - Don't bother trying to translate the strings "Tools" (for the
>  Tools menu) or "Migrate" (for its only menu option).  This block
>  of code doesn't even belong in git-gui.  Its for my day-job and
>  is a custom hack that I need to strip out and carry as a local
>  patch there, rather than in the public distribution.

Err... from looking at the code, it's not quite clear to me whether any code 
parts like these are not publicly shown to the user. For that reason I rather 
translated everything that was currently available in the file. But I'll 
happily remove this from the patch.

>  - In our Makefile we do the looping in GNU make using its
>  $(foreach) operator, rather than using the shell's for builtin.
>  In other words, can we have the catalog target look more like the
>  install target?

Sure. I did it this way because I'm more used to the shell syntax, but I'll 
change that.

>  - Can ALL_LINGUAS be automatically built from the directory
>  contents of the po/ directory?

Yes. I used this one because this variable always appears in gettext's 
autoconf infrastructure, but it's not required here. Will remove it.

>  - Can we define a dist rule for the maintainer to build the catalog
>  files, so the maintainer can convert the .po -> .msg for Tcl and
>  the user doesn't need the GNU tools installed to build git-gui?

Yes, I'll try to add that, but I'd need further feedback and testing whether 
it actually works.

> > and/or in different
> > formats?
>
> Please send one patch per email message, inline and not attached.
> This way they are easy to review, respond to and comment on.

I'll try to do that, but at the workplace where I work on this issue I'm 
forced to use a webmailer and I have to check whether this leaves the patches 
intact.

> > Do you prefer to have all changes in a smaller number of
> > commit rather than split the way I did before?
>
> No, this series looks reasonably fine to me structurally.
>
> Did you base the patches on git.git's git-gui/ subdirectory, 

Yes.

> or 
> did you base them on the git-gui.git repository?  Technically all
> patches for git-gui should be against the git-gui repository on
> repo.or.cz, as git-gui is its own project.  

Will do.

> Dscho recently created a fork of git-gui.git here:
>
>   http://repo.or.cz/w/git-gui/git-gui-i18n.git
>
> and added your patch series into it.  But I'd like to see some
> cleanups before it merges in, and I want to hold off on actually
> applying it into git-gui 0.8.0 is released, 

Was this meant to say "hold off until git-gui 0.8.0 is released"? Sure, no 
problem.

I'll submit an updated set of patches by beginning of next week. Thank you 
very much for the feedback.

Christian

^ permalink raw reply

* Re: qgit: failed assertion involving unapplied stgit patches
From: Marco Costalba @ 2007-07-21  7:14 UTC (permalink / raw)
  To: Yann DIRSON; +Cc: ydirson, git
In-Reply-To: <e5bfff550707201045s270e0ae1p206ad62cd02ebea4@mail.gmail.com>

On 7/20/07, Marco Costalba <mcostalba@gmail.com> wrote:
> On 7/20/07, Yann DIRSON <yann.dirson@sagem.com> wrote:
> >
>
> Regarding to show unapplied patch it seems a little bit difficult
> because git-log /git-rev-list does not know them, after a quick look
> it would seem easier to me to show applied patches as such...I will
> investigate.
>

Yes, it was easier.

Pushed a patch to show applied patches with nice green '+'.

Thanks for bug reporting
Marco

^ permalink raw reply

* Re: gitk problems: can't unset "idinlist(...)"
From: Jeff King @ 2007-07-21  6:54 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Git Mailing List, Paul Mackerras, Junio C Hamano
In-Reply-To: <alpine.LFD.0.999.0707202335570.27249@woody.linux-foundation.org>

On Fri, Jul 20, 2007 at 11:47:24PM -0700, Linus Torvalds wrote:

> So the difference between your version and mine is that the
> 
> 	while ((p = *pp) != NULL)

I actually like your version better (I like saving for loops for
honest-to-god, for-each-element-in-this-list iteration; munging the list
in the middle is something that you _should_ call attention to). I just
found your patch much harder to verify, because I had to make sure the
for/while change was equivalent. So you can blame Junio for writing it
wrong in the first place. :)

Junio, whatever you apply, please credit Linus; he beat me to the fix
and so my patch is completely cribbed from his. :)

-Peff

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox