Git development
 help / color / mirror / Atom feed
* Re: [PATCH] git-cget: prints elements of C code in the git repository
From: roel kluin @ 2009-03-27  9:22 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.1.00.0903241257430.7493@intel-tinevez-2-302>

Hi Johannes,

> - it misdetects functions: trying
>
>        $ ./git-cget -f get_sha1.*

The .* is not strict enough. What you want to do instead is:

$ ./git-cget -f "get_sha1[A-Za-z0-9_]*"

and that will give correct matches.

Roel

^ permalink raw reply

* Re: [PATCH 2/2] Make local branches behave like remote branches when --tracked
From: Michael J Gruber @ 2009-03-27  8:47 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Daniel Barkalow, Johannes Schindelin
In-Reply-To: <7vprg3fkw8.fsf@gitster.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 27.03.2009 09:08:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> This makes sure that local branches, when followed using --track, behave
>> the same as remote ones (e.g. differences being reported by git status
>> and git checkout). This fixes 1 known failure.
>>
>> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
>> ---
>>  remote.c                 |    9 +++++----
>>  t/t6040-tracking-info.sh |    2 +-
>>  2 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/remote.c b/remote.c
>> index 2b037f1..5d2d7a1 100644
>> --- a/remote.c
>> +++ b/remote.c
>> @@ -1170,8 +1170,9 @@ struct branch *branch_get(const char *name)
>>  			for (i = 0; i < ret->merge_nr; i++) {
>>  				ret->merge[i] = xcalloc(1, sizeof(**ret->merge));
>>  				ret->merge[i]->src = xstrdup(ret->merge_name[i]);
>> -				remote_find_tracking(ret->remote,
>> -						     ret->merge[i]);
>> +				if(remote_find_tracking(ret->remote,
>> +						     ret->merge[i]) && !strcmp(ret->remote_name, "."))
>> +					ret->merge[i]->dst = xstrdup(ret->merge_name[i]);
>>  			}
>>  		}
>>  	}
> 
> Yuck; please have a SP betweeen "if" and "(", and also have a decency to
> break a long line at a more sensible place, like:
> 
> 			if (remote_find_tracking(ret->remote, ret->merge[i])
> 			    && !strcmp(...))
>                             	then do this;
> 

Sorry about the space. Regarding the break, you can see that the break
was like that before already, and I just followed suite, which I think
makes the diff more readable. But no problem changing that,

> A naïve question from me to this change is why this "fix-up" is done here.

It was the easiest and least intrusive way for me...

> 
> The remote_find_tracking() function is given a half-filled refspec (this
> caller fills the src side, and asks to find the dst side to the function).
> After it fails to find a fetch refspec that copies remote refs to tracking
> refs in the local repository that match the criteria, it returns -1 to
> signal an error, otherwise it returns 0 after updating the other half of
> the refspec.
> 
> After calling r-f-t, because this new code assumes that for the "." remote
> (aka "local repository"), r-f-t lies and does not give back what it
> expects, fixes what it got back from r-f-t.  Shouldn't we be fixing this
> inside r-f-t?

The technical reason is that there is no local remote, i.e. no remote
struct for '.', and I don't think we want it, because it would show up
in all places where the list of remotes is searched/displayed/...

With ret being the branch we talk about, r-f-t is passed ret->remote and
ret->merge[i] only. In the local case, r-f-t cannot use the remote
struct for '.' (there is none) to find what it needs, and it has no easy
access to ret->merge_names[i] which is that info.

branch_get(), on the other hand, has all needed info in place. So,
having r-f-t do it would require changing the parameters or adding a
remote struct for '.' and adjusting all callers correspondingly. Doing
it the way I did it is "minimally invasive" in that respect, with the
(small) downside that we may call r-f-t unnecessarily in the local case
- but we don't know before: If someone set up a remote config for '.'
then we have to go through r-f-t anayways.

> 
>> @@ -1449,8 +1450,8 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
>>  		return 0;
>>  
>>  	base = branch->merge[0]->dst;
>> -	if (!prefixcmp(base, "refs/remotes/")) {
>> -		base += strlen("refs/remotes/");
>> +	if (!prefixcmp(base, "refs/")) {
>> +		base += strlen("refs/");
> 
> I am not sure if this is a good change.  The majority of the case would
> be remotes/ and we would be better off not repeating them.  Can't you
> limit the use of longer refs only when disambiguation is necessary?
> 

The majority will be remotes, yes, but will the majority be unique? In
my case not.  Even when we knew that format_tracking_info() would have
to deal with remote branches only (before this series) there was a
(high) chance of outputting non-unique refs, even worse: if foo is
ambiguous because refs/heads/foo and refs/remotes/foo exist then
refs/heads/foo would win, i.e. we used to output the *wrong* ref. The
above disambiguates. But I'll see if I can simplify the output based on
the necessity of disambiguation.

Michael

^ permalink raw reply

* Re: On git 1.6 (novice's opinion)
From: H.Merijn Brand @ 2009-03-27  8:05 UTC (permalink / raw)
  To: Ulrich Windl; +Cc: git
In-Reply-To: <49CC8C90.12268.242CEFCE@Ulrich.Windl.rkdvmks1.ngate.uni-regensburg.de>

On Fri, 27 Mar 2009 08:21:36 +0100, "Ulrich Windl"
<ulrich.windl@rz.uni-regensburg.de> wrote:

> What I'd like to see in git (My apologies if some were already discussed to 
> death):
> 
> 1) The ability to use the file's time at the time of add/commit instead of
>    the current time, and the ability tho check outfiles with the times stored
>    in the repository.
> 
> 2) Keyword substitution. I know it's controverse (dealing with binary files),
>    but I'd like to have some automatic version numbering keyword at least:
>    Initial idea is that every commit with a change increments the number by
>    one, and when merging numbers a and b, the resulting number is max(a, b) + 1.

impossible. Even with checkin- and checkout hooks, you won't get that
SCCS behaviour. They have to be better in something too :)
/me still misses that but got used to it

> 3) "git undo": If possible undo the effects of the last command.
> 
> Following are some random remarks from a first-time git user, regarding the 
> buld/install:
> 
> Notes on building git-1.6.1.3 on openSUSE 11.0:
> There is no "asciidoc"; the INSTALL should be more verbose on special
> requirements (i.e. additional packages needed, and where to get them).

# zypper in asciidoc libcurl-devel

(yes, 'make install-man' should stop soon after detecting asciidoc is
not installed


-- 
H.Merijn Brand  http://tux.nl      Perl Monger  http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, SuSE 10.3, 11.0, and 11.1, AIX 5.2, and Cygwin.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/

^ permalink raw reply

* Re: patch series starting with [JGIT PATCH 1/5] Remove dead/unused reset method from CountingOutputStream
From: Robin Rosenberg @ 2009-03-27  8:11 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Marek Zawirski, Daniel Cheng, git
In-Reply-To: <1238030515-31768-1-git-send-email-spearce@spearce.org>


Seems fine. While verifying this I got this error.

jgit push sftp://me@calhost/home/me/tmp/cb/.git master:master

Counting objects:       20464
Compressing objects:    100% (20464/20464)
Writing objects:        100% (20464/20464)
fatal: Can't write /home/me/tmp/cb/.git/objects/../HEAD: Failure
fatal: sftp://me@localhost/home/me/tmp/cb/.git: cannot create HEAD

It seems the remote repo is OK and actually has handsome HEAD despite this.

More related, I also noted that the git:// ssh or file: clone calculates the CRC's separately
and wasn't subject to this bug.

-- robin

^ permalink raw reply

* Re: [PATCH 2/2] Make local branches behave like remote branches when --tracked
From: Junio C Hamano @ 2009-03-27  8:08 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git, Daniel Barkalow, Johannes Schindelin
In-Reply-To: <1238100805-19619-3-git-send-email-git@drmicha.warpmail.net>

Michael J Gruber <git@drmicha.warpmail.net> writes:

> This makes sure that local branches, when followed using --track, behave
> the same as remote ones (e.g. differences being reported by git status
> and git checkout). This fixes 1 known failure.
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
>  remote.c                 |    9 +++++----
>  t/t6040-tracking-info.sh |    2 +-
>  2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/remote.c b/remote.c
> index 2b037f1..5d2d7a1 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -1170,8 +1170,9 @@ struct branch *branch_get(const char *name)
>  			for (i = 0; i < ret->merge_nr; i++) {
>  				ret->merge[i] = xcalloc(1, sizeof(**ret->merge));
>  				ret->merge[i]->src = xstrdup(ret->merge_name[i]);
> -				remote_find_tracking(ret->remote,
> -						     ret->merge[i]);
> +				if(remote_find_tracking(ret->remote,
> +						     ret->merge[i]) && !strcmp(ret->remote_name, "."))
> +					ret->merge[i]->dst = xstrdup(ret->merge_name[i]);
>  			}
>  		}
>  	}

Yuck; please have a SP betweeen "if" and "(", and also have a decency to
break a long line at a more sensible place, like:

			if (remote_find_tracking(ret->remote, ret->merge[i])
			    && !strcmp(...))
                            	then do this;

A naïve question from me to this change is why this "fix-up" is done here.

The remote_find_tracking() function is given a half-filled refspec (this
caller fills the src side, and asks to find the dst side to the function).
After it fails to find a fetch refspec that copies remote refs to tracking
refs in the local repository that match the criteria, it returns -1 to
signal an error, otherwise it returns 0 after updating the other half of
the refspec.

After calling r-f-t, because this new code assumes that for the "." remote
(aka "local repository"), r-f-t lies and does not give back what it
expects, fixes what it got back from r-f-t.  Shouldn't we be fixing this
inside r-f-t?

