Git development
 help / color / mirror / Atom feed
* Re: Problem with "From:" line on "git format-patch" generated patches
From: Santi Béjar @ 2009-11-03 17:02 UTC (permalink / raw)
  To: André Goddard Rosa; +Cc: Git Mailing List
In-Reply-To: <b8bf37780911030830l42ea6dc2v3ef66e2a9e1ca281@mail.gmail.com>

On Tue, Nov 3, 2009 at 5:30 PM, André Goddard Rosa
<andre.goddard@gmail.com> wrote:
> Hi, everybody!
>
>    When I generate patches using "git format-patch" it always makes
> my name garbled in the "From:" line
> as shown below. I'm using openSUSE 11.2 RC 1 (x86_64) with the
> following settings:
>
>        # locale charmap
>        UTF-8
>        # echo $LANG
>        en_US.UTF-8
>
>    I've tried changing my environment to use another encoding like
> ISO-8859-1, but it didn't work as well.
>
>    Does someone can explain why does this happens? Any suggestions?
>
> P.s.: the problem never occurs on the commit message (Signed-off-by)
>
>
>>> >From 584d9bfc7c1d41b76a05655b4562b98fcbef6ee4 Mon Sep 17 00:00:00 2001
>>> From: =?UTF-8?q?Andr=C3=A9=20Goddard=20Rosa?= <andre.goddard@gmail.com>
>>> Date: Sun, 1 Nov 2009 14:09:06 -0200
>>> Subject: [PATCH v2 7/7] vsprintf: factor out skip_space code in a
>>> separate function
>>> MIME-Version: 1.0
>>> Content-Type: text/plain; charset=UTF-8
>>> Content-Transfer-Encoding: 8bit

This is the normal encoding for email headers where you cannot use
8bit characters. You have to use a 7bit characters with this
=?UTF-8... encoding.

You can check the From: line in your mail, the mail I'm replying:

From:	=?ISO-8859-1?Q?Andr=E9_Goddard_Rosa?= <andre.goddard@gmail.com>

At the other hand the tools using the output of git-format-patch must
deal with this all, as they do. git-am handles it well, if not it's a
bug that should be reported.

HTH,
Santi

^ permalink raw reply

* Re: [PATCH 0/2] Set Makefile variables from configure
From: Ben Walton @ 2009-11-03 17:25 UTC (permalink / raw)
  To: gitster, jrnieder, git
In-Reply-To: <1257021695-21260-1-git-send-email-bwalton@artsci.utoronto.ca>

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

Excerpts from Ben Walton's message of Sat Oct 31 16:41:33 -0400 2009:

Ping?  Is this useful or should I drop it?

Thanks
-Ben

> These patches add support for setting the newly created DEFAULT_EDITOR
> and DEFAULT_PAGER from the configure script.  I also tacked in
> ETC_GITCONFIG, since I can't currently toggle this without setting a
> command line value when building, but have need to alter it.
> 
> The function added is generic, and will allow for setting new
> variables as needed in the future.  No validation is done on the
> values.  It is less specific than the *_PATH setting functions that
> already exist.
> 
> Ben Walton (2):
>   configure: add function to directly set Makefile variables
>   configure: allow user to set gitconfig, pager and editor
> 
>  configure.ac |   24 ++++++++++++++++++++++++
>  1 files changed, 24 insertions(+), 0 deletions(-)
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: Problem with "From:" line on "git format-patch" generated patches
From: André Goddard Rosa @ 2009-11-03 18:06 UTC (permalink / raw)
  To: Santi Béjar; +Cc: Git Mailing List
In-Reply-To: <adf1fd3d0911030902x15faffcen86644733ffda43d5@mail.gmail.com>

On 11/3/09, Santi Béjar <santi@agolina.net> wrote:
> On Tue, Nov 3, 2009 at 5:30 PM, André Goddard Rosa
> <andre.goddard@gmail.com> wrote:
>> Hi, everybody!
>>
>>    When I generate patches using "git format-patch" it always makes
>> my name garbled in the "From:" line
>> as shown below. I'm using openSUSE 11.2 RC 1 (x86_64) with the
>> following settings:
>>
>>        # locale charmap
>>        UTF-8
>>        # echo $LANG
>>        en_US.UTF-8
>>
>>    I've tried changing my environment to use another encoding like
>> ISO-8859-1, but it didn't work as well.
>>
>>    Does someone can explain why does this happens? Any suggestions?
>>
>> P.s.: the problem never occurs on the commit message (Signed-off-by)
>>
>>>> >From 584d9bfc7c1d41b76a05655b4562b98fcbef6ee4 Mon Sep 17 00:00:00 2001
>>>> From: =?UTF-8?q?Andr=C3=A9=20Goddard=20Rosa?= <andre.goddard@gmail.com>
>>>> Date: Sun, 1 Nov 2009 14:09:06 -0200
>>>> Subject: [PATCH v2 7/7] vsprintf: factor out skip_space code in a
>>>> separate function
>>>> MIME-Version: 1.0
>>>> Content-Type: text/plain; charset=UTF-8
>>>> Content-Transfer-Encoding: 8bit
>
> This is the normal encoding for email headers where you cannot use
> 8bit characters. You have to use a 7bit characters with this
> =?UTF-8... encoding.
>
> You can check the From: line in your mail, the mail I'm replying:
>
> From:	=?ISO-8859-1?Q?Andr=E9_Goddard_Rosa?= <andre.goddard@gmail.com>
>
> At the other hand the tools using the output of git-format-patch must
> deal with this all, as they do. git-am handles it well, if not it's a
> bug that should be reported.
>

Great, Santi!

     I really appreciate your reply!!!

    I was just in the process of debugging this issue when I landed
into function pp_user_info(), which calls add_rfc2047(). So I started
looking into http://www.faqs.org/rfcs/rfc2047.html , which specifies:

"Generally, an "encoded-word" is a sequence of printable ASCII
characters that begins with "=?", ends with "?=", and has two "?"s in
between."

Ok... I got it; it's necessary for proper signaling of the email
header when it detects the presence of certain characters outside the
ASCII range 0..127 (7 bits). It's the case for latin "é" letter in my
name.

So, let me explain what happened to me:

I'm not using any specific tool for inputting the git-format-patch,
but instead I'm sending the files generated by it through gmail as an
inlined patch in the email body.

I like the convenience of format-patch for generating the patch files,
but in this case, formatting the header as rfc2047 is not necessary
and makes a funny/garbled output in my patch submission.

Do you have a suggestion for my workflow?

Thanks a lot,
André

^ permalink raw reply

* Re: Problem with "From:" line on "git format-patch" generated patches
From: André Goddard Rosa @ 2009-11-03 18:11 UTC (permalink / raw)
  To: Santi Béjar; +Cc: Git Mailing List
In-Reply-To: <b8bf37780911031006q4bc4c487xd9db86eb0fa531e7@mail.gmail.com>

> I'm not using any specific tool for inputting the git-format-patch,
> but instead I'm sending the files generated by it through gmail as an
> inlined patch in the email body.
>
> I like the convenience of format-patch for generating the patch files,
> but in this case, formatting the header as rfc2047 is not necessary
> and makes a funny/garbled output in my patch submission.
>
> Do you have a suggestion for my workflow?
>

I really would like continuing having the convenience of using a web
access to my gmail for sending the patches, so I just need a way to
format the patches which makes it easy submitting them later. I'd like
to avoid using any other email client for that, if possible.

^ permalink raw reply

* Re: Problem signing a tag
From: Joshua J. Kugler @ 2009-11-03 18:11 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git
In-Reply-To: <81b0412b0911022331q2976b6e6u575a9700b212623d@mail.gmail.com>

On Monday 02 November 2009, Alex Riesen said something like:
> On Tue, Nov 3, 2009 at 01:58, Joshua J. Kugler <joshua@eeinternet.com> 
wrote:
> > Nobody on the git IRC channel responded to this question, even
> > after asking it a few times, so I thought I'd try here.
> >
> > I'm having trouble signing a tag.  I'm using this command:
> >
> > git tag -u EAFD344D14EA086E -F .git/TAG_EDITMSG tag_name
> >
> > I type in my passphrase, and am then told:
> >
> > error: gpg failed to sign the tag
> > error: unable to sign the tag
> >
> > However, if I use this command:
> >
> > gpg -s -u EAFD344D14EA086E
> >
> > and use the same passphrase, it works fine. Is there any way to
> > find out why a key-signing is failing?
>
> What does "echo $?" after it prints? IOW, maybe plain gpg fails too,
> without printing anything special, and you don't pay attention to the
> exit code. Git does. And it runs "gpg -bsau <key-id>".

$ git tag -s -F .git/TAG_EDITMSG tag_name

You need a passphrase to unlock the secret key for
user: "Joshua J. Kugler <joshua@azariah.com>"
1024-bit DSA key, ID 14EA086E, created 2009-08-09

gpg: problem with the agent - disabling agent use
error: gpg failed to sign the tag
error: unable to sign the tag
$ echo $?
128

And when I sign at the prompt:

$ gpg -sa

You need a passphrase to unlock the secret key for
user: "Joshua J. Kugler <joshua@azariah.com>"
1024-bit DSA key, ID 14EA086E, created 2009-08-09

gpg: problem with the agent - disabling agent use
Blah blah blah blah
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.9 (GNU/Linux)

