* Re: [PATCH] gitweb/Makefile: Remove static/gitweb.js in the clean target
From: Ramsay Jones @ 2011-10-29 19:59 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jakub Narebski, Drew Northup, GIT Mailing-list
In-Reply-To: <7vk47qz5na.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
>
>>> gitweb.js is nowadays a generated file. Though that bit should be
>>> in commit message...
>> Yep, will do ...
>
> Thanks; here is what I already queued.
Yeah, I saw this about two hours after I sent those emails ...
Also, I prefer your commit message! ;-)
Thanks.
ATB,
Ramsay Jones
^ permalink raw reply
* [PATCH] Fix a typo in line 117 of git-gui/lib/sshkeys.tcl.
From: Dejan Ribič @ 2011-10-30 17:18 UTC (permalink / raw)
To: Git ML; +Cc: Dejan Ribič
"succeded" changed to "succeeded".
Reference Launchpad bug #879427.
modified: git-gui/lib/sshkey.tcl
Signed-off-by: Dejan Ribič <dejan.ribic@gmail.com>
---
git-gui/lib/sshkey.tcl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-gui/lib/sshkey.tcl b/git-gui/lib/sshkey.tcl
index 5f75bc9..aa6457b 100644
--- a/git-gui/lib/sshkey.tcl
+++ b/git-gui/lib/sshkey.tcl
@@ -117,7 +117,7 @@ proc read_sshkey_output {fd w} {
} else {
set finfo [find_ssh_key]
if {$finfo eq {}} {
- set sshkey_title [mc "Generation succeded, but no keys found."]
+ set sshkey_title [mc "Generation succeeded, but no keys found."]
$w.contents insert end $sshkey_output
} else {
set sshkey_title [mc "Your key is in: %s" [lindex $finfo 0]]
--
1.7.5.4
^ permalink raw reply related
* Re: [PATCH] typo in git-gui/lib/sshkeys.tcl
From: Ramkumar Ramachandra @ 2011-10-30 14:47 UTC (permalink / raw)
To: Dejan Ribič; +Cc: git
In-Reply-To: <4EAD23AA.8000400@gmail.com>
Hi Dejan,
Dejan Ribič writes:
> I am new at this, but I am trying to fix a few "bitesize" bugs in
> Ubuntu for start and somebody suggested, that I post this patch to
> Upstream, so I'm doing this.
Welcome to the Git community. Please read
Documentation/SubmittingPatches so that your patch can be considered
for inclusion: in short, prepare and send the patch using 'git
format-patch'/ 'git send-email' along with a nice commit message and
signoff.
> P.S.: I am not subscribed to this list, so please CC to me.
That's the default convention on this list- no need to specify explicitly.
Cheers.
-- Ram
^ permalink raw reply
* [PATCH] typo in git-gui/lib/sshkeys.tcl
From: Dejan Ribič @ 2011-10-30 10:15 UTC (permalink / raw)
To: git
[-- Attachment #1.1: Type: text/plain, Size: 258 bytes --]
Hi,
I am new at this, but I am trying to fix a few "bitesize" bugs in
Ubuntu for start and somebody suggested, that I post this patch to
Upstream, so I'm doing this.
Cheers,
Dejan
P.S.: I am not subscribed to this list, so please CC to me.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: sshkeys.tcl.diff --]
[-- Type: text/x-patch; name="sshkeys.tcl.diff", Size: 501 bytes --]
=== modified file 'git-gui/lib/sshkey.tcl'
--- git-gui/lib/sshkey.tcl 2010-04-03 15:07:19 +0000
+++ git-gui/lib/sshkey.tcl 2011-10-29 23:08:15 +0000
@@ -117,7 +117,7 @@
} else {
set finfo [find_ssh_key]
if {$finfo eq {}} {
- set sshkey_title [mc "Generation succeded, but no keys found."]
+ set sshkey_title [mc "Generation succeeded, but no keys found."]
$w.contents insert end $sshkey_output
} else {
set sshkey_title [mc "Your key is in: %s" [lindex $finfo 0]]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 554 bytes --]
^ permalink raw reply
* Re: [PATCH/WIP 03/11] t5403: avoid doing "git add foo/bar" where foo/.git exists
From: Nguyen Thai Ngoc Duy @ 2011-10-30 9:55 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vaa8jrm6a.fsf@alter.siamese.dyndns.org>
On Sun, Oct 30, 2011 at 2:08 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Side note. I just did this and I am not getting what you saw above.
>
> $ mkdir -p /var/tmp/j/y && cd /var/tmp/j/y
> $ git init; git init clone2
> $ : >3; : >clone2/2
> $ GIT_DIR=clone2/.git git add clone2/2 3
> $ GIT_DIR=clone2/.git git ls-files
> 3
> clone2/2
>
> The behavour is different when clone2/.git already has commit, and
> whatever codepath that gives these two different behaviour needs
> to be fixed.
It's resolve_gitlink_ref() in treat_directory(). I think replacing
that call() with is_git_directory() would fix this problem. We may
want to do the same with remove_dir_recursively().
> When GIT_DIR=clone2/.git is given, however, the caller explicitly declines
> the repository discovery. We do not know how the repository we are dealing
> with (which we were explicitly told with $GIT_DIR) and a directory whose
> name is ".git" under "clone2" we happened to find in read_directory()
> relates to each other, especially when our index does not have clone2 as
> our submodule.
>
> We however *do* know that our working tree is our current directory, so
> it would be wrong to do this:
>
> $ GIT_DIR=clone2/.git git add clone2/2 3; echo $?
> error: 3 is outside our repository, possibly goverened by .git
> 1
>
> The command should just add clone2/2 and 3 as it was told to.
I am concerned about clone2/2 in this case, not 3. I guess we can
check if clone2/.git is the repo we are using. If it is, skip it.
--
Duy
^ permalink raw reply
* Re: [RFC/PATCH] define the way new representation types are encoded in the pack
From: Nguyen Thai Ngoc Duy @ 2011-10-30 9:31 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Nicolas Pitre, Shawn O. Pearce, Jeff King
In-Reply-To: <7v4nyrrm1w.fsf@alter.siamese.dyndns.org>
On Sun, Oct 30, 2011 at 2:11 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Not sure if it's related to representation types, but is there any way
>> (perhaps FLAT_BLOB type?) we can mark an object uncompressed, so we
>> can mmap() and access it directly?
>
> In pack? Loose? Both?
>
> What kind of payload and use case do you have in mind?
Hmm.. big files in general with partial file transfer (e.g. git
torrent). But if CAT_TREE is properly used, then all blob pieces
should be reasonably small and decompress time should not be a
problem. I think we won't need this. Sorry for the noise.
--
Duy
^ permalink raw reply
* Re: [PATCH/WIP 05/11] symbolize return values of tree_entry_interesting()
From: Nguyen Thai Ngoc Duy @ 2011-10-30 9:17 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vbot2z3gf.fsf@alter.siamese.dyndns.org>
2011/10/28 Junio C Hamano <gitster@pobox.com>:
>> static void skip_uninteresting(struct tree_desc *t, struct strbuf *base,
>> - struct diff_options *opt, int *match)
>> + struct diff_options *opt,
>> + enum interesting *match)
>> {
>> while (t->size) {
>> *match = tree_entry_interesting(&t->entry, base, 0, &opt->pathspec);
>> if (*match) {
>> - if (*match < 0)
>> + if (*match == all_entries_not_interesting)
>> t->size = 0;
>> break;
>> }
>
> The caller of this function needs to be updated as well.
Yeah, thanks.
> But I have to wonder why this skip_uninteresting() does not peek the
> original value of *match and skip, which is the loop structure the other
> caller of tree_entry_interesting() in this file has.
Probably because no one asked that question before. I think it makes
sense for skip_uninteresting() to skip t_e_i() when *match == -1 or 2.
Thanks.
--
Duy
^ permalink raw reply
* Re: imap-send badly handles commit bodies beginning with "From <"
From: Magnus Bäck @ 2011-10-30 9:01 UTC (permalink / raw)
To: git; +Cc: Andrew Eikum, Jeff King
In-Reply-To: <20111028203256.GA15082@sigill.intra.peff.net>
On Friday, October 28, 2011 at 22:32 CEST,
Jeff King <peff@peff.net> wrote:
> On Fri, Oct 28, 2011 at 01:00:44PM -0500, Andrew Eikum wrote:
>
> > On the server side, it was split into two mails on either side
> > of that commit message's From line with neither mail actually
> > containing the From line. To fix it, I just changed it to "Copied
> > from <url>:" :-P
> >
> > Ain't mbox grand?
>
> Mbox does have this problem, but I think in this case it is a
> particularly crappy implementation of mbox in imap-send. Look at
> imap-send.c:split_msg; it just looks for "From ".
While there seems to be about a million different implementations of
mbox creation and parsing, the relevant RFC[0] points to [1] as an
authoritative source. The latter claims that lines matching "^From "
denote a message boundary and that lines within a message that match
the same pattern should be quoted with ">". That would suggest that
the problem isn't imap-send.c but whatever code produces the mbox
file in the first place. Of course, if that software isn't part of
Git I guess we'll have to deal with the situation anyway. And whatever
the RFCs say, we still need to be as compatible is possible with
whatever software is out there.
> It should at least check for something that looks like a timestamp,
> like git-mailsplit does. Maybe mailsplit's is_from_line should be
> factored out so that it can be reused in imap-send.
I guess that's a reasonable "liberal in what you accept" mitigation.
(As a sidenote, I'm getting the ">From" quoting in my maildir message
files where no such quoting is expected, so "From" lines are shown as
">From" in my MUA. I don't know if it's Procmail screwing things up or
what's going on.)
[0] http://tools.ietf.org/html/rfc4155
[1] http://qmail.org./man/man5/mbox.html
--
Magnus Bäck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson
^ permalink raw reply
* Re: [PATCH] http.c: Use curl_multi_fdset to select on curl fds instead of just sleeping
From: Mika Fischer @ 2011-10-30 7:19 UTC (permalink / raw)
To: Daniel Stenberg; +Cc: git
In-Reply-To: <alpine.DEB.2.00.1110292230500.28196@tvnag.unkk.fr>
On Sat, Oct 29, 2011 at 22:33, Daniel Stenberg <daniel@haxx.se> wrote:
>> + curl_multi_fdset(curlm, &readfds, &writefds,
>> &excfds, &max_fd);
>> +
>> + select(max_fd+1, &readfds, &writefds, &excfds,
>> &select_timeout);
>
> At times, curl_multi_fdset() might return -1 in max_fd, as when there's no
> internal socket around to provide to the application to wait for.
>
> Calling select() with max_fd+1 (== 0) will then not be appreciated by all
> implementations of select() so that case should probably also be covered by
> the 50ms sleep approach...
Actually, the 50ms sleep was also implemented using select(0, ...)
before the patch. I tried to keep the previous behavior when curl does
not give us any information.
I assumed that the select(0, ...) was some portable way to sleep with
microsecond granularity.
Is there some other way to tell select not to check any fds, or should
I just call select(1, ...)?
Best,
Mika
^ permalink raw reply
* Re: [RFC/PATCH] define the way new representation types are encoded in the pack
From: Junio C Hamano @ 2011-10-30 7:13 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: git, Nicolas Pitre, Shawn O. Pearce, Jeff King
In-Reply-To: <7v4nyrrm1w.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
>
>> Because all blobs in this tree object must be in a fixed order, and
>> they won't likely have meaningful names nor permission, should
>> CAT_TREE payload is a SHA-1 sequence of all blobs (or cat-trees if we
>> want nested trees) instead? IOW the tree is integrated into cat-tree
>> object, not as a separate tree object.
>
> I have no problem with that (I am not worried about minor details of the
> actual implementation of cat-tree yet).
Side note. It should be renamed "split-object" or something if we go the
route you suggest, as "tree"-ness of the actual representation is not
essential.
^ permalink raw reply
* Re: [RFC/PATCH] define the way new representation types are encoded in the pack
From: Junio C Hamano @ 2011-10-30 7:11 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: git, Nicolas Pitre, Shawn O. Pearce, Jeff King
In-Reply-To: <CACsJy8Cz0R_s+VYRd+1wTTfbt_vH5dd3ALgZip0xn7rfYf6gpw@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> Because all blobs in this tree object must be in a fixed order, and
> they won't likely have meaningful names nor permission, should
> CAT_TREE payload is a SHA-1 sequence of all blobs (or cat-trees if we
> want nested trees) instead? IOW the tree is integrated into cat-tree
> object, not as a separate tree object.
I have no problem with that (I am not worried about minor details of the
actual implementation of cat-tree yet).
> Not sure if it's related to representation types, but is there any way
> (perhaps FLAT_BLOB type?) we can mark an object uncompressed, so we
> can mmap() and access it directly?
In pack? Loose? Both?
What kind of payload and use case do you have in mind?
^ permalink raw reply
* Re: [PATCH/WIP 03/11] t5403: avoid doing "git add foo/bar" where foo/.git exists
From: Junio C Hamano @ 2011-10-30 7:08 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: git
In-Reply-To: <CACsJy8DdQXXoYT2gB2L5z6pdCNU_vL2w7c8eJvKRGX2T9iAC3Q@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> Note that this has nothing to do with read_directory() discussion we
> had in the notes-merge patch...
I think we are in agreement on that point.
Going back to your example...
> $ GIT_DIR=clone2/.git git add clone2/2 3
>
> $ GIT_DIR=clone2/.git git ls-files --stage
> 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 1
> 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 3
You probably found a bug here. It is simply wrong to choose not to add
clone2/2, especially without telling the caller anything.
Side note. I just did this and I am not getting what you saw above.
$ mkdir -p /var/tmp/j/y && cd /var/tmp/j/y
$ git init; git init clone2
$ : >3; : >clone2/2
$ GIT_DIR=clone2/.git git add clone2/2 3
$ GIT_DIR=clone2/.git git ls-files
3
clone2/2
The behavour is different when clone2/.git already has commit, and
whatever codepath that gives these two different behaviour needs
to be fixed.
By the way, I think I know where you are coming from.
If we think clone2/ and everything underneath belongs to a repository that
is _not_ governed by our GIT_DIR (which usually is .git), it may be nicer
when the user attempts to add clone2/2 (which would normally belong to
clone2/.git) to at least warn about it, or even error out. I would not be
entirely opposed to a change in the behaviour if the above example were
done without GIT_DIR and produced an error, like this:
$ git add clone2/2 3; echo $?
error: clone2/2 is outside our repository, possibly governed by clone2/.git
1
$ git ls-files
1
After all, if clone2 were a submodule of our repository, we do notice and
error out an attempt to add clone2/2 to our repository, so if we changed
the way how "git add" behaves to do the above, I can buy an argument that
calls it a bugfix.
When GIT_DIR=clone2/.git is given, however, the caller explicitly declines
the repository discovery. We do not know how the repository we are dealing
with (which we were explicitly told with $GIT_DIR) and a directory whose
name is ".git" under "clone2" we happened to find in read_directory()
relates to each other, especially when our index does not have clone2 as
our submodule.
We however *do* know that our working tree is our current directory, so
it would be wrong to do this:
$ GIT_DIR=clone2/.git git add clone2/2 3; echo $?
error: 3 is outside our repository, possibly goverened by .git
1
The command should just add clone2/2 and 3 as it was told to.
^ permalink raw reply
* Re: [PATCH] document 'T' status from git-status
From: Junio C Hamano @ 2011-10-30 6:25 UTC (permalink / raw)
To: Mark Dominus; +Cc: git, Mark Dominus
In-Reply-To: <1319933204-21587-1-git-send-email-mjd@plover.com>
Mark Dominus <mjd@plover.com> writes:
> From: Mark Dominus <mjd@icgroup.com>
>
> Signed-off-by: Mark Dominus <mjd@plover.com>
> ---
> Documentation/git-status.txt | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
> index 3d51717..e7fc5c3 100644
> --- a/Documentation/git-status.txt
> +++ b/Documentation/git-status.txt
> @@ -122,6 +122,8 @@ codes can be interpreted as follows:
> * 'R' = renamed
> * 'C' = copied
> * 'U' = updated but unmerged
> +* 'T' = file type changed
> + (typically from plain file to symlink, or vice versa)
>
> Ignored files are not listed, unless `--ignored` option is in effect,
> in which case `XY` are `!!`.
> @@ -134,9 +136,11 @@ in which case `XY` are `!!`.
> D [ M] deleted from index
> R [ MD] renamed in index
> C [ MD] copied in index
> + T [ MD] file type changed in index
> [MARC] index and work tree matches
> [ MARC] M work tree changed since index
> [ MARC] D deleted in work tree
> + [ MARC] T file type changed in work tree
The current organization of this table may need to be rethought, but if we
were to keep it, then this change is far from sufficient. For example, you
do not explain what XY = TT means.
Side note. The reason why we do not have two independent tables,
one of which shows "if X is M then it means updated in index, if X
is A then..." and the other shows "if Y is ' ' then index and
working tree matches, if Y is 'M' then ...", is because this table
is meant to show _possible_ combinations. For example, the row
with X = D shows that only two possible value for Y are ' ' and M
and A or D are not possible values for Y in that case.
It may be easier to explain if you treated that 'T' is merely a variant of
'M' (this comment applies to the first hunk of your patch that starts at
line 122), i.e.
Documentation/git-status.txt | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index 3d51717..bc2552e 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -126,6 +126,10 @@ codes can be interpreted as follows:
Ignored files are not listed, unless `--ignored` option is in effect,
in which case `XY` are `!!`.
+Note that a change in filetype (i.e. a regular file to symbolic link or
+vice versa) is a special case of "modified" and shown as 'T' instead of
+'M'; in the table below an 'M' could be a 'T'.
+
X Y Meaning
-------------------------------------------------
[MD] not updated
^ permalink raw reply related
* Re: [PATCH] Display change history as a diff between two dirs
From: Junio C Hamano @ 2011-10-30 6:09 UTC (permalink / raw)
To: Roland Kaufmann; +Cc: git
In-Reply-To: <4EAC6765.4030003@gmail.com>
Roland Kaufmann <rlndkfmn+git@gmail.com> writes:
> diff --git a/git-dirdiff--helper.sh b/git-dirdiff--helper.sh
> new file mode 100755
> index 0000000..bc0b49d
> --- /dev/null
> +++ b/git-dirdiff--helper.sh
> @@ -0,0 +1,28 @@
> ...
> +# bail out if there is any problems copying
> +set -e
I do not think any of our scripted Porcelains use "set -e"; rather they
try to catch errors and produce messages that are more appropriate for
specific error sites.
> +# check that we are called by git-dirdiff
> +if [ -z $__GIT_DIFF_DIR ]; then
> + echo Error: Do not call $(basename $0) directly 1>&2
> + exit 1
> +fi
(style)
if test -z "$__GIT_DIFF_DIR"
then
echo >&2 "..."
exit 1
fi
If this were to become part of the main Porcelain set, you would probably
source in the git-sh-setup helper near the beginning with
. git-sh-setup
and use "die" instead of "echo && exit 1".
> diff --git a/git-dirdiff.sh b/git-dirdiff.sh
> new file mode 100755
> index 0000000..4e75eda
> --- /dev/null
> +++ b/git-dirdiff.sh
> @@ -0,0 +1,34 @@
> ...
> +# create a temporary directory to hold snapshots of changed files
> +__GIT_DIFF_DIR=$(mktemp --tmpdir -d git-dirdiff.XXXXXX)
> +export __GIT_DIFF_DIR
I do not think any of our scripted Porcelains use "mktemp" especially
"mktemp -d". How portable is it?
> +git diff --raw "$@" > $__GIT_DIFF_DIR/toc
> +
> +# let the helper script accumulate them into the temporary directory
> +cut -f 2- -s $__GIT_DIFF_DIR/toc | while read f; do
> + GIT_EXTERNAL_DIFF=git-dirdiff--helper git --no-pager diff "$@" $f
> +done
(style)
... upstream command ... |
while read f
do
...
done
It also is not clear what could be used in "$@". Obviously you would not
want things like "-U20" and "--stat" fed to the first "list of paths"
phase, but there may be some options you may want to give to the inner
"external diff" thing.
It is not clear to me why you need to grab the list of paths in toc and
iterate over them one by one. IOW, why isn't this sufficient?
# dirdiff--helper will copy the files in the temporary directory
GIT_EXTERNAL_DIFF=git-dirdiff--helper git --no-pager diff "$@"
# Now the temporary old/ and new/ are populated, compare them
git-difftool--helper - .....
Overall, I found it interesting, but I am not convinced yet that this
should be in the set of main Porcelains. It seems to be a hack to work
around the design of the current external diff interface that specifically
targets tools that are about comparing single pair of paths at a time.
If "compare two sets of files, each extracted in its own temporary
directory" turns out to be sufficiently useful thing to do (which I
suspect is true), we would probably want to make it an option to "git
diff" itself, and not a separate git subcommand like "dirdiff". I can see
"git diff" (and possibly even things like "git log -p") populating two
temporary directories (your old/ and new/) and running a custom program
specified by GIT_EXTERNAL_TREEDIFF environment variable, instead of doing
any textual diff generation internally.
I wouldn't mind carrying a polished version of this in contrib/ for a
cycle or two in order to let people try it out and get kinks out of its
design.
For example, how well does this approach work with -M/-C (I do not think
it would do anything useful, but I haven't thought things through). It
would be nice if we gave the hint to the external program that compares
the populated temporary directories how paths in the preimage tree and
postimage tree correspond to each other.
^ permalink raw reply
* Re: [PATCH/WIP 03/11] t5403: avoid doing "git add foo/bar" where foo/.git exists
From: Nguyen Thai Ngoc Duy @ 2011-10-30 5:55 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vobx2z60w.fsf@alter.siamese.dyndns.org>
On Fri, Oct 28, 2011 at 12:41 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> ... Should we stick with one way only?
>
> Whatever we have been doing should not change, especially in corner cases.
I disagree. If it's not right, then we should change it even though it
may face unpleasant consequences from misusing it. And I don't think
it's sane to behave like what we're doing now:
$ GIT_DIR=clone2/.git git ls-files --stage
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 1
$ ls -l clone2/2 3
-rw-r--r-- 1 pclouds users 0 Th10 30 12:40 3
-rw-r--r-- 1 pclouds users 0 Th10 30 12:40 clone2/2
$ GIT_DIR=clone2/.git git add clone2/2 3
$ GIT_DIR=clone2/.git git ls-files --stage
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 1
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 3
$ GIT_DIR=clone2/.git git add clone2/2
$ GIT_DIR=clone2/.git git ls-files --stage
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 1
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 3
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 clone2/2
"git add" behaves inconsistently when "clone2/2" and "3" are given and
when clone2/2 is given alone. This is just bad to me.
Note that this has nothing to do with read_directory() discussion we
had in the notes-merge patch, I agree we should keep the prefix. This
is about the calculating common prefix automatically from pathspec.
But prefix and pathspec are treated differently by read_directory().
In "git add clone2/2 3", common prefix is "" while in "git add
clone2/2" common prefix is "clone2".
--
Duy
^ permalink raw reply
* Re: [RFC/PATCH] define the way new representation types are encoded in the pack
From: Nguyen Thai Ngoc Duy @ 2011-10-30 5:40 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Nicolas Pitre, Shawn O. Pearce, Jeff King
In-Reply-To: <7vwrbptzjm.fsf@alter.siamese.dyndns.org>
On Fri, Oct 28, 2011 at 1:12 PM, Junio C Hamano <gitster@pobox.com> wrote:
> As people may be able to guess from the name, CAT_TREE is envisioned to
> encode a large data (primarily of type "blob") by recording the object
> name of a tree object and probably the total length, and would represent
> the concatenation of all blobs contained in the tree object when the tree
> is traversed in some fixed order (e.g. Avery's "bup split"). I am guessing
> that the payload for CAT_TREE representation type will be:
>
> - 20-byte object name for the top-level tree object;
Because all blobs in this tree object must be in a fixed order, and
they won't likely have meaningful names nor permission, should
CAT_TREE payload is a SHA-1 sequence of all blobs (or cat-trees if we
want nested trees) instead? IOW the tree is integrated into cat-tree
object, not as a separate tree object.
> - type of the basic object (commit, tree, blob, or tag) it represents,
> even though it is unlikely that we would want to record such a large
> commit or tag that needs CAT_TREE representation;
>
> - the total length of the basic object it represents, even though it is
> redundant (you could traverse and sum the sizes of blobs contained in
> the tree object), it would help sha1_object_info() and friends. This
> will be the "some size" I mentioned in the previous message for this
> representation type.
Not sure if it's related to representation types, but is there any way
(perhaps FLAT_BLOB type?) we can mark an object uncompressed, so we
can mmap() and access it directly?
--
Duy
^ permalink raw reply
* [PATCH] document 'T' status from git-status
From: Mark Dominus @ 2011-10-30 0:06 UTC (permalink / raw)
To: git, gitster; +Cc: Mark Dominus, Mark Dominus
From: Mark Dominus <mjd@icgroup.com>
Signed-off-by: Mark Dominus <mjd@plover.com>
---
Documentation/git-status.txt | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index 3d51717..e7fc5c3 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -122,6 +122,8 @@ codes can be interpreted as follows:
* 'R' = renamed
* 'C' = copied
* 'U' = updated but unmerged
+* 'T' = file type changed
+ (typically from plain file to symlink, or vice versa)
Ignored files are not listed, unless `--ignored` option is in effect,
in which case `XY` are `!!`.
@@ -134,9 +136,11 @@ in which case `XY` are `!!`.
D [ M] deleted from index
R [ MD] renamed in index
C [ MD] copied in index
+ T [ MD] file type changed in index
[MARC] index and work tree matches
[ MARC] M work tree changed since index
[ MARC] D deleted in work tree
+ [ MARC] T file type changed in work tree
-------------------------------------------------
D D unmerged, both deleted
A U unmerged, added by us
--
1.7.7.dirty
^ permalink raw reply related
* [PATCH] Display change history as a diff between two dirs
From: Roland Kaufmann @ 2011-10-29 20:51 UTC (permalink / raw)
To: gitster; +Cc: git
Watching patches serially it can be difficult to get an overview of how
a pervasive change is distributed through-out different modules. Thus:
Extract snapshots of the files that have changed between two revisions
into temporary directories and launch a graphical tool to show the diff
between them.
Use existing functionality in git-diff to figure out which files have
changed, and to get the files themselves.
Based on a script called 'git-diffc' by Nitin Gupta.
Signed-off-by: Roland Kaufmann <rlndkfmn+git@gmail.com>
---
Requests for such a scripts surface occationally, so I believe it could
be useful to have in the distribution itself.
Documentation/git-dirdiff.txt | 55 +++++++++++++++++++++++++++++++++++++++++
Makefile | 2 +
git-dirdiff--helper.sh | 28 +++++++++++++++++++++
git-dirdiff.sh | 34 +++++++++++++++++++++++++
4 files changed, 119 insertions(+), 0 deletions(-)
create mode 100644 Documentation/git-dirdiff.txt
create mode 100755 git-dirdiff--helper.sh
create mode 100755 git-dirdiff.sh
diff --git a/Documentation/git-dirdiff.txt b/Documentation/git-dirdiff.txt
new file mode 100644
index 0000000..bdd2581
--- /dev/null
+++ b/Documentation/git-dirdiff.txt
@@ -0,0 +1,55 @@
+git-dirdiff(1)
+==============
+
+NAME
+----
+git-dirdiff - Show changes using directory compare
+
+SYNOPSIS
+--------
+[verse]
+'git dirdiff' [<options>] [<commit> [<commit>]] [--] [<path>...]
+
+DESCRIPTION
+-----------
+'git dirdiff' is a git command that allows you to compare revisions
+as a difference between two directories. 'git dirdiff' is a frontend
+to linkgit:git-diff[1].
+
+OPTIONS
+-------
+See linkgit:git-diff[1] for the list of supported options.
+
+CONFIG VARIABLES
+----------------
+'git dirdiff' uses the same config variables as linkgit:git-difftool[1]
+to determine which difftool should be used.
+
+TEMPORARY FILES
+---------------
+'git dirdiff' creates a directory with 'mktemp' to hold snapshots of the
+files which are different in the two revisions. This directory is removed
+when the diff viewer terminates.
+
+NOTES
+-----
+The diff viewer must support being passed directories instead of files
+as its arguments.
++
+Files that are not put under version control are not included when
+viewing the difference between a revision and the working directory.
+
+SEE ALSO
+--------
+linkgit:git-diff[1]::
+ Show changes between commits, commit and working tree, etc
+
+linkgit:git-difftool[1]::
+ Show changes using common diff tools
+
+linkgit:git-config[1]::
+ Get and set repository or global options
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Makefile b/Makefile
index 3139c19..03771cf 100644
--- a/Makefile
+++ b/Makefile
@@ -365,6 +365,8 @@ unexport CDPATH
SCRIPT_SH += git-am.sh
SCRIPT_SH += git-bisect.sh
SCRIPT_SH += git-difftool--helper.sh
+SCRIPT_SH += git-dirdiff.sh
+SCRIPT_SH += git-dirdiff--helper.sh
SCRIPT_SH += git-filter-branch.sh
SCRIPT_SH += git-lost-found.sh
SCRIPT_SH += git-merge-octopus.sh
diff --git a/git-dirdiff--helper.sh b/git-dirdiff--helper.sh
new file mode 100755
index 0000000..bc0b49d
--- /dev/null
+++ b/git-dirdiff--helper.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Accumulate files in a changeset into a pre-defined directory.
+#
+# Copyright (C) 2011 Roland Kaufmann
+# Based on a script called git-diffc by Nitin Gupta
+#
+# This file is licensed under the GPL v2, or a later version
+# at the discretion of the official Git maintainer.
+
+# bail out if there is any problems copying
+set -e
+
+# check that we are called by git-dirdiff
+if [ -z $__GIT_DIFF_DIR ]; then
+ echo Error: Do not call $(basename $0) directly 1>&2
+ exit 1
+fi
+
+# don't attempt to copy new or removed files
+if [ "$2" != "/dev/null" ]; then
+ mkdir -p $__GIT_DIFF_DIR/old/$(dirname $1)
+ cp $2 $__GIT_DIFF_DIR/old/$1
+fi
+if [ "$5" != "/dev/null" ]; then
+ mkdir -p $__GIT_DIFF_DIR/new/$(dirname $1)
+ cp $5 $__GIT_DIFF_DIR/new/$1
+fi
diff --git a/git-dirdiff.sh b/git-dirdiff.sh
new file mode 100755
index 0000000..4e75eda
--- /dev/null
+++ b/git-dirdiff.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# Display differences between two commits with a directory comparison.
+#
+# Copyright (C) 2011 Roland Kaufmann
+# Based on a script called git-diffc by Nitin Gupta
+#
+# This file is licensed under the GPL v2, or a later version
+# at the discretion of the official Git maintainer.
+
+# bail out if there is any problems in getting a diff
+set -e
+
+# create a temporary directory to hold snapshots of changed files
+__GIT_DIFF_DIR=$(mktemp --tmpdir -d git-dirdiff.XXXXXX)
+export __GIT_DIFF_DIR
+
+# cleanup after we're done
+trap 'rm -rf $__GIT_DIFF_DIR' 0
+
+# list all files that have changed. store this list in a separate
+# file so that we can test the exit status of this command. (if we had
+# bash we could use pipefail, or if we had Posix we could use mkfifo)
+git diff --raw "$@" > $__GIT_DIFF_DIR/toc
+
+# let the helper script accumulate them into the temporary directory
+cut -f 2- -s $__GIT_DIFF_DIR/toc | while read f; do
+ GIT_EXTERNAL_DIFF=git-dirdiff--helper git --no-pager diff "$@" $f
+done
+
+# run original diff program, reckoning it will understand directories
+# modes and shas does not apply to the root directories so submit dummy
+# values for those, hoping that the diff tool does not use them.
+git-difftool--helper - $__GIT_DIFF_DIR/old deadbeef 0755 $__GIT_DIFF_DIR/new babeface 0755
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] http.c: Use curl_multi_fdset to select on curl fds instead of just sleeping
From: Daniel Stenberg @ 2011-10-29 20:33 UTC (permalink / raw)
To: Mika Fischer; +Cc: git
In-Reply-To: <1319901621-482-1-git-send-email-mika.fischer@zoopnet.de>
On Sat, 29 Oct 2011, Mika Fischer wrote:
> Previously, when nothing could be read from the connections curl had open,
> git would just sleep unconditionally for 50ms. This patch changes this
> behavior and instead obtains the recommended timeout and the actual file
> descriptors from curl. This should eliminate time spent sleeping when data
> could actually be read/written on the socket.
It looks fine to me, from a libcurl perspective. I only have one comment about
this:
> + curl_multi_fdset(curlm, &readfds, &writefds, &excfds, &max_fd);
> +
> + select(max_fd+1, &readfds, &writefds, &excfds, &select_timeout);
At times, curl_multi_fdset() might return -1 in max_fd, as when there's no
internal socket around to provide to the application to wait for.
Calling select() with max_fd+1 (== 0) will then not be appreciated by all
implementations of select() so that case should probably also be covered by
the 50ms sleep approach...
--
/ daniel.haxx.se
^ permalink raw reply
* Re: What's cooking in git.git (Oct 2011, #11; Fri, 28)
From: Erik Faye-Lund @ 2011-10-29 15:42 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, msysGit
In-Reply-To: <7vzkglrnmc.fsf@alter.siamese.dyndns.org>
Cc'ing the msysgit list.
On Fri, Oct 28, 2011 at 8:12 PM, Junio C Hamano <gitster@pobox.com> wrote:
> * ef/mingw-upload-archive (2011-10-26) 3 commits
> - upload-archive: use start_command instead of fork
> - compat/win32/poll.c: upgrade from upstream
> - mingw: move poll out of sys-folder
>
> Are msysgit folks OK with this series (I didn't see msysgit list Cc'ed on
> these patches)? If so let's move this forward, as the changes to the core
> part seem solid.
>
The msysgit list not being Cc'ed on the patches was a slip-up on my
behalf. I believe the changes are relatively uncontroversial from an
msysgit point of view, though. However, an ack/nack would be
appreciated ;)
Or does people prefer me re-sending the series, with the msysgit list Cc'ed?
^ permalink raw reply
* [PATCH] http.c: Use curl_multi_fdset to select on curl fds instead of just sleeping
From: Mika Fischer @ 2011-10-29 15:20 UTC (permalink / raw)
To: git; +Cc: Mika Fischer
Previously, when nothing could be read from the connections curl had
open, git would just sleep unconditionally for 50ms. This patch changes
this behavior and instead obtains the recommended timeout and the actual
file descriptors from curl. This should eliminate time spent sleeping when
data could actually be read/written on the socket.
Signed-off-by: Mika Fischer <mika.fischer@zoopnet.de>
---
http.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/http.c b/http.c
index a4bc770..12180f3 100644
--- a/http.c
+++ b/http.c
@@ -649,6 +649,7 @@ void run_active_slot(struct active_request_slot *slot)
fd_set excfds;
int max_fd;
struct timeval select_timeout;
+ long int curl_timeout;
int finished = 0;
slot->finished = &finished;
@@ -664,14 +665,24 @@ void run_active_slot(struct active_request_slot *slot)
}
if (slot->in_use && !data_received) {
- max_fd = 0;
+ curl_multi_timeout(curlm, &curl_timeout);
+ if (curl_timeout == 0) {
+ continue;
+ } else if (curl_timeout == -1) {
+ select_timeout.tv_sec = 0;
+ select_timeout.tv_usec = 50000;
+ } else {
+ select_timeout.tv_sec = curl_timeout / 1000;
+ select_timeout.tv_usec = (curl_timeout % 1000) * 1000;
+ }
+
+ max_fd = -1;
FD_ZERO(&readfds);
FD_ZERO(&writefds);
FD_ZERO(&excfds);
- select_timeout.tv_sec = 0;
- select_timeout.tv_usec = 50000;
- select(max_fd, &readfds, &writefds,
- &excfds, &select_timeout);
+ curl_multi_fdset(curlm, &readfds, &writefds, &excfds, &max_fd);
+
+ select(max_fd+1, &readfds, &writefds, &excfds, &select_timeout);
}
}
#else
--
1.7.7.1.489.g1fee
^ permalink raw reply related
* Re: git slow over https
From: Mika Fischer @ 2011-10-29 15:15 UTC (permalink / raw)
To: Daniel Stenberg; +Cc: Git Mailing List
In-Reply-To: <alpine.DEB.2.00.1110282019510.28338@tvnag.unkk.fr>
Thanks for the pointer. Doing it this way fixes things for me. I'll
send a patch soon. I'd appreciate it if you could check it quicky.
Best,
Mika
On Fri, Oct 28, 2011 at 20:28, Daniel Stenberg <daniel@haxx.se> wrote:
> On Fri, 28 Oct 2011, Mika Fischer wrote:
>
>> 1) What's the purpose of the select in http.c:673? Can it be removed?
>> 2) If it serves a useful purpose, what can be the reason that it hurts
>> performance so much in my case?
>
> The purpose must be to avoid busy-looping in case there's nothing to read.
>
> It should probably use curl_multi_fdset [1] to get a decent set to wait for
> instead so that it'll return fast if there is pending data. The timeout for
> select can in fact also get extended with the use of curl_multi_timeout [2].
>
> 1 = http://curl.haxx.se/libcurl/c/curl_multi_fdset.html
> 2 = http://curl.haxx.se/libcurl/c/curl_multi_timeout.html
>
> --
>
> / daniel.haxx.se
>
>
^ permalink raw reply
* Re: [PATCHv2 3/3] completion: match ctags symbol names in grep patterns
From: SZEDER Gábor @ 2011-10-29 12:47 UTC (permalink / raw)
To: Jeff King; +Cc: git
In-Reply-To: <20111028060517.GA3993@sigill.intra.peff.net>
Hi,
On Thu, Oct 27, 2011 at 11:05:20PM -0700, Jeff King wrote:
> On Sun, Oct 23, 2011 at 11:29:28PM +0200, SZEDER Gábor wrote:
>
> > On Fri, Oct 21, 2011 at 01:30:21PM -0400, Jeff King wrote:
> > > This incorporates the suggestions from Gábor's review, with one
> > > exception: it still looks only in the current directory for the "tags"
> > > files. I think that might have some performance implications, so I'd
> > > rather add it separately, if at all.
> >
> > I agree that scanning through a whole working tree for tags files
> > would cost too much. But I think that a tags file at the top of the
> > working tree is common enough to be supported, and checking its
> > existence is fairly cheap.
>
> Actually, it's not too expensive. Asking git for the top of the working
> tree means it has to traverse up to there anyway. So the trick is just
> doing our search without invoking too many external tools which would
> cause unnecessary forks.
>
> The patch is below, but I'm still not sure it's a good idea.
>
> Grep only looks in the current subdirectory for matches.
Unless the user explicitly specifies the path(s)... But that comes at
the end of the command line, so the completion script could have no
idea about it at the time of 'git grep <TAB>'.
> > So how about something like this for the case arm? (I didn't actually
> > tested it.)
> >
> > local tagsfile
> > if test -r tags; then
> > tagsfile=tags
> > else
> > local dir="$(__gitdir)"
>
> You don't want __gitdir here, but rather "git rev-parse --show-cdup".
Oh, yes, indeed.
But there was a point in using __gitdir() here: it respects the
--git-dir= option. Which brings up the question: what
should 'git --git-dir=/some/where/.git grep <TAB>' offer?
So in the end I agree that it's not a good idea.
> > Btw, there is a bug in the case statement: 'git --no-pager grep <TAB>'
> > offers refs instead of symbols, because $cword is not 2 and $prev
> > doesn't start with a dash. But it's not worse than the current
> > behavior, so I don't think this bug is a show-stopper for the patch.
>
> Yeah. The intent of the "$cword is 2" thing is to know that we are the
> first non-option argument. Arguably, _get_comp_words_by_ref should
> somehow tell us which position we are completing relative to the actual
> command name.
_get_comp_words_by_ref() is a general completion function, the purpose
of which is to provide a bash-version-independent equivalent of
$COMP_WORDS and $COMP_CWORD by working around the different word
splitting rules. It doesn't know about git and its commands at all.
But there is the while loop in _git() that looks for the git command
(among other things) on the command line, which could store the index
of the command name in $words in a variable. This variable could then
be used in that case statement (and probably in a couple of other
places, too).
Best,
Gábor
> ---
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index af283cb..b0ed657 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1429,6 +1429,39 @@ _git_gitk ()
> _gitk
> }
>
> +__git_cdup_dirs() {
> + local prefix=$(git rev-parse --show-cdup 2>/dev/null)
> + local oldifs=$IFS
> + local dots
> + local i
> + IFS=/
> + for i in $prefix; do
> + dots=$dots../
> + echo "$dots"
> + done
> + IFS=$oldifs
> +}
No need for $oldifs here; do a local IFS=/ instead, and then it just
goes out of scope when returning from the function.
> +
> +__git_find_in_cdup_one() {
> + local dir=$1; shift
> + for i in "$@"; do
> + if test -r "$dir$i"; then
> + echo "$dir$i"
> + return 0
> + fi
> + done
> + return 1
> +}
> +
> +__git_find_in_cdup() {
> + __git_find_in_cdup_one "" "$@" && return
> +
> + local dir
> + for dir in $(__git_cdup_dirs); do
> + __git_find_in_cdup_one "$dir" "$@" && return
> + done
> +}
> +
> __git_match_ctag() {
> awk "/^${1////\\/}/ { print \$1 }" "$2"
> }
> @@ -1457,8 +1490,9 @@ _git_grep ()
>
> case "$cword,$prev" in
> 2,*|*,-*)
> - if test -r tags; then
> - __gitcomp "$(__git_match_ctag "$cur" tags)"
> + local tags=$(__git_find_in_cdup tags)
> + if test -n "$tags"; then
> + __gitcomp "$(__git_match_ctag "$cur" "$tags")"
> return
> fi
> ;;
^ permalink raw reply
* Re: Git is exploding
From: Ramkumar Ramachandra @ 2011-10-29 9:12 UTC (permalink / raw)
To: Tay Ray Chuan; +Cc: Øyvind A. Holm, git
In-Reply-To: <CALUzUxqHNByaV+TL2p4wBcwaLNpiaATw14Jgkb1YwcfXxNkMrg@mail.gmail.com>
Hi Tay,
Tay Ray Chuan writes:
> How were the numbers gathered? I looked around the page but gave up.
See: http://popcon.debian.org/FAQ
-- Ram
^ permalink raw reply
* Re: Git is exploding
From: Tay Ray Chuan @ 2011-10-29 8:36 UTC (permalink / raw)
To: Øyvind A. Holm; +Cc: git
In-Reply-To: <CAA787r=jeBv9moineaJVY=urYzEX+d7n23ED-txAGhLS+OPbmg@mail.gmail.com>
On Sat, Oct 29, 2011 at 8:39 AM, Øyvind A. Holm <sunny@sunbase.org> wrote:
> Found an interesting "Popularity Contest" graph on debian.org (via
> Thomas Bassetto on G+):
>
> http://bit.ly/rNxVN0
>
> Very cool indeed. Maybe it's the rise of GitHub, or simply that the
> user interface is mature enough that also "regular" users feel
> comfortable with it.
How were the numbers gathered? I looked around the page but gave up.
--
Cheers,
Ray Chuan
^ 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