> @@ -1449,8 +1450,8 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
>  		return 0;
>  
>  	base = branch->merge[0]->dst;
> -	if (!prefixcmp(base, "refs/remotes/")) {
> -		base += strlen("refs/remotes/");
> +	if (!prefixcmp(base, "refs/")) {
> +		base += strlen("refs/");

I am not sure if this is a good change.  The majority of the case would
be remotes/ and we would be better off not repeating them.  Can't you
limit the use of longer refs only when disambiguation is necessary?

^ permalink raw reply

* Re: Problem Creating Commit Messages
From: Jonas Flodén @ 2009-03-27  7:56 UTC (permalink / raw)
  To: git
In-Reply-To: <22735968.post@talk.nabble.com>

bggy wrote:
> Hello, I'm new to git and I haven't been able to create commit messages in
> either vim or textmate(changed core.editor to mate).  I can create commit
> messages when I use the -m option, but I like creating multiple-line
> messages and it's easier to do it with a fresh line-break in the terminal.
> 
> Using textmate I saved and closed the textmate file that pops up after $git
> commit -a, but git responds that the commit was terminated due to an empty
> message.
> 

Hi there,
For TextMate to work with Git you need to add the option -w to "mate"
which will specify that it should wait for the file to be closed.

So set EDITOR="mate -w" and it should work with TextMate.


With regards,
Jonas

^ permalink raw reply

* On git 1.6 (novice's opinion)
From: Ulrich Windl @ 2009-03-27  7:21 UTC (permalink / raw)
  To: git

Hello everybody,

[About my experience on version control systems: I started out with SCCS in
the eighties, and I thought it must be cool as the UNIX guys used it to
maintain their sources. Some times later I was using Emacs' numbered backup
files as a poor substiutute for nothing else. Then I came across RCS, and I
liked it soon ,because it was fully documented and well-written. I even ported
it to MS-DOS (whew!). I was attaching tags to individual files to mark
"releases" at those times. Then I heard about CVS. It seemed to help with the
tagging, so I used it for the mopre complex projects. I even did branches and
merging with it for the Linux sources. I spontaneously diskliked Bitkeeper,
because it would not work off-line. I heard about Git some time ago, but using
it seems very non-obvious. After having read the tutorial, and playing some
simple scenarios, I must admit that I really like the fully distributed nature
of it. However some commands seem to be a bit strange (e.g. "git add" is
almost, but quite a "commit" (if you come from CVS)), and sources are quite
complex. Also some seemingly dangerous commands that cannot easily be undone
should ask safety questions ("cvs merge (-j)" would also fall into that
category.]

What I'd like to see in git (My apologies if some were already discussed to 
death):

1) The ability to use the file's time at the time of add/commit instead of the
current time, and the ability tho check outfiles with the times stored in the
repository.

2) Keyword substitution. I know it's controverse (dealing with binary files),
but I'd like to have some automatic version numbering keyword at least:
Initial idea is that every commit with a change increments the number by one,
and when merging numbers a and b, the resulting number is max(a, b) + 1.

3) "git undo": If possible undo the effects of the last command.

Following are some random remarks from a first-time git user, regarding the 
buld/install:

Notes on building git-1.6.1.3 on openSUSE 11.0:
There is no "asciidoc"; the INSTALL should be more verbose on special
requirements (i.e. additional packages needed, and where to get them).
LANG= make configure
/bin/sh: curl-config: command not found
make: `configure' is up to date.

make[2]: Entering directory `/git/git-1.6.1.3'
make[2]: `GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory `/git/git-1.6.1.3'
rm -f git-add.html+ git-add.html
asciidoc -b xhtml11 -d manpage -f asciidoc.conf \
                 -agit_version=1.6.1.3 -o git-add.html+ git-add.txt
make[1]: asciidoc: Command not found
make[1]: *** [git-add.html] Error 127
make[1]: Leaving directory `/git/git-1.6.1.3/Documentation'
make: *** [doc] Error 2

Some parts of the make process may look like an error if they pass by quickly:

[...]
    GEN git-request-pull
    GEN git-sh-setup
    GEN git-stash
    GEN git-submodule
    GEN git-web--browse
    SUBDIR perl
/usr/bin/perl Makefile.PL PREFIX='/home/windl/Projects/git/inst'
Writing perl.mak for Git
    GEN git-add--interactive
    GEN git-archimport
    GEN git-cvsexportcommit
    GEN git-cvsimport
[...]

Same is true for the install process:
make[1]: Leaving directory `/home/windl/Projects/git/git-1.6.1.3/git-gui'
bindir=$(cd '/home/windl/Projects/git/inst/bin' && pwd) && \
        execdir=$(cd '/home/windl/Projects/git/inst/libexec/git-core/' && pwd) && 
\
        { rm -f "$execdir/git-add" && \
                ln git-add "$execdir/git-add" 2>/dev/null || \
                cp git-add "$execdir/git-add"; } && \
        {  rm -f "$execdir/git-annotate" && ln "$execdir/git-add" "$execdir/git-
annotate" 2>/dev/null || ln -s "git-add" "$execdir/git-annotate" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-annotate" || exit;  rm -f "$execdir/git-apply" && 
ln "$execdir/git-add" "$execdir/git-apply" 2>/dev/null || ln -s "git-add" 
"$execdir/git-apply" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-apply" || 
exit;  rm -f "$execdir/git-archive" && ln "$execdir/git-add" "$execdir/git-
archive" 2>/dev/null || ln -s "git-add" "$execdir/git-archive" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-archive" || exit;  rm -f "$execdir/git-blame" && 
ln "$execdir/git-add" "$execdir/git-blame" 2>/dev/null || ln -s "git-add" 
"$execdir/git-blame" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-blame" || 
exit;  rm -f "$execdir/git-branch" && ln "$execdir/git-add" "$execdir/git-branch" 
2>/dev/null || ln -s "git-add" "$execdir/git-branch" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-branch" || exit;  rm -f "$execdir/git-bundle" && 
ln "$execdir/git-add" "$execdir/git-bundle" 2>/dev/null || ln -s "git-add" 
"$execdir/git-bundle" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-bundle" 
|| exit;  rm -f "$execdir/git-cat-file" && ln "$execdir/git-add" "$execdir/git-
cat-file" 2>/dev/null || ln -s "git-add" "$execdir/git-cat-file" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-cat-file" || exit;  rm -f "$execdir/git-check-
attr" && ln "$execdir/git-add" "$execdir/git-check-attr" 2>/dev/null || ln -s 
"git-add" "$execdir/git-check-attr" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-check-attr" || exit;  rm -f "$execdir/git-check-ref-format" && ln 
"$execdir/git-add" "$execdir/git-check-ref-format" 2>/dev/null || ln -s "git-add" 
"$execdir/git-check-ref-format" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-check-ref-format" || exit;  rm -f "$execdir/git-checkout-index" && 
ln "$execdir/git-add" "$execdir/git-checkout-index" 2>/dev/null || ln -s "git-add" 
"$execdir/git-checkout-index" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-
checkout-index" || exit;  rm -f "$execdir/git-checkout" && ln "$execdir/git-add" 
"$execdir/git-checkout" 2>/dev/null || ln -s "git-add" "$execdir/git-checkout" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-checkout" || exit;  rm -f 
"$execdir/git-clean" && ln "$execdir/git-add" "$execdir/git-clean" 2>/dev/null || 
ln -s "git-add" "$execdir/git-clean" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-clean" || exit;  rm -f "$execdir/git-clone" && ln "$execdir/git-add" 
"$execdir/git-clone" 2>/dev/null || ln -s "git-add" "$execdir/git-clone" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-clone" || exit;  rm -f 
"$execdir/git-commit-tree" && ln "$execdir/git-add" "$execdir/git-commit-tree" 
2>/dev/null || ln -s "git-add" "$execdir/git-commit-tree" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-commit-tree" || exit;  rm -f "$execdir/git-
commit" && ln "$execdir/git-add" "$execdir/git-commit" 2>/dev/null || ln -s "git-
add" "$execdir/git-commit" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-
commit" || exit;  rm -f "$execdir/git-config" && ln "$execdir/git-add" 
"$execdir/git-config" 2>/dev/null || ln -s "git-add" "$execdir/git-config" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-config" || exit;  rm -f 
"$execdir/git-count-objects" && ln "$execdir/git-add" "$execdir/git-count-objects" 
2>/dev/null || ln -s "git-add" "$execdir/git-count-objects" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-count-objects" || exit;  rm -f "$execdir/git-
describe" && ln "$execdir/git-add" "$execdir/git-describe" 2>/dev/null || ln -s 
"git-add" "$execdir/git-describe" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-describe" || exit;  rm -f "$execdir/git-diff-files" && ln 
"$execdir/git-add" "$execdir/git-diff-files" 2>/dev/null || ln -s "git-add" 
"$execdir/git-diff-files" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-diff-
files" || exit;  rm -f "$execdir/git-diff-index" && ln "$execdir/git-add" 
"$execdir/git-diff-index" 2>/dev/null || ln -s "git-add" "$execdir/git-diff-index" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-diff-index" || exit;  rm -f 
"$execdir/git-diff-tree" && ln "$execdir/git-add" "$execdir/git-diff-tree" 
2>/dev/null || ln -s "git-add" "$execdir/git-diff-tree" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-diff-tree" || exit;  rm -f "$execdir/git-diff" && 
ln "$execdir/git-add" "$execdir/git-diff" 2>/dev/null || ln -s "git-add" 
"$execdir/git-diff" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-diff" || 
exit;  rm -f "$execdir/git-fast-export" && ln "$execdir/git-add" "$execdir/git-
fast-export" 2>/dev/null || ln -s "git-add" "$execdir/git-fast-export" 2>/dev/null 
|| cp "$execdir/git-add" "$execdir/git-fast-export" || exit;  rm -f "$execdir/git-
fetch--tool" && ln "$execdir/git-add" "$execdir/git-fetch--tool" 2>/dev/null || ln 
-s "git-add" "$execdir/git-fetch--tool" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-fetch--tool" || exit;  rm -f "$execdir/git-fetch-pack" && ln 
"$execdir/git-add" "$execdir/git-fetch-pack" 2>/dev/null || ln -s "git-add" 
"$execdir/git-fetch-pack" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-
fetch-pack" || exit;  rm -f "$execdir/git-fetch" && ln "$execdir/git-add" 
"$execdir/git-fetch" 2>/dev/null || ln -s "git-add" "$execdir/git-fetch" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-fetch" || exit;  rm -f 
"$execdir/git-fmt-merge-msg" && ln "$execdir/git-add" "$execdir/git-fmt-merge-msg" 
2>/dev/null || ln -s "git-add" "$execdir/git-fmt-merge-msg" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-fmt-merge-msg" || exit;  rm -f "$execdir/git-for-
each-ref" && ln "$execdir/git-add" "$execdir/git-for-each-ref" 2>/dev/null || ln -
s "git-add" "$execdir/git-for-each-ref" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-for-each-ref" || exit;  rm -f "$execdir/git-fsck" && ln 
"$execdir/git-add" "$execdir/git-fsck" 2>/dev/null || ln -s "git-add" 
"$execdir/git-fsck" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-fsck" || 
exit;  rm -f "$execdir/git-gc" && ln "$execdir/git-add" "$execdir/git-gc" 
2>/dev/null || ln -s "git-add" "$execdir/git-gc" 2>/dev/null || cp "$execdir/git-
add" "$execdir/git-gc" || exit;  rm -f "$execdir/git-grep" && ln "$execdir/git-
add" "$execdir/git-grep" 2>/dev/null || ln -s "git-add" "$execdir/git-grep" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-grep" || exit;  rm -f 
"$execdir/git-help" && ln "$execdir/git-add" "$execdir/git-help" 2>/dev/null || ln 
-s "git-add" "$execdir/git-help" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-help" || exit;  rm -f "$execdir/git-init-db" && ln "$execdir/git-
add" "$execdir/git-init-db" 2>/dev/null || ln -s "git-add" "$execdir/git-init-db" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-init-db" || exit;  rm -f 
"$execdir/git-log" && ln "$execdir/git-add" "$execdir/git-log" 2>/dev/null || ln -
s "git-add" "$execdir/git-log" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-
log" || exit;  rm -f "$execdir/git-ls-files" && ln "$execdir/git-add" 
"$execdir/git-ls-files" 2>/dev/null || ln -s "git-add" "$execdir/git-ls-files" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-ls-files" || exit;  rm -f 
"$execdir/git-ls-remote" && ln "$execdir/git-add" "$execdir/git-ls-remote" 
2>/dev/null || ln -s "git-add" "$execdir/git-ls-remote" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-ls-remote" || exit;  rm -f "$execdir/git-ls-tree" 
&& ln "$execdir/git-add" "$execdir/git-ls-tree" 2>/dev/null || ln -s "git-add" 
"$execdir/git-ls-tree" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-ls-tree" 
|| exit;  rm -f "$execdir/git-mailinfo" && ln "$execdir/git-add" "$execdir/git-
mailinfo" 2>/dev/null || ln -s "git-add" "$execdir/git-mailinfo" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-mailinfo" || exit;  rm -f "$execdir/git-
mailsplit" && ln "$execdir/git-add" "$execdir/git-mailsplit" 2>/dev/null || ln -s 
"git-add" "$execdir/git-mailsplit" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-mailsplit" || exit;  rm -f "$execdir/git-merge" && ln "$execdir/git-
add" "$execdir/git-merge" 2>/dev/null || ln -s "git-add" "$execdir/git-merge" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-merge" || exit;  rm -f 
"$execdir/git-merge-base" && ln "$execdir/git-add" "$execdir/git-merge-base" 
2>/dev/null || ln -s "git-add" "$execdir/git-merge-base" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-merge-base" || exit;  rm -f "$execdir/git-merge-
file" && ln "$execdir/git-add" "$execdir/git-merge-file" 2>/dev/null || ln -s 
"git-add" "$execdir/git-merge-file" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-merge-file" || exit;  rm -f "$execdir/git-merge-ours" && ln 
"$execdir/git-add" "$execdir/git-merge-ours" 2>/dev/null || ln -s "git-add" 
"$execdir/git-merge-ours" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-
merge-ours" || exit;  rm -f "$execdir/git-merge-recursive" && ln "$execdir/git-
add" "$execdir/git-merge-recursive" 2>/dev/null || ln -s "git-add" "$execdir/git-
merge-recursive" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-merge-
recursive" || exit;  rm -f "$execdir/git-mv" && ln "$execdir/git-add" 
"$execdir/git-mv" 2>/dev/null || ln -s "git-add" "$execdir/git-mv" 2>/dev/null || 
cp "$execdir/git-add" "$execdir/git-mv" || exit;  rm -f "$execdir/git-name-rev" && 
ln "$execdir/git-add" "$execdir/git-name-rev" 2>/dev/null || ln -s "git-add" 
"$execdir/git-name-rev" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-name-
rev" || exit;  rm -f "$execdir/git-pack-objects" && ln "$execdir/git-add" 
"$execdir/git-pack-objects" 2>/dev/null || ln -s "git-add" "$execdir/git-pack-
objects" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-pack-objects" || exit;  
rm -f "$execdir/git-pack-refs" && ln "$execdir/git-add" "$execdir/git-pack-refs" 
2>/dev/null || ln -s "git-add" "$execdir/git-pack-refs" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-pack-refs" || exit;  rm -f "$execdir/git-prune-
packed" && ln "$execdir/git-add" "$execdir/git-prune-packed" 2>/dev/null || ln -s 
"git-add" "$execdir/git-prune-packed" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-prune-packed" || exit;  rm -f "$execdir/git-prune" && ln 
"$execdir/git-add" "$execdir/git-prune" 2>/dev/null || ln -s "git-add" 
"$execdir/git-prune" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-prune" || 
exit;  rm -f "$execdir/git-push" && ln "$execdir/git-add" "$execdir/git-push" 
2>/dev/null || ln -s "git-add" "$execdir/git-push" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-push" || exit;  rm -f "$execdir/git-read-tree" && 
ln "$execdir/git-add" "$execdir/git-read-tree" 2>/dev/null || ln -s "git-add" 
"$execdir/git-read-tree" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-read-
tree" || exit;  rm -f "$execdir/git-receive-pack" && ln "$execdir/git-add" 
"$execdir/git-receive-pack" 2>/dev/null || ln -s "git-add" "$execdir/git-receive-
pack" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-receive-pack" || exit;  
rm -f "$execdir/git-reflog" && ln "$execdir/git-add" "$execdir/git-reflog" 
2>/dev/null || ln -s "git-add" "$execdir/git-reflog" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-reflog" || exit;  rm -f "$execdir/git-remote" && 
ln "$execdir/git-add" "$execdir/git-remote" 2>/dev/null || ln -s "git-add" 
"$execdir/git-remote" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-remote" 
|| exit;  rm -f "$execdir/git-rerere" && ln "$execdir/git-add" "$execdir/git-
rerere" 2>/dev/null || ln -s "git-add" "$execdir/git-rerere" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-rerere" || exit;  rm -f "$execdir/git-reset" && 
ln "$execdir/git-add" "$execdir/git-reset" 2>/dev/null || ln -s "git-add" 
"$execdir/git-reset" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-reset" || 
exit;  rm -f "$execdir/git-rev-list" && ln "$execdir/git-add" "$execdir/git-rev-
list" 2>/dev/null || ln -s "git-add" "$execdir/git-rev-list" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-rev-list" || exit;  rm -f "$execdir/git-rev-
parse" && ln "$execdir/git-add" "$execdir/git-rev-parse" 2>/dev/null || ln -s 
"git-add" "$execdir/git-rev-parse" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-rev-parse" || exit;  rm -f "$execdir/git-revert" && ln 
"$execdir/git-add" "$execdir/git-revert" 2>/dev/null || ln -s "git-add" 
"$execdir/git-revert" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-revert" 
|| exit;  rm -f "$execdir/git-rm" && ln "$execdir/git-add" "$execdir/git-rm" 
2>/dev/null || ln -s "git-add" "$execdir/git-rm" 2>/dev/null || cp "$execdir/git-
add" "$execdir/git-rm" || exit;  rm -f "$execdir/git-send-pack" && ln 
"$execdir/git-add" "$execdir/git-send-pack" 2>/dev/null || ln -s "git-add" 
"$execdir/git-send-pack" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-send-
pack" || exit;  rm -f "$execdir/git-shortlog" && ln "$execdir/git-add" 
"$execdir/git-shortlog" 2>/dev/null || ln -s "git-add" "$execdir/git-shortlog" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-shortlog" || exit;  rm -f 
"$execdir/git-show-branch" && ln "$execdir/git-add" "$execdir/git-show-branch" 
2>/dev/null || ln -s "git-add" "$execdir/git-show-branch" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-show-branch" || exit;  rm -f "$execdir/git-show-
ref" && ln "$execdir/git-add" "$execdir/git-show-ref" 2>/dev/null || ln -s "git-
add" "$execdir/git-show-ref" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-
show-ref" || exit;  rm -f "$execdir/git-stripspace" && ln "$execdir/git-add" 
"$execdir/git-stripspace" 2>/dev/null || ln -s "git-add" "$execdir/git-stripspace" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-stripspace" || exit;  rm -f 
"$execdir/git-symbolic-ref" && ln "$execdir/git-add" "$execdir/git-symbolic-ref" 
2>/dev/null || ln -s "git-add" "$execdir/git-symbolic-ref" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-symbolic-ref" || exit;  rm -f "$execdir/git-tag" 
&& ln "$execdir/git-add" "$execdir/git-tag" 2>/dev/null || ln -s "git-add" 
"$execdir/git-tag" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-tag" || 
exit;  rm -f "$execdir/git-tar-tree" && ln "$execdir/git-add" "$execdir/git-tar-
tree" 2>/dev/null || ln -s "git-add" "$execdir/git-tar-tree" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-tar-tree" || exit;  rm -f "$execdir/git-unpack-
objects" && ln "$execdir/git-add" "$execdir/git-unpack-objects" 2>/dev/null || ln 
-s "git-add" "$execdir/git-unpack-objects" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-unpack-objects" || exit;  rm -f "$execdir/git-update-index" && ln 
"$execdir/git-add" "$execdir/git-update-index" 2>/dev/null || ln -s "git-add" 
"$execdir/git-update-index" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-
update-index" || exit;  rm -f "$execdir/git-update-ref" && ln "$execdir/git-add" 
"$execdir/git-update-ref" 2>/dev/null || ln -s "git-add" "$execdir/git-update-ref" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-update-ref" || exit;  rm -f 
"$execdir/git-upload-archive" && ln "$execdir/git-add" "$execdir/git-upload-
archive" 2>/dev/null || ln -s "git-add" "$execdir/git-upload-archive" 2>/dev/null 
|| cp "$execdir/git-add" "$execdir/git-upload-archive" || exit;  rm -f 
"$execdir/git-verify-pack" && ln "$execdir/git-add" "$execdir/git-verify-pack" 
2>/dev/null || ln -s "git-add" "$execdir/git-verify-pack" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-verify-pack" || exit;  rm -f "$execdir/git-
verify-tag" && ln "$execdir/git-add" "$execdir/git-verify-tag" 2>/dev/null || ln -
s "git-add" "$execdir/git-verify-tag" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-verify-tag" || exit;  rm -f "$execdir/git-write-tree" && ln 
"$execdir/git-add" "$execdir/git-write-tree" 2>/dev/null || ln -s "git-add" 
"$execdir/git-write-tree" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-
write-tree" || exit;  rm -f "$execdir/git-cherry-pick" && ln "$execdir/git-add" 
"$execdir/git-cherry-pick" 2>/dev/null || ln -s "git-add" "$execdir/git-cherry-
pick" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-cherry-pick" || exit;  rm 
-f "$execdir/git-cherry" && ln "$execdir/git-add" "$execdir/git-cherry" 
2>/dev/null || ln -s "git-add" "$execdir/git-cherry" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-cherry" || exit;  rm -f "$execdir/git-format-
patch" && ln "$execdir/git-add" "$execdir/git-format-patch" 2>/dev/null || ln -s 
"git-add" "$execdir/git-format-patch" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-format-patch" || exit;  rm -f "$execdir/git-fsck-objects" && ln 
"$execdir/git-add" "$execdir/git-fsck-objects" 2>/dev/null || ln -s "git-add" 
"$execdir/git-fsck-objects" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-
fsck-objects" || exit;  rm -f "$execdir/git-get-tar-commit-id" && ln 
"$execdir/git-add" "$execdir/git-get-tar-commit-id" 2>/dev/null || ln -s "git-add" 
"$execdir/git-get-tar-commit-id" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-get-tar-commit-id" || exit;  rm -f "$execdir/git-init" && ln 
"$execdir/git-add" "$execdir/git-init" 2>/dev/null || ln -s "git-add" 
"$execdir/git-init" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-init" || 
exit;  rm -f "$execdir/git-merge-subtree" && ln "$execdir/git-add" "$execdir/git-
merge-subtree" 2>/dev/null || ln -s "git-add" "$execdir/git-merge-subtree" 
2>/dev/null || cp "$execdir/git-add" "$execdir/git-merge-subtree" || exit;  rm -f 
"$execdir/git-peek-remote" && ln "$execdir/git-add" "$execdir/git-peek-remote" 
2>/dev/null || ln -s "git-add" "$execdir/git-peek-remote" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-peek-remote" || exit;  rm -f "$execdir/git-repo-
config" && ln "$execdir/git-add" "$execdir/git-repo-config" 2>/dev/null || ln -s 
"git-add" "$execdir/git-repo-config" 2>/dev/null || cp "$execdir/git-add" 
"$execdir/git-repo-config" || exit;  rm -f "$execdir/git-show" && ln 
"$execdir/git-add" "$execdir/git-show" 2>/dev/null || ln -s "git-add" 
"$execdir/git-show" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-show" || 
exit;  rm -f "$execdir/git-stage" && ln "$execdir/git-add" "$execdir/git-stage" 
2>/dev/null || ln -s "git-add" "$execdir/git-stage" 2>/dev/null || cp 
"$execdir/git-add" "$execdir/git-stage" || exit;  rm -f "$execdir/git-status" && 
ln "$execdir/git-add" "$execdir/git-status" 2>/dev/null || ln -s "git-add" 
"$execdir/git-status" 2>/dev/null || cp "$execdir/git-add" "$execdir/git-status" 
|| exit;  rm -f "$execdir/git-whatchanged" && ln "$execdir/git-add" "$execdir/git-
whatchanged" 2>/dev/null || ln -s "git-add" "$execdir/git-whatchanged" 2>/dev/null 
|| cp "$execdir/git-add" "$execdir/git-whatchanged" || exit; } && \
        ./check_bindir "z$bindir" "z$execdir" "$bindir/git-add"

There's a problem with "make quick-install-man":
LANG= make quick-install-man
make -C Documentation quick-install-man
make[1]: Entering directory `/git/git-1.6.1.3/Documentation'
make -C ../ GIT-VERSION-FILE
make[2]: Entering directory `/git/git-1.6.1.3'
make[2]: `GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory `/git/git-1.6.1.3'
sh ./install-doc-quick.sh origin/man /git/inst/share/man
./install-doc-quick.sh: line 9: /git/inst/libexec/git-sh-setup: No such file or 
directory
make[1]: *** [quick-install-man] Error 1
make[1]: Leaving directory `/git/git-1.6.1.3/Documentation'
make: *** [quick-install-man] Error 2

Regards,
Ulrich Windl

^ permalink raw reply

* Re: How to merge by subtree while preserving history?
From: Miklos Vajna @ 2009-03-27  7:38 UTC (permalink / raw)
  To: David Reitter; +Cc: git
In-Reply-To: <A5C2B218-4E4F-4C05-959D-5B6E9C619DDB@gmail.com>

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

On Thu, Mar 26, 2009 at 06:59:51PM -0400, David Reitter <david.reitter@gmail.com> wrote:
> I have two separately developed projects (foo, bar) which I'd like to  
> merge; the contents of foo should, initially, go in a subdirectory of  
> bar.
> 
> I'm aware of two methods:  moving (renaming) everything within foo  
> into foo-dir, and then just pulling foo into bar.

The result of the two methods are the same.

> This works beautifully, except that the big rename causes havoc w.r.t.  
> to the files histories, i.e. git-log needs a "--follow" argument now,  
> and "diff-tree" can't track changes when given the new file name.  No  
> good.
> 
> I've also tried the method described in [1], but it seems that all  
> history is lost here (the text could point this out..)

Of course it is not lost. :)

Example:

commit f8c62880ef22b74ea6df47bb349ff0743d2a93f9
Merge: f474c52... 52b8ea9...
Author: Junio C Hamano <gitster@pobox.com>
Date:   Sun Mar 1 22:20:52 2009 -0800

    Merge git://git.kernel.org/pub/scm/gitk/gitk

Now do a 'git log f474c52..52b8ea9' and you'll see the merged commits.

But you are right about that 'git log -- path' will find the merge
commits only (which is right, as the tree objects are not modified when
merging, just the resulting tree has the original tree in a
subdirectory).

If this is a one-time operation then I would just use git filter-branch
to move the code to a subdir.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply

* Re: sending patch sets (was: Re: [PATCH 01/10] refs: add "for_each_bisect_ref" function)
From: Christian Couder @ 2009-03-27  7:22 UTC (permalink / raw)
  To: Julian Phillips
  Cc: Johannes Schindelin, Michael J Gruber, Sverre Rabbelier,
	Junio C Hamano, git, John Tapsell
In-Reply-To: <alpine.LNX.2.00.0903270126210.25399@reaper.quantumfyre.co.uk>

Le vendredi 27 mars 2009, Julian Phillips a écrit :
> On Fri, 27 Mar 2009, Christian Couder wrote:
> > If someone knows some other tools that can easily send a threaded patch
> > series, I will try to see if I can use them...
>
> I long ago gave up on send-email, as it seemed to cumbersome for what I
> wanted, and my perl had got so rusty I really couldn't face trying to
> improve it.
>
> So I wrote a replacement in Python (attached), which I have subsequently
> used for all patches I've sent.  It calls format-patch, passing through
> arguments (and you can use -- to let it pass options too).
>
> (the only setting it reads from git config atm is mail-commit.to)
>
> I find it much easier to use than send-email, but as usual YMMV ...

Thanks I will try to have a look at it,
Christian.

^ permalink raw reply

* Re: [PATCH 01/10] refs: add "for_each_bisect_ref" function
From: Christian Couder @ 2009-03-27  7:21 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Michael J Gruber, Sverre Rabbelier, Junio C Hamano, git,
	John Tapsell
In-Reply-To: <alpine.DEB.1.00.0903270305340.10279@pacific.mpi-cbg.de>

Le vendredi 27 mars 2009, Johannes Schindelin a écrit :
> Hi,
>
> On Fri, 27 Mar 2009, Christian Couder wrote:
> > Le jeudi 26 mars 2009, Johannes Schindelin a écrit :
> > > On Thu, 26 Mar 2009, Michael J Gruber wrote:
> > > > Christian Couder venit, vidit, dixit 26.03.2009 08:48:
> > > > > Le jeudi 26 mars 2009, Sverre Rabbelier a écrit :
> > > > >> A 10 patches series with no cover letter?
> > > > >
> > > > > I am not a big fan of cover letters. Usually I prefer adding
> > > > > comments in the patches.
> > > >
> > > > I'm sorry I have to say that, but your individual preferences don't
> > > > matter. Many of us would do things differently, each in their own
> > > > way, but people adjust to the list's preferences. It's a matter of
> > > > attitude. So, please...
> > >
> > > Actually, a better way to ask for a cover letter would have been to
> > > convince Christian.  So I'll try that.
> >
> > Thanks.
> >
> > As you know, I have been sending patches since nearly 3 years ago to
> > this list. And it's only since a few weeks ago that I am asked to send
> > cover letters...
>
> Heh, I have the feeling that your patch series were much shorter, and did
> not have many revisions, until a few weeks ago ;-)

Please try to look for a 9 patch long series that you reviewed around 
october 2007 with "dunno" or "skip" in the title ;-)

> > > From the patch series' titles (especially when they are cropped due
> > > to the text window being too small to fit the indented thread), it is
> > > not all that obvious what you want to achieve with those 10 patches.
> > >
> > > From recent discussions, I seem to remember that you wanted to have
> > > some cute way to mark commits as non-testable during a bisect, and I
> > > further seem to remember that Junio said that very method should be
> > > usable outside of bisect, too.
> >
> > Well, we want to move "git bisect skip" code from shell (in
> > "git-bisect.sh") to C. So this patch series does that by creating a new
> > "git bisect--helper" command in C that contains the new code and using
> > that new command in "git-bisect.sh".
>
> Oh?  I _completely_ missed that.  And that's being one of the original
> Cc:ed persons...
>
> > > Unfortunately, that does not reveal to me, quickly, what is the
> > > current state of affairs, and what you changed since the last time.
> >
> > Yeah, I should have at least put something in the comment section of my
> > first patch in this series.
>
> No.  I would still have missed it.
>
> The cover letter is outside of any patch, because it describes the
> purpose of the _whole_ patch series, not just one patch.
>
> So, it would have been nice to get a heads-up that this is not your
> bisect-skip-a-whole-bunch-of-commits series, but a new animal.
>
> This way, I decided I do not have time for something I do not need, and
> deleted it without having a look.

Well as I said in my previous email I am willing to improve. So perhaps next 
time.

Best regards,
Christian.

^ permalink raw reply

* Re: [PATCH] log-tree: fix patch filename computation in "git format-patch"
From: Christian Couder @ 2009-03-27  7:15 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Stephen Boyd, git
In-Reply-To: <7v3acziot0.fsf@gitster.siamese.dyndns.org>

Le vendredi 27 mars 2009, Junio C Hamano a écrit :
> Christian Couder <chriscool@tuxfamily.org> writes:
> > When using "git format-patch", "get_patch_filename" in
> > "log-tree.c" calls "strbuf_splice" that could die with
> > the following message:
> >
> > "`pos + len' is too far after the end of the buffer"
> >
> > if you have:
> >
> > 	buf->len < start_len + FORMAT_PATCH_NAME_MAX
> >
> > but:
> >
> > 	buf->len + suffix_len > start_len + FORMAT_PATCH_NAME_MAX
> >
> > This patch tries to get rid of that bug.
>
> hmm, tries to?