owGbwMvMwCT46q+Jr8grjjzG01JJDF4fChqdchIzFJJQCK4ONxYGQSYGNlYmkAoG
Lk4BmLZpyxgW7Jol8mB6kt+Hr1xb9gvUnTs9f/XdVIYFW3VNlx3cmvy4sf/R0/m7
nr9fFpzyFQA=
=Plql
-----END PGP MESSAGE-----
$ echo $?
2

So, it appear that it works (prints the signature) but then exits with 
an error code of 2.

Using --status-log, I get:

[GNUPG:] USERID_HINT EAFD344D14EA086E Joshua J. Kugler 
<joshua@azariah.com>
[GNUPG:] NEED_PASSPHRASE EAFD344D14EA086E EAFD344D14EA086E 17 0
[GNUPG:] GOOD_PASSPHRASE
[GNUPG:] BEGIN_SIGNING
[GNUPG:] SIG_CREATED S 17 2 00 1257271594 
4FE551A1A4AE4DEF7EDD58E1EAFD344D14EA086E

No indication of an error.  The only thing I see that might be an error 
is "gpg: problem with the agent - disabling agent use." But that should 
be a warning, not an error, correct?  I talked with somebody on the 
gnupg IRC channel and they were able to create a signed tag, even 
though they were not using an agent.

Here it is with -bsau:

$ gpg -bsau EAFD344D14EA086E

You need a passphrase to unlock the secret key for
user: "Joshua J. Kugler <joshua@azariah.com>"
1024-bit DSA key, ID 14EA086E, created 2009-08-09

gpg: problem with the agent - disabling agent use
Blah blah blah blah
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkrwciEACgkQ6v00TRTqCG7TZwCfSrvb6p0L+ZZqPB8XrVuMpJPj
jicAoJKnfIeTsWylXpklB9Gw/ArdxvxU
=CM2I
-----END PGP SIGNATURE-----
$ echo $?
2


I'm lost. Thanks for the tips.

j

-- 
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/  ID 0x14EA086E

^ permalink raw reply

* Re: [PATCH] commit -c/-C/--amend: reset timestamp and authorship to  committer with --mine
From: Erick Mattos @ 2009-11-03 18:21 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Please don't forget your comments down here wasn't about the last sent
patch.  Please see it, in case you don't have it, at:
http://marc.info/?l=git&m=125712272606721&w=2

Anyway I am answering your comments down here:

2009/11/2 Junio C Hamano <gitster@pobox.com>:
> Erick Mattos <erick.mattos@gmail.com> writes:
>
>> 2009/11/1 Junio C Hamano <gitster@pobox.com>:
>>> Erick Mattos <erick.mattos@gmail.com> writes:
>>>
>>>>>    % git commit --claim --author='Erick Mattos <eric@mattos>' -C HEAD
>>>>>
>>>>> Should you detect an error?  Does your code do so?  Do you have a test
>>>>> that catches this error?
>>>>
>>>> It works as intended.  Both together.
>>>
>>> That does not make any sense.  If you are saying this is yours and it is
>>> his at the same time, there can be no sane way to work "as intended", no?.
>>
>> I am adding a new option not changing the option --author already in
>> git.  So it does work together.
>
> Somebody who says "this commit is mine, and its author is this other
> person" is not making any sense.  The resulting commit can either have
> that person (i.e. the committer) as the author, which is what the "claim"
> option means, or it can have the person named with --author as the author,
> but both cannot be true at the same time.
>
> When you introduce a new option, sometimes it cannot sanely be used with
> an existing option.  In such a case, two options (the new one and the
> existing one) are called mutually exclusive.  And you add some code to
> catch an user error to use them together.

As --author text says: "override author for commit".
As I see, something that OVERRIDES supersedes everything else.
IMHO --author shouldn't be blocked by the new option.  Probably your
point is about "mine" name.
Cutting --author away would make impossible for someone to force a new
author with a new timestamp in case he is templating.  Of course he
can be using the --author because he is doing a change in a computer
not his own or something alike.  So I would not wipe "author" out from
the new option.
Please don't forget that I am just being a small contributor.  I am
just suggesting things.  You have the final word.

>>>>>> +     git commit -c HEAD <<EOF
>>>>>> +     "Changed"
>>>>>> +     EOF &&
>>>>>
>>>>> What editor is reading this "Changed"?
>>>>
>>>> Nobody cares...  Just a text to change the file.
>>>
>>> I actually care.  Who uses that Changed string, and where does it end up
>>> with?  At the end of the log message?  At the beginning?  What "file"?
>>
>> I didn't get it.  -c option does not accept -m option and starts an
>> editor to change the message.  The text "Changed is just a forced
>> message.  I can not use an editor in interactive mode in a script...
>
> How are the existing tests that try "commit -c" do this?  I do not think
> there is any here-text redirect into "git commit".

Sorry, it was automatic for me.  Just supposing a here-text...   :-)
I am going to fix it.

> It is sometimes easier to show by example than by giving nudging words
> that only show direction, so here is a suggested rewrite on top of your
> patch.  I am not very happy with the option name "mine" either, but at
> least I think this gets the semantics right.

We could call it --reset-author.  What do you think?

> +       if (force_author && renew_authorship)
> +               die("Using both --mine and --author does not make sense");
> +

As previously said up there.

^ permalink raw reply

* [ANNOUNCE] Grack - Rack-based Git Smart-HTTP Handler
From: Scott Chacon @ 2009-11-03 18:57 UTC (permalink / raw)
  To: git list

Just a quick note for those of you interested in running a smart-http
server once Shawns series graduates from 'pu' - I don't use Apache and
the provided git-http-backend CGI script only works with Apache
currently (and only CGI-supporting servers in general).  In order to
allow Git smart-http to work through a wider variety of servers, I
wrote a Rack application that does the same things that
git-http-backend does, in case CGI/Apache is not your particular bag
of fun.

Rack (http://rack.rubyforge.org/) is a Ruby webserver interface - you
can write an application for it and it has a bunch of handlers for
common webservers so you can deal with a middleware abstraction rather
than a specific server implementation.  This is nice because it means
the Rack app I wrote that provides (hopefully) identical functionality
to the git-http-backend script can run in the following webservers:

* Just about anything that supports CGI or FCGI
* Mongrel (and EventedMongrel and SwiftipliedMongrel)
* WEBrick
* SCGI
* LiteSpeed
* Thin
* Ebb
* Fuzed
* Phusion Passenger (which is mod_rack for Apache and for nginx)
* Unicorn

You can also generate a WAR file from it (via the Warbler project and
JRuby) that can be loaded into any Java application server (I tested
it on Glassfish, but Tomcat, Websphere, JBoss, Jetty, etc should all
work too).

The project is here:

http://github.com/schacon/grack

I've tested it on a few servers, I'll try to test it on more and
provide example setups for each.  If you use it, please let me know
how things go.

Scott

^ permalink raw reply

* determine if the tree is dirty
From: Adam Mercer @ 2009-11-03 18:57 UTC (permalink / raw)
  To: git

Hi

As part of a python script I need to determine if a tree has any
uncommitted changes, so far I am been using:

  # determine tree status
  status_cmd = 'git status'
  status_output = run_external_command(status_cmd,
honour_ret_code=False)[1].strip()
  if status_output.endswith('no changes added to commit (use "git add"
and/or "git commit -a")'):
    git_status = 'UNCLEAN: Some modifications not committed'
  else:
    git_status = 'CLEAN: All modifications committed'

but I feel that this relies to heavily on the porcelain and that there
should be a better way to accomplish this without relying on parsing
the output of git-status.

Does anyone know of a better way to accomplish this?

Cheers

Adam

^ permalink raw reply

* Re: determine if the tree is dirty
From: Jeff Epler @ 2009-11-03 19:06 UTC (permalink / raw)
  To: Adam Mercer; +Cc: git
In-Reply-To: <799406d60911031057l5dcb4d4fi3705cc66997ff7f7@mail.gmail.com>

On Tue, Nov 03, 2009 at 12:57:37PM -0600, Adam Mercer wrote:
> As part of a python script I need to determine if a tree has any
> uncommitted changes

GIT-VERSION-GEN uses something like this (shell script):
        git update-index -q --refresh
        test -z "$(git diff-index --name-only HEAD --)" || VN="$VN-dirty" ;;

Jeff

^ permalink raw reply

* Re: determine if the tree is dirty
From: Junio C Hamano @ 2009-11-03 19:19 UTC (permalink / raw)
  To: Adam Mercer; +Cc: git
In-Reply-To: <799406d60911031057l5dcb4d4fi3705cc66997ff7f7@mail.gmail.com>

Adam Mercer <ramercer@gmail.com> writes:

> As part of a python script I need to determine if a tree has any
> uncommitted changes, so far I am been using:
>
>   # determine tree status
>   status_cmd = 'git status'
>   status_output = run_external_command(status_cmd,
> honour_ret_code=False)[1].strip()
>   if status_output.endswith('no changes added to commit (use "git add"
> and/or "git commit -a")'):
>     git_status = 'UNCLEAN: Some modifications not committed'
>   else:
>     git_status = 'CLEAN: All modifications committed'
>
> but I feel that this relies to heavily on the porcelain and that there
> should be a better way to accomplish this without relying on parsing
> the output of git-status.
>
> Does anyone know of a better way to accomplish this?

Use plumbing commands.

"git diff-files" will show changes you have in the work tree compared to
the index.

"git diff-index HEAD" will show changes you have in the work tree compared
to the HEAD.

"git diff-index --cached HEAD" will show changes you have in the index
compared to the HEAD.

^ permalink raw reply

* Re: determine if the tree is dirty
From: Adam Mercer @ 2009-11-03 19:30 UTC (permalink / raw)
  To: Junio C Hamano, jepler; +Cc: git
In-Reply-To: <7v3a4vs9g3.fsf@alter.siamese.dyndns.org>

On Tue, Nov 3, 2009 at 13:06, Jeff Epler <jepler@unpythonic.net> wrote:

> GIT-VERSION-GEN uses something like this (shell script):
>        git update-index -q --refresh
>        test -z "$(git diff-index --name-only HEAD --)" || VN="$VN-dirty" ;;

On Tue, Nov 3, 2009 at 13:19, Junio C Hamano <gitster@pobox.com> wrote:

> Use plumbing commands.
>
> "git diff-files" will show changes you have in the work tree compared to
> the index.
>
> "git diff-index HEAD" will show changes you have in the work tree compared
> to the HEAD.
>
> "git diff-index --cached HEAD" will show changes you have in the index
> compared to the HEAD.

Fantastic, this is exactly what I was after! Thanks!

Cheers

Adam

^ permalink raw reply

* Re: gitweb - bare repos integration - owner info in description file
From: Petr Baudis @ 2009-11-03 20:22 UTC (permalink / raw)
  To: Eugene Sajine; +Cc: Johannes Schindelin, Jakub Narebski, git
In-Reply-To: <76c5b8580910121448q67edd935wb189c8a6f9af2f2e@mail.gmail.com>

On Mon, Oct 12, 2009 at 05:48:14PM -0400, Eugene Sajine wrote:
> Hi,
> 
> Somebody from development camp recently complained here that there is
> no many end users "chiming" about issues in the mailing list. Well,
> don't tell i didn't try;)
> 
> First I tried to use gitweb.url, gitweb.description and gitweb.owner
> files and none of them worked... gitweb is unable to pickup the info
> from those files.
> 
> Although it successfully interactively picks up info from description
> and cloneurl files. I didn't find a substitution for gitweb.owner...
> 
> I might be sent to RTFM again, but i would like to bring an attention
> to the fact that setting up bare repo with these simplest parameters
> as well as setting up gitweb is a USABILITY NIGHTMARE for beginners. I
> would even say more: while gitweb is very flexible and powerful, all
> its flexibility and power is hidden behind unusable management
> interface, which IMHO requires a lot of improvements . Rebuilding to
> configure? Perl look-and-feel for configuration variables? I think
> this is not the way to configure web applications no matter how smart
> and flexible application should be. There are some problems with XML,
> I don't care. Let's use simple property file. 1 property file! and let
> gitweb read it. don;t like this solution, propose yours..

