git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* tool to diff cache <-> working directory
@ 2005-05-06  0:23 Thomas Glanzmann
  2005-05-06  1:33 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Glanzmann @ 2005-05-06  0:23 UTC (permalink / raw)
  To: GIT

Hello,
is there a tool to compare cache with working directory similiar to
diff-tree, diff-cache and diff-files? Or is there a way to find out the
SHA checksum of a file in a working directory without adding it to a
temporary cache?

	Thomas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tool to diff cache <-> working directory
  2005-05-06  0:23 tool to diff cache <-> working directory Thomas Glanzmann
@ 2005-05-06  1:33 ` Junio C Hamano
  2005-05-06  2:07   ` Thomas Glanzmann
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2005-05-06  1:33 UTC (permalink / raw)
  To: Thomas Glanzmann; +Cc: git

>>>>> "TG" == Thomas Glanzmann <sithglan@stud.uni-erlangen.de> writes:

TG> Is there a tool to compare cache with working directory
TG> similiar to diff-tree, diff-cache and diff-files?

    git-diff-tree tree1 tree2           two trees
    git-diff-cache --cached tree1	cache and tree
    git-diff-cache tree1		tree and working directory
    git-diff-files                      cache and working directory

So git-diff-files is not just similar to but exactly is what you
want if I read your question correctly.

TG> Or is there a way to find out the SHA checksum of a file in
TG> a working directory without adding it to a temporary cache?

Yes there is a way, git-write-blob, but why would you want to do
that?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tool to diff cache <-> working directory
  2005-05-06  1:33 ` Junio C Hamano
@ 2005-05-06  2:07   ` Thomas Glanzmann
  2005-05-06  2:48     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Glanzmann @ 2005-05-06  2:07 UTC (permalink / raw)
  To: git

Hello,

>     git-diff-tree tree1 tree2           two trees
>     git-diff-cache --cached tree1	  cache and tree
>     git-diff-cache tree1		  tree and working directory
>     git-diff-files                      cache and working directory

that makes it clear. Thanks.

> So git-diff-files is not just similar to but exactly is what you
> want if I read your question correctly.

Yes, it is. :-)

> Yes there is a way, git-write-blob, but why would you want to do
> that?

I thought there would be no cache<->working directory delta generation.
And I need a way to see if there are unchecked-in deltas in the working
tree. So I thought about looking at the 'git-diff-cache --cached tree1'
and comparing it with the self generated SHAs of the working tree. But
now, that there is such a tool, I am perfectly fine.

Thanks,
	Thomas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tool to diff cache <-> working directory
  2005-05-06  2:07   ` Thomas Glanzmann
@ 2005-05-06  2:48     ` Junio C Hamano
  2005-05-06  3:13       ` Thomas Glanzmann
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2005-05-06  2:48 UTC (permalink / raw)
  To: Thomas Glanzmann; +Cc: git

>>>>> "TG" == Thomas Glanzmann <sithglan@stud.uni-erlangen.de> writes:

TG> I thought there would be no cache<->working directory delta generation.
TG> And I need a way to see if there are unchecked-in deltas in the working
TG> tree. So I thought about looking at the 'git-diff-cache --cached tree1'
TG> and comparing it with the self generated SHAs of the working tree. But
TG> now, that there is such a tool, I am perfectly fine.

Are you using pure GIT, without any Porcelain layer like Cogito?

Cogito has "cg-status" that shows something like "cvs -n update"
output.

My (shameless plug ;-) JIT [*1*] also has "jit-status".

[References]
*1* http://members.cox.net/junkio/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: tool to diff cache <-> working directory
  2005-05-06  2:48     ` Junio C Hamano
@ 2005-05-06  3:13       ` Thomas Glanzmann
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Glanzmann @ 2005-05-06  3:13 UTC (permalink / raw)
  To: git

Hello,

> Are you using pure GIT, without any Porcelain layer like Cogito?

no, I actually write a porcelain layer myself in perl. For several reasons:

	- I want something that runs on Solaris without gnu-utils
	- I want to understand the git internals.
	- I don't need branches and refs in .git

> Cogito has "cg-status" that shows something like "cvs -n update"
> output.

I just finished implementing my 'git status' command which does the
following:

	(faui01) [~/work/git/git] git status
	 + 1
	 ? 2
	 - COPYING
	D* Makefile
	 * commit.c
	D  export.c

	+/-/* -> add, rm, mod
	?     -> orphan (not under revision control)
	D     -> dirty -> was explicit modified in cache but cache doesn't match working copy

I also have a ignore list for known orphans:

	(faui01) [~/work/git/git] cat .git/ignore
	\.o$
	git-cat-file
	...
	git-write-tree
	libgit.a

Sincerely,
	Thomas

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-05-06  3:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-06  0:23 tool to diff cache <-> working directory Thomas Glanzmann
2005-05-06  1:33 ` Junio C Hamano
2005-05-06  2:07   ` Thomas Glanzmann
2005-05-06  2:48     ` Junio C Hamano
2005-05-06  3:13       ` Thomas Glanzmann

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).