From: Junio C Hamano <junkio@cox.net>
To: Brian Gerst <bgerst@didntduck.org>
Cc: git@vger.kernel.org
Subject: Re: GIT - breaking backward compatibility
Date: Mon, 19 Sep 2005 23:19:36 -0700 [thread overview]
Message-ID: <7vu0gg8dmv.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <432F8C33.5080603@didntduck.org> (Brian Gerst's message of "Tue, 20 Sep 2005 00:12:35 -0400")
Brian Gerst <bgerst@didntduck.org> writes:
> Junio C Hamano wrote:
[Long quotation snipped]
Brian, you did not have to quote the whole thing if you wanted
to respond to only one bullet point in my footnotes.
> Essentially what I want to do is:
>
> git-ls-files --others | xargs git-update-index --add --
> git-ls-files --deleted | xargs git-update-index --remove --
> git-ls-files --modified | xargs git-update-index --
>
> This will completely resync the index and cache to the working tree
> state after applying a patch. git-update-index --refresh only updates
> the stat info in the index. It does _not_ write a new cache object if
> the file contents have actually changed.
First of all, what I meant to say with 'update-index --refresh'
was not the refreshing part itself, but the fact that says
'needs update' -- meaning it knows those paths have been truly
modified.
Forgetting 'use git-apply' comment from Linus for now,... if you
are going to do the above in separate steps, then the last one
is already available (but not as an option to 'git-ls-files'):
git-diff-files -r --name-only -z | xargs -0 git-update-index --
> If your objection is to calling the files modifed, then call it dirty or
> something else.
I was not talking about the name, but the semantics.
* The user may be interested in cache-dirty files, but I suspect
that is a very limited audience. I do not offhand think of a
good reason to want to know which files are cache-dirty
without wanting to know if they are really modified, except
when debugging git itself. If you really want to know that,
you can always say `git-diff-files`, or if you want to be
pickier, `git-diff-files --diff-filter=M --name-only`.
* Showing a list of *truly* 'modified' files, disregarding the
false hits from cache-dirty but otherwise unmodified files,
would be another useful thing. But that is something
`git-update-cache --refresh` already gives you.
* As a front-end, `git status` shows you list of modifications
between HEAD and cache, and between cache and working tree.
The latter is done with `git-diff-files` after running
`git-update-cache --refresh`. This probably gives the most
useful information to the end user.
Having said all that, `git-ls-files`, especially with `-t` flag,
is a handy way to know the status of all files in the working
tree with a single command. What it does not currently give us
that would be nicer to have as an addition is not cache-dirty
status, but *true* 'modified' flag. Although this is something
available from `git-update-cache --refresh` as I said earlier,
it would still be nice to be able to get it out of a single
command invocation, together with files in other status.
So that is what I have on the proposed updates branch tonight.
Does it more-or-less do what you wanted?
next prev parent reply other threads:[~2005-09-20 6:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-20 2:07 GIT - breaking backward compatibility Junio C Hamano
2005-09-20 4:12 ` Brian Gerst
2005-09-20 4:33 ` Linus Torvalds
2005-09-20 4:41 ` Brian Gerst
2005-09-20 5:03 ` Linus Torvalds
2005-09-20 7:29 ` Petr Baudis
2005-09-20 6:19 ` Junio C Hamano [this message]
2005-09-20 13:08 ` Petr Baudis
[not found] ` <20050920062549.GI15165MdfPADPa@greensroom.kotnet.org>
[not found] ` <7v3bo06xv4.fsf@assigned-by-dhcp.cox.net>
2005-09-20 7:11 ` Sven Verdoolaege
2005-09-20 13:23 ` Petr Baudis
2005-09-22 14:41 ` Petr Baudis
2005-09-23 6:02 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vu0gg8dmv.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=bgerst@didntduck.org \
--cc=git@vger.kernel.org \
/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.
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 NNTP newsgroup(s).