I think you got confused by perhaps unclear gitweb/README wording. There
is a single property file, it's called "config" and _that's_ where you
set the gitweb configuration variables, in its gitweb section.

Try running

	git config gitweb.owner "Eugene Sajine"
	git config gitweb.description tralala

within the repository (and optionally marveling at the config file again
afterwards). Is this what you are after?

Perhaps the gitweb/README file doesn't make it clear enough that these
are gitweb configuration variables, not stand-alone files, and maybe it
should provide an example on how to set them. I'm sure that if you will
submit a patch for gitweb/README clarifying this, it will be welcome.

Kind regards,

-- 
				Petr "Pasky" Baudis
A lot of people have my books on their bookshelves.
That's the problem, they need to read them. -- Don Knuth

^ permalink raw reply

* Re: [PATCH] GitWeb + TopGit
From: Petr Baudis @ 2009-11-03 20:39 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: git
In-Reply-To: <1244027352-24055-1-git-send-email-bert.wesarg@googlemail.com>

  Hi!

On Wed, Jun 03, 2009 at 01:09:12PM +0200, Bert Wesarg wrote:
> I have changed gitweb to show topgit topics. log and shortlog shows
> only the history for refs/top-bases/$topic..$topic.
> 
> You can see it in action here:
> 
> http://kgb2.thruhere.net/git/?p=bertw/topgit.git;a=summary
> 
> This patch is based on the debian package gitweb-1.6.3.1-1.  If you'r
> interested I can rebase the patch on git.git.

  I'm very sorry I never got around to replying to this patch; I'd like
to add it to repo.or.cz now, would you still be interested in improving
it a little?

  Specifically, it would be necessary to show the topics section only if
the repository actually is topgit-controlled, that is it has the
refs/top-bases/ tree. If you could add that, I'm wondering if it would
be also suitable for gitweb upstream inclusion? Anyone...?

  Your gitweb above also has an extra 'patches' link in the shortlog
view - this would indeed be much useful to actually get the patch
introduced by the topic branch, however:

  (i) It is not included in this patch?
  (ii) It doesn't seem to work, giving a 400 error.
  (iii) It would be cool if it could also be added to the links in the
topic list.

  Thanks!

> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
> 
> ---
> diff --git a/gitweb.cgi b/gitweb.cgi
> index 820f073..fd9e64b 100755
> --- a/gitweb.cgi
> +++ b/gitweb.cgi
> @@ -5054,7 +5148,11 @@ sub git_log {
>  	}
>  	my $refs = git_get_references();
>  
> -	my @commitlist = parse_commits($hash, 101, (100 * $page));
> +	my $commit_hash = $hash;
> +	if (defined $hash_parent) {
> +		$commit_hash = "$hash_parent..$hash";
> +	}
> +	my @commitlist = parse_commits($commit_hash, 101, (100 * $page));
>  
>  	my $paging_nav = format_paging_nav('log', $hash, $head, $page, $#commitlist >= 100);
>  

  And this seems like overally useful gitweb addition.

-- 
				Petr "Pasky" Baudis
A lot of people have my books on their bookshelves.
That's the problem, they need to read them. -- Don Knuth

^ permalink raw reply

* [PATCH] git-update-index.txt: Document the --really-refresh option.
From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= @ 2009-11-03 20:59 UTC (permalink / raw)
  To: git


Signed-off-by: Štěpán Němec <stepnem@gmail.com>
---
I noticed that --really-refresh is included in SYNOPSIS, but otherwise
undocumented, although mentioned in the text and example.
This is an attempt at fixing that.

 Documentation/git-update-index.txt |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 25e0bbe..6052484 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -99,6 +99,10 @@ in the index e.g. when merging in a commit;
 thus, in case the assumed-untracked file is changed upstream,
 you will need to handle the situation manually.
 
+--really-refresh::
+	Like '--refresh', but checks stat information unconditionally,
+	without regard to the "assume unchanged" setting.
+
 -g::
 --again::
 	Runs 'git-update-index' itself on the paths whose index
@@ -308,7 +312,7 @@ Configuration
 -------------
 
 The command honors `core.filemode` configuration variable.  If
-your repository is on an filesystem whose executable bits are
+your repository is on a filesystem whose executable bits are
 unreliable, this should be set to 'false' (see linkgit:git-config[1]).
 This causes the command to ignore differences in file modes recorded
 in the index and the file mode on the filesystem if they differ only on
-- 
1.6.5.2.74.g610f9.dirty

^ permalink raw reply related

* [PATCH] t1200: cleanup and modernize test style
From: Stephen Boyd @ 2009-11-03 21:05 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

Many parts of the tests in t1200 are run outside the test harness,
circumventing the usefulness of -v and spewing messages to stdout when
-v isn't used. Fix these problems by modernizing the test a bit.

An extra test_done has existed since commit 6a74642 (git-commit --amend:
two fixes., 2006-04-20) leading to the last 6 tests never being run.
Remove it and teach the resolve merge test about fast-forward merges.

Finally, we remove the TODO notes, because fetch, push, and clone have
their own tests since t1200 was introduced and we're not going to add
them here 4 years later.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---

I saw some output when running this test and thought it could be modernized a
bit.

 t/t1200-tutorial.sh |  131 +++++++++++++++++++++++++++++----------------------
 1 files changed, 74 insertions(+), 57 deletions(-)

diff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh
index 67e637b..16c5b6d 100755
--- a/t/t1200-tutorial.sh
+++ b/t/t1200-tutorial.sh
@@ -7,14 +7,18 @@ test_description='A simple turial in the form of a test case'
 
 . ./test-lib.sh
 
-echo "Hello World" > hello
-echo "Silly example" > example
+test_expect_success 'blob'  '
+	echo "Hello World" > hello &&
+	echo "Silly example" > example &&
 
-git update-index --add hello example
+	git update-index --add hello example &&
 
-test_expect_success 'blob' "test blob = \"$(git cat-file -t 557db03)\""
+	test blob = "$(git cat-file -t 557db03)"
+'
 
-test_expect_success 'blob 557db03' "test \"Hello World\" = \"$(git cat-file blob 557db03)\""
+test_expect_success 'blob 557db03' '
+	test "Hello World" = "$(git cat-file blob 557db03)"
+'
 
 echo "It's a new day for git" >>hello
 cat > diff.expect << EOF
@@ -26,25 +30,33 @@ index 557db03..263414f 100644
  Hello World
 +It's a new day for git
 EOF
-git diff-files -p > diff.output
-test_expect_success 'git diff-files -p' 'cmp diff.expect diff.output'
-git diff > diff.output
-test_expect_success 'git diff' 'cmp diff.expect diff.output'
-
-tree=$(git write-tree 2>/dev/null)
 
-test_expect_success 'tree' "test 8988da15d077d4829fc51d8544c097def6644dbb = $tree"
+test_expect_success 'git diff-files -p' '
+	git diff-files -p > diff.output &&
+	cmp diff.expect diff.output
+'
 
-output="$(echo "Initial commit" | git commit-tree $(git write-tree) 2>&1 > .git/refs/heads/master)"
+test_expect_success 'git diff' '
+	git diff > diff.output &&
+	cmp diff.expect diff.output
+'
 
-git diff-index -p HEAD > diff.output
-test_expect_success 'git diff-index -p HEAD' 'cmp diff.expect diff.output'
+test_expect_success 'tree' '
+	tree=$(git write-tree 2>/dev/null)
+	test 8988da15d077d4829fc51d8544c097def6644dbb = $tree
+'
 
-git diff HEAD > diff.output
-test_expect_success 'git diff HEAD' 'cmp diff.expect diff.output'
+test_expect_success 'git diff-index -p HEAD' '
+	echo "Initial commit" | \
+	git commit-tree $(git write-tree) 2>&1 > .git/refs/heads/master &&
+	git diff-index -p HEAD > diff.output &&
+	cmp diff.expect diff.output
+'
 
-#rm hello
-#test_expect_success 'git read-tree --reset HEAD' "git read-tree --reset HEAD ; test \"hello: needs update\" = \"$(git update-index --refresh)\""
+test_expect_success 'git diff HEAD' '
+	git diff HEAD > diff.output &&
+	cmp diff.expect diff.output
+'
 
 cat > whatchanged.expect << EOF
 commit VARIABLE
@@ -69,39 +81,45 @@ index 0000000..557db03
 +Hello World
 EOF
 
-git whatchanged -p --root | \
-	sed -e "1s/^\(.\{7\}\).\{40\}/\1VARIABLE/" \
+test_expect_success 'git whatchanged -p --root' '
+	git whatchanged -p --root | \
+		sed -e "1s/^\(.\{7\}\).\{40\}/\1VARIABLE/" \
 		-e "2,3s/^\(.\{8\}\).*$/\1VARIABLE/" \
-> whatchanged.output
-test_expect_success 'git whatchanged -p --root' 'cmp whatchanged.expect whatchanged.output'
-
-git tag my-first-tag
-test_expect_success 'git tag my-first-tag' 'cmp .git/refs/heads/master .git/refs/tags/my-first-tag'
+	> whatchanged.output &&
+	cmp whatchanged.expect whatchanged.output
+'
 
-# TODO: test git clone
+test_expect_success 'git tag my-first-tag' '
+	git tag my-first-tag &&
+	cmp .git/refs/heads/master .git/refs/tags/my-first-tag
+'
 
-git checkout -b mybranch
-test_expect_success 'git checkout -b mybranch' 'cmp .git/refs/heads/master .git/refs/heads/mybranch'
+test_expect_success 'git checkout -b mybranch' '
+	git checkout -b mybranch &&
+	cmp .git/refs/heads/master .git/refs/heads/mybranch
+'
 
 cat > branch.expect <<EOF
   master
 * mybranch
 EOF
 
-git branch > branch.output
-test_expect_success 'git branch' 'cmp branch.expect branch.output'
+test_expect_success 'git branch' '
+	git branch > branch.output &&
+	cmp branch.expect branch.output
+'
 
-git checkout mybranch
-echo "Work, work, work" >>hello
-git commit -m 'Some work.' -i hello
+test_expect_success 'git resolve now fails' '
+	git checkout mybranch &&
+	echo "Work, work, work" >>hello &&
+	git commit -m "Some work." -i hello &&
 
-git checkout master
+	git checkout master &&
 
-echo "Play, play, play" >>hello
-echo "Lots of fun" >>example
-git commit -m 'Some fun.' -i hello example
+	echo "Play, play, play" >>hello &&
+	echo "Lots of fun" >>example &&
+	git commit -m "Some fun." -i hello example &&
 
-test_expect_success 'git resolve now fails' '
 	test_must_fail git merge -m "Merge work in mybranch" mybranch
 '
 
@@ -112,10 +130,6 @@ Play, play, play
 Work, work, work
 EOF
 
-git commit -m 'Merged "mybranch" changes.' -i hello
-
-test_done
-
 cat > show-branch.expect << EOF
 * [master] Merged "mybranch" changes.
  ! [mybranch] Some work.
@@ -124,21 +138,26 @@ cat > show-branch.expect << EOF
 *+ [mybranch] Some work.
 EOF
 
-git show-branch --topo-order master mybranch > show-branch.output
-test_expect_success 'git show-branch' 'cmp show-branch.expect show-branch.output'
-
-git checkout mybranch
+test_expect_success 'git show-branch' '
+	git commit -m "Merged \"mybranch\" changes." -i hello &&
+	git show-branch --topo-order master mybranch > show-branch.output &&
+	cmp show-branch.expect show-branch.output
+'
 
 cat > resolve.expect << EOF
-Updating from VARIABLE to VARIABLE
+Updating VARIABLE..VARIABLE
+Fast forward
  example |    1 +
  hello   |    1 +
  2 files changed, 2 insertions(+), 0 deletions(-)
 EOF
 
-git merge -s "Merge upstream changes." master | \
-	sed -e "1s/[0-9a-f]\{40\}/VARIABLE/g" >resolve.output
-test_expect_success 'git resolve' 'cmp resolve.expect resolve.output'
+test_expect_success 'git resolve' '
+	git checkout mybranch &&
+	git merge -s resolve master | \
+		sed -e "1s/[0-9a-f]\{7\}/VARIABLE/g" >resolve.output &&
+	cmp resolve.expect resolve.output
+'
 
 cat > show-branch2.expect << EOF
 ! [master] Merged "mybranch" changes.
@@ -147,12 +166,10 @@ cat > show-branch2.expect << EOF
 -- [master] Merged "mybranch" changes.
 EOF
 
-git show-branch --topo-order master mybranch > show-branch2.output
-test_expect_success 'git show-branch' 'cmp show-branch2.expect show-branch2.output'
-
-# TODO: test git fetch
-
-# TODO: test git push
+test_expect_success 'git show-branch' '
+	git show-branch --topo-order master mybranch > show-branch2.output &&
+	cmp show-branch2.expect show-branch2.output
+'
 
 test_expect_success 'git repack' 'git repack'
 test_expect_success 'git prune-packed' 'git prune-packed'
-- 
1.6.5.2.181.gd6f41

^ permalink raw reply related

* Re: determine if the tree is dirty
From: Markus Hitter @ 2009-11-03 21:07 UTC (permalink / raw)
  To: Adam Mercer; +Cc: git
In-Reply-To: <799406d60911031057l5dcb4d4fi3705cc66997ff7f7@mail.gmail.com>


Am 03.11.2009 um 19:57 schrieb Adam Mercer:

> As part of a python script I need to determine if a tree has any
> uncommitted changes, so far I am been using:
> [...]
> Does anyone know of a better way to accomplish this?

I'm using

git ls-files -m -o -d --exclude-standard

If it returns anything, your repo is dirty.


Markus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/

^ permalink raw reply

* [PATCH] commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author
From: Erick Mattos @ 2009-11-03 21:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Erick Mattos

When we use one of the options above we are normally trying to do mainly
two things: using the source as a template or recreating a commit with
corrections.

When they are used, the authorship and timestamp recorded in the newly
created commit are always taken from the original commit.  And they
should not when we are using it as a template or when our change to the
code is so significant that we should take over the authorship (with the
blame for bugs we introduce, of course).

The new --reset-author option is meant to solve this need by
regenerating the timestamp and setting as the new author the committer
or the one specified by --author option.

Signed-off-by: Erick Mattos <erick.mattos@gmail.com>
---
 Documentation/git-commit.txt |    7 +++-
 builtin-commit.c             |    9 +++-
 t/t7509-commit.sh            |   94 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 106 insertions(+), 4 deletions(-)
 create mode 100755 t/t7509-commit.sh

diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 0578a40..f89db9a 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -9,7 +9,7 @@ SYNOPSIS
 --------
 [verse]
 'git commit' [-a | --interactive] [-s] [-v] [-u<mode>] [--amend] [--dry-run]
-	   [(-c | -C) <commit>] [-F <file> | -m <msg>]
+	   [(-c | -C) <commit>] [-F <file> | -m <msg>] [--reset-author]
 	   [--allow-empty] [--no-verify] [-e] [--author=<author>]
 	   [--cleanup=<mode>] [--] [[-i | -o ]<file>...]
 
@@ -69,6 +69,11 @@ OPTIONS
 	Like '-C', but with '-c' the editor is invoked, so that
 	the user can further edit the commit message.
 
+--reset-author::
+	When used with -C/-c/--amend options, declare that the
+	authorship of the resulting commit now belongs of the committer.
+	This also renews the author timestamp.
+
 -F <file>::
 --file=<file>::
 	Take the commit message from the given file.  Use '-' to
diff --git a/builtin-commit.c b/builtin-commit.c
index beddf01..6b51a1b 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -51,7 +51,7 @@ static const char *template_file;
 static char *edit_message, *use_message;
 static char *author_name, *author_email, *author_date;
 static int all, edit_flag, also, interactive, only, amend, signoff;
-static int quiet, verbose, no_verify, allow_empty, dry_run;
+static int quiet, verbose, no_verify, allow_empty, dry_run, renew_authorship;
 static char *untracked_files_arg;
 /*
  * The default commit message cleanup mode will remove the lines
@@ -91,8 +91,9 @@ static struct option builtin_commit_options[] = {
 	OPT_FILENAME('F', "file", &logfile, "read log from file"),
 	OPT_STRING(0, "author", &force_author, "AUTHOR", "override author for commit"),
 	OPT_CALLBACK('m', "message", &message, "MESSAGE", "specify commit message", opt_parse_m),
-	OPT_STRING('c', "reedit-message", &edit_message, "COMMIT", "reuse and edit message from specified commit "),
+	OPT_STRING('c', "reedit-message", &edit_message, "COMMIT", "reuse and edit message from specified commit"),
 	OPT_STRING('C', "reuse-message", &use_message, "COMMIT", "reuse message from specified commit"),
+	OPT_BOOLEAN(0, "reset-author", &renew_authorship, "reset timestamp and authorship to committer"),
 	OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by:"),
 	OPT_FILENAME('t', "template", &template_file, "use specified template file"),
 	OPT_BOOLEAN('e', "edit", &edit_flag, "force edit of commit"),
@@ -381,7 +382,7 @@ static void determine_author_info(void)
 	email = getenv("GIT_AUTHOR_EMAIL");
 	date = getenv("GIT_AUTHOR_DATE");
 
-	if (use_message) {
+	if (use_message && !renew_authorship) {
 		const char *a, *lb, *rb, *eol;
 
 		a = strstr(use_message_buffer, "\nauthor ");
@@ -780,6 +781,8 @@ static int parse_and_validate_options(int argc, const char *argv[],
 		use_message = edit_message;
 	if (amend && !use_message)
 		use_message = "HEAD";
+	if (!use_message && renew_authorship)
+		die("Option --reset-author is used only with -C/-c/--amend.");
 	if (use_message) {
 		unsigned char sha1[20];
 		static char utf8[] = "UTF-8";
diff --git a/t/t7509-commit.sh b/t/t7509-commit.sh
new file mode 100755
index 0000000..7290242
--- /dev/null
+++ b/t/t7509-commit.sh
@@ -0,0 +1,94 @@
+#!/bin/sh
+#
+# Copyright (c) 2009 Erick Mattos
+#
+
+test_description='git commit
+
+Tests for --reset-author option on a commit.'
+
+. ./test-lib.sh
+
+TEST_FILE=foo
+
+test_expect_success '-C without --reset-author uses the author from the old commit' '
+	echo "initial" > "$TEST_FILE" &&
+	git add "$TEST_FILE" &&
+	git commit -m "Initial Commit" --author "Frigate <flying@over.world>" &&
+	test_tick &&
+	echo "Test 1" >> "$TEST_FILE" &&
+	git add "$TEST_FILE" &&
+	git commit -C HEAD &&
+	git cat-file -p HEAD^ | sed -e "/^parent/d" -e "/^tree/d" \
+		-e "/^committer/d" > commit_1 &&
+	git cat-file -p HEAD | sed -e "/^parent/d" -e "/^tree/d" \
+		-e "/^committer/d" > commit_2 &&
+	test_cmp commit_1 commit_2
+'
+
+test_expect_success '-C with --reset-author makes me the author' '
+	test_tick &&
+	echo "Test 2" >> "$TEST_FILE" &&
+	git add "$TEST_FILE" &&
+	git commit -C HEAD^ --reset-author &&
+	git cat-file -p HEAD^ | grep "^author" > commit_1 &&
+	git cat-file -p HEAD | grep "^author" > commit_2 &&
+	test "$(cat commit_1 | sed "s/.*> //")" !=\
+		"$(cat commit_2 | sed "s/.*> //")" &&
+	test "$(cat commit_2 | sed -e "s/author //" -e "s/>.*/>/")" =\
+		"$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>"
+'
+
+test_expect_success '-c without --reset-author uses the author from the old commit' '
+	echo "Initial" > "$TEST_FILE" &&
+	git add "$TEST_FILE" &&
+	git commit -m "Initial Commit" --author "Frigate <flying@over.world>" &&
+	test_tick &&
+	echo "Test 3" >> "$TEST_FILE" &&
+	git add "$TEST_FILE" &&
+	EDITOR=: VISUAL=: git commit -c HEAD
+	git cat-file -p HEAD^ | grep "^author" > commit_1 &&
+	git cat-file -p HEAD | grep "^author" > commit_2 &&
+	test_cmp commit_1 commit_2
+'
+
+test_expect_success '-c with --reset-author makes me the author' '
+	test_tick &&
+	echo "Test 4" >> "$TEST_FILE" &&
+	git add "$TEST_FILE" &&
+	EDITOR=: VISUAL=: git commit -c HEAD^ --reset-author
+	git cat-file -p HEAD^ | grep "^author" > commit_1 &&
+	git cat-file -p HEAD | grep "^author" > commit_2 &&
+	test "$(cat commit_1 | sed "s/.*> //")" !=\
+		"$(cat commit_2 | sed "s/.*> //")" &&
+	test "$(cat commit_2 | sed -e "s/author //" -e "s/>.*/>/")" =\
+		"$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>"
+'
+
+test_expect_success '--amend without --reset-author uses the author from the old commit' '
+	echo "Initial" > "$TEST_FILE" &&
+	git add "$TEST_FILE" &&
+	git commit -m "Initial Commit" --author "Frigate <flying@over.world>" &&
+	echo "Test 5" >> "$TEST_FILE" &&
+	git add "$TEST_FILE" &&
+	git commit -m "--amend test" &&
+	git cat-file -p HEAD | grep "^author" > commit_1 &&
+	test_tick &&
+	git commit -m "Changed" --amend &&
+	git cat-file -p HEAD | grep "^author" > commit_2 &&
+	test_cmp commit_1 commit_2
+'
+
+test_expect_success '--amend with --reset-author makes me the author' '
+	test_tick &&
+	echo "Test 6" >> "$TEST_FILE" &&
+	git add "$TEST_FILE" &&
+	git commit -m "Changed again" --amend --reset-author &&
+	git cat-file -p HEAD | grep "^author" > commit_1 &&
+	test "$(cat commit_1 | sed "s/.*> //")" !=\
+		"$(cat commit_2 | sed "s/.*> //")" &&
+	test "$(cat commit_2 | sed -e "s/author //" -e "s/>.*/>/")" =\
+		"$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>"
+'
+
+test_done
-- 
1.6.5.2.144.g1babf

^ permalink raw reply related

* [PATCH bg/format-patch-p-noop] log-tree: always add --- marker when options are patch and a stat
From: Stephen Boyd @ 2009-11-03 21:24 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Björn Gustavsson

Previously, the three dash marker (---) would only be added if the diff
output format was a patch and diffstat (usually -p and --stat). Now that
patches are always generated by format-patch regardless of the stat
format being used (--stat, --raw, --numstat, etc.), always add the three
dash marker when a patch is being generated and a stat option is used.

This allows users to choose the stat format they want and unifies the
format of patches with stats. It also make patches easier to apply when
generated by format-patch with non-standard stat options as the stat is
no longer considered part of the commit message.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---

It seems that after looking at this series it would be better if the
marker is always displayed even when a user has used a non-standard
stat option with format-patch.

I'm not sure this is wanted though and I guess this could break people's
scripts. Are people actually using --numstat or --raw to put the stat into
the commit message?

 log-tree.c                                         |    5 +++--
 ...f-tree_--pretty_--root_--patch-with-raw_initial |    2 +-
 t/t4013/diff.show_--patch-with-raw_side            |    2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/log-tree.c b/log-tree.c
index 1618f3c..1871c6c 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -461,8 +461,9 @@ int log_tree_diff_flush(struct rev_info *opt)
 		if ((opt->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT) &&
 		    opt->verbose_header &&
 		    opt->commit_format != CMIT_FMT_ONELINE) {
-			int pch = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;
-			if ((pch & opt->diffopt.output_format) == pch)
+			int pch = DIFF_FORMAT_PATCH;
+			int fmt = opt->diffopt.output_format;
+			if (pch & fmt && pch ^ fmt)
 				printf("---");
 			putchar('\n');
 		}
diff --git a/t/t4013/diff.diff-tree_--pretty_--root_--patch-with-raw_initial b/t/t4013/diff.diff-tree_--pretty_--root_--patch-with-raw_initial
index a3203bd..2f4fec9 100644
--- a/t/t4013/diff.diff-tree_--pretty_--root_--patch-with-raw_initial
+++ b/t/t4013/diff.diff-tree_--pretty_--root_--patch-with-raw_initial
@@ -4,7 +4,7 @@ Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:00:00 2006 +0000
 
     Initial
-
+---
 :000000 100644 0000000000000000000000000000000000000000 35d242ba79ae89ac695e26b3d4c27a8e6f028f9e A	dir/sub
 :000000 100644 0000000000000000000000000000000000000000 01e79c32a8c99c557f0757da7cb6d65b3414466d A	file0
 :000000 100644 0000000000000000000000000000000000000000 01e79c32a8c99c557f0757da7cb6d65b3414466d A	file2
diff --git a/t/t4013/diff.show_--patch-with-raw_side b/t/t4013/diff.show_--patch-with-raw_side
index 221b46a..b7566be 100644
--- a/t/t4013/diff.show_--patch-with-raw_side
+++ b/t/t4013/diff.show_--patch-with-raw_side
@@ -4,7 +4,7 @@ Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:03:00 2006 +0000
 
     Side
-
+---
 :100644 100644 35d242b... 7289e35... M	dir/sub
 :100644 100644 01e79c3... f4615da... M	file0
 :000000 100644 0000000... 7289e35... A	file3
-- 
1.6.5.2.181.gd6f41

^ permalink raw reply related

* [PATCH 0/1] Port of pthreads to Windows API threads
From: Andrzej K. Haczewski @ 2009-11-03 21:30 UTC (permalink / raw)
  To: git; +Cc: Andrzej K. Haczewski

Here is a small patch that allows use of native Windows API threads for
where git uses pthreads. I don't have full msysgit environment to test it,
all I know is it compiles, so someone else could test it a little. I enabled
it for MSVC only (since msysgit uses win32-pthreads and cygwin has it's own).
I assume that patch could help with getting rid of that one dependency for
msysgit.

PS. I'm new here (actually new for whole kernel-like-development-cycle-with-
patches-flying-low-on-mailing-lists), so please be kind to my stupidity for
a while... please? ;-)

