* Quick command reference
From: Junio C Hamano @ 2005-05-06 6:30 UTC (permalink / raw)
To: Linus Torvalds; +Cc: David Greaves, git
In-Reply-To: <42750D06.70004@dgreaves.com>
Linus, please pull from git-jc.git archive at:
http://members.cox.net/junkio/git-jc.git/
(this time I have refs/heads/master there as well as HEAD; sorry
but no rsync).
I've added the Documentation directory as you suggested and
placed the copy of Quick reference David Greaves has been
working on. I've minimally copy edited it to match the current
command names after the big git-* renaming, and also added
descriptions of commands and scripts that was missing back
then. These three steps are recorded as separate commits (in
sequence, not Octopus).
The format is still plain text. AsciiDoc can come in the next
round, but let's get the ball rolling by putting something in
there.
Please note that I do not intend to take the document over from
David. I am just trying to help him get the result of his
effort into the mainline so that the document helps wider
audience, and to encourage (and remind) patch writers to keep it
up to date when modifying the Plumbing.
^ permalink raw reply
* Re: Kernel nightly snapshots..
From: David Woodhouse @ 2005-05-06 7:29 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Linus Torvalds, Git Mailing List
In-Reply-To: <427ABA45.3050803@zytor.com>
On Thu, 2005-05-05 at 17:28 -0700, H. Peter Anvin wrote:
> Could you add that to 2.4 as well, too?
Is there a 2.4 git tree?
--
dwmw2
^ permalink raw reply
* Re: Kernel nightly snapshots..
From: David Woodhouse @ 2005-05-06 7:42 UTC (permalink / raw)
To: Linus Torvalds; +Cc: H. Peter Anvin, Git Mailing List
In-Reply-To: <Pine.LNX.4.58.0505050834550.2328@ppc970.osdl.org>
On Thu, 2005-05-05 at 08:46 -0700, Linus Torvalds wrote:
> So this _should_ work for a while, but will eventually (before a -rc10
> happens or we get to v2.6.100 ;^) need something better. That something
> better probably being to ignore any tags that don't point to commits, and
> then sorting by the date of the commit object.
Enough with the dates already. I don't want to be doing snapshots
against 2.6.11.9 just because that happened to get tagged more recently
than 2.6.12-rc4. Time is an illusion; especially so when looking at
branches which may not even have been merged.
The tag I want is the one which refers to a commit which is made by
yourself and is accessible from the current HEAD in the lowest number of
steps. And I don't _care_ if you tagged it 'Woozy Numbat'.
--
dwmw2
^ permalink raw reply
* GIT blame (was Re: Quick command reference)
From: Junio C Hamano @ 2005-05-06 9:32 UTC (permalink / raw)
To: Linus Torvalds; +Cc: David Greaves, git
In-Reply-To: <7vhdhgeuj1.fsf@assigned-by-dhcp.cox.net>
>>>>> I == Junio C Hamano <junkio@cox.net> said:
JCH> Linus, please pull from git-jc.git archive at:
JCH> http://members.cox.net/junkio/git-jc.git/
Since that message I have added a couple more commits there.
One of the things is a backport of -t (tag) flag to git-ls-files
from Cogito fork.
The reason I am writing this message is not because I am excited
about the backport [*1*], but because I find it quite cool the
way I found out which commit in Pasky's development line
introduced the change. It demonstrates your previous "renames
does not matter when doing CVS blame" argument actually works.
Here is what I did:
1. Go into git.pasky and look at ls-files.c, grab a couple of
lines that look particular to Cogito version and store
those lines in a file. I used the following:
$ cat >pattern <<\EOF
static const char *tag_cached = "";
static const char *tag_unmerged = "";
static const char *tag_removed = "";
static const char *tag_other = "";
EOF
2. Run the following command:
$ jit-search-change HEAD pattern
What jit-search-change does is essentially what you described in
your "renames do not matter" argument. It does git-rev-list to
list the commits from newer to older, runs git-diff-tree between
parent-commit pairs, with GIT_EXTERNAL_DIFF set to a script that
shows the diff between corresponding file in these two trees
only if the file from one tree has that pattern string and the
other tree's does not. When it shows this diff, it also reports
the commit pair, and that's how you can find out which commit
introduced that change.
It currently shows useless hits when it sees merges from you to
Cogito, since those merges re-introduces the same change by
forward porting it over and over, which I am thinking about ways
to cull. Maybe limiting the search only to parent-commit pair
that has only one parent would be good enough. There are other
things to improve, but I am reasonably happy how it worked out.
[Footnote]
*1* The reason for the backport is because it is so small and
trivial change that does not affect the operation of the command
when the flag is not used. I do not see a reason to force Pasky
to keep shipping the version modified for Cogito use.
^ permalink raw reply
* How do I...
From: Frank Sorenson @ 2005-05-06 9:49 UTC (permalink / raw)
To: git
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Okay, I've got some "How can I?" questions. I hope I'm not the only one
still working to "git it".
How can I git a list of commits that have modified a particular file?
For example, I'd like to do something like this:
# git-file-revs Makefile
f7eb55878f11575281add2a5726e483aed5e45bb
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
...
How can I output a list of the filename(s) modified by a particular
commit? (for example)
# git-commit-info files 6741f3a7f9922391cd02b3ca1329e669497dc22f
Makefile
file1
arch/file2
Can I use cg-log to output just the information about a particular
commit? (I don't need all the commits, just the one I'm interested in).
After doing a cg-update, can I cg-log just the changes since the last
update? Alternatively, how can I tell cg-log I'm caught up, and don't
need anything historical?
Can I do these with git/cogito, or will I need to start diving deeper
into the code?
Thanks,
Frank
- --
Frank Sorenson - KD7TZK
Systems Manager, Computer Science Department
Brigham Young University
frank@tuxrocks.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCez2zaI0dwg4A47wRAuNAAJ0QsBkwwHFbFQshRGSDCLv/pEaZXQCfeZj6
rqC9ZoVAYNeMwKqppbyXx9o=
=pJDl
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: How do I...
From: Thomas Glanzmann @ 2005-05-06 9:59 UTC (permalink / raw)
To: git
In-Reply-To: <427B3DB3.4000507@tuxrocks.com>
hello,
> How can I git a list of commits that have modified a particular file?
You have to parse the git-rev-list and look at every single commit. But
I think cogito as well as jit have a command to obtain that.
> How can I output a list of the filename(s) modified by a particular
> commit? (for example)
A commit is only a pointer to a tree, so you can't. But you can see what
files have changed between a parent (note: there are up to 16) and the
dir which is associated with the commit:
git-diff-tree <child> <parent>
So calling git-diff-tree for every parent should do what you want.
Thomas
^ permalink raw reply
* Re: How do I...
From: Thomas Glanzmann @ 2005-05-06 10:03 UTC (permalink / raw)
To: git
In-Reply-To: <20050506095904.GC11506@cip.informatik.uni-erlangen.de>
Hello,
> git-diff-tree <child> <parent>
of course this is: git-diff-tree <parent> <child>
Thomas
^ permalink raw reply
* [ISSUE RESOLVED] Problems with threeway diff, checkout-cache and permissions of two blobs
From: Thomas Glanzmann @ 2005-05-06 11:17 UTC (permalink / raw)
To: GIT
Hello,
[ *** ISSUE RESOLVED: Doesn't happen with GIT HEAD *** ]
The following issue is resolved. Just if someone hits the same problem:
I did a merge with two conflicts, which can AFAIK automatically be
resolved. However if I call 'git-checkout-cache -f -a' it fails on me:
(faui01) [~/work/mutt/git/mutt-tg] git pull ../mutt-cstatus
head => 8aa9f8e95f17213a583d28bbc80d15bba01a375d
remote => b54cf35a50e50a8e1bf09f79b714d0f18c8f3c92
base => e8f4a291a81f0a8fb24555f0e36e4b75e2d3f4c8
curs_main.c: unmerged (ff55f1869b953acb2ec816569470e4adb3421c1d)
curs_main.c: unmerged (b5c5275ead8882ed37205b92b2bc88f7799c2ac8)
curs_main.c: unmerged (335c5c978ac580b95168916deb297fb254592079)
protos.h: unmerged (3cda50538b733826e37cd35734e68755173f080c)
protos.h: unmerged (011d63023a7f1d718f90d87a4933c6f50d0fb1de)
protos.h: unmerged (66324e580002ebd6c9d974c4873cc215b6478029)
fatal: write-tree: not able to write tree
Threewaydiff invloved.
<<
This is the error I get from git-checkout-cache the first time:
fatal: internal error: ce_mode is 644
git-checkout-cache failed: child exit value: 1 at /home/cip/adm/sithglan/work/git/yagf/git line 942.
(faui01) [~/work/mutt/git/mutt-tg] git-ls-tree HEAD | grep ^0 | grep blob
000644 blob d43160b921f037dc45dba6cf80dd22520ac17c7e curs_main.c
000644 blob 210fe03ed3004c45b9548c7f7d1e011bb216c468 protos.h
Note ^ while every else this is '1' for files.
(faui01) [~/work/mutt/git/mutt-tg] rm -rf *
(faui01) [~/work/mutt/git/mutt-tg] git-read-tree HEAD
(faui01) [~/work/mutt/git/mutt-tg] git-checkout-cache -f -a
error: checkout-cache: unknown file mode for curs_main.c
Thomas
^ permalink raw reply
* Locking the repository
From: Thomas Glanzmann @ 2005-05-06 12:31 UTC (permalink / raw)
To: GIT
Hello,
I need a way to lock a repository for certain actions. What can I use to
obtain this? Is there a way to use rsync for that? It should also be
NFS-safe. Are there are any classic unix tools that I can use for this?
Thomas
^ permalink raw reply
* visualization tool?
From: Krzysztof Halasa @ 2005-05-06 12:40 UTC (permalink / raw)
To: git
Hi,
Do we have anything (making sense) that can visualize a git tree?
I know gitweb.pl but it doesn't do what I want: which is displaying
a tree, displaying diffs between specific parents and childs etc.
Somebody mentioned some monotone (IIRC) util hacked for git - does
that make sense?
If there is none, I'm of course going to write one right now. I was
thinking about *HTML output (so it could be used over Internet with
standard protocol and tools), but the language is missing graphical
operations, right?
--
Krzysztof Halasa
^ permalink raw reply
* Re: Please rename cg-X* to something else
From: Mads Martin Joergensen @ 2005-05-06 12:42 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Pavel Roskin, git
In-Reply-To: <427A9ECB.8070409@zytor.com>
* H. Peter Anvin <hpa@zytor.com> [May 06. 2005 00:32]:
>
> $prefix/libexec/cogito rather...
These days FHS dictates $prefix/lib/cogito.
--
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
and totally illogical, with just a little bit more effort?"
-- A. P. J.
^ permalink raw reply
* Re: visualization tool?
From: Thomas Glanzmann @ 2005-05-06 12:49 UTC (permalink / raw)
To: git
In-Reply-To: <m3ll6sjznk.fsf@defiant.localdomain>
Hello,
someone has ported http://oandrieu.nerim.net/monotone-viz/ to git:
http://grahame.angrygoats.net/viewmtn/revision.psp?id=4998dc296128aaae1bee97460e9e0863fb1e6c1c
Thomas
^ permalink raw reply
* Version of dirdiff to display diffs between git trees
From: Paul Mackerras @ 2005-05-06 13:18 UTC (permalink / raw)
To: git
I have adapted my "dirdiff" program to be able to display differences
between git trees (without checking them out). It can display the
differences between up to 5 trees, each of which can be either a git
tree (identified by a tree id, a commit id or a tag) or the working
directory.
The main window summarizes which files have changed. Double-clicking
on a file name pops up a diff viewer window which displays the
differences between the different versions of the file in a
color-coded unidiff format. I find it useful to copy .git/HEAD to
.git/OLD_HEAD before doing an update on my linux-2.6 repository, and
then after the update do
girdiff OLD_HEAD HEAD
to see what has changed. With the file list I can easily skip over
files that I'm not interested in and then use the diff viewer to look
at changes to files that I do care about.
I have called this version "girdiff" to distinguish it from my normal
dirdiff releases. It is available at:
http://ozlabs.org/~paulus/girdiff
If invoked as girdiff, or if invoked as dirdiff and the -g flag is
given, it will interpret its arguments as git trees rather than
directory or file names. As a special case, the working directory is
indicated by ".".
This is still under development and there are probably bugs - let me
know if you find any.
Paul.
^ permalink raw reply
* [PATCH] Add #include <limits.h> so that git compiles under Solaris
From: Thomas Glanzmann @ 2005-05-06 13:36 UTC (permalink / raw)
To: GIT
[PATCH] Add #include <limits.h> so that git compiles under Solaris
--- a/diff-tree-helper.c
+++ b/diff-tree-helper.c
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2005 Junio C Hamano
*/
+#include <limits.h>
#include "cache.h"
#include "strbuf.h"
#include "diff.h"
--- a/diff.c
+++ b/diff.c
@@ -4,6 +4,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
+#include <limits.h>
#include "cache.h"
#include "diff.h"
--- a/local-pull.c
+++ b/local-pull.c
@@ -5,6 +5,7 @@
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
+#include <limits.h>
#include "cache.h"
#include "commit.h"
#include <errno.h>
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -7,6 +7,7 @@
* creation etc.
*/
#include <stdarg.h>
+#include <limits.h>
#include "cache.h"
const char *sha1_file_directory = NULL;
^ permalink raw reply
* [PATCH] fix compare symlink against readlink not data
From: Kay Sievers @ 2005-05-06 13:45 UTC (permalink / raw)
To: Linus Torvalds; +Cc: git
Fix update-cache to compare the blob of a symlink against the link-target
and not the file it points to. Also ignore all permissions applied to
links.
Thanks to Greg for recognizing this while he added our list of symlinks
back to the udev repository.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
---
--- a/diff-files.c
+++ b/diff-files.c
@@ -111,7 +111,7 @@ int main(int argc, char **argv)
continue;
}
- if (stat(ce->name, &st) < 0) {
+ if (lstat(ce->name, &st) < 0) {
if (errno != ENOENT) {
perror(ce->name);
continue;
--- a/read-cache.c
+++ b/read-cache.c
@@ -16,6 +16,9 @@ int cache_match_stat(struct cache_entry
switch (ntohl(ce->ce_mode) & S_IFMT) {
case S_IFREG:
changed |= !S_ISREG(st->st_mode) ? TYPE_CHANGED : 0;
+ /* We consider only the owner x bit to be relevant for "mode changes" */
+ if (0100 & (ntohl(ce->ce_mode) ^ st->st_mode))
+ changed |= MODE_CHANGED;
break;
case S_IFLNK:
changed |= !S_ISLNK(st->st_mode) ? TYPE_CHANGED : 0;
@@ -43,9 +46,6 @@ int cache_match_stat(struct cache_entry
if (ce->ce_uid != htonl(st->st_uid) ||
ce->ce_gid != htonl(st->st_gid))
changed |= OWNER_CHANGED;
- /* We consider only the owner x bit to be relevant for "mode changes" */
- if (0100 & (ntohl(ce->ce_mode) ^ st->st_mode))
- changed |= MODE_CHANGED;
if (ce->ce_dev != htonl(st->st_dev) ||
ce->ce_ino != htonl(st->st_ino))
changed |= INODE_CHANGED;
--- a/update-cache.c
+++ b/update-cache.c
@@ -64,7 +64,7 @@ static int add_file_to_cache_1(char *pat
struct stat st;
int fd;
unsigned int len;
- char target[1024];
+ char *target;
if (lstat(path, &st) < 0) {
if (errno == ENOENT || errno == ENOTDIR) {
@@ -90,11 +90,14 @@ static int add_file_to_cache_1(char *pat
return -1;
break;
case S_IFLNK:
- len = readlink(path, target, sizeof(target));
- if (len == -1 || len+1 > sizeof(target))
+ target = xmalloc(st.st_size+1);
+ if (readlink(path, target, st.st_size+1) != st.st_size) {
+ free(target);
return -1;
- if (write_sha1_file(target, len, "blob", ce->sha1))
+ }
+ if (write_sha1_file(target, st.st_size, "blob", ce->sha1))
return -1;
+ free(target);
break;
default:
return -1;
@@ -163,6 +166,32 @@ static int compare_data(struct cache_ent
return match;
}
+static int compare_link(struct cache_entry *ce, unsigned long expected_size)
+{
+ int match = -1;
+ char *target;
+ void *buffer;
+ unsigned long size;
+ char type[10];
+ int len;
+ target = xmalloc(expected_size);
+ len = readlink(ce->name, target, expected_size);
+ if (len != expected_size ) {
+ free(target);
+ return -1;
+ }
+ buffer = read_sha1_file(ce->sha1, type, &size);
+ if (!buffer) {
+ free(target);
+ return -1;
+ }
+ if (size == expected_size)
+ match = memcmp(buffer, target, size);
+ free(buffer);
+ free(target);
+ return match;
+}
+
/*
* "refresh" does not calculate a new sha1 file or bring the
* cache up-to-date for mode/content changes. But what it
@@ -194,8 +223,18 @@ static struct cache_entry *refresh_entry
if (changed & (MODE_CHANGED | TYPE_CHANGED))
return ERR_PTR(-EINVAL);
- if (compare_data(ce, st.st_size))
+ switch (st.st_mode & S_IFMT) {
+ case S_IFREG:
+ if (compare_data(ce, st.st_size))
+ return ERR_PTR(-EINVAL);
+ break;
+ case S_IFLNK:
+ if (compare_link(ce, st.st_size))
+ return ERR_PTR(-EINVAL);
+ break;
+ default:
return ERR_PTR(-EINVAL);
+ }
cache_changed = 1;
size = ce_size(ce);
^ permalink raw reply
* [PATCH] make INSTALL binary in Makefile configurable via make variable
From: Thomas Glanzmann @ 2005-05-06 13:46 UTC (permalink / raw)
To: GIT
[PATCH] make INSTALL binary in Makefile configurable via make variable
On Solaris machines gnu install called ginstall
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@
CC=gcc
AR=ar
+INSTALL=install
SCRIPTS=git-apply-patch-script git-merge-one-file-script git-prune-script \
git-pull-script git-tag-script git-resolve-script
@@ -26,7 +27,7 @@
all: $(PROG)
install: $(PROG) $(SCRIPTS)
- install $(PROG) $(SCRIPTS) $(HOME)/bin/
+ $(INSTALL) $(PROG) $(SCRIPTS) $(HOME)/bin/
LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
tag.o date.o
^ permalink raw reply
* Re: How do I...
From: Dave Kleikamp @ 2005-05-06 14:37 UTC (permalink / raw)
To: Frank Sorenson; +Cc: Git Mailing List
In-Reply-To: <427B3DB3.4000507@tuxrocks.com>
On Fri, 2005-05-06 at 03:49 -0600, Frank Sorenson wrote:
> After doing a cg-update, can I cg-log just the changes since the last
> update? Alternatively, how can I tell cg-log I'm caught up, and don't
> need anything historical?
(Assuming pulling from "origin")
Instead of doing cg-update, do cg-pull. Then "cg-log :origin" will give
you you the changesets you just pulled. "cg-merge origin" will then
complete operation, thereby catching you up.
--
David Kleikamp
IBM Linux Technology Center
^ permalink raw reply
* Re: [PATCH] fix compare symlink against readlink not data
From: Greg KH @ 2005-05-06 16:03 UTC (permalink / raw)
To: Kay Sievers; +Cc: Linus Torvalds, git
In-Reply-To: <20050506134501.GA11430@vrfy.org>
On Fri, May 06, 2005 at 03:45:01PM +0200, Kay Sievers wrote:
> Fix update-cache to compare the blob of a symlink against the link-target
> and not the file it points to. Also ignore all permissions applied to
> links.
> Thanks to Greg for recognizing this while he added our list of symlinks
> back to the udev repository.
Hm, even with this patch applied (it's in Linus's tree right now), I
still get the following with a clean checked out udev tree:
$ cg-diff
Index: test/sys/block/cciss!c0d0/device
===================================================================
Index: test/sys/block/rd!c0d0/device
===================================================================
Index: test/sys/block/sda/device
===================================================================
Index: test/sys/bus/pci/devices/0000:00:09.0
===================================================================
Index: test/sys/bus/pci/devices/0000:00:1e.0
===================================================================
Index: test/sys/bus/pci/devices/0000:02:05.0
===================================================================
Index: test/sys/bus/pci/drivers/aic7xxx/0000:02:05.0
===================================================================
Index: test/sys/bus/scsi/devices/0:0:0:0
===================================================================
Index: test/sys/bus/scsi/drivers/sd/0:0:0:0
===================================================================
Index: test/sys/bus/usb-serial/devices/ttyUSB0
===================================================================
Index: test/sys/bus/usb-serial/drivers/PL-2303/ttyUSB0
===================================================================
Index: test/sys/bus/usb/devices/3-0:1.0
===================================================================
Index: test/sys/bus/usb/devices/3-1
===================================================================
Index: test/sys/bus/usb/devices/3-1:1.0
===================================================================
Index: test/sys/bus/usb/devices/usb3
===================================================================
Index: test/sys/bus/usb/drivers/hub/3-0:1.0
===================================================================
Index: test/sys/bus/usb/drivers/pl2303/3-1:1.0
===================================================================
Index: test/sys/bus/usb/drivers/usb/3-1
===================================================================
Index: test/sys/bus/usb/drivers/usb/usb3
===================================================================
Index: test/sys/class/tty/ttyUSB0/device
===================================================================
Index: test/sys/devices/pci0000:00/0000:00:09.0/usb3/3-1/ttyUSB0/driver
===================================================================
Any idea?
thanks,
greg k-h
^ permalink raw reply
* Re: How do I...
From: Linus Torvalds @ 2005-05-06 16:13 UTC (permalink / raw)
To: Frank Sorenson; +Cc: git
In-Reply-To: <427B3DB3.4000507@tuxrocks.com>
On Fri, 6 May 2005, Frank Sorenson wrote:
>
> Okay, I've got some "How can I?" questions. I hope I'm not the only one
> still working to "git it".
>
> How can I git a list of commits that have modified a particular file?
> For example, I'd like to do something like this:
> # git-file-revs Makefile
> f7eb55878f11575281add2a5726e483aed5e45bb
> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
There has been at least two different scripts for this posted, and one C
source code version.
I just haven't integrated them, because I'm an idiot, and too much choice
makes me run around in small circles and clucking.
Guys - whoever wrote one of the scripts, can you please send out your
current version to the git list and cc me, and explain why yours is
superior to the other peoples version. Please?
But I might cook something up myself too.
> How can I output a list of the filename(s) modified by a particular
> commit? (for example)
> # git-commit-info files 6741f3a7f9922391cd02b3ca1329e669497dc22f
You need to use "git-tree-diff", but it doesn't want one commit, it wants
two.
In the case of "what did this one commit change", you need to look up its
parents (there can be more than one! In fact, the current git repository
has one entry with _five_ parents), and then you need to select one of
them as the reference. In other words, if it's a merge, you need to select
which side you care about.
> Can I use cg-log to output just the information about a particular
> commit? (I don't need all the commits, just the one I'm interested in).
You don't even need cg-log for that. If you already know which commit
you're interested in, just output that one commit:
git-cat-file commit <commit-name-here>
> After doing a cg-update, can I cg-log just the changes since the last
> update? Alternatively, how can I tell cg-log I'm caught up, and don't
> need anything historical?
I don't know how to do with with cg-update, but if you use the
"git-pull-script" thing, you can do
git-diff-tree -p ORIG_HEAD HEAD
which shows you what the pull brought in.
> Can I do these with git/cogito, or will I need to start diving deeper
> into the code?
Apart from finding the "which commit changed this", it's all trivially
doable. And the "which commit" thing is also trivially doable if you just
find the script..
Linus
^ permalink raw reply
* Re: Locking the repository
From: Linus Torvalds @ 2005-05-06 16:15 UTC (permalink / raw)
To: Thomas Glanzmann; +Cc: GIT
In-Reply-To: <20050506123122.GF11506@cip.informatik.uni-erlangen.de>
On Fri, 6 May 2005, Thomas Glanzmann wrote:
>
> I need a way to lock a repository for certain actions.
Nope - if you want to serialize something, you'll need to write your own
serialization scripts. git doesn't care, because all the git operations
should be totally lockless already. There just isn't any reason to lock as
far as git is concerned, since the objects are immutable.
The only exception is the "index" file, where we don't want concurrect
index updates. So that is handled by writers creating the new "index.lock"
file first, and then when they are done, they rename it to "index".
Linus
^ permalink raw reply
* Re: Version of dirdiff to display diffs between git trees
From: Linus Torvalds @ 2005-05-06 16:19 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git
In-Reply-To: <17019.28326.351036.268948@cargo.ozlabs.ibm.com>
On Fri, 6 May 2005, Paul Mackerras wrote:
> The main window summarizes which files have changed. Double-clicking
> on a file name pops up a diff viewer window which displays the
> differences between the different versions of the file in a
> color-coded unidiff format. I find it useful to copy .git/HEAD to
> .git/OLD_HEAD before doing an update on my linux-2.6 repository, and
> then after the update do
If you use git-pull-script, it does this for you (except it calls it
ORIG_HEAD), and you can just do
git-diff-tree -p ORIG_HEAD HEAD
to see the changes. In fact git-pull-script will do that for you, and
output the diffstat of it.
Having the original head is also nice for when you decide that the other
side has had a few too many drugs, in which case you just do
cat .git/ORIG_HEAD > .git/HEAD
git-read-tree -m HEAD
git-checkout-cache -f -a
git-update-cache --refresh
and you're back to your original head (the above is basically "unpull").
Linus
^ permalink raw reply
* cg-update doesn't clean away empty directories
From: Luck, Tony @ 2005-05-06 16:22 UTC (permalink / raw)
To: git
I just did a cg-update from Linus' tree, and all the files
in Documentation/BK-Usage were neatly thrown away from my
working directory. But Documentation/BK-Usage itself is
still there. Looking at the output from git-ls-tree it was
removed from the GIT level.
-Tony
^ permalink raw reply
* Re: [PATCH] fix compare symlink against readlink not data
From: Kay Sievers @ 2005-05-06 16:23 UTC (permalink / raw)
To: Greg KH; +Cc: Linus Torvalds, git
In-Reply-To: <20050506160359.GB6904@kroah.com>
On Fri, 2005-05-06 at 09:03 -0700, Greg KH wrote:
> On Fri, May 06, 2005 at 03:45:01PM +0200, Kay Sievers wrote:
> > Fix update-cache to compare the blob of a symlink against the link-target
> > and not the file it points to. Also ignore all permissions applied to
> > links.
> > Thanks to Greg for recognizing this while he added our list of symlinks
> > back to the udev repository.
>
> Hm, even with this patch applied (it's in Linus's tree right now), I
> still get the following with a clean checked out udev tree:
> $ cg-diff
> Index: test/sys/block/cciss!c0d0/device
> ===================================================================
I can't reproduce this. Are you sure, that the git-core binaries are
called and not the cogito ones?
git-update-cache --refresh
git-diff-cache -r HEAD
from the core-git should print nothing.
Thanks,
Kay
^ permalink raw reply
* Re: [PATCH] fix compare symlink against readlink not data
From: Junio C Hamano @ 2005-05-06 16:26 UTC (permalink / raw)
To: Greg KH; +Cc: Kay Sievers, Linus Torvalds, git
In-Reply-To: <20050506160359.GB6904@kroah.com>
>>>>> "GKH" == Greg KH <greg@kroah.com> writes:
GKH> On Fri, May 06, 2005 at 03:45:01PM +0200, Kay Sievers wrote:
>> Thanks to Greg for recognizing this while he added our list of symlinks
>> back to the udev repository.
GKH> Hm, even with this patch applied (it's in Linus's tree right now), I
GKH> still get the following with a clean checked out udev tree:
GKH> $ cg-diff
GKH> Index: test/sys/block/cciss!c0d0/device
GKH> ===================================================================
GKH> Index: test/sys/block/rd!c0d0/device
GKH> ===================================================================
GKH> Any idea?
I do not use Cogito but probably it is this piece of code in
cg-Xdiffdo. It is assuming that a valid SHA1 means it can diff
against the filesystem object that resides there. It used to be
the case before symlinks but not anymore.
mkbanner () {
loc=$1; treeid=$2; fname=$3; mode=$4; sha1=$5;
if [ "$sha1" != "0000000000000000000000000000000000000000" ]; then
git-cat-file blob $sha1 >$loc
else
ln -s "$(pwd)/$fname" "$loc"
sha1="!"
fi
Maybe changing the if to (I'm writing this in e-mail editor so
completely untested) something like:
if expr "$sha1" : '0*$' >/dev/null ||
expr "$mode" : '.*120000$' >/dev/null
then
git-cat-file blob "$sha1" >$loc
would help?
Also could you try the low-level git command, git-diff-cache -p,
against the tree you are comparing? The built-in diff stuff
might get this wrong too.
^ permalink raw reply
* Re: How do I...
From: Junio C Hamano @ 2005-05-06 16:35 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Frank Sorenson, git
In-Reply-To: <Pine.LNX.4.58.0505060905090.2233@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:
LT> On Fri, 6 May 2005, Frank Sorenson wrote:
>>
>> Okay, I've got some "How can I?" questions. I hope I'm not the only one
>> still working to "git it".
>>
>> How can I git a list of commits that have modified a particular file?
>> For example, I'd like to do something like this:
>> # git-file-revs Makefile
>> f7eb55878f11575281add2a5726e483aed5e45bb
>> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
>> bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
LT> Guys - whoever wrote one of the scripts, can you please send out your
LT> current version to the git list and cc me, and explain why yours is
LT> superior to the other peoples version. Please?
I think I mentioned and posted an interactive version called
jit-trackdown. It is part of JIT found at [*1*]. You may have
an older version that does not have the command.
LT> But I might cook something up myself too.
Yourself or not, I think it is a good idea to do something that
does exactly Frank wants, namely, just list commits. Even
better would be, to take commits with multiple parents into
account, list of <commit> <parent> pairs, like:
$ git-file-revs Makefile
f7eb55....... aaaaaa.......
f7eb55....... bbbbbb.......
aaaaaa....... dddddd.......
which shows commit f7eb55... changed it relative to both of its
parents aaaaaa... and bbbbbb...
[Footnotes]
*1* http://members.cox.net/junkio/
^ 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