* Re: [PATCH] gitk: disable checkout of remote branch
From: Tim Mazid @ 2009-11-04 0:48 UTC (permalink / raw)
To: git
In-Reply-To: <fabb9a1e0911030807h6b76b661pef75628a1255356@mail.gmail.com>
Sverre Rabbelier-2 wrote:
>
> On Tue, Nov 3, 2009 at 17:00, Sitaram Chamarty <sitaramc@gmail.com> wrote:
>> At the command line, this gives you a detailed warning message, but the
>> GUI currently allows it without any fuss.
>
> This is even better than an annoying popup dialog, as we all know
> those are just ignored anyway :).
>
Might be better to include a configuration option to allow this, for those
that know what they're doing. Most of the people that know what they're
doing will use the command line, anyway, but it may irritate some people.
--
View this message in context: http://n2.nabble.com/PATCH-gitk-disable-checkout-of-remote-branch-tp3939363p3942366.html
Sent from the git mailing list archive at Nabble.com.
^ permalink raw reply
* Re: Common setting for interoperability repo across windows and unix?
From: Vietor Liu @ 2009-11-04 0:46 UTC (permalink / raw)
To: Dilip M; +Cc: git
In-Reply-To: <c94f8e120911030709h29c5b8edr53df269632990e81@mail.gmail.com>
On Tue, 2009-11-03 at 20:39 +0530, Dilip M wrote:
> Hello,
>
> I have repo in unix. The same repo is cloned onto windows.I have set
> "core.autocrlf=input" in both the repos.
>
> When I do some change to a file in windows and push to unix repo, I
> get file deleted If I do "git status"?
>
> What is the setting to be done if I want an repo to be
> access/push/pulled across windows and unix?
>
>
>
msysgit, test:
core.autocrlf=false
^ permalink raw reply
* Re: [PATCH] Update packfile transfer protocol documentation
From: Junio C Hamano @ 2009-11-04 0:40 UTC (permalink / raw)
To: Scott Chacon; +Cc: git list, Shawn O. Pearce
In-Reply-To: <d411cc4a0911011518q15a8267bn642e6937be8c9ab1@mail.gmail.com>
Scott Chacon <schacon@gmail.com> writes:
> diff --git a/Documentation/technical/protocol-capabilities.txt
> b/Documentation/technical/protocol-capabilities.txt
> new file mode 100644
> index 0000000..3c86fc3
> --- /dev/null
> +++ b/Documentation/technical/protocol-capabilities.txt
> @@ -0,0 +1,188 @@
> +Git Protocol Capabilities
> +=========================
> +
> +Servers SHOULD support all capabilities defined in this document.
> +
> +On the very first line of the initial server response, the first
> +reference is followed by a null byte and then a list of space
> +delimited server capabilities. These allow the server to declare
> +what it can and cannot do to the client.
A few paragraphs below the reader will notice that it talks about both,
but it would be better to make it clear upfront that this document intends
to apply to both of the protocols (fetch-pack protocol and send-pack
protocol).
> +Client sends space separated list of capabilities it wants. It
> +SHOULD send a subset of server capabilities, i.e do not send
> +capabilities served does not advertise. The client SHOULD NOT ask
> +for capabilities the server did not say it supports.
The last two sentences are redundant, and "served does not" is probably
"server did not". I'd suggest dropping from "It SHOULD send a subset"
to "does not advertise."
> +Server MUST ignore capabilities it does not understand. Server MUST
> +NOT ignore capabilities that client requested and server advertised.
Hmm, is the first sentence true? Shouldn't it notice and error out?
After all the other end is asking something we do not know how to obey,
and there is no guarantee we do the right thing if we ignore blindly.
> +The 'report-status' and 'delete-refs' capabilities are sent and
> +recognized by the receive-pack (push to server) process.
> +
> +The 'ofs-delta' capability is sent and recognized by both upload-pack
> +and receive-pack protocols.
> +
> +All other capabilities are only recognized by the upload-pack (fetch
> +from server) process.
> +
> +multi_ack
> +---------
> +
> +The 'multi_ack' capability allows the server to return "ACK $SHA1
> +continue" as soon as it finds a commit that it can use as a common
> +base, between the client's wants and the client's have set.
s/$SHA1/obj-id/; to be consistent with the other document.
> +By sending this early, the server can potentially head off the client
> +from walking any further down that particular branch of the client's
> +repository history. The client may still need to walk down other
> +branches, sending have lines for those, until the server has a
> +complete cut across the DAG, or the client has said "done".
> +
> +Without multi_ack, a client sends have lines in --date-order until
> +the server has found a common base. That means the client will send
> +have lines that are already known by the server to be common, because
> +they overlap in time with another branch that the server hasn't found
> +a common base on yet.
> +
> +The client has things in caps that the server doesn't; server has
> +things in lower case.
s/things/commits/g; perhaps?
It's a bit abrupt to omit "For example suppose ...; we will illustrate
what happens." entirely.
> + +---- u ---------------------- x
> + / +----- y
> + / /
> + a -- b -- c -- d -- E -- F
> + \
> + +--- Q -- R -- S
Is it just my mail client, or is the line from 'd' to 'y' misaligned and
does not begin at 'd'?
> +If the client wants x,y and starts out by saying have F,S, the server
> +doesn't know what F,S is. Eventually the client says "have d" and
> +the server sends "ACK d continue" to let the client know to stop
> +walking down that line (so don't send c-b-a), but its not done yet,
> +it needs a base for X. The client keeps going with S-R-Q, until a
s/X/x/;
Otherwise, a nice example that is easy to understand.
> +thin-pack
> +---------
> +
> +Server can send thin packs, i.e. packs which do not contain base
> +elements, if those base elements are available on clients side.
> +Client requests thin-pack capability when it understands how to "thicken"
> +them adding required delta bases making them independent.
We call it "base object" when referring to what a "deltified
representation of an object" is based on. "base element" is a word that
has never been used to describe it elsewhere in our documentation set.
It seems that git-index-pack.txt calls the requirement of a packfile "self
contained and indexable"; I think "self contained" would be a better
wording than "independent" which has never been used to describe this
condition elsewhere in our documentation set.
> +side-band, side-band-64k
> +------------------------
> +
> +This means that server can send, and client understand multiplexed
> +(muxed) progress reports and error info interleaved with the packfile
> +itself.
I don't see need for "(muxed)"; you don't use the abbreviated form
anywhere else in the rest of the document.
> +These two options are mutually exclusive. A client should ask for
> +only one of them, and a modern client always favors side-band-64k.
> +
> +Either mode indicates that the packfile data will be streamed broken
> +up into packets of either 1000 bytes in the case of 'side_band', or
> +65520 bytes in the case of 'side_band_64k'. Each packet is made up of
> +a leading 4-byte pkt-line length of how much data is in the packet,
> +followed by a 1-byte stream code, followed by the actual data.
I think I mumbled something about "up to" in the other document on this
same topic. The same comment applies here.
> +The stream code can be one of:
> +
> + 1 - pack data
> + 2 - progress messages
> + 3 - fatal error message just before stream aborts
> +
> +The "side-band-64k" capability came about as a way for newer clients
> +that can handle much larger packets to request packets that are
> +actually crammed nearly full, while maintaining backward compatibility
> +for the older clients.
> +
> +Further, with side-band and its 1000 byte messages, it's actually
> +999 bytes of payload and 1 byte for the stream code. With side-band-64k,
> +same deal, you have 65519 bytes of data and 1 byte for the stream code.
> +
> +The client MUST send only maximum of one of "side-band" and "side-
> +band-64k". Server MUST favor side-band-64k if client requests both.
Again I think sending both is an error and should be diagnosed as such.
This is not a three-way handshake where I say "I can handle both", you say
"I can too", and then I finally pick "then we'll use this one". There is
no way for the requesting side to tell which one was chosen, and the
requester who sent both assumed that the other end chose "side-band" and
allocated only a 1000-byte buffer like older implementation did, the limit
of buffer will be busted.
Fix the last line "Server MUST favor" to "Server MUST diagnose it as an
error". Also drop "A client should ask for only one of them," near the
beginning of this section, as it is redundant. I think it is fine to keep
"A modern client always favors".
> +ofs-delta
> +---------
> +
> +Server can send, and client understand PACKv2 with delta refering to
> +its base by position in pack rather than by SHA-1. Its that they can
> +send/read OBJ_OFS_DELTA, aka type 6 in a pack file.
"Its that"? EPARSE. Perhaps "That is,"?
> +include-tag
> +-----------
> +
> +The 'include-tag' capability is about sending tags if we are sending
> +objects they point to. If we pack an object to the client, and a tag
> +points exactly at that object, we pack the tag too. In general this
> +allows a client to get all new tags when it fetches a branch, in a
> +single network connection.
> +
> +Clients MAY always send include-tag, hardcoding it into a request.
"... when the server advertises this capability", no?
> +The decision for a client to request include-tag only has to do with
> +the client's desires for tag data, whether or not a server had
> +advertised objects in the refs/tags/* namespace.
> +
> +Clients SHOULD NOT send include-tag if remote.name.tagopt was set to
> +--no-tags, as the client doesn't want tag data.
> +
> +Servers MUST accept include-tag without error or warning, even if the
> +server does not understand or support the option.
Why is this special case here? In the beginning, the servers are required
to support all of these (and include-tag is part of that "all"). If a
server for some justifiable reason does not understand a capability, it
would ignore it anyway with your earlier specification, so there is no
need to spell this out. Since I do not agree with "ignore capability
requests for something we do not know" at all, I cannot agree with this
sentence. If a server does not understand this capability, it is an error
for a client to ask for it, and it should be diagnosed as a protocol
error, no?
> +Servers SHOULD pack the tags if their referrant is packed and the
> +client has requested include-tag.
Sorry, I do not understand the motivation to make make this so weak? If
the server claims to support this capability, and when a referrant is
going to the client, the server MUST do so---if it cannot guarantee, why
claim to support that capability?
Or am I missing something?
> +Clients MUST be prepared for the case where a server has ignored
> +include-tag and has not actually sent tags in the pack. In such
> +cases the client SHOULD issue a subsequent fetch to acquire the tags
> +that include-tag would have otherwise given the client.
> +
> +The server SHOULD send include-tag, if it supports it, irregardless
> +of whether or not there are tags available.
irregardless?
> diff --git a/Documentation/technical/protocol-common.txt
> b/Documentation/technical/protocol-common.txt
> new file mode 100644
> index 0000000..ddf9912
> --- /dev/null
> +++ b/Documentation/technical/protocol-common.txt
> @@ -0,0 +1,96 @@
> +Documentation Common to Pack and Http Protocols
> +===============================================
> +
> +ABNF Notation
> +-------------
> +
> +ABNF notation as described by RFC 5234 is used within the protocol documents,
> +except the following replacement core rules are used:
> +----
> + HEXDIG = DIGIT / "a" / "b" / "c" / "d" / "e" / "f"
> +----
> +
> +We also define the following common rules:
> +----
> + NUL = %x00
> + zero-id = 40*"0"
> + obj-id = 40*(HEXDIGIT)
> +
> + refname = "HEAD"
> + refname /= "refs/" <see discussion below>
> +----
> +
> +A refname is a hierarichal octet string beginning with "refs/" and
> +not violating the 'git-check-ref-format' command's validation rules.
> +More generally, they:
s/generally/specifically/; I think. Also if you end with "they:" and
continue with enumeration, each enumerated sentence should omit "they",
no?
> +. They can include slash `/` for hierarchical (directory)
> + grouping, but no slash-separated component can begin with a
> + dot `.`.
> +...
> +pkt-line Format
> +---------------
> +
> +Much (but not all) of the payload is described around pkt-lines.
> +
> +A pkt-line is a variable length binary string. The first four bytes
> +of the line, the pkt-len, indicates the total length of the line,
> +in hexadecimal. The pkt-len includes the 4 bytes used to contain
> +the length's hexadecimal representation.
> +
> +A pkt-line MAY contain binary data, so implementors MUST ensure
> +pkt-line parsing/formatting routines are 8-bit clean.
> +
> +A non-binary line SHOULD BE terminated by an LF, which if present
> +MUST be included in the total length.
> +
> +The maximum length of a pkt-line's data component is 65520 bytes.
> +Implementations MUST NOT send pkt-line whose length exceeds 65524
> +(65520 bytes of payload + 4 bytes of length data).
> +
> +Implementations SHOULD NOT send an empty pkt-line ("0004").
Not an objection, but where is this coming from?
> +A pkt-line with a length field of 0 ("0000"), called a flush-pkt,
> +is a special case and MUST be handled differently than an empty
> +pkt-line ("0004").
...especially that this sentence makes it sound as if it is perfectly
normal to send "0004" for "an empty line" (and I've always thought that is
Ok), I am quite puzzled by that "SHOULD NOT".
> +----
> + pkt-line = data-pkt / flush-pkt
> +
> + data-pkt = pkt-len pkt-payload
> + pkt-len = 4*(HEXDIG)
> + pkt-payload = (pkt-len - 4)*(OCTET)
> +
> + flush-pkt = "0000"
> +----
> +
> +Examples (as C-style strings):
> +
> +----
> + pkt-line actual value
> + ---------------------------------
> + "0006a\n" "a\n"
> + "0005a" "a"
> + "000bfoobar\n" "foobar\n"
> + "0004" ""
Whew. Sorry for taking more than a few days to give you review comments.
It must have been quite a lot of work to carefully assemble these
documents.
Thanks.
^ permalink raw reply
* Re: [PATCH] Update packfile transfer protocol documentation
From: Junio C Hamano @ 2009-11-04 0:40 UTC (permalink / raw)
To: Scott Chacon; +Cc: Shawn O. Pearce, git list
In-Reply-To: <d411cc4a0911031405x60ea2396o35eea78a0b07fda9@mail.gmail.com>
Scott Chacon <schacon@gmail.com> writes:
> Would you prefer that I try to incorporate all these comments and
> submit another patch, or are you going to modify it in-tree?
I prefer to not munge other people's patches if the modification will
involve more than ten lines and if I know the original submitter can be
trusted to do the right thing.
I would rewrite other's patch myself heavily _only_ after I tried the
usual "suggest to improve" and found that it would not be worth my time to
wait for yet more rounds that would require more suggestions, major part
of which will eventually be forgotten or ignored again, iow, when I sense
that the communication with the contributor is hopelessly inefficient.
Needless to say, you have been here long enough to be in the "trusted"
category.
Thanks.
^ permalink raw reply
* Re: [PATCH] commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author
From: Erick Mattos @ 2009-11-03 23:51 UTC (permalink / raw)
To: Nanako Shiraishi; +Cc: Junio C Hamano, git
In-Reply-To: <20091104073822.6117@nanako3.lavabit.com>
2009/11/3 Nanako Shiraishi <nanako3@lavabit.com>:
> If you are sending an update to a previous patch (I am comparing
> this patch with the "show by example" patch Junio sent on 11/02
> http://article.gmane.org/gmane.comp.version-control.git/131893),
> it is a common courtesy to summarize what you changed relative
> to the base version after the three dashes line, so that people
> will know which part can be skipped while reviewing your patch.
I got your point. I will try to improve that.
I have been talking to Junio during the weekend and with a lot of
emails sent to each other. It happens that when he sent gmane/131893
(I had to find out what that code meant because I was using
[marc.info]! :-) ) I had already sent another patch with the
suggestions he made in a previous email.
So his message was late. While I was waiting for his acknowledgment I
started thinking he could be lost on those e-mails so I sent the one
you are replying to make it the last on the queue.
> I have to say that the test script is much worse than what
> gmane/131893 had.
>
> The old test made sure that -C copied the message, with or
> without the --mine option. But this test only checks the
> author line (and it doesn't even make sure that "^author"
> matches only in the header). The messages are unchecked,
> and it will let a bug when someone breaks --reset-author
> logic in the future in such a way that it corrupts the
> message by mistake go unnoticed.
I think you misunderstood something here:
* On his patch (which he sent before seeing mine), while testing -C,
on first check, he is checking author_header only.
* While testing -C on mine I compare both messages without "parent",
"tree" and "committer". Whole!
After check one I did concentrate only on author data. But on mine I
separate the tests between timestamp and author (name and email),
making sure the author was set to the actual committer and that the
timestamp was behaving as expected.
I am not saying mine is better. What I am saying is that I expected
him to notice and change/improve THIS patch. Not the other.
The new option only touches on getting new author or copying the
original so that is why I made the first check in whole and the others
only by author. If people think that this operation is so uncertain,
then everything should be compared: parent, author and message on all
tests.
It is not a problem for me adding more code to the test even if I
consider it unnecessary. I am doing this only to give a pay-back for
all the good service this free software gave to me so I am very
patient to all demands. I will be letting this effort go only at the
real end. No matter how long it takes.
> Also the old test was much more readable because it used
> shell functions to avoid repeating cat-file and pipe to sed
> script. It also tagged the initial commit, which had a nice
> effect that a failure in any intermediate test will not change
> which earlier commit is reused (eg. yours say "-C HEAD^" but
> old test said "-C Initial").
I am so used to scripts that I really haven't thought it difficult to
read but I can do some cosmetic too if it is important. As I said
early, I was waiting for Junio's jugdement over my later patch.
> It looks silly to create an "Initial Commit" in the middle
> of history, too (^_^).
This is something more laborious but which I thought was important to
let murphy's law act on a real case. We never do an amend on an
initial commit so I only did the tests on a later one.
> I think it is much better to replace "--mine" in gmane/131893
> with "--reset-author" and make no other change to the test.
Let's see Junio's opinion... We have changed names a lot since start. ;-)
> --
> Nanako Shiraishi
> http://ivory.ap.teacup.com/nanako3/
>
>
Thank you very much for all your comments. I really appreciate about
being noticed by you people. It is nice for a newcomer!
^ permalink raw reply
* Re: [PATCH 1/1] MSVC: port pthread code to native Windows threads
From: Johannes Schindelin @ 2009-11-03 23:38 UTC (permalink / raw)
To: Andrzej K. Haczewski; +Cc: git
In-Reply-To: <1257283802-29726-2-git-send-email-ahaczewski@gmail.com>
Hi,
On Tue, 3 Nov 2009, Andrzej K. Haczewski wrote:
> ---
Could you please add the reasoning from the cover letter to this commit
message? And add a sign-off?
> 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
>
It is unlikely that an #ifdef "contamination" of this extent will go
through easily, but I have a suggestion that may make your patch both
easier to read and more likely to be accepted into git.git: Try to wrap
the win32 calls into pthread-compatible function signatures. Then you can
add a compat/win32/pthread.h and not even touch core files of git.git at
all.
Oh, and you definitely do not want to copy-paste err_win_to_posix(). You
definitely want to reuse the existing instance.
Ciao,
Dscho
^ permalink raw reply
* [PATCH] gitk: Fix "git gui blame" invocation when called from topdir
From: Markus Heidelberg @ 2009-11-03 23:21 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git, Markus Heidelberg
In-Reply-To: <19184.2163.760155.285153@cargo.ozlabs.ibm.com>
In this case "git rev-parse --git-dir" doesn't return an absolute path,
but merely ".git", so the selected file has a relative path.
The function make_relative then tries to make the already relative path
relative, which results in a path like "../../../../Makefile" with as
much ".." as the number of parts [pwd] consists of.
This regression was introduced by commit 9712b81 (gitk: Fix bugs in
blaming code, 2008-12-06), which fixed "git gui blame" when called from
subdirs.
This also fixes it for bare repositories.
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
Paul Mackerras, 03.11.2009:
> Thanks for the patch, but I'd prefer to just add:
>
> if {[file pathtype $f] ne "relative"} {
> return $f
> }
>
> at the start of the function. I think that's easier to read than
> having a big if statement.
Definitely yes. But eq instead of ne.
gitk | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/gitk b/gitk
index 32e4ab0..949abfe 100755
--- a/gitk
+++ b/gitk
@@ -3378,6 +3378,9 @@ proc index_sha1 {fname} {
# Turn an absolute path into one relative to the current directory
proc make_relative {f} {
+ if {[file pathtype $f] eq "relative"} {
+ return $f
+ }
set elts [file split $f]
set here [file split [pwd]]
set ei 0
--
1.6.5.2.155.gaa0e5
^ permalink raw reply related
* Re: Problem with "From:" line on "git format-patch" generated patches
From: Jonathan Nieder @ 2009-11-03 22:55 UTC (permalink / raw)
To: André Goddard Rosa; +Cc: Santi Béjar, Git Mailing List
In-Reply-To: <b8bf37780911031011v5c8ec684ke6eebc6b0de1a66a@mail.gmail.com>
Hi André,
André Goddard Rosa wrote:
>> 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.
The header fields git format-patch outputs are just intended as a
starting point for the header of your mailing. It is more convenient
to receive an e-mail with
Delivered-to: maintainer@example.com
Received: [...]
Message-ID: <patch.sender.0001@example.com>
Date: Tue, 03 Nov 2009 16:33:54 -0600
From: Patch Sender <patch.sender@example.com>
Subject: [PATCH] Fix one bug, add another
Content-Type: text/plain; charset=us-ascii
Blah blah blah
than one in which the content includes some useless metadata that was
already in the header. So you should just strip the header out from
the body before sending.
There are three common exceptions: 1) you might want to send a patch
written by someone else, 2) you might want to mark a patch as written
before it was sent, and 3) some people like to receive patches as
attachments rather than inlined in messages. For the first two cases,
the solution is to include the header fields to change in the body:
From: Patch Writer <patch.writer@example.com>
Date: Wed, 01 Apr 1970 01:23:45 +0100
Blah blah blah
---
Hi,
Patch Writer wrote this patch a while ago that might be
relevant. It needed a straightforward one-line change to
apply and is otherwise unchanged.
What do you think?
[...]
For the last case, I think it is most common to send unchanged 'git
format-patch' output. But only the From, Date, and Subject fields
are actually needed.
I am not sure how well 'git am' copes with non-ascii characters in
the pseudo-header lines: I would have guessed it could handle them
both rfc2047-encoded and not, but I have not tried.
> 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.
Here, there is another danger: the Gmail web interface does not
consider your whitespace precious, so it is very prone to mangling
patches (especially with long lines).
Documentation/SubmittingPatches [1] has some advice:
| Gmail
| -----
|
| GMail does not appear to have any way to turn off line wrapping in the web
| interface, so this will mangle any emails that you send. You can however
| use any IMAP email client to connect to the google imap server, and forward
| the emails through that. Just make sure to disable line wrapping in that
| email client. Alternatively, use "git send-email" instead.
|
| Submitting properly formatted patches via Gmail is simple now that
| IMAP support is available. First, edit your ~/.gitconfig to specify your
| account settings:
|
| [imap]
| folder = "[Gmail]/Drafts"
| host = imaps://imap.gmail.com
| user = user@gmail.com
| pass = p4ssw0rd
| port = 993
| sslverify = false
|
| You might need to instead use: folder = "[Google Mail]/Drafts" if you get an error
| that the "Folder doesn't exist".
|
| Next, ensure that your Gmail settings are correct. In "Settings" the
| "Use Unicode (UTF-8) encoding for outgoing messages" should be checked.
|
| Once your commits are ready to send to the mailing list, run the following
| command to send the patch emails to your Gmail Drafts folder.
|
| $ git format-patch -M --stdout origin/master | git imap-send
|
| Go to your Gmail account, open the Drafts folder, find the patch email, fill
| in the To: and CC: fields and send away!
Good luck.
Hope that helps,
Jonathan
[1] <http://git.kernel.org/?p=git/git.git;a=blob_plain;f=Documentation/SubmittingPatches>
converting tabs to spaces.
^ permalink raw reply
* Re: [PATCH] commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author
From: Nanako Shiraishi @ 2009-11-03 22:38 UTC (permalink / raw)
To: Erick Mattos; +Cc: Junio C Hamano, git
In-Reply-To: <1257282551-9999-1-git-send-email-erick.mattos@gmail.com>
Quoting Erick Mattos <erick.mattos@gmail.com>
> 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>
> ---
If you are sending an update to a previous patch (I am comparing
this patch with the "show by example" patch Junio sent on 11/02
http://article.gmane.org/gmane.comp.version-control.git/131893),
it is a common courtesy to summarize what you changed relative
to the base version after the three dashes line, so that people
will know which part can be skipped while reviewing your patch.
I was originally puzzled by Junio's "mine" because I thought
"what does taking over the authorship have to do with digging
diamonds out of earth?". "reset-author" makes it very clear,
and I think it is a much better name for the option.
Your first paragraph mentions "one of the options", but subject
mentions four (-c, -C, --amend and --reset-author) and you want
only the first three of them.
The second paragraph of gmane/131893 says "borrow the commit log
message" instead of repeating "a template". It has the effect of
clarifying that only the message part is borrowed but not the
authorship information.
I think gmane/131893 has much better description than your first
two paragraphs for the these reasons.
> 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
I have to say that the test script is much worse than what
gmane/131893 had.
The old test made sure that -C copied the message, with or
without the --mine option. But this test only checks the
author line (and it doesn't even make sure that "^author"
matches only in the header). The messages are unchecked,
and it will let a bug when someone breaks --reset-author
logic in the future in such a way that it corrupts the
message by mistake go unnoticed.
Also the old test was much more readable because it used
shell functions to avoid repeating cat-file and pipe to sed
script. It also tagged the initial commit, which had a nice
effect that a failure in any intermediate test will not change
which earlier commit is reused (eg. yours say "-C HEAD^" but
old test said "-C Initial").
It looks silly to create an "Initial Commit" in the middle
of history, too (^_^).
I think it is much better to replace "--mine" in gmane/131893
with "--reset-author" and make no other change to the test.
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply
* Re: git hang with corrupted .pack
From: Pascal Obry @ 2009-11-03 22:34 UTC (permalink / raw)
To: Shawn O. Pearce
Cc: Alex Riesen, Junio C Hamano, Nicolas Pitre, Andy Isaacson, git
In-Reply-To: <20091103222834.GC10505@spearce.org>
Shawn,
> It was fixed in 1.6.5.2 by Junio.
Hum... I was using today Git from master. Just after I send my message I
tried 1.6.5 and it was working... I went back to master and it is now
working... Really strange... Maybe a file did not get properly
recompiled. I doubt it... but for sure it was failing and I build git
every day from master! Strange!
Anyway, it was a false alarm.
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: 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
* 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: [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 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: 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
* [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
* [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 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] 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
* 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] 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
* [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
* 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
* 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: 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
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox