git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Kirill Likhodedov <Kirill.Likhodedov@jetbrains.com>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git ls-files handles paths differently in Windows and Mac (probably Linux)
Date: Wed, 13 Oct 2010 13:09:40 +0400	[thread overview]
Message-ID: <AEC0873D-4AFC-402E-9D7D-197A7D40DCDD@jetbrains.com> (raw)
In-Reply-To: <AANLkTi=6nJAYKB_MTjXL3oftcWtr_wtdHaULYzRcP6oP@mail.gmail.com>


12.10.2010, в 19:25, Alex Riesen написал(а):
> 
> Besides, if you have to just check if the tree under a path is changed
> you can always use
> --exit-code or --quiet to "git diff", it will speed them up.

Unfortunately, that's not enough: I have to know which files have changed and how (created, deleted, modified).
Also I feel that it's not the size of the output which is slow - the scan of directories itself is. 


>> And also "git diff --name-status" doesn't show unversioned files.
>> As I've found, "git ls-files" is the only command which shows unversioned files (except git status), isn't it?
> 
> Yes, you're right. What are you trying to do, BTW?

I'm developing a plugin for Git integration for IntelliJ IDEA (an IDE for Java and other languages).
And the task I'm working now is to get the status of index and working tree. I want to make it as fast as possible.
To work with a Git repository I start a process with git native commands, so every command to execute is additional cost.
(Maybe I could work with the filesystem and raw Git repository, but it would be an overhead).

If we forget about "git status --porcelain" there is no single command to get the whole status. I could use 
"git ls-files -ov" for unversioned files + "git diff --name-status" for all other.
OR 
"git ls-files -douvm" for the changes in the working tree + "git diff-index --cached" for the changes in the index.
OR
"git ls-files -ov" for unversioned + "git diff-files" for other files in the working tree + "git diff-index --cached" for the changes in the index.
or maybe something else

I've made a script which executes these commands (which allow to get the total status) on a large repository many times. 
My results show that "ls-files -douvm"+"git diff-index --cached" is the fastest combination.

Do you think I could achieve the same result in a simpler or faster way?

Thanks a lot.

----------------------------------
Kirill Likhodedov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

  reply	other threads:[~2010-10-13  9:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-12 12:14 git ls-files handles paths differently in Windows and Mac (probably Linux) Kirill Likhodedov
2010-10-12 12:51 ` Alex Riesen
2010-10-12 12:59   ` Kirill Likhodedov
2010-10-12 13:52     ` Kirill Likhodedov
2010-10-12 15:25       ` Alex Riesen
2010-10-13  9:09         ` Kirill Likhodedov [this message]
2010-10-13 10:35           ` Alex Riesen
2010-10-13 11:20           ` Jakub Narebski
2010-10-13 11:35             ` Kirill Likhodedov
2010-10-12 15:24     ` Alex Riesen
2010-10-12 13:11 ` Johannes Sixt
2010-10-12 13:24   ` Kirill Likhodedov
2010-10-12 13:28     ` Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AEC0873D-4AFC-402E-9D7D-197A7D40DCDD@jetbrains.com \
    --to=kirill.likhodedov@jetbrains.com \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).