Andrzej K. Haczewski (1):
  MSVC: port pthread code to native Windows threads

 Makefile               |    2 +-
 builtin-pack-objects.c |   42 +++++++++-
 compat/winthread.h     |  219 ++++++++++++++++++++++++++++++++++++++++++++++++
 preload-index.c        |   12 +++
 4 files changed, 272 insertions(+), 3 deletions(-)
 create mode 100644 compat/winthread.h

^ permalink raw reply

* [PATCH 1/1] MSVC: port pthread code to native Windows threads
From: Andrzej K. Haczewski @ 2009-11-03 21:30 UTC (permalink / raw)
  To: git; +Cc: Andrzej K. Haczewski
In-Reply-To: <1257283802-29726-1-git-send-email-ahaczewski@gmail.com>

---
 Makefile               |    2 +-
 builtin-pack-objects.c |   42 +++++++++-
 compat/winthread.h     |  219 ++++++++++++++++++++++++++++++++++++++++++++++++
 preload-index.c        |   12 +++
 4 files changed, 272 insertions(+), 3 deletions(-)
 create mode 100644 compat/winthread.h

diff --git a/Makefile b/Makefile
index 28d6ecf..126ab43 100644
--- a/Makefile
+++ b/Makefile
@@ -940,7 +940,7 @@ ifdef MSVC
 	OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
 	NO_REGEX = YesPlease
 	NO_CURL = YesPlease