Yeah, I was tired last night, when I created and sent this patch so I knew 
that it could be wrong.

>
> > diff --git a/log-tree.c b/log-tree.c
> > index 56a3488..ade79ab 100644
> > --- a/log-tree.c
> > +++ b/log-tree.c
> > @@ -187,16 +187,17 @@ void get_patch_filename(struct commit *commit,
> > int nr, const char *suffix,
> >
> >  	strbuf_addf(buf, commit ? "%04d-" : "%d", nr);
> >  	if (commit) {
> > +		int max_len = start_len + FORMAT_PATCH_NAME_MAX;
> >  		format_commit_message(commit, "%f", buf, DATE_NORMAL);
> >  		/*
> >  		 * Replace characters at the end with the suffix if the
> >  		 * filename is too long
> >  		 */
> > +		if (buf->len + suffix_len > max_len) {
> > +			int base = (max_len > buf->len) ? buf->len : max_len;
> > +			strbuf_splice(buf, base - suffix_len, suffix_len,
> > +				      suffix, suffix_len);
> > +		} else
> >  			strbuf_addstr(buf, suffix);
>
> Your third argument to splice does not look right; if the existing length
> is very very long, you would need to remove a lot, and if the existing
> length is slightly long, you would need to remove just a little bit, but
> you always seem to remove the fixed amount, to splice the suffix in.
>
> In any case, why does this have to be so complex?
>
> In your buffer, you originally have start_len, and would want to end up
> with "%f" expansion, plus the suffix, but you are not allowed to exceed
> FORMAT_PATCH_NAME_MAX to store what you add, and are only allowed to chop
> the "%f" expansion if you are short of room.
>
> Shouldn't it be just:
>
> 	size_t max_len = start_len + FORMAT_PATCH_NAME_MAX - suffix_len;
>         if (max_len < buf->len)
>                 strbuf_setlen(buf, max_len);
> 	strbuf_addstr(buf, suffix);
>
> The caller must make sure that suffix_len is sufficiently shorter than
> FORMAT_PATCH_NAME_MAX; I do not know if the current code does that,
> though.

Yes, this looks better.

Thanks,
Christian.

^ permalink raw reply

* [PATCH v2 2/2] Documentation/Makefile: break up texi pipeline
From: Chris Johnsen @ 2009-03-27  6:49 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, Chris Johnsen
In-Reply-To: <1238136579-23166-1-git-send-email-chris_johnsen@pobox.com>

Most shells define the exit value of a pipeline as the exit value
of the last process. For each texi rule, run the DOCBOOK2X_TEXI
tool and the "fixup" script in their own non-pipeline commands so
that make will notice an error exit code.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>

---

Change since "v1": Fix incompletely introduced, "&& chain" in
  gitman.texi rule.

This textually depends on my "quiet doc gen" patch as it modifies
a couple of the same lines.
---
 Documentation/Makefile |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 3e1d175..d145372 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -178,7 +178,7 @@ cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
 
 clean:
 	$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
-	$(RM) *.texi *.texi+ git.info gitman.info
+	$(RM) *.texi *.texi+ *.texi++ git.info gitman.info
 	$(RM) howto-index.txt howto/*.html doc.dep
 	$(RM) technical/api-*.html technical/api-index.txt
 	$(RM) $(cmds_txt) *.made
@@ -221,8 +221,9 @@ git.info: user-manual.texi
 
 user-manual.texi: user-manual.xml
 	$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
-	$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout | \
-		$(PERL_PATH) fix-texi.perl >$@+ && \
+	$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \
+	$(PERL_PATH) fix-texi.perl <$@++ >$@+ && \
+	rm $@++ && \
 	mv $@+ $@
 
 user-manual.pdf: user-manual.xml
@@ -233,7 +234,9 @@ user-manual.pdf: user-manual.xml
 gitman.texi: $(MAN_XML) cat-texi.perl
 	$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
 	($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \
-		--to-stdout $(xml) &&) true) | $(PERL_PATH) cat-texi.perl $@ >$@+ && \
+		--to-stdout $(xml) &&) true) > $@++ && \
+	$(PERL_PATH) cat-texi.perl $@ <$@++ >$@+ && \
+	rm $@++ && \
 	mv $@+ $@
 
 gitman.info: gitman.texi
-- 
1.6.2.1.401.gc048

^ permalink raw reply related

* [PATCH v2 1/2] Documentation/Makefile: make most operations "quiet"
From: Chris Johnsen @ 2009-03-27  6:49 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, Chris Johnsen

This adapts the "quiet make" implementation from the main
Makefile.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>

---

"v1" of this series can be found here: <http://thread.gmane.org/gmane.comp.version-control.git/114417/focus=114557>.

Changes since "v1": Fixed broken technical/api-index.txt target
  (thanks, Peff). Extended error propagation across calls to
  DOCBOOK2X_TEXI for gitman.texi. Added QUIET_XSLTPROC for
  "one-off" user-manual.html.
---
 Documentation/Makefile |   84 +++++++++++++++++++++++++++++++----------------
 1 files changed, 55 insertions(+), 29 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 144ec32..3e1d175 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -76,6 +76,32 @@ endif
 # yourself - yes, all 6 characters of it!
 #
 
+QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir
+QUIET_SUBDIR1  =
+
+ifneq ($(findstring $(MAKEFLAGS),w),w)
+PRINT_DIR = --no-print-directory
+else # "make -w"
+NO_SUBDIR = :
+endif
+
+ifneq ($(findstring $(MAKEFLAGS),s),s)
+ifndef V
+	QUIET_ASCIIDOC	= @echo '   ' ASCIIDOC $@;
+	QUIET_XMLTO	= @echo '   ' XMLTO $@;
+	QUIET_DB2TEXI	= @echo '   ' DB2TEXI $@;
+	QUIET_MAKEINFO	= @echo '   ' MAKEINFO $@;
+	QUIET_DBLATEX	= @echo '   ' DBLATEX $@;
+	QUIET_XSLTPROC	= @echo '   ' XSLTPROC $@;
+	QUIET_GEN	= @echo '   ' GEN $@;
+	QUIET_STDERR	= 2> /dev/null
+	QUIET_SUBDIR0	= +@subdir=
+	QUIET_SUBDIR1	= ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
+			  $(MAKE) $(PRINT_DIR) -C $$subdir
+	export V
+endif
+endif
+
 all: html man
 
 html: $(DOC_HTML)
@@ -119,7 +145,7 @@ install-html: html
 	sh ./install-webdoc.sh $(DESTDIR)$(htmldir)
 
 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
-	$(MAKE) -C ../ GIT-VERSION-FILE
+	$(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE
 
 -include ../GIT-VERSION-FILE
 
@@ -127,8 +153,8 @@ install-html: html
 # Determine "include::" file references in asciidoc files.
 #
 doc.dep : $(wildcard *.txt) build-docdep.perl
-	$(RM) $@+ $@
-	$(PERL_PATH) ./build-docdep.perl >$@+
+	$(QUIET_GEN)$(RM) $@+ $@ && \
+	$(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
 	mv $@+ $@
 
 -include doc.dep
@@ -146,8 +172,8 @@ cmds_txt = cmds-ancillaryinterrogators.txt \
 $(cmds_txt): cmd-list.made
 
 cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
-	$(RM) $@
-	$(PERL_PATH) ./cmd-list.perl ../command-list.txt
+	$(QUIET_GEN)$(RM) $@ && \
+	$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \
 	date >$@
 
 clean:
@@ -158,79 +184,79 @@ clean:
 	$(RM) $(cmds_txt) *.made
 
 $(MAN_HTML): %.html : %.txt
-	$(RM) $@+ $@
+	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
 	$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
-		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
+		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
 	mv $@+ $@
 
 %.1 %.5 %.7 : %.xml
-	$(RM) $@
+	$(QUIET_XMLTO)$(RM) $@ && \
 	xmlto -m $(MANPAGE_XSL) man $<
 
 %.xml : %.txt
-	$(RM) $@+ $@
+	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
 	$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
-		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
+		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
 	mv $@+ $@
 
 user-manual.xml: user-manual.txt user-manual.conf
-	$(ASCIIDOC) -b docbook -d book $<
+	$(QUIET_ASCIIDOC)$(ASCIIDOC) -b docbook -d book $<
 
 technical/api-index.txt: technical/api-index-skel.txt \
 	technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
-	cd technical && sh ./api-index.sh
+	$(QUIET_GEN)cd technical && sh ./api-index.sh
 
 $(patsubst %,%.html,$(API_DOCS) technical/api-index): %.html : %.txt
-	$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
+	$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
 		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt
 
 XSLT = docbook.xsl
 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
 
 user-manual.html: user-manual.xml
-	xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
+	$(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
 
 git.info: user-manual.texi
-	$(MAKEINFO) --no-split -o $@ user-manual.texi
+	$(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
 
 user-manual.texi: user-manual.xml
-	$(RM) $@+ $@
+	$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
 	$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout | \
-		$(PERL_PATH) fix-texi.perl >$@+
+		$(PERL_PATH) fix-texi.perl >$@+ && \
 	mv $@+ $@
 
 user-manual.pdf: user-manual.xml
-	$(RM) $@+ $@
-	$(DBLATEX) -o $@+ -p /etc/asciidoc/dblatex/asciidoc-dblatex.xsl -s /etc/asciidoc/dblatex/asciidoc-dblatex.sty $<
+	$(QUIET_DBLATEX)$(RM) $@+ $@ && \
+	$(DBLATEX) -o $@+ -p /etc/asciidoc/dblatex/asciidoc-dblatex.xsl -s /etc/asciidoc/dblatex/asciidoc-dblatex.sty $< && \
 	mv $@+ $@
 
 gitman.texi: $(MAN_XML) cat-texi.perl
-	$(RM) $@+ $@
+	$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
 	($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \
-		--to-stdout $(xml);)) | $(PERL_PATH) cat-texi.perl $@ >$@+
+		--to-stdout $(xml) &&) true) | $(PERL_PATH) cat-texi.perl $@ >$@+ && \
 	mv $@+ $@
 
 gitman.info: gitman.texi
-	$(MAKEINFO) --no-split --no-validate $*.texi
+	$(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi
 
 $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
-	$(RM) $@+ $@
-	$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+
+	$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
+	$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \
 	mv $@+ $@
 
 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
-	$(RM) $@+ $@
-	sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
+	$(QUIET_GEN)$(RM) $@+ $@ && \
+	sh ./howto-index.sh $(wildcard howto/*.txt) >$@+ && \
 	mv $@+ $@
 
 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
-	$(ASCIIDOC) -b xhtml11 $*.txt
+	$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 $*.txt
 
 WEBDOC_DEST = /pub/software/scm/git/docs
 
 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
-	$(RM) $@+ $@
-	sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
+	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
+	sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+ && \
 	mv $@+ $@
 
 install-webdoc : html
-- 
1.6.2.1.401.gc048

^ permalink raw reply related

* [PATCH v2 8/8] Documentation: option to render literal text as bold for manpages
From: Chris Johnsen @ 2009-03-27  6:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, Chris Johnsen
In-Reply-To: <1238136245-22853-1-git-send-email-chris_johnsen@pobox.com>

This allows manpages viewed on a tty to render inline literal
text in a manner that is distinct from the surrounding text.

The initial implementation (pre-mailing-list) of this patch
included a conditional variant of the XSLT code in
manpage-base.xsl and use xmlto's --stringparam option to
optionally enable the functionality. It turns out that
--stringparam is broken in all versions of xmlto except for the
pre-release, SVN version. Since xmlto is a shell script the patch
to fix it is simple enough, but I instead opted to use xmlto's
"module" functionality.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>

---

Change since "v1": Move dicussion of --stringparam from patch 2
  to this patch. Deleted a bunch of it in the process. No content
  changes from the first version.

---

Since dobcook-xsl 1.74.0 seems to introduce using a monospace
font for literal text (asciidoc backticks), this patch may not be
so important for end users that can install their own
docbook-xsl.

But this patch, or something like it, might be useful for
introducing some kind of typesetting for literal text in the
official manpages (since it would not require upgrading
docbook-xsl). It could probably even be changed/extended to
provide monospacing without using a new docbook-xsl.

The functionality is optional and defaults to "off", so there
probably is not too much harm in including it, even if it is not
used for the official manpages.
---
 Documentation/Makefile                 |    6 +++++-
 Documentation/manpage-bold-literal.xsl |   17 +++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/manpage-bold-literal.xsl

diff --git a/Documentation/Makefile b/Documentation/Makefile
index d71760b..1c94531 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -42,6 +42,7 @@ man7dir=$(mandir)/man7
 ASCIIDOC=asciidoc
 ASCIIDOC_EXTRA =
 MANPAGE_XSL = manpage-normal.xsl
+XMLTO_EXTRA =
 INSTALL?=install
 RM ?= rm -f
 DOC_REF = origin/man
@@ -93,6 +94,9 @@ else
 	ASCIIDOC_EXTRA += -a git-asciidoc-no-roff
 	endif
 endif
+ifdef MAN_BOLD_LITERAL
+XMLTO_EXTRA += -m manpage-bold-literal.xsl
+endif
 
 #
 # Please note that there is a minor bug in asciidoc.
@@ -192,7 +196,7 @@ $(MAN_HTML): %.html : %.txt
 
 %.1 %.5 %.7 : %.xml
 	$(RM) $@
-	xmlto -m $(MANPAGE_XSL) man $<
+	xmlto -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
 
 %.xml : %.txt
 	$(RM) $@+ $@
diff --git a/Documentation/manpage-bold-literal.xsl b/Documentation/manpage-bold-literal.xsl
new file mode 100644
index 0000000..608eb5d
--- /dev/null
+++ b/Documentation/manpage-bold-literal.xsl
@@ -0,0 +1,17 @@
+<!-- manpage-bold-literal.xsl:
+     special formatting for manpages rendered from asciidoc+docbook -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+		version="1.0">
+
+<!-- render literal text as bold (instead of plain or monospace);
+     this makes literal text easier to distinguish in manpages
+     viewed on a tty -->
+<xsl:template match="literal">
+	<xsl:value-of select="$git.docbook.backslash"/>
+	<xsl:text>fB</xsl:text>
+	<xsl:apply-templates/>
+	<xsl:value-of select="$git.docbook.backslash"/>
+	<xsl:text>fR</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
-- 
1.6.2.1.401.gc048

^ permalink raw reply related

* [PATCH v2 7/8] Documentation: asciidoc.conf: fix verse block with block titles
From: Chris Johnsen @ 2009-03-27  6:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, Chris Johnsen
In-Reply-To: <1238136245-22853-1-git-send-email-chris_johnsen@pobox.com>

No files use the variant of block-title with verse-block, but
such a case would have generated broken docbook XML (<simpara> is
not allowed inside <para>). This fixes the potential deviation from
valid docbook XML.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>

---

This is a bugfix for a bug that the documentation currently does
not trigger. Drop this patch if this is unwarranted.
---
 Documentation/asciidoc.conf |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index 9963f2d..dc76e7f 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -59,8 +59,9 @@ ifdef::doctype-manpage[]
 {title%}<literallayout{id? id="{id}"}>
 {title#}<literallayout>
 |
-</literallayout><simpara></simpara>
+</literallayout>
 {title#}</para></formalpara>
+{title%}<simpara></simpara>
 endif::doctype-manpage[]
 endif::git-asciidoc-no-roff[]
 endif::backend-docbook[]
-- 
1.6.2.1.401.gc048

^ permalink raw reply related

* [PATCH v2 5/8] Documentation: move "spurious .sp" code into manpage-base.xsl
From: Chris Johnsen @ 2009-03-27  6:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, Chris Johnsen
In-Reply-To: <1238136245-22853-1-git-send-email-chris_johnsen@pobox.com>

The "spurious .sp" code should be independent of docbook-xsl
versions.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>

---

I do not know why this was only in the non-1.72 variant. Maybe
docbook-xsl 1.72.0 did not need it. But it does not seem like it
would hurt to push it into the shared XSLT. As before, if there
is a good reason to keep it out of the -1.72 processing, then
just drop this patch, none of the rest depend on it.
---
 Documentation/manpage-base.xsl   |   13 +++++++++++++
 Documentation/manpage-normal.xsl |   13 -------------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Documentation/manpage-base.xsl b/Documentation/manpage-base.xsl
index a264fa6..16e2e40 100644
--- a/Documentation/manpage-base.xsl
+++ b/Documentation/manpage-base.xsl
@@ -32,4 +32,17 @@
 	<xsl:text>br&#10;</xsl:text>
 </xsl:template>
 
+<!-- attempt to work around spurious .sp at the tail of the line
+     that docbook stylesheets seem to add -->
+<xsl:template match="simpara">
+  <xsl:variable name="content">
+    <xsl:apply-templates/>
+  </xsl:variable>
+  <xsl:value-of select="normalize-space($content)"/>
+  <xsl:if test="not(ancestor::authorblurb) and
+                not(ancestor::personblurb)">
+    <xsl:text>&#10;&#10;</xsl:text>
+  </xsl:if>
+</xsl:template>
+
 </xsl:stylesheet>
diff --git a/Documentation/manpage-normal.xsl b/Documentation/manpage-normal.xsl
index e36472f..a48f5b1 100644
--- a/Documentation/manpage-normal.xsl
+++ b/Documentation/manpage-normal.xsl
@@ -10,17 +10,4 @@
 <xsl:param name="git.docbook.backslash">\</xsl:param>
 <xsl:param name="git.docbook.dot"	>.</xsl:param>
 
-<!-- attempt to work around spurious .sp at the tail of the line
-     that docbook stylesheets seem to add -->
-<xsl:template match="simpara">
-  <xsl:variable name="content">
-    <xsl:apply-templates/>
-  </xsl:variable>
-  <xsl:value-of select="normalize-space($content)"/>
-  <xsl:if test="not(ancestor::authorblurb) and
-                not(ancestor::personblurb)">
-    <xsl:text>&#10;&#10;</xsl:text>
-  </xsl:if>
-</xsl:template>
-
 </xsl:stylesheet>
-- 
1.6.2.1.401.gc048

^ permalink raw reply related

* [PATCH v2 6/8] Documentation: asciidoc.conf: always use <literallayout> for [blocktext]
From: Chris Johnsen @ 2009-03-27  6:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, Chris Johnsen
In-Reply-To: <1238136245-22853-1-git-send-email-chris_johnsen@pobox.com>

Make the docbook-xsl-no-raw-roff variant match the
no-docbook-xsl-no-raw-roff variant in terms of which XML tag is
used to wrap listing block text (delimited with lines of dashes).

e920b56 (Tweak asciidoc output to work with broken docbook-xsl,
2006-03-05) says docbook-xsl 1.68 needs <literallayout>. This
<screen> usages was in the old, 1.72-only section. But since it
is now the "roff-less" section, it probably makes sense to make it
symmetric with the "roff-ful" section.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>

---

This is another cleanup to make the two conditional sections more
symmetric.

The only large, remaining asymmetry in the asciidoc.conf
roff/non-roff parts is the [verseblock] in the non-roff
section. Should [verseblock] be pulled out of the
roff-conditional parts?  Should a [verseblock] section be added
to the roff-using part?
---
 Documentation/asciidoc.conf |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index ce1b175..9963f2d 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -49,9 +49,9 @@ ifdef::doctype-manpage[]
 # The following two small workarounds insert a simple paragraph after screen
 [listingblock]
 <example><title>{title}</title>
-<screen>
+<literallayout>
 |
-</screen><simpara></simpara>
+</literallayout><simpara></simpara>
 {title#}</example>
 
 [verseblock]
-- 
1.6.2.1.401.gc048

^ permalink raw reply related

* [PATCH v2 4/8] Documentation: move quieting params into manpage-base.xsl
From: Chris Johnsen @ 2009-03-27  6:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, Chris Johnsen
In-Reply-To: <1238136245-22853-1-git-send-email-chris_johnsen@pobox.com>

Move a couple of XSL parameters that act to silence
informational/warning messages generated when running xmlto from
manpage-1.72.xsl to manpage-base.xsl.

Since unused parameters are silently ignored, there is no problem
if some version of docbook-xsl does not know about these
parameters. The only problem might be if a version of docbook-xsl
uses the parameters for alternate functionality. Since both
parameters have fairly specific names such a situation is
unlikely.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>

---

I am not sure why these were only in the -1.72 variant. They
should probably be in -base (done by this patch) or in neither
variant. If there is a good reason for having it only in -1.72,
this patch can be dropped entirely, the rest do not depend on it.
---
 Documentation/manpage-1.72.xsl |    4 ----
 Documentation/manpage-base.xsl |    4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/manpage-1.72.xsl b/Documentation/manpage-1.72.xsl
index e24d26c..b4d315c 100644
--- a/Documentation/manpage-1.72.xsl
+++ b/Documentation/manpage-1.72.xsl
@@ -11,8 +11,4 @@
 <xsl:param name="git.docbook.backslash">&#x2593;</xsl:param>
 <xsl:param name="git.docbook.dot"      >&#x2302;</xsl:param>
 
-<!-- these params silence some output from xmlto -->
-<xsl:param name="man.output.quietly" select="1"/>
-<xsl:param name="refentry.meta.get.quietly" select="1"/>
-
 </xsl:stylesheet>
diff --git a/Documentation/manpage-base.xsl b/Documentation/manpage-base.xsl
index 6d3eb19..a264fa6 100644
--- a/Documentation/manpage-base.xsl
+++ b/Documentation/manpage-base.xsl
@@ -3,6 +3,10 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 		version="1.0">
 
+<!-- these params silence some output from xmlto -->
+<xsl:param name="man.output.quietly" select="1"/>
+<xsl:param name="refentry.meta.get.quietly" select="1"/>
+
 <!-- convert asciidoc callouts to man page format;
      git.docbook.backslash and git.docbook.dot params
      must be supplied by another XSL file or other means -->
-- 
1.6.2.1.401.gc048

^ permalink raw reply related

* [PATCH v2 3/8] Documentation: rename docbook-xsl-172 attribute to git-asciidoc-no-roff
From: Chris Johnsen @ 2009-03-27  6:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, Chris Johnsen
In-Reply-To: <1238136245-22853-1-git-send-email-chris_johnsen@pobox.com>

It seems that the ability to use raw roff codes in asciidoc.conf
was eliminated by docbook-xsl 1.72.0 _and later_. Unlike the
1.72.0-specific XSLT problem, this behavior was not reverted in
later releases.

This patch aims to make it clear that the affected asciidoc
attribute (flag) can be reasonably used with docbook-xsl versions
other than 1.72.0.

Also, document which make variables should be set for various
versions of asciidoc and docbook-xsl.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>

---

This has no behavior changes for existing uses (make
DOCBOOK_XSL_172=Yes), but it enables new functionality
(ASCIIDOC_NO_ROFF=Yes) by divorcing the roff-avoiding parts of
asciidoc.conf from the label docbook-xsl-172.

I like the idea of including "tested with asciidoc/docbook-xsl
version info" in the commit message. It would have been very
helpful if all the previous commits to the core documentation
generation infrastructure carried such information.
---
 Documentation/Makefile      |   29 ++++++++++++++++++++++++++++-
 Documentation/asciidoc.conf |    8 ++++----
 2 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index e1562e3..d71760b 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -59,12 +59,39 @@ endif
 -include ../config.mak.autogen
 -include ../config.mak
 
+#
+# For asciidoc ...
+#	-7.1.2,	no extra settings are needed.
+#	8.0-,	set ASCIIDOC8.
+#
+
+#
+# For docbook-xsl ...
+#	-1.68.1,	set ASCIIDOC_NO_ROFF? (based on changelog from 1.73.0)
+#	1.69.0-1.71.1,	no extra settings are needed?
+#	1.72.0,		set DOCBOOK_XSL_172.
+#	1.73.0-,	set ASCIIDOC_NO_ROFF
+#
+
+#
+# If you had been using DOCBOOK_XSL_172 in an attempt to get rid
+# of 'the ".ft C" problem' in your generated manpages, and you
+# instead ended up with weird characters around callouts, try
+# using ASCIIDOC_NO_ROFF instead (it works fine with ASCIIDOC8).
+#
+
 ifdef ASCIIDOC8
 ASCIIDOC_EXTRA += -a asciidoc7compatible
 endif
 ifdef DOCBOOK_XSL_172
-ASCIIDOC_EXTRA += -a docbook-xsl-172
+ASCIIDOC_EXTRA += -a git-asciidoc-no-roff
 MANPAGE_XSL = manpage-1.72.xsl
+else
+	ifdef ASCIIDOC_NO_ROFF
+	# docbook-xsl after 1.72 needs the regular XSL, but will not
+	# pass-thru raw roff codes from asciidoc.conf, so turn them off.
+	ASCIIDOC_EXTRA += -a git-asciidoc-no-roff
+	endif
 endif
 
 #
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index 1e735df..ce1b175 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -27,7 +27,7 @@ ifdef::backend-docbook[]
 endif::backend-docbook[]
 
 ifdef::backend-docbook[]
-ifndef::docbook-xsl-172[]
+ifndef::git-asciidoc-no-roff[]
 # "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
 # v1.72 breaks with this because it replaces dots not in roff requests.
 [listingblock]
@@ -42,9 +42,9 @@ ifdef::doctype-manpage[]
 endif::doctype-manpage[]
 </literallayout>
 {title#}</example>
-endif::docbook-xsl-172[]
+endif::git-asciidoc-no-roff[]
 
-ifdef::docbook-xsl-172[]
+ifdef::git-asciidoc-no-roff[]
 ifdef::doctype-manpage[]
 # The following two small workarounds insert a simple paragraph after screen
 [listingblock]
@@ -62,7 +62,7 @@ ifdef::doctype-manpage[]
 </literallayout><simpara></simpara>
 {title#}</para></formalpara>
 endif::doctype-manpage[]
-endif::docbook-xsl-172[]
+endif::git-asciidoc-no-roff[]
 endif::backend-docbook[]
 
 ifdef::doctype-manpage[]
-- 
1.6.2.1.401.gc048

^ permalink raw reply related

* [PATCH v2 2/8] Documentation: use parametrized manpage-base.xsl with manpage-{1.72,normal}.xsl
From: Chris Johnsen @ 2009-03-27  6:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, Chris Johnsen
In-Reply-To: <1238136245-22853-1-git-send-email-chris_johnsen@pobox.com>

Parametrize the backslash and dot characters that are used to
generate roff control sequences in manpage-base.xsl.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>

---

Changes since "v1": In manpage-{normal,1.72}.xsl, use
  <xsl:import> to incorporate manpage-base.xsl. Take
  manpage-base.xsl off the xmlto commandline. Thanks, Peff!

  Implementation details in the commit message have been moved to
  the last patch.

---

Still no change in behavior. Just refactoring here.
---
 Documentation/manpage-1.72.xsl   |   29 ++++++++++++---------------
 Documentation/manpage-base.xsl   |   39 +++++++++++++++++++------------------
 Documentation/manpage-normal.xsl |   30 ++++++++++++----------------
 3 files changed, 46 insertions(+), 52 deletions(-)

diff --git a/Documentation/manpage-1.72.xsl b/Documentation/manpage-1.72.xsl
index 4065a3a..e24d26c 100644
--- a/Documentation/manpage-1.72.xsl
+++ b/Documentation/manpage-1.72.xsl
@@ -1,21 +1,18 @@
-<!-- Based on callouts.xsl. Fixes man page callouts for DocBook 1.72 XSL -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<!-- manpage-1.72.xsl:
+     special settings for manpages rendered from asciidoc+docbook
+     handles peculiarities in docbook-xsl 1.72.0 -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+		version="1.0">
 
+<xsl:import href="manpage-base.xsl"/>
+
+<!-- these are the special values for the roff control characters
+     needed for docbook-xsl 1.72.0 -->
+<xsl:param name="git.docbook.backslash">&#x2593;</xsl:param>
+<xsl:param name="git.docbook.dot"      >&#x2302;</xsl:param>
+
+<!-- these params silence some output from xmlto -->
 <xsl:param name="man.output.quietly" select="1"/>
 <xsl:param name="refentry.meta.get.quietly" select="1"/>
 
-<xsl:template match="co">
-	<xsl:value-of select="concat('&#x2593;fB(',substring-after(@id,'-'),')&#x2593;fR')"/>
-</xsl:template>
-<xsl:template match="calloutlist">
-	<xsl:text>&#x2302;sp&#10;</xsl:text>
-	<xsl:apply-templates/>
-	<xsl:text>&#10;</xsl:text>
-</xsl:template>
-<xsl:template match="callout">
-	<xsl:value-of select="concat('&#x2593;fB',substring-after(@arearefs,'-'),'. &#x2593;fR')"/>
-	<xsl:apply-templates/>
-	<xsl:text>&#x2302;br&#10;</xsl:text>
-</xsl:template>
-
 </xsl:stylesheet>
diff --git a/Documentation/manpage-base.xsl b/Documentation/manpage-base.xsl
index 6a361a2..6d3eb19 100644
--- a/Documentation/manpage-base.xsl
+++ b/Documentation/manpage-base.xsl
@@ -1,30 +1,31 @@
-<!-- callout.xsl: converts asciidoc callouts to man page format -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<!-- manpage-base.xsl:
+     special formatting for manpages rendered from asciidoc+docbook -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+		version="1.0">
+
+<!-- convert asciidoc callouts to man page format;
+     git.docbook.backslash and git.docbook.dot params
+     must be supplied by another XSL file or other means -->
 <xsl:template match="co">
-	<xsl:value-of select="concat('\fB(',substring-after(@id,'-'),')\fR')"/>
+	<xsl:value-of select="concat(
+			      $git.docbook.backslash,'fB(',
+			      substring-after(@id,'-'),')',
+			      $git.docbook.backslash,'fR')"/>
 </xsl:template>
 <xsl:template match="calloutlist">
-	<xsl:text>.sp&#10;</xsl:text>
+	<xsl:value-of select="$git.docbook.dot"/>
+	<xsl:text>sp&#10;</xsl:text>
 	<xsl:apply-templates/>
 	<xsl:text>&#10;</xsl:text>
 </xsl:template>
 <xsl:template match="callout">
-	<xsl:value-of select="concat('\fB',substring-after(@arearefs,'-'),'. \fR')"/>
+	<xsl:value-of select="concat(
+			      $git.docbook.backslash,'fB',
+			      substring-after(@arearefs,'-'),
+			      '. ',$git.docbook.backslash,'fR')"/>
 	<xsl:apply-templates/>
-	<xsl:text>.br&#10;</xsl:text>
-</xsl:template>
-
-<!-- sorry, this is not about callouts, but attempts to work around
- spurious .sp at the tail of the line docbook stylesheets seem to add -->
-<xsl:template match="simpara">
-  <xsl:variable name="content">
-    <xsl:apply-templates/>
-  </xsl:variable>
-  <xsl:value-of select="normalize-space($content)"/>
-  <xsl:if test="not(ancestor::authorblurb) and
-                not(ancestor::personblurb)">
-    <xsl:text>&#10;&#10;</xsl:text>
-  </xsl:if>
+	<xsl:value-of select="$git.docbook.dot"/>
+	<xsl:text>br&#10;</xsl:text>
 </xsl:template>
 
 </xsl:stylesheet>
diff --git a/Documentation/manpage-normal.xsl b/Documentation/manpage-normal.xsl
index 6a361a2..e36472f 100644
--- a/Documentation/manpage-normal.xsl
+++ b/Documentation/manpage-normal.xsl
@@ -1,21 +1,17 @@
-<!-- callout.xsl: converts asciidoc callouts to man page format -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-<xsl:template match="co">
-	<xsl:value-of select="concat('\fB(',substring-after(@id,'-'),')\fR')"/>
-</xsl:template>
-<xsl:template match="calloutlist">
-	<xsl:text>.sp&#10;</xsl:text>
-	<xsl:apply-templates/>
-	<xsl:text>&#10;</xsl:text>
-</xsl:template>
-<xsl:template match="callout">
-	<xsl:value-of select="concat('\fB',substring-after(@arearefs,'-'),'. \fR')"/>
-	<xsl:apply-templates/>
-	<xsl:text>.br&#10;</xsl:text>
-</xsl:template>
+<!-- manpage-normal.xsl:
+     special settings for manpages rendered from asciidoc+docbook
+     handles anything we want to keep away from docbook-xsl 1.72.0 -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+		version="1.0">
+
+<xsl:import href="manpage-base.xsl"/>
+
+<!-- these are the normal values for the roff control characters -->
+<xsl:param name="git.docbook.backslash">\</xsl:param>
+<xsl:param name="git.docbook.dot"	>.</xsl:param>
 
-<!-- sorry, this is not about callouts, but attempts to work around
- spurious .sp at the tail of the line docbook stylesheets seem to add -->
+<!-- attempt to work around spurious .sp at the tail of the line
+     that docbook stylesheets seem to add -->
 <xsl:template match="simpara">
   <xsl:variable name="content">
     <xsl:apply-templates/>
-- 
1.6.2.1.401.gc048

^ permalink raw reply related

* [PATCH v2 1/8] Documentation: move callouts.xsl to manpage-{base,normal}.xsl
From: Chris Johnsen @ 2009-03-27  6:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, Chris Johnsen
In-Reply-To: <1238136245-22853-1-git-send-email-chris_johnsen@pobox.com>

Each of manpage-base.xsl and manpage-normal.xsl gets a copy of
the contents of callouts.xsl and the original is removed. The
Makefile is adjusted to refer to manpage-normal.xsl instead of
callouts.xsl. manpage-base.xsl will be later made into a common
base for -normal and -1.72.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>

---

This duplication is in preparation for refactoring. It should
make it easier to keep track of the source of the various XSL
constructs while reviewing.
---
 Documentation/Makefile                             |    2 +-
 Documentation/{callouts.xsl => manpage-base.xsl}   |    0
 Documentation/{callouts.xsl => manpage-normal.xsl} |    0
 3 files changed, 1 insertions(+), 1 deletions(-)
 copy Documentation/{callouts.xsl => manpage-base.xsl} (100%)
 rename Documentation/{callouts.xsl => manpage-normal.xsl} (100%)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 144ec32..e1562e3 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -41,7 +41,7 @@ man7dir=$(mandir)/man7
 
 ASCIIDOC=asciidoc
 ASCIIDOC_EXTRA =
-MANPAGE_XSL = callouts.xsl
+MANPAGE_XSL = manpage-normal.xsl
 INSTALL?=install
 RM ?= rm -f
 DOC_REF = origin/man
diff --git a/Documentation/callouts.xsl b/Documentation/manpage-base.xsl
similarity index 100%
copy from Documentation/callouts.xsl
copy to Documentation/manpage-base.xsl
diff --git a/Documentation/callouts.xsl b/Documentation/manpage-normal.xsl
similarity index 100%
rename from Documentation/callouts.xsl
rename to Documentation/manpage-normal.xsl
-- 
1.6.2.1.401.gc048

^ permalink raw reply related

* [PATCH v2 0/8] Documentation: XSLT/asciidoc.conf cleanup; tty literals
From: Chris Johnsen @ 2009-03-27  6:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git

"v1" of this series can be found here: <http://thread.gmane.org/gmane.comp.version-control.git/114417>.

Change since "v1":

  1/8: No content change from "v1". This time -C -M was used to
       show copy/rename of callouts.xsl (thanks to Peff for
       pointing to diff.renames config option).

  2/8: Use <xsl:import> instead of xmlto command line to reuse
       manpage-base.xsl. In commit message, move discussion of
       --stringparm to 8/8.

  8/8: No content change from "v1" (though context is changed due
       to content change in 2/8). In commit message, add some of
       --stringparm discussion from "v1" 2/8.

-- 
Chris

^ permalink raw reply

* Re: Problem Creating Commit Messages
From: John Tapsell @ 2009-03-27  6:08 UTC (permalink / raw)
  To: bggy; +Cc: git
In-Reply-To: <22735968.post@talk.nabble.com>

2009/3/27 bggy <balishaggy@yahoo.com>:
>
> Hello, I'm new to git and I haven't been able to create commit messages in
> either vim or textmate(changed core.editor to mate).  I can create commit
> messages when I use the -m option, but I like creating multiple-line
> messages and it's easier to do it with a fresh line-break in the terminal.

You could use a simple text editor like "joe".

> Using textmate I saved and closed the textmate file that pops up after $git
> commit -a, but git responds that the commit was terminated due to an empty
> message.

Sometimes graphical editors return on the command line before they
actually quit.  This might be what is happening here.  If so, you
could file a bug against textmate.

John

^ permalink raw reply

* Re: Problem Creating Commit Messages
From: Geoffrey Lee @ 2009-03-27  5:18 UTC (permalink / raw)
  To: git
In-Reply-To: <22735968.post@talk.nabble.com>

On Thu, Mar 26, 2009 at 9:44 PM, bggy <balishaggy@yahoo.com> wrote:
> I am not familiar with VIM, can change modes, but none of the key combos I
> tried worked.

1) Press "i" to enter Insert mode
2) Type in some text on the first line
3) Press "esc" to leave Insert mode
4) Press Shift + ; (or in other words, the colon character)
5) Enter the characters "wq" without the quotes, and press Enter. ("w"
for write, "q" for quit)

-Geoffrey Lee

^ permalink raw reply

* Re: [PATCH 1/2] init: support --import to add all files and commit right after init
From: Jeff King @ 2009-03-27  5:08 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Markus Heidelberg, Santi Béjar,
	Nguyễn Thái Ngọc, git
In-Reply-To: <20090327050626.GA23512@coredump.intra.peff.net>

On Fri, Mar 27, 2009 at 01:06:26AM -0400, Jeff King wrote:

> Another option would be a patch on top of the original to allow
> 
>   git config --global init.importmessage 'Commit inicial'
> 
> or
> 
>   git config --global init.importeditor true
> 
> I have no interest in writing such a patch, but I don't see a reason to
> reject it.

Actually, there is one possible reason to reject it: scripts could not
rely on the behavior of "--import" without it. But I think it is OK to
make a conscious decision that this is a feature for _humans_, and that
scripts can use "init && add && commit" (or they can be happy with
dealing with the human's choice of editor or not).

-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