* Re: [PATCH 2/3] t: mailmap: add 'git blame -e' tests
From: Jonathan Nieder @ 2012-02-04 21:13 UTC (permalink / raw)
To: Felipe Contreras; +Cc: git, Junio C Hamano, Marius Storm-Olsen
In-Reply-To: <CAMP44s3tmiPGgAUakUgoen2aJcsKw4CygtF5f=4x2dxNTrGbGA@mail.gmail.com>
Felipe Contreras wrote:
> On Sat, Feb 4, 2012 at 10:10 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Since I didn't receive a copy of the cover letter or patch 1, I don't
>> know what this is intended to test _for_. Good --- I can more easily
>> convey the reaction of future readers who do not necessarily know the
>> context in which the patch was written (and the commit message does
>> not seem to say).
[...]
> Look at the title:
> add 'git blame -e' tests
>
> s/blame/blame -e/
And? After copy/pasting this particular test with that substitution,
what do we get a test for? What class of problem is it supposed to
catch? I do not think a sentence or two is too much to ask for.
By the way, "I blindly copy/pasted" does not seem like a very sensible
excuse for writing meaningless code (such as the "# git blame" comment
line). Before the code contained one riddle. Afterwards it has two.
Hope that helps,
Jonathan
^ permalink raw reply
* Re: [PATCH 3/3] t: mailmap: add simple name translation test
From: Jonathan Nieder @ 2012-02-04 21:15 UTC (permalink / raw)
To: Felipe Contreras; +Cc: git, Junio C Hamano, Marius Storm-Olsen, Jim Meyering
In-Reply-To: <CAMP44s1ZPQJzHzYj7e4Kj3Cu+qq0Q3uKrwsE=xS7BmmSqd3gSw@mail.gmail.com>
Felipe Contreras wrote:
> Title: mailmap: add simple name translation test
Thanks. I guess you think I'm stupid. I have no idea how I can
correct that assumption and help you to actually work with me to make
the code better. :/
^ permalink raw reply
* Re: How to change the index for git status?
From: PJ Weisberg @ 2012-02-04 21:24 UTC (permalink / raw)
To: Peng Yu; +Cc: git
In-Reply-To: <CABrM6wngVDotJoe3Yi5cA_n=JWpLa+M35QEeoKqr1tsp5GD3ng@mail.gmail.com>
On Sat, Feb 4, 2012 at 12:08 PM, Peng Yu <pengyu.ut@gmail.com> wrote:
> Hi,
>
> When I run git status, it show the status compared against the branch
> upstream/develop. I want it to compare against origin/develop. I
> checked progit. But I don't see how to change the branch to compare
> to. Could anybody let me know how to do so? Thanks!
>
> ~/dvcs_src/craftyjs1/Crafty/build/api$ git status
> # On branch 2D_doc_dev
> # Your branch is ahead of 'upstream/develop' by 2 commits.
> #
> nothing to commit (working directory clean)
git branch --set-upstream 2D_doc_dev origin/develop
-PJ
Gehm's Corrollary to Clark's Law: Any technology distinguishable from
magic is insufficiently advanced.
^ permalink raw reply
* Re: [PATCH 5/5] run-command: Error out if interpreter not found
From: Frans Klaver @ 2012-02-04 21:31 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Junio C Hamano, Johannes Sixt, git, Jeff King
In-Reply-To: <20120127094145.GA2611@burratino>
On Fri, 27 Jan 2012 10:41:45 +0100, Jonathan Nieder <jrnieder@gmail.com>
wrote:
> Frans Klaver wrote:
>
>> Just for my understanding: before a command is executed, a pager
>> (less/more or so) is started? We want to avoid starting the pager if
>> we won't be able to execute the command?
>
> See [1] for an example of a recent patch touching the relevant
> code path.
>
> For example: if I run "git --paginate foo", foo is an alias for bar,
> and the "[pager] bar" configuration is set to point to "otherpager",
> then without this safety git launches the default pager in preparation
> for running git-foo, receives ENOENT from execvp("git-foo"), and then
> the pager has already been launched and it is too late to launch
> otherpager instead.
Took me a while to catch your drift, but if I understand correctly, you're
thinking using some of the code to find out if starting the pager is a
good idea or not. If I factor out the part that finds a command in PATH,
there's the helper that with a fair amount of certainty, will predict
whether 'git foo' will fail with ENOENT or not. It would fix a possible
problem that is currently there. Obviously the only case we can catch, is
the command not actually existing. Although it is just one of the cases
ENOENT can be returned for, I think it is the only one git actually cares
about when checking for it.
>> On Fri, Jan 27, 2012 at 9:48 AM, Jonathan Nieder <jrnieder@gmail.com>
>> wrote:
>
>>> I want to like (b), but the downside seems unacceptable.
>>
>> The downside being: having to figure out what execvp is going to do?
>> That would be tantamount to writing your own execvp.
>
> Exactly.
So as it seems, there are a few cases where we can fairly reliably predict
whether a command is or isn't going to be found. Unless I'm mistaken,
dashed externals are never shell built-ins and so we don't have to be able
to check for their existence. Then assuming that silent_exec_failure
really only cares about commands actually not existing, we can be fairly
naive about it. See if we can find it somewhere in PATH and if we can't
bail out. If we can, start the pager and everything execvp then returns
will be regarded a fatal error. In this case it would be a choice between
spawning the wrong pager, or having a quick browse through the file system.
> That's part of why I was really grateful to Hannes for the reminder to
> take a step back for a moment and consider whether it's worth it.
It may be a sensible reminder. I didn't understand that comment as such.
Maybe it's Hannes' style, I don't know.
> Maybe there's another way or a more targetted way to take care of the
> motivational original confusing scenario that leads to execvp errors.
> (By the way, can you remind me which one that was?)
Been thinking about it and I doubt it. To find out whether EACCES is
returned due to a PATH issue, you have to go through all of those PATH
entries. So while you're at it, there's a lot more you can check and most
of those checks are fairly trivial to do.
I think I've worked through all your review comments. I'll address Hannes'
comments, create an RFC series and see where we end up.
Junio, care to be CC'd in that?
Thanks,
Frans
> [1] http://thread.gmane.org/gmane.comp.version-control.git/179635
^ permalink raw reply
* Re: Git performance results on a large repository
From: Greg Troxel @ 2012-02-04 21:42 UTC (permalink / raw)
To: Joshua Redstone; +Cc: git@vger.kernel.org
In-Reply-To: <CB5074CF.3AD7A%joshua.redstone@fb.com>
[-- Attachment #1: Type: text/plain, Size: 3075 bytes --]
Joshua Redstone <joshua.redstone@fb.com> writes:
> The test repo has 4 million commits, linear history and about 1.3 million
> files. The size of the .git directory is about 15GB, and has been
> repacked with 'git repack -a -d -f --max-pack-size=10g --depth=100
> --window=250'. This repack took about 2 days on a beefy machine (I.e.,
> lots of ram and flash). The size of the index file is 191 MB. I can share
> the script that generated it if people are interested - It basically picks
> 2-5 files, modifies a line or two and adds a few lines at the end
> consisting of random dictionary words, occasionally creates a new file,
> commits all the modifications and repeats.
I have a repository with about 500K files, 3.3G checkout, 1.5G .git, and
about 10K commits. (This is a real repository, not a test case.) So
not as many commits by a lot, but the size seems not so far off.
> I timed a few common operations with both a warm OS file cache and a cold
> cache. i.e., I did a 'echo 3 | tee /proc/sys/vm/drop_caches' and then did
> the operation in question a few times (first timing is the cold timing,
> the next few are the warm timings). The following results are on a server
> with average hard drive (I.e., not flash) and > 10GB of ram.
>
> 'git status' : 39 minutes cold, and 24 seconds warm.
Both of these numbers surprise me. I'm using NetBSD, whose stat
implementation isn't as optimized as Linux (you didn't say, but
assuming). On a years-old desktop, git status seems to be about a
minute semi-cold and 5s warm (once I set the vnode cache big over 500K,
vs 350K default for a 2G ram machine).
So on the warm status, I wonder how big your vnode cache is, and if
you've exceeded it, and I don't follow the cold time at all. Probably
some sort of profiling within git status would be illuminating.
> 'git blame': 44 minutes cold, 11 minutes warm.
>
> 'git add' (appending a few chars to the end of a file and adding it): 7
> seconds cold and 5 seconds warm.
>
> 'git commit -m "foo bar3" --no-verify --untracked-files=no --quiet
> --no-status': 41 minutes cold, 20 seconds warm. I also hacked a version
> of git to remove the three or four places where 'git commit' stats every
> file in the repo, and this dropped the times to 30 minutes cold and 8
> seconds warm.
So without the stat, I wonder what it's doing that takes 30 minutes.
> One way to get there is to do some deep code modifications to git
> internals, to, for example, create some abstractions and interfaces that
> allow plugging in the specialized servers. Another way is to leave git
> internals as they are and develop a layer of wrapper scripts around all
> the git commands that do the necessary interfacing. The wrapper scripts
> seem perhaps easier in the short-term, but may lead to increasing
> divergence from how git behaves natively and also a layer of complexity.
Having hooks for a blame server cache, etc. sounds sensible. Having a
way to call blames sort of like with --since and then keep updating it
(eg. in emacs) to earlier times sounds useful.
[-- Attachment #2: Type: application/pgp-signature, Size: 194 bytes --]
^ permalink raw reply
* Re: Breakage in master?
From: Erik Faye-Lund @ 2012-02-04 21:55 UTC (permalink / raw)
To: Jeff King; +Cc: Git Mailing List, msysGit, Ævar Arnfjörð
In-Reply-To: <CABPQNSZfKCTsuusPpHa2djEOeGVN9z5s_Fr+S3EaHiv7Q4Re9w@mail.gmail.com>
On Fri, Feb 3, 2012 at 1:28 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:
> On Thu, Feb 2, 2012 at 6:46 PM, Jeff King <peff@peff.net> wrote:
>> On Thu, Feb 02, 2012 at 01:14:19PM +0100, Erik Faye-Lund wrote:
>>
>>> But here's the REALLY puzzling part: If I add a simple, unused
>>> function to diff-lib.c, like this:
>>> [...]
>>> "git status" starts to error out with that same vsnprintf complaint!
>>>
>>> ---8<---
>>> $ git status
>>> # On branch master
>>> # Changes not staged for commit:
>>> # (use "git add <file>..." to update what will be committed)
>>> fatal: BUG: your vsnprintf is broken (returned -1)
>>> ---8<---
>>
>> OK, that's definitely odd.
>>
>> At the moment of the die() in strbuf_vaddf, what does errno say?
>
> If I apply this patch:
> ---8<---
> diff --git a/strbuf.c b/strbuf.c
> index ff0b96b..52dfdd6 100644
> --- a/strbuf.c
> +++ b/strbuf.c
> @@ -218,7 +218,7 @@ void strbuf_vaddf(struct strbuf *sb, const char
> *fmt, va_list ap)
> len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, cp);
> va_end(cp);
> if (len < 0)
> - die("BUG: your vsnprintf is broken (returned %d)", len);
> + die_errno("BUG: your vsnprintf is broken (returned %d)", len);
> if (len > strbuf_avail(sb)) {
> strbuf_grow(sb, len);
> len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
> ---8<---
>
> Then I get "fatal: BUG: your vsnprintf is broken (returned -1): Result
> too large". This goes both for both failure cases I described. I
> assume this means errno=ERANGE.
>
>> vsnprintf should generally never be returning -1 (it should return the
>> number of characters that would have been written). Since you're on
>> Windows, I assume you're using the replacement version in
>> compat/snprintf.c.
>
> No. SNPRINTF_RETURNS_BOGUS is only set for the MSVC target, not for
> the MinGW target. I'm assuming that means MinGW-runtime has a sane
> vsnprintf implementation. But even if I enable SNPRINTF_RETURNS_BOGUS,
> the problem occurs. And it's still "Result too large".
>
> So I decided to do a bit of stepping, and it seems libintl takes over
> vsnprintf, directing us to libintl_vsnprintf instead. I guess this is
> so it can ensure we support reordering the parameters with $1 etc...
> And aparently this vsnprintf implementation calls the system vnsprintf
> if the format string does not contain '$', and it's using _vsnprintf
> rather than vsnprintf on Windows. _vsnprintf is the MSVCRT-version,
> and not the MinGW-runtime, which needs SNPRINTF_RETURNS_BOGUS.
>
> So I guess I can patch libintl to call vsnprintf from MinGW-runtime instead.
>
Indeed, I just got around to testing this, and doing this on top of
gettext seems to fix the problem for me. For the MSVC, a more
elaborate fix is needed, as it doesn't have a sane vsnprintf.
---
diff --git a/gettext-runtime/intl/printf.c b/gettext-runtime/intl/printf.c
index b7cdc5d..f55023e 100644
--- a/gettext-runtime/intl/printf.c
+++ b/gettext-runtime/intl/printf.c
@@ -192,7 +192,7 @@ libintl_sprintf (char *resultbuf, const char *format, ...)
#if HAVE_SNPRINTF
-# if HAVE_DECL__SNPRINTF
+# if HAVE_DECL__SNPRINTF && !defined(__MINGW32__)
/* Windows. */
# define system_vsnprintf _vsnprintf
# else
^ permalink raw reply related
* Re: [PATCH 2/3] t: mailmap: add 'git blame -e' tests
From: Felipe Contreras @ 2012-02-04 21:59 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git, Junio C Hamano, Marius Storm-Olsen
In-Reply-To: <20120204211351.GB3278@burratino>
On Sat, Feb 4, 2012 at 11:13 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Felipe Contreras wrote:
>> On Sat, Feb 4, 2012 at 10:10 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>
>>> Since I didn't receive a copy of the cover letter or patch 1, I don't
>>> know what this is intended to test _for_. Good --- I can more easily
>>> convey the reaction of future readers who do not necessarily know the
>>> context in which the patch was written (and the commit message does
>>> not seem to say).
> [...]
>> Look at the title:
>> add 'git blame -e' tests
>>
>> s/blame/blame -e/
>
> And? After copy/pasting this particular test with that substitution,
> what do we get a test for?
For 'git blame -e'.
> What class of problem is it supposed to catch?
Problems related to 'git blame -e'?
> By the way, "I blindly copy/pasted" does not seem like a very sensible
> excuse for writing meaningless code (such as the "# git blame" comment
> line). Before the code contained one riddle. Afterwards it has two.
Fine, the drop the patch then... Who needs to test 'git blame -e'
anyway, the current situation of having zero tests for it is perfectly
fine.
Or just apply it. Don't let the perfect be the enemy of the good.
Cheers.
--
Felipe Contreras
^ permalink raw reply
* Re: [PATCH 3/3] t: mailmap: add simple name translation test
From: Felipe Contreras @ 2012-02-04 22:19 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git, Junio C Hamano, Marius Storm-Olsen, Jim Meyering
In-Reply-To: <20120204211544.GC3278@burratino>
On Sat, Feb 4, 2012 at 11:15 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Felipe Contreras wrote:
>
>> Title: mailmap: add simple name translation test
>
> Thanks. I guess you think I'm stupid. I have no idea how I can
> correct that assumption and help you to actually work with me to make
> the code better. :/
You mean the commit message, you haven't made any comment about the code.
If you want to know why I had to modify those test assertions, you
really need to look at the code. In essence; all of them use the same
repo, and obviously adding a new commit message changes the output of
the commands.
--
Felipe Contreras
^ permalink raw reply
* Re: Git-gui: crashes on OS X when entering combining ("dead") keys
From: Pat Thoyts @ 2012-02-04 23:07 UTC (permalink / raw)
To: Beat Bolli; +Cc: git
In-Reply-To: <4F2B085C.2000508@drbeat.li>
Beat Bolli <ig@drbeat.li> writes:
>Hi
>
>I've just had git-gui crash on me when I tried to enter the ~ (tilde)
>character on my Mac mini under OS X 10.6.8:
>
This doesn't look git-gui specific so you will likely get more results
posting to the comp.lang.tcl newsgroup about this - or there is a
mac-specific tcl/tk list someplace.
Not posessing a Mac I can't look into this at all - but an
NSException -- that is a problem from the Tk to native layer.
--
Pat Thoyts http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
^ permalink raw reply
* Re: [PATCH 0/9] respect binary attribute in grep
From: Jeff King @ 2012-02-04 23:18 UTC (permalink / raw)
To: Pete Wyckoff
Cc: Junio C Hamano, Thomas Rast, Conrad Irwin, git,
Nguyen Thai Ngoc Duy, Dov Grobgeld
In-Reply-To: <20120204192252.GA15319@padd.com>
On Sat, Feb 04, 2012 at 02:22:52PM -0500, Pete Wyckoff wrote:
> I took a look at this series. It's nice. My worry was that the
> extra open() of non-existent .gitattributes files in all the
> directories would cause performance problems across networked
> filesystems like NFS.
Yeah, I was able to measure a small slow-down on a quick grep even with
a warm cache. So it does take some extra effort, but I think the
correctness is worth it (and note that the slow down is in the tens of
milliseconds if you have a reasonable stat()).
If people have big trees on NFS (or some other slow-stat system) where
these lookups are actually a problem, I'd rather see a global option to
disable .gitattributes lookups for both diff and grep (i.e., a "trust
me, I'm not using gitattributes, and don't bother with stat" flag). In
practice, though, I think such a thing is not necessary because the
stat() is local to the file being examined (e.g., for "foo/bar/baz", we
look only at "foo/bar/.gitattributes", "foo/.gitattributes", and
".gitattributes", without having to touch other parts of the tree).
Anyway, thanks for doing some performance testing. More data is always
good.
> It could be plausible that deep directory structures with few
> grep-able files will suffer with this change. For example, many
> big binary blobs in deep directory hierarchies, but also some
> useful files here and there.
>
> One could argue that with the use of .gitattributes to specify
> which blobs should not be searched, this series makes this faster
> by not having to to read the binary blobs at all. And I'd be
> okay with that.
Yes, exactly. I think this will end up being a big win for such cases,
because the cost of loading even one large binary file from disk will
dwarf all of the stats. But it does depend on people marking their
binaries and using "-I".
-Peff
^ permalink raw reply
* Re: [bug] blame duplicates trailing ">" in mailmapped emails
From: Jeff King @ 2012-02-04 23:20 UTC (permalink / raw)
To: Felipe Contreras; +Cc: Junio C Hamano, Jonathan Nieder, git, SZEDER Gábor
In-Reply-To: <CAMP44s2r-fcnfpdT4u5U7TwF1z6Abp+J1U7oqfsSrYMuD6weOQ@mail.gmail.com>
On Sat, Feb 04, 2012 at 09:30:42PM +0200, Felipe Contreras wrote:
> > but it feels like the fix should go into map_user. I tried a few things,
> > like "git log -1 --format=%aE", and couldn't find other code paths with
> > this problem. So presumably they are all feeding email addresses without
> > the closing ">" (so one option is to just say "map_user needs to get
> > NUL-terminated strings).
>
> Perhaps, but I though the idea was to make it efficient. I think the
> above fix should be ok.
Because of the calling convention of map_user, the buffer with the input
must also be writable (since it holds the result). So there should be no
loss of efficiency to convert the ">" into a "\0" (and in fact, the
simplest fix is probably to just have map_user "tie off" any ">" it
detects).
> We should have tests for this though, to make sure it doesn't get
> broken again. I'm on that.
Definitely. Thanks for working on it.
-Peff
^ permalink raw reply
* Re: Git-gui: crashes on OS X when entering combining ("dead") keys
From: Beat Bolli @ 2012-02-04 23:29 UTC (permalink / raw)
To: Pat Thoyts; +Cc: git
In-Reply-To: <871uqafba4.fsf@fox.patthoyts.tk>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 05.02.12 00:07, Pat Thoyts wrote:
> Beat Bolli <ig@drbeat.li> writes:
>
>> Hi
>>
>> I've just had git-gui crash on me when I tried to enter the ~
>> (tilde) character on my Mac mini under OS X 10.6.8:
>>
>
> This doesn't look git-gui specific so you will likely get more
> results posting to the comp.lang.tcl newsgroup about this - or
> there is a mac-specific tcl/tk list someplace.
OK, I'll try to find the appropriate group.
Thanks,
Beat
- --
mail: echo '<bNbolOli@ewaSPnetAM.ch>' | tr -d '[A-S]'
pgp: 0x506A903A; 49D5 794A EA77 F907 764F D89E 304B 93CF 506A 903A
gsm: 4.7.7.6.0.7.7.9.7.1.4.e164.arpa
icbm: 47.0452 N, 7.2715 E
"It takes love over gold, and mind over matter" -- Dire Straits
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk8tv2AACgkQMEuTz1BqkDqWAgCeOvSzdtYqzAsIZ3VFxd7HbNmY
HxYAoMpAdrYx8QoxlSX7blBj/y66wMQP
=WvyW
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: [PATCH 1/3] blame: fix email output with mailmap
From: Jeff King @ 2012-02-04 23:39 UTC (permalink / raw)
To: Felipe Contreras
Cc: git, Junio C Hamano, Brian Gianforcaro, Marius Storm-Olsen,
Junio C Hamano
In-Reply-To: <1328385024-6955-2-git-send-email-felipe.contreras@gmail.com>
On Sat, Feb 04, 2012 at 09:50:22PM +0200, Felipe Contreras wrote:
> diff --git a/builtin/blame.c b/builtin/blame.c
> index 5a67c20..dd69e51 100644
> --- a/builtin/blame.c
> +++ b/builtin/blame.c
> @@ -1403,10 +1403,13 @@ static void get_ac_line(const char *inbuf, const char *what,
> * Now, convert both name and e-mail using mailmap
> */
> if (map_user(&mailmap, mail+1, mail_len-1, person, tmp-person-1)) {
> - /* Add a trailing '>' to email, since map_user returns plain emails
> - Note: It already has '<', since we replace from mail+1 */
> + /*
> + * Add a trailing '>' to email, since map_user returns plain
> + * emails when it finds a matching mail.
> + * Note: It already has '<', since we replace from mail + 1
> + */
> mailpos = memchr(mail, '\0', mail_len);
> - if (mailpos && mailpos-mail < mail_len - 1) {
> + if (mailpos && mailpos-mail < mail_len - 1 && *(mailpos - 1) != '>') {
> *mailpos = '>';
> *(mailpos+1) = '\0';
I'm not sure if it's possible, but do you need to be checking that
"mailpos > mail" to avoid reading off the beginning of the buffer?
It would mean the email field is empty, which may or may not be
possible.
-Peff
^ permalink raw reply
* Re: [PATCH 3/3] t: mailmap: add simple name translation test
From: Jeff King @ 2012-02-04 23:42 UTC (permalink / raw)
To: Felipe Contreras
Cc: Jonathan Nieder, git, Junio C Hamano, Marius Storm-Olsen,
Jim Meyering
In-Reply-To: <CAMP44s0Z=k6VBfv0HOGHyMBLRcPauK7K5RNvuRDbfq5=5aKVpg@mail.gmail.com>
On Sun, Feb 05, 2012 at 12:19:53AM +0200, Felipe Contreras wrote:
> > Thanks. I guess you think I'm stupid. I have no idea how I can
> > correct that assumption and help you to actually work with me to make
> > the code better. :/
>
> You mean the commit message, you haven't made any comment about the code.
>
> If you want to know why I had to modify those test assertions, you
> really need to look at the code. In essence; all of them use the same
> repo, and obviously adding a new commit message changes the output of
> the commands.
Then say that in the commit message.
Looking at this series, I wonder if the tests should simply be squashed
into the bugfix patch, which might make what is going on more obvious.
Keep in mind that as reviewers now, we read the whole series. But in a
year, as "git log" users, we may see the commits in isolation.
-Peff
^ permalink raw reply
* Specifying revisions in the future
From: jpaugh @ 2012-02-04 15:58 UTC (permalink / raw)
To: git
Hello.
Is it possible to specify revisions in the future? The gitrevisions man
page implies otherwise. Alternatively, is there a way to find out the
number of commits between two revs---assuming one is an ancestor of the
other?
I want to do a certain arbitrary operation for each revision between
where I am now and the tip of the branch.
v1.0-a master
\ \
o---o---o---o---o---o---o
|
I am here
I've been using the following to do what I want:
ref=master; \
for i in {5..1}; do \
echo; \
git log --stat $ref~$i^\!; \
read -p 'Full diff? '; \
echo; \
if [[ $REPLY == 'y' ]]; then \
git diff $ref~$i^\!; \
fi; \
done;
which lists the log and diffstat for last 5 commits between master and
where I am (e.g. an older tag/branch) with an optional full diff. I know
implementing revision specifiers to the future is nontrivial. (I
realized that when I considered non-linear histories.) In this case,
I've distilled it to the point that all I need is the number of commits
between two revs. Can this be had without manually inspecting git log?
Or, is there a better way to get detailed diffs like this?
Thanks.
Jonathan Paugh
^ permalink raw reply
* [PATCH] Change include order in two compat/ files to avoid compiler warning
From: Ben Walton @ 2012-02-05 1:08 UTC (permalink / raw)
To: git, gitster; +Cc: Ben Walton
The inet_ntop and inet_pton compatibility wrapper source files
included system headers before git-compat-utils.h. This was causing a
warning on Solaris as _FILE_OFFSET_BITS was being redefined in
git-compat-utils.h. Including git-compat-utils.h first avoids the
warnings.
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
I verified that this re-ordering doesn't affect either the build or the
test suite completion on both i386 and sparc. I think the ordering is
simply the result of placing the git-compat-utils.h include where some
others were removed in da523cc597b1.
compat/inet_ntop.c | 4 +---
compat/inet_pton.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/compat/inet_ntop.c b/compat/inet_ntop.c
index 60b5a1d..f1bf81c 100644
--- a/compat/inet_ntop.c
+++ b/compat/inet_ntop.c
@@ -15,11 +15,9 @@
* SOFTWARE.
*/
+#include "../git-compat-util.h"
#include <errno.h>
#include <sys/types.h>
-
-#include "../git-compat-util.h"
-
#include <stdio.h>
#include <string.h>
diff --git a/compat/inet_pton.c b/compat/inet_pton.c
index 2ec995e..1d44a5d 100644
--- a/compat/inet_pton.c
+++ b/compat/inet_pton.c
@@ -15,11 +15,9 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "../git-compat-util.h"
#include <errno.h>
#include <sys/types.h>
-
-#include "../git-compat-util.h"
-
#include <stdio.h>
#include <string.h>
--
1.7.8.3
^ permalink raw reply related
* Re: Specifying revisions in the future
From: Jakub Narebski @ 2012-02-05 2:44 UTC (permalink / raw)
To: Jonathan Paugh; +Cc: git
In-Reply-To: <jgjkk0$qrg$1@dough.gmane.org>
jpaugh@gmx.us writes:
> Hello.
> I want to do a certain arbitrary operation for each revision between
> where I am now and the tip of the branch.
>
> v1.0-a master
> \ \
> o---o---o---o---o---o---o
> |
> I am here
That is the problem X.
> Is it possible to specify revisions in the future? The gitrevisions man
> page implies otherwise. Alternatively, is there a way to find out the
> number of commits between two revs---assuming one is an ancestor of the
> other?
That is your idea of a solution, Y.
You have XY problem. You need to do X, and you think you can use Y to
do X, so you ask about how to do Y.
If you want to list all revsions between v1.0-a and master, use
git rev-list v1.0a..master
or
git rev-list --ancestry-path v1.0a..master
depending on definition of _between_ (see "History simplification" in
git-log(1) manpage for description of `--ancestry-path` option).
>
> I've been using the following to do what I want:
>
> ref=master; \
> for i in {5..1}; do \
> echo; \
> git log --stat $ref~$i^\!; \
> read -p 'Full diff? '; \
> echo; \
> if [[ $REPLY == 'y' ]]; then \
> git diff $ref~$i^\!; \
> fi; \
> done;
>
> which lists the log and diffstat for last 5 commits between master and
> where I am (e.g. an older tag/branch) with an optional full diff. I know
> implementing revision specifiers to the future is nontrivial. (I
> realized that when I considered non-linear histories.) In this case,
> I've distilled it to the point that all I need is the number of commits
> between two revs. Can this be had without manually inspecting git log?
> Or, is there a better way to get detailed diffs like this?
--
Jakub Narebski
^ permalink raw reply
* Re: Specifying revisions in the future
From: Jakub Narebski @ 2012-02-05 3:07 UTC (permalink / raw)
To: Jonathan Paugh; +Cc: git
In-Reply-To: <4F2DEF89.4030302@gmx.us>
Jonathan Paugh wrote:
> > You have XY problem. You need to do X, and you think you can use Y to
> > do X, so you ask about how to do Y.
> >
> > If you want to list all revsions between v1.0-a and master, use
> >
> > git rev-list v1.0a..master
> >
> > or
> >
> > git rev-list --ancestry-path v1.0a..master
> Thanks. This Y' will take me to lot's of exciting destinations---and I
> must confess I haven't messed with the plumbing heretofore.
Of course you can also do
git log --ancestry-path v1.0a..master
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: Git performance results on a large repository
From: Nguyen Thai Ngoc Duy @ 2012-02-05 3:47 UTC (permalink / raw)
To: Joshua Redstone; +Cc: git@vger.kernel.org
In-Reply-To: <243C23AF01622E49BEA3F28617DBF0AD5912CA85@SC-MBX02-5.TheFacebook.com>
On Sun, Feb 5, 2012 at 1:05 AM, Joshua Redstone <joshua.redstone@fb.com> wrote:
> It's also conceivable that, if there were an external interface in git to attach other
> systems to efficiently report which files have changed (e.g., via file-system integration),
> it's possible that we could omit managing the index in many cases.
> I know that would be a big change, but the benefits are intriguing.
The "interface to report which files have changed" is exactly "git
update-index --[no-]assume-unchanged" is for. Have a look at the man
page. Basically you can mark every file "unchanged" in the beginning
and git won't bother lstat() them. What files you change, you have to
explicitly run "git update-index --no-assume-unchanged" to tell git.
Someone on HN suggested making assume-unchanged files read-only to
avoid 90% accidentally changing a file without telling git. When
assume-unchanged bit is cleared, the file is made read-write again.
--
Duy
^ permalink raw reply
* Re: Git performance results on a large repository
From: david @ 2012-02-05 4:30 UTC (permalink / raw)
To: Joshua Redstone; +Cc: git@vger.kernel.org
In-Reply-To: <CB5074CF.3AD7A%joshua.redstone@fb.com>
On Fri, 3 Feb 2012, Joshua Redstone wrote:
> The test repo has 4 million commits, linear history and about 1.3 million
> files. The size of the .git directory is about 15GB, and has been
> repacked with 'git repack -a -d -f --max-pack-size=10g --depth=100
> --window=250'. This repack took about 2 days on a beefy machine (I.e.,
> lots of ram and flash). The size of the index file is 191 MB.
This may be a silly thought, but what if instead of one pack file of your
entire history (4 million commits) you create multiple packs (say every
half million commits) and mark all but the most recent pack as .keep (so
that they won't be modified by a repack)
that way things that only need to worry about recent history (blame, etc)
will probably never have to go past the most recent pack file or two
I may be wrong, but I think that when git is looking for 'similar files'
for delta compression, it limits it's search to the current pack, so this
will also keep you from searching the entire project history.
David Lang
^ permalink raw reply
* Re: [PATCH 3/3] t: mailmap: add simple name translation test
From: Jonathan Nieder @ 2012-02-05 6:17 UTC (permalink / raw)
To: Felipe Contreras; +Cc: git, Junio C Hamano, Marius Storm-Olsen, Jim Meyering
In-Reply-To: <CAMP44s0Z=k6VBfv0HOGHyMBLRcPauK7K5RNvuRDbfq5=5aKVpg@mail.gmail.com>
Felipe Contreras wrote:
> You mean the commit message, you haven't made any comment about the code.
No, for this patch, more important than the absence of any explanation
in the commit message (which is also important) is the code change
that seems unnecessarily invasive.
You've already demonstrated that I do not have the right communication
style to explain such things to you and work towards a fix that
addresses both our concerns. So I give up. I'll just give my
feedback on patches that concern code I care about and an explanation
for the sake of others on the list that are better able to interact
with you. I am willing to work with or answer questions from anyone
including you, though.
Sorry,
Jonathan
^ permalink raw reply
* Build oddities
From: Michael @ 2012-02-05 6:34 UTC (permalink / raw)
To: git
Hi there,
I ran into a build oddity with git today - the environment variable $X is
appended to most binaries. At the time, I had X=last, so I ended up with
gitlast, git-peek-remotelast etc.
Does anyone know why this behaviour exists, and if it is still desired?
Best regards,
Michael
^ permalink raw reply
* Re: Build oddities
From: Nguyen Thai Ngoc Duy @ 2012-02-05 6:46 UTC (permalink / raw)
To: Michael; +Cc: git
In-Reply-To: <loom.20120205T072940-523@post.gmane.org>
On Sun, Feb 5, 2012 at 1:34 PM, Michael <kensington@astralcloak.net> wrote:
> Hi there,
>
> I ran into a build oddity with git today - the environment variable $X is
> appended to most binaries. At the time, I had X=last, so I ended up with
> gitlast, git-peek-remotelast etc.
$X is to append .exe for Windows build so you would get git.exe,
git-peek-remote.exe... We should set X to empty from the beginning.
Patches are welcome.
--
Duy
^ permalink raw reply
* [PATCH 0/3] On compresing large index
From: Nguyễn Thái Ngọc Duy @ 2012-02-05 8:30 UTC (permalink / raw)
To: git; +Cc: Joshua Redstone, Nguyễn Thái Ngọc Duy
I was thinking whether compressing index might help when it contained
~2M files. It turns out that only makes the situation worse. Anyway, I
post the code and some numbers here.
The index is created artifically with the program [1]
$ git init
$ touch foo
$ git hash-object -w foo
$ ./a.out 256 256 32 | git update-index --index-info
That gives ~2M files in index, 209 MB in size.
$ time ~/w/git/git ls-files | head >/dev/null
real 0m4.635s
user 0m4.258s
sys 0m0.329s
$ time ~/w/git/git update-index level-0-0000/foo
real 0m4.593s
user 0m4.264s
sys 0m0.323s
Index is compressed with GIT_ZCACHE=1.
$ GIT_ZCACHE=1 ~/w/git/git update-index level-0-0000/foo
which gives 6.8 MB index (the true number may be less impressive
because compressing rate in my artificial tree is really high). The
only problem with this is git uses more time, not less
$ time ~/w/git/git ls-files | head >/dev/null
real 0m4.970s
user 0m4.675s
sys 0m0.289s
$ time GIT_ZCACHE=1 ~/w/git/git update-index level-0-0000/foo
real 0m4.959s
user 0m4.682s
sys 0m0.273s
My guess is Linux caches the whole index in memory already so I/O time
does not really matter, while we still have to pay for zlib's time. We
need to figure out what git uses 4s user time for.
This series may be useful on OSes that do not cache heavily. Though
I'm not sure if there is any out there nowadays.
Nguyễn Thái Ngọc Duy (3):
read-cache: factor out cache entries reading code
read-cache: reduce malloc/free during writing index
Support compressing index when GIT_ZCACHE=1
cache.h | 1 +
read-cache.c | 172 +++++++++++++++++++++++++++++++++++++++++++++++++---------
2 files changed, 148 insertions(+), 25 deletions(-)
[1]
-- 8< --
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
const char *prefix = "100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\t";
int l1, l2, l3;
int m1, m2, m3;
m1 = atoi(argv[1]);
m2 = atoi(argv[2]);
m3 = atoi(argv[3]);
for (l1 = 0; l1 < m1; l1++) {
printf("%slevel-0-%04d/foo\n", prefix, l1);
for (l2 = 0; l2 < m2; l2++)
for (l3 = 0; l3 < m3; l3++)
printf("%slevel-0-%04d/level-1-%04d/foo-%04d\n",
prefix, l1, l2, l3);
}
return 0;
}
-- 8< --
--
1.7.8.36.g69ee2
^ permalink raw reply
* [PATCH 2/3] read-cache: reduce malloc/free during writing index
From: Nguyễn Thái Ngọc Duy @ 2012-02-05 8:30 UTC (permalink / raw)
To: git; +Cc: Joshua Redstone, Nguyễn Thái Ngọc Duy
In-Reply-To: <1328430605-4566-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
read-cache.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/read-cache.c b/read-cache.c
index 2dbf923..7b9a989 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1521,12 +1521,19 @@ static void ce_smudge_racily_clean_entry(struct cache_entry *ce)
}
}
-static int ce_write_entry(git_SHA_CTX *c, int fd, struct cache_entry *ce)
+static int ce_prepare_ondisk_entry(struct cache_entry *ce,
+ void **ondisk_p, int *ondisk_size)
{
int size = ondisk_ce_size(ce);
- struct ondisk_cache_entry *ondisk = xcalloc(1, size);
+ struct ondisk_cache_entry *ondisk;
char *name;
- int result;
+
+ if (size <= *ondisk_size)
+ ondisk = *ondisk_p;
+ else {
+ ondisk = *ondisk_p = xrealloc(*ondisk_p, size);
+ *ondisk_size = size;
+ }
ondisk->ctime.sec = htonl(ce->ce_ctime.sec);
ondisk->mtime.sec = htonl(ce->ce_mtime.sec);
@@ -1549,10 +1556,7 @@ static int ce_write_entry(git_SHA_CTX *c, int fd, struct cache_entry *ce)
else
name = ondisk->name;
memcpy(name, ce->name, ce_namelen(ce));
-
- result = ce_write(c, fd, ondisk, size);
- free(ondisk);
- return result;
+ return size;
}
static int has_racy_timestamp(struct index_state *istate)
@@ -1588,6 +1592,8 @@ int write_index(struct index_state *istate, int newfd)
struct cache_entry **cache = istate->cache;
int entries = istate->cache_nr;
struct stat st;
+ void *ce_ondisk = NULL;
+ int ce_ondisk_size = 0;
for (i = removed = extended = 0; i < entries; i++) {
if (cache[i]->ce_flags & CE_REMOVE)
@@ -1612,13 +1618,17 @@ int write_index(struct index_state *istate, int newfd)
for (i = 0; i < entries; i++) {
struct cache_entry *ce = cache[i];
+ int size;
+
if (ce->ce_flags & CE_REMOVE)
continue;
if (!ce_uptodate(ce) && is_racy_timestamp(istate, ce))
ce_smudge_racily_clean_entry(ce);
- if (ce_write_entry(&c, newfd, ce) < 0)
+ size = ce_prepare_ondisk_entry(ce, &ce_ondisk, &ce_ondisk_size);
+ if (ce_write(&c, newfd, ce_ondisk, size) < 0)
return -1;
}
+ free(ce_ondisk);
/* Write extension data here */
if (istate->cache_tree) {
--
1.7.8.36.g69ee2
^ permalink raw reply related
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