-	NO_PTHREADS = YesPlease
+	THREADED_DELTA_SEARCH = YesPlease
 	BLK_SHA1 = YesPlease
 
 	CC = compat/vcbuild/scripts/clink.pl
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 02f9246..a8a4f59 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -18,8 +18,12 @@
 #include "refs.h"
 
 #ifdef THREADED_DELTA_SEARCH
-#include "thread-utils.h"
-#include <pthread.h>
+# include "thread-utils.h"
+# ifndef _WIN32
+#  include <pthread.h>
+# else
+#  include <winthread.h>
+# endif
 #endif
 
 static const char pack_usage[] =
@@ -1592,7 +1596,11 @@ struct thread_params {
 
 static pthread_cond_t progress_cond = PTHREAD_COND_INITIALIZER;
 
+#ifndef _WIN32
 static void *threaded_find_deltas(void *arg)
+#else
+static DWORD WINAPI threaded_find_deltas(LPVOID arg)
+#endif
 {
 	struct thread_params *me = arg;
 
@@ -1620,7 +1628,11 @@ static void *threaded_find_deltas(void *arg)
 		pthread_mutex_unlock(&me->mutex);
 	}
 	/* leave ->working 1 so that this doesn't get more work assigned */
+#ifndef _WIN32
 	return NULL;
+#else
+	return 0;
+#endif
 }
 
 static void ll_find_deltas(struct object_entry **list, unsigned list_size,
@@ -2327,6 +2339,18 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 #ifdef THREADED_DELTA_SEARCH
 	if (!delta_search_threads)	/* --threads=0 means autodetect */
 		delta_search_threads = online_cpus();
+
+#ifdef _WIN32
+	/*
+	 * Windows require initialization of mutex (CRITICAL_SECTION)
+	 * and conditional variable.
+	 */
+	pthread_mutex_init(&read_mutex);
+	pthread_mutex_init(&cache_mutex);
+	pthread_mutex_init(&progress_mutex);
+	win32_cond_init(&progress_cond);
+#endif
+
 #endif
 
 	prepare_packed_git();
@@ -2345,7 +2369,11 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 	stop_progress(&progress_state);
 
 	if (non_empty && !nr_result)
+#if defined(THREADED_DELTA_SEARCH) && defined(_WIN32)
+		goto cleanup;
+#else
 		return 0;
+#endif
 	if (nr_result)
 		prepare_pack(window, depth);
 	write_pack_file();
@@ -2353,5 +2381,15 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 		fprintf(stderr, "Total %"PRIu32" (delta %"PRIu32"),"
 			" reused %"PRIu32" (delta %"PRIu32")\n",
 			written, written_delta, reused, reused_delta);
+
+#if defined(THREADED_DELTA_SEARCH) && defined(_WIN32)
+cleanup:
+	/* cleanup Windows threads thingies */
+	win32_cond_destroy(&progress_cond);
+	pthread_mutex_destroy(&read_mutex);
+	pthread_mutex_destroy(&cache_mutex);
+	pthread_mutex_destroy(&progress_mutex);
+#endif
+
 	return 0;
 }
diff --git a/compat/winthread.h b/compat/winthread.h
new file mode 100644
index 0000000..32c9010
--- /dev/null
+++ b/compat/winthread.h
@@ -0,0 +1,219 @@
+/*
+ * Header used to "adapt" pthread-based POSIX code to Windows API threads.
+ *
+ * Copyright (C) 2009 Andrzej K. Haczewski <ahaczewski@gmail.com>
+ */
+
+#ifndef WINTHREAD_H
+#define WINTHREAD_H
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+/* Implement simple condition variable for Windows threads, based on ACE implementation */
+typedef struct win32_cond {
+	LONG waiters;
+	CRITICAL_SECTION waiters_lock;
+	HANDLE sema;
+} win32_cond_t;
+
+#define PTHREAD_COND_INITIALIZER { 0, { 0 }, NULL }
+
+static __inline int win32_cond_init(win32_cond_t *cond)
+{
+	cond->waiters = 0;
+
+	InitializeCriticalSection(&cond->waiters_lock);
+
+	cond->sema = CreateSemaphore(NULL, 0, LONG_MAX, NULL);
+	if (NULL == cond->sema)
+		return -1;
+	return 0;
+}
+
+static __inline int win32_cond_destroy(win32_cond_t *cond)
+{
+	CloseHandle(cond->sema);
+	cond->sema = NULL;
+
+	DeleteCriticalSection(&cond->waiters_lock);
+
+	return 0;
+}
+
+static __inline int win32_cond_wait(win32_cond_t *cond, CRITICAL_SECTION *mutex)
+{
+	DWORD result;
+	int ret = 0;
+
+	/* we're waiting... */
+	EnterCriticalSection(&cond->waiters_lock);
+	++cond->waiters;
+	LeaveCriticalSection(&cond->waiters_lock);
+
+	/* unlock external mutex and wait for signal */
+	LeaveCriticalSection(mutex);
+	result = WaitForSingleObject(cond->sema, INFINITE);
+
+	if (0 != result)
+		ret = -1;
+
+	/* one waiter less */
+	EnterCriticalSection(&cond->waiters_lock);
+	--cond->waiters;
+	LeaveCriticalSection(&cond->waiters_lock);
+
+	/* lock external mutex again */
+	EnterCriticalSection(mutex);
+
+	return ret;
+}
+
+static __inline int win32_cond_signal(win32_cond_t *cond)
+{
+	int have_waiters;
+
+	EnterCriticalSection(&cond->waiters_lock);
+	have_waiters = cond->waiters > 0;
+	LeaveCriticalSection(&cond->waiters_lock);
+
+	if (have_waiters)
+		return ReleaseSemaphore(cond->sema, 1, NULL) ? 0 : -1;
+	else
+		return 0;
+}
+
+#define pthread_t HANDLE
+#define pthread_mutex_t CRITICAL_SECTION
+#define pthread_cond_t win32_cond_t
+
+#define PTHREAD_MUTEX_INITIALIZER { 0 }
+
+#define pthread_mutex_init(a,b) InitializeCriticalSection((a))
+#define pthread_mutex_destroy(a) DeleteCriticalSection((a))
+#define pthread_mutex_lock EnterCriticalSection
+#define pthread_mutex_unlock LeaveCriticalSection
+
+#define pthread_cond_init(a,b) win32_cond_init((a))
+#define pthread_cond_destroy win32_cond_destroy
+#define pthread_cond_wait(a,b) win32_cond_wait((a), (b))
+#define pthread_cond_signal win32_cond_signal
+
+#define pthread_create(a,b,c,d) ((NULL == (*(a) = CreateThread(NULL, 0, (c), (d), 0, NULL))) ? (errno = err_win_to_posix(), -1) : (errno = 0, 0))
+#define pthread_join(a,b) ((WAIT_OBJECT_0 == WaitForSingleObject((a), INFINITE)) ? 0 : -1)
+
+/* almost copy-paste code of mingw.c */
+static int err_win_to_posix()
+{
+	int error = ENOSYS;
+	switch(GetLastError()) {
+	case ERROR_ACCESS_DENIED: error = EACCES; break;
+	case ERROR_ACCOUNT_DISABLED: error = EACCES; break;
+	case ERROR_ACCOUNT_RESTRICTION: error = EACCES; break;
+	case ERROR_ALREADY_ASSIGNED: error = EBUSY; break;
+	case ERROR_ALREADY_EXISTS: error = EEXIST; break;
+	case ERROR_ARITHMETIC_OVERFLOW: error = ERANGE; break;
+	case ERROR_BAD_COMMAND: error = EIO; break;
+	case ERROR_BAD_DEVICE: error = ENODEV; break;
+	case ERROR_BAD_DRIVER_LEVEL: error = ENXIO; break;
+	case ERROR_BAD_EXE_FORMAT: error = ENOEXEC; break;
+	case ERROR_BAD_FORMAT: error = ENOEXEC; break;
+	case ERROR_BAD_LENGTH: error = EINVAL; break;
+	case ERROR_BAD_PATHNAME: error = ENOENT; break;
+	case ERROR_BAD_PIPE: error = EPIPE; break;
+	case ERROR_BAD_UNIT: error = ENODEV; break;
+	case ERROR_BAD_USERNAME: error = EINVAL; break;
+	case ERROR_BROKEN_PIPE: error = EPIPE; break;
+	case ERROR_BUFFER_OVERFLOW: error = ENAMETOOLONG; break;
+	case ERROR_BUSY: error = EBUSY; break;
+	case ERROR_BUSY_DRIVE: error = EBUSY; break;
+	case ERROR_CALL_NOT_IMPLEMENTED: error = ENOSYS; break;
+	case ERROR_CANNOT_MAKE: error = EACCES; break;
+	case ERROR_CANTOPEN: error = EIO; break;
+	case ERROR_CANTREAD: error = EIO; break;
+	case ERROR_CANTWRITE: error = EIO; break;
+	case ERROR_CRC: error = EIO; break;
+	case ERROR_CURRENT_DIRECTORY: error = EACCES; break;
+	case ERROR_DEVICE_IN_USE: error = EBUSY; break;
+	case ERROR_DEV_NOT_EXIST: error = ENODEV; break;
+	case ERROR_DIRECTORY: error = EINVAL; break;
+	case ERROR_DIR_NOT_EMPTY: error = ENOTEMPTY; break;
+	case ERROR_DISK_CHANGE: error = EIO; break;
+	case ERROR_DISK_FULL: error = ENOSPC; break;
+	case ERROR_DRIVE_LOCKED: error = EBUSY; break;
+	case ERROR_ENVVAR_NOT_FOUND: error = EINVAL; break;
+	case ERROR_EXE_MARKED_INVALID: error = ENOEXEC; break;
+	case ERROR_FILENAME_EXCED_RANGE: error = ENAMETOOLONG; break;
+	case ERROR_FILE_EXISTS: error = EEXIST; break;
+	case ERROR_FILE_INVALID: error = ENODEV; break;
+	case ERROR_FILE_NOT_FOUND: error = ENOENT; break;
+	case ERROR_GEN_FAILURE: error = EIO; break;
+	case ERROR_HANDLE_DISK_FULL: error = ENOSPC; break;
+	case ERROR_INSUFFICIENT_BUFFER: error = ENOMEM; break;
+	case ERROR_INVALID_ACCESS: error = EACCES; break;
+	case ERROR_INVALID_ADDRESS: error = EFAULT; break;
+	case ERROR_INVALID_BLOCK: error = EFAULT; break;
+	case ERROR_INVALID_DATA: error = EINVAL; break;
+	case ERROR_INVALID_DRIVE: error = ENODEV; break;
+	case ERROR_INVALID_EXE_SIGNATURE: error = ENOEXEC; break;
+	case ERROR_INVALID_FLAGS: error = EINVAL; break;
+	case ERROR_INVALID_FUNCTION: error = ENOSYS; break;
+	case ERROR_INVALID_HANDLE: error = EBADF; break;
+	case ERROR_INVALID_LOGON_HOURS: error = EACCES; break;
+	case ERROR_INVALID_NAME: error = EINVAL; break;
+	case ERROR_INVALID_OWNER: error = EINVAL; break;
+	case ERROR_INVALID_PARAMETER: error = EINVAL; break;
+	case ERROR_INVALID_PASSWORD: error = EPERM; break;
+	case ERROR_INVALID_PRIMARY_GROUP: error = EINVAL; break;
+	case ERROR_INVALID_SIGNAL_NUMBER: error = EINVAL; break;
+	case ERROR_INVALID_TARGET_HANDLE: error = EIO; break;
+	case ERROR_INVALID_WORKSTATION: error = EACCES; break;
+	case ERROR_IO_DEVICE: error = EIO; break;
+	case ERROR_IO_INCOMPLETE: error = EINTR; break;
+	case ERROR_LOCKED: error = EBUSY; break;
+	case ERROR_LOCK_VIOLATION: error = EACCES; break;
+	case ERROR_LOGON_FAILURE: error = EACCES; break;
+	case ERROR_MAPPED_ALIGNMENT: error = EINVAL; break;
+	case ERROR_META_EXPANSION_TOO_LONG: error = E2BIG; break;
+	case ERROR_MORE_DATA: error = EPIPE; break;
+	case ERROR_NEGATIVE_SEEK: error = ESPIPE; break;
+	case ERROR_NOACCESS: error = EFAULT; break;
+	case ERROR_NONE_MAPPED: error = EINVAL; break;
+	case ERROR_NOT_ENOUGH_MEMORY: error = ENOMEM; break;
+	case ERROR_NOT_READY: error = EAGAIN; break;
+	case ERROR_NOT_SAME_DEVICE: error = EXDEV; break;
+	case ERROR_NO_DATA: error = EPIPE; break;
+	case ERROR_NO_MORE_SEARCH_HANDLES: error = EIO; break;
+	case ERROR_NO_PROC_SLOTS: error = EAGAIN; break;
+	case ERROR_NO_SUCH_PRIVILEGE: error = EACCES; break;
+	case ERROR_OPEN_FAILED: error = EIO; break;
+	case ERROR_OPEN_FILES: error = EBUSY; break;
+	case ERROR_OPERATION_ABORTED: error = EINTR; break;
+	case ERROR_OUTOFMEMORY: error = ENOMEM; break;
+	case ERROR_PASSWORD_EXPIRED: error = EACCES; break;
+	case ERROR_PATH_BUSY: error = EBUSY; break;
+	case ERROR_PATH_NOT_FOUND: error = ENOENT; break;
+	case ERROR_PIPE_BUSY: error = EBUSY; break;
+	case ERROR_PIPE_CONNECTED: error = EPIPE; break;
+	case ERROR_PIPE_LISTENING: error = EPIPE; break;
+	case ERROR_PIPE_NOT_CONNECTED: error = EPIPE; break;
+	case ERROR_PRIVILEGE_NOT_HELD: error = EACCES; break;
+	case ERROR_READ_FAULT: error = EIO; break;
+	case ERROR_SEEK: error = EIO; break;
+	case ERROR_SEEK_ON_DEVICE: error = ESPIPE; break;
+	case ERROR_SHARING_BUFFER_EXCEEDED: error = ENFILE; break;
+	case ERROR_SHARING_VIOLATION: error = EACCES; break;
+	case ERROR_STACK_OVERFLOW: error = ENOMEM; break;
+	case ERROR_SWAPERROR: error = ENOENT; break;
+	case ERROR_TOO_MANY_MODULES: error = EMFILE; break;
+	case ERROR_TOO_MANY_OPEN_FILES: error = EMFILE; break;
+	case ERROR_UNRECOGNIZED_MEDIA: error = ENXIO; break;
+	case ERROR_UNRECOGNIZED_VOLUME: error = ENODEV; break;
+	case ERROR_WAIT_NO_CHILDREN: error = ECHILD; break;
+	case ERROR_WRITE_FAULT: error = EIO; break;
+	case ERROR_WRITE_PROTECT: error = EROFS; break;
+	}
+	return error;
+}
+
+#endif /* WINTHREAD_H */
diff --git a/preload-index.c b/preload-index.c
index 9289933..6d69a8d 100644
--- a/preload-index.c
+++ b/preload-index.c
@@ -10,7 +10,11 @@ static void preload_index(struct index_state *index, const char **pathspec)
 }
 #else
 
+#ifndef _WIN32
 #include <pthread.h>
+#else
+#include <winthread.h>
+#endif
 
 /*
  * Mostly randomly chosen maximum thread counts: we
@@ -28,7 +32,11 @@ struct thread_data {
 	int offset, nr;
 };
 
+#ifndef _WIN32
 static void *preload_thread(void *_data)
+#else
+static DWORD WINAPI preload_thread(LPVOID _data)
+#endif
 {
 	int nr;
 	struct thread_data *p = _data;
@@ -59,7 +67,11 @@ static void *preload_thread(void *_data)
 			continue;
 		ce_mark_uptodate(ce);
 	} while (--nr > 0);
+#ifndef _WIN32
 	return NULL;
+#else
+	return 0;
+#endif
 }
 
 static void preload_index(struct index_state *index, const char **pathspec)
-- 
1.6.5.2

^ permalink raw reply related

* Re: git hang with corrupted .pack
From: Pascal Obry @ 2009-11-03 21:31 UTC (permalink / raw)
  To: Alex Riesen
  Cc: Junio C Hamano, Nicolas Pitre, Shawn O. Pearce, Andy Isaacson,
	git
In-Reply-To: <81b0412b0910200814v269e91fbkd7841308685e1c54@mail.gmail.com>

Le 20/10/2009 17:14, Alex Riesen a écrit :
> I seem to have problems with this change (on Cygwin). Sometimes
> accessing an object in a pack fails in unpack_compressed_entry.
> When it happens, both avail_in and avail_out of the stream are 0,
> and the reported status is Z_BUF_ERROR.
> Output with the second attached patch:
>
> error: *** inflate error: 0x862380 size=1256, avail_in=0 (was 697),
> avail_out=0 (was 1256)
> error: *** unpack_compressed_entry failed
> error: failed to read object 3296766eb5531ef051ae392114de5d75556f5613
> at offset 2620741 from
> .git/objects/pack/pack-996206790aaefbf4d34c86b3ff546bb924546b7c.pack
> fatal: object 3296766eb5531ef051ae392114de5d75556f5613 is corrupted

I have this problem on some repository on Cygwin too. For now I have 
reverted to Git 1.6.4 which seems to be working fine.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B

^ permalink raw reply

* Re: [PATCH 0/2] Set Makefile variables from configure
From: Jonathan Nieder @ 2009-11-03 21:54 UTC (permalink / raw)
  To: Ben Walton; +Cc: gitster, git
In-Reply-To: <1257269082-sup-5056@ntdws12.chass.utoronto.ca>

Ben Walton wrote:
> Excerpts from Ben Walton's message of Sat Oct 31 16:41:33 -0400 2009:
 
>> These patches add support for setting the newly created DEFAULT_EDITOR
>> and DEFAULT_PAGER from the configure script.  I also tacked in
>> ETC_GITCONFIG, since I can't currently toggle this without setting a
>> command line value when building, but have need to alter it.
[...]
> Ping?  Is this useful or should I drop it?

I am not sure these patches alone would make the configuration much
easier.  The --help text means one has to check the Makefile to learn
what these options do, anyway:

--with-editor=VALUE	provide value for DEFAULT_EDITOR
--with-pager=VALUE	provide value for DEFAULT_PAGER

But then, why not just set the value directly in the Makefile, 'make'
command line, or config.mak?

Maybe something like this could help.  The help text is not carefully
written; it’s just a placeholder to show the idea.

 configure.ac |   56 ++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac
index f8db034..aeef08c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,20 +68,25 @@ else \
 	GIT_CONF_APPEND_LINE(${PACKAGE}DIR=$withval); \
 fi \
 ])# GIT_PARSE_WITH
+
 dnl
-dnl GIT_WITH_MAKE_VAR(withname, VAR)
-dnl ---------------------
-dnl Set VAR to the value specied by --with-$withname if --with-$withname
-dnl is specified.  This is a direct way to allow setting variables in the
-dnl Makefile.
-AC_DEFUN([GIT_WITH_MAKE_VAR],
-[AC_ARG_WITH([$1],
- [AS_HELP_STRING([--with-$1=VALUE],
-		 [provide value for $2])],
- if test -n "$withval"; then \
-    AC_MSG_NOTICE([Setting $2 to $withval]); \
-    GIT_CONF_APPEND_LINE($2=$withval); \
- fi)])# GIT_WITH_MAKE_VAR
+dnl GIT_PARSE_VALUE(WITHNAME, VAR)
+dnl ------------------------------
+dnl For use in AC_ARG_WITH action-if-found, for tweakable values that
+dnl are not actually enabling or disabling anything.
+dnl  * Set VAR=ARG for --with-WITHNAME=ARG
+dnl  * Complain for --without-WITHNAME or --with-WITHNAME without ARG
+AC_DEFUN([GIT_PARSE_VALUE], [
+if test "$withval" = "no"; then
+	AC_MSG_ERROR([$1 cannot be disabled])
+fi
+if test "$withval" = "yes"; then
+	AC_MSG_WARN([You should provide a value for --with-$1])
+else
+	AC_MSG_NOTICE([Setting $2 to $withval])
+	GIT_CONF_APPEND_LINE($2=$withval)
+fi
+])
 
 dnl
 dnl GIT_CHECK_FUNC(FUNCTION, IFTRUE, IFFALSE)
@@ -242,13 +247,32 @@ GIT_PARSE_WITH(iconv))
 
 #
 # Allow user to set ETC_GITCONFIG variable
-GIT_WITH_MAKE_VAR(gitconfig, ETC_GITCONFIG)
+AC_ARG_WITH(gitconfig,
+  [AS_HELP_STRING([--with-gitconfig=PATH],
+                  [Use PATH instead of /etc/gitconfig.]
+                  [Interpreted by git as a path relative to the computed]
+                  [prefix at run-time.])],
+  [GIT_PARSE_VALUE(gitconfig, ETC_GITCONFIG)])
+
 #
 # Allow user to set the default pager
-GIT_WITH_MAKE_VAR(pager, DEFAULT_PAGER)
+AC_ARG_WITH(pager,
+  [AS_HELP_STRING([--with-pager=CMD],
+                  [Set fall-back pager to CMD instead of less.]
+                  [The fall-back pager will be used by commands such]
+                  [as git log if the user does not specify some]
+                  [preferred pager.])],
+  [GIT_PARSE_VALUE(pager, DEFAULT_PAGER)])
+
 #
 # Allow user to set the default editor
-GIT_WITH_MAKE_VAR(editor, DEFAULT_EDITOR)
+AC_ARG_WITH(editor,
+  [AS_HELP_STRING([--with-editor=CMD],
+                  [Set fall-back text editor to CMD instead of vi.]
+                  [The fall-back editor will be used by commands such]
+                  [as git commit if the user does not specify some]
+                  [preferred editor.])],
+  [GIT_PARSE_VALUE(editor, DEFAULT_EDITOR)])
 
 #
 # Define SHELL_PATH to provide path to shell.
-- 
1.6.5.2

^ permalink raw reply related

* Re: [PATCH] Update packfile transfer protocol documentation
From: Scott Chacon @ 2009-11-03 22:05 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Junio C Hamano, git list
In-Reply-To: <20091103005815.GW10505@spearce.org>

Junio,

On Mon, Nov 2, 2009 at 4:58 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
> Junio C Hamano <gitster@pobox.com> wrote:
>> "Shawn O. Pearce" <spearce@spearce.org> writes:
>> > Junio C Hamano <gitster@pobox.com> wrote:
>> > ...
>> >> Shouldn't we say "the client MUST NOT make reference update request if
>> >> everything is up to date" which would imply that in practice there is no
>> >> reason to send an empty pack data?
>
> Creating new branch quirk aside, I do agree with this.  Clients
> shouldn't send no-op updates if it knows in advance the update is
> a no-op.
>
> --
> Shawn.
>

Would you prefer that I try to incorporate all these comments and
submit another patch, or are you going to modify it in-tree?

Thanks,
Scott

^ permalink raw reply

* Re: [PATCH 0/2] Set Makefile variables from configure
From: Jonathan Nieder @ 2009-11-03 22:21 UTC (permalink / raw)
  To: Ben Walton; +Cc: gitster, git
In-Reply-To: <1257021695-21260-1-git-send-email-bwalton@artsci.utoronto.ca>

Ben Walton wrote:
> These patches add support for setting the newly created DEFAULT_EDITOR
> and DEFAULT_PAGER from the configure script.  I also tacked in
> ETC_GITCONFIG, since I can't currently toggle this without setting a
> command line value when building, but have need to alter it.

Would the --sysconfdir option work for you here?  Setting --sysconfdir
currently does nothing, so the question is kind of moot without some
change like this (untested):

Hook up more of ./configure’s installation directory options to
actually do something.  Unfortunately, this defeats the RUNTIME_PREFIX
facility unless all the relevant paths are explicitly set.  Probably
the defaults set in Makefile should not be overridden unless
explicitly requested.

This patch also changes the default location for HTML documentation
after running ./configure from /usr/local/share/git-doc to
/usr/local/share/git.  In my opinion, the fix to this would also be to
make the configure script not override defaults from Makefile.

 config.mak.in |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/config.mak.in b/config.mak.in
index 67b12f7..430134a 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -11,17 +11,21 @@ TAR = @TAR@
 TCLTK_PATH = @TCLTK_PATH@
 
 prefix = @prefix@
-exec_prefix = @exec_prefix@
 bindir = @bindir@
+mandir = @mandir@
+infodir = @infodir@
 gitexecdir = @libexecdir@/git-core
-datarootdir = @datarootdir@
+sharedir = @datadir@
 template_dir = @datadir@/git-core/templates
+htmldir = @htmldir@
+sysconfdir = @sysconfdir@
 
-mandir=@mandir@
-
+exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+docdir = @docdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
-
 export exec_prefix mandir
 export srcdir VPATH
 
-- 
1.6.5.2

^ permalink raw reply related

* Re: git hang with corrupted .pack
From: Shawn O. Pearce @ 2009-11-03 22:28 UTC (permalink / raw)
  To: Pascal Obry
  Cc: Alex Riesen, Junio C Hamano, Nicolas Pitre, Andy Isaacson, git
In-Reply-To: <4AF0A132.1060103@obry.net>

Pascal Obry <pascal@obry.net> wrote:
> Le 20/10/2009 17:14, Alex Riesen a ??crit :
>> I seem to have problems with this change (on Cygwin). Sometimes
>> accessing an object in a pack fails in unpack_compressed_entry.
>> When it happens, both avail_in and avail_out of the stream are 0,
>> and the reported status is Z_BUF_ERROR.
>> Output with the second attached patch:
>>
>> error: *** inflate error: 0x862380 size=1256, avail_in=0 (was 697),
>> avail_out=0 (was 1256)
>> error: *** unpack_compressed_entry failed
>> error: failed to read object 3296766eb5531ef051ae392114de5d75556f5613
>> at offset 2620741 from
>> .git/objects/pack/pack-996206790aaefbf4d34c86b3ff546bb924546b7c.pack
>> fatal: object 3296766eb5531ef051ae392114de5d75556f5613 is corrupted
>
> I have this problem on some repository on Cygwin too. For now I have  
> reverted to Git 1.6.4 which seems to be working fine.

It was fixed in 1.6.5.2 by Junio.

-- 
Shawn.

^ 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