Git development
 help / color / mirror / Atom feed
* Re: Git.xs merge status
From: Junio C Hamano @ 2006-06-30  7:18 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: git, hpa
In-Reply-To: <1151644101.10496.22.camel@dv>

Pavel Roskin <proski@gnu.org> writes:

> I guess all this perl stuff should be in a separate module perl-Git to
> comply with Red Hat conventions.  This would make git-core depend on
> perl-Git, but it's OK.
>
> Error.pm is already provided by perl-Error.  If we require perl(Error)
> for building, it won't be installed.  Actually, probing for Error.pm is
> incorrect, so I'm fixing it.
>
> Git.bs, .packlist and perllocal.pod should be removed - that's what
> other Perl packages do.  Red Hat packages use INSTALLDIRS=vendor so that
> "site_perl" becomes "vendor_perl".
>
> While hacking that, I have wound that "--without doc" is broken in pu,
> so I'm fixing it as well.  The patches will be sent shortly.

Thanks.

The kernel.org machine I am using for testing does not seem to
have perl-Error installed, and I suspect Pasky arranged to ship
our own Error.pm for people building git from source because the
package is not so widely installed.  I guess I should ask the
admins there before I can build perl-Git RPMs for release. 

I am doing this preparation not for the upcoming 1.4.1 but later
than that -- perhaps way later than that -- so there is no rush.

^ permalink raw reply

* Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree
From: Junio C Hamano @ 2006-06-30  6:28 UTC (permalink / raw)
  To: Michal Ludvig; +Cc: git
In-Reply-To: <44A4BA6D.5010006@logix.cz>

Michal Ludvig <michal@logix.cz> writes:

> Linus Torvalds wrote:
>
>> 	git log -p --full-diff v2.6.16.. crypto/
>
> Can I somehow get the result in a reverse order, i.e. oldest commits first?

Two ways:

	git format-patch -o patches-output/ --full-diff v2.6.16.. crypto/

would give you one file a patch in patches-output directory,
numbered.

	git format-patch --stdout --full-diff v2.6.16.. crypto/

would give you a single stream of the above to the standard output.

^ permalink raw reply

* Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree
From: Linus Torvalds @ 2006-06-30  6:20 UTC (permalink / raw)
  To: Michal Ludvig; +Cc: Herbert Xu, linux-crypto, git
In-Reply-To: <44A4BA6D.5010006@logix.cz>



On Fri, 30 Jun 2006, Michal Ludvig wrote:
>
> Linus Torvalds wrote:
> 
> > 	git log -p --full-diff v2.6.16.. crypto/
> 
> Can I somehow get the result in a reverse order, i.e. oldest commits first?

Not that way, no. "git log" generates the data on-the-fly, so a simple 
"git log" will always give most recent first.

However, you can do this

	git log --pretty=oneline v2.6.16.. crypto/

to generate a list of commits, one per line. Then, reverse that list 
("tac" is your friend), and feed it back to "git-diff-tree --stdin 
--pretty -p" to get the diffs.

So

	git log --pretty=oneline v2.6.16.. crypto/ |
		tac |
		git-diff-tree --stdin --pretty -p

should do what you want.

Of course, the patches (to other files than the crypt/ subdirectory) may 
still clash due to changes that are unrelated to the crypto changes. That 
is unavoidable, and you'll just have to fix that up by hand.

			Linus

^ permalink raw reply

* Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree
From: Michal Ludvig @ 2006-06-30  5:45 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Herbert Xu, linux-crypto, git
In-Reply-To: <Pine.LNX.4.64.0606291943010.12404@g5.osdl.org>

Linus Torvalds wrote:

> 	git log -p --full-diff v2.6.16.. crypto/

Can I somehow get the result in a reverse order, i.e. oldest commits first?

As it is the patch conflicts on files that were changed multiple times
since 2.6.16 :-(

Will see if patchutils can help me somehow...

Michal

^ permalink raw reply

* [PATCH 3/3] Make perl interface a separate package
From: Pavel Roskin @ 2006-06-30  5:09 UTC (permalink / raw)
  To: git
In-Reply-To: <20060630050923.701.37665.stgit@dv.roinet.com>

From: Pavel Roskin <proski@gnu.org>

Install it as a vendor package.  Remove .packlist, perllocal.pod,
Git.bs.  Require perl(Error) for building so that our Error.pm is not
installed.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 git.spec.in |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/git.spec.in b/git.spec.in
index b8feda3..6d90034 100644
--- a/git.spec.in
+++ b/git.spec.in
@@ -9,7 +9,7 @@ URL: 		http://kernel.org/pub/software/sc
 Source: 	http://kernel.org/pub/software/scm/git/%{name}-%{version}.tar.gz
 BuildRequires:	zlib-devel >= 1.2, openssl-devel, curl-devel, expat-devel  %{!?_without_docs:, xmlto, asciidoc > 6.0.3}
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires:	git-core, git-svn, git-cvs, git-arch, git-email, gitk
+Requires:	git-core, git-svn, git-cvs, git-arch, git-email, gitk, perl-Git
 
 %description
 This is a stupid (but extremely fast) directory content manager.  It
@@ -70,6 +70,16 @@ Requires:       git-core = %{version}-%{
 %description -n gitk
 Git revision tree visualiser ('gitk')
 
+%package -n perl-Git
+Summary:        Perl interface to Git
+Group:          Development/Libraries
+Requires:       git-core = %{version}-%{release}
+Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
+BuildRequires:  perl(Error)
+
+%description -n perl-Git
+Perl interface to Git
+
 %prep
 %setup -q
 
@@ -80,10 +90,14 @@ make %{_smp_mflags} CFLAGS="$RPM_OPT_FLA
 %install
 rm -rf $RPM_BUILD_ROOT
 make %{_smp_mflags} DESTDIR=$RPM_BUILD_ROOT WITH_OWN_SUBPROCESS_PY=YesPlease \
-     prefix=%{_prefix} mandir=%{_mandir} \
+     prefix=%{_prefix} mandir=%{_mandir} INSTALLDIRS=vendor \
      install %{!?_without_docs: install-doc}
+find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
+find $RPM_BUILD_ROOT -type f -name '*.bs' -empty -exec rm -f {} ';'
+find $RPM_BUILD_ROOT -type f -name perllocal.pod -exec rm -f {} ';'
 
 (find $RPM_BUILD_ROOT%{_bindir} -type f | grep -vE "arch|svn|cvs|email|gitk" | sed -e s@^$RPM_BUILD_ROOT@@)               > bin-man-doc-files
+(find $RPM_BUILD_ROOT%{perl_vendorarch} -type f | sed -e s@^$RPM_BUILD_ROOT@@) >> perl-files
 %if %{!?_without_docs:1}0
 (find $RPM_BUILD_ROOT%{_mandir} $RPM_BUILD_ROOT/Documentation -type f | grep -vE "arch|svn|git-cvs|email|gitk" | sed -e s@^$RPM_BUILD_ROOT@@ -e 's/$/*/' ) >> bin-man-doc-files
 %else
@@ -131,6 +145,9 @@ # These are no files in the root package
 %{!?_without_docs: %{_mandir}/man1/*gitk*.1*}
 %{!?_without_docs: %doc Documentation/*gitk*.html }
 
+%files -n perl-Git -f perl-files
+%defattr(-,root,root)
+
 %files core -f bin-man-doc-files
 %defattr(-,root,root)
 %{_datadir}/git-core/

^ permalink raw reply related

* [PATCH 1/3] Fix probing for already installed Error.pm
From: Pavel Roskin @ 2006-06-30  5:09 UTC (permalink / raw)
  To: git

From: Pavel Roskin <proski@gnu.org>

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 perl/Makefile.PL |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index d401a66..b3fbb73 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -12,7 +12,7 @@ my %pm = ('Git.pm' => '$(INST_LIBDIR)/Gi
 
 # We come with our own bundled Error.pm. It's not in the set of default
 # Perl modules so install it if it's not available on the system yet.
-eval { require 'Error' };
+eval { require Error };
 if ($@) {
 	$pm{'Error.pm'} = '$(INST_LIBDIR)/Error.pm';
 }

^ permalink raw reply related

* [PATCH 2/3] Delete manuals if compiling without docs
From: Pavel Roskin @ 2006-06-30  5:09 UTC (permalink / raw)
  To: git
In-Reply-To: <20060630050923.701.37665.stgit@dv.roinet.com>

From: Pavel Roskin <proski@gnu.org>

Otherwise, rpm would complain about unpacked files.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 git.spec.in |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/git.spec.in b/git.spec.in
index 8ccd256..b8feda3 100644
--- a/git.spec.in
+++ b/git.spec.in
@@ -86,6 +86,8 @@ make %{_smp_mflags} DESTDIR=$RPM_BUILD_R
 (find $RPM_BUILD_ROOT%{_bindir} -type f | grep -vE "arch|svn|cvs|email|gitk" | sed -e s@^$RPM_BUILD_ROOT@@)               > bin-man-doc-files
 %if %{!?_without_docs:1}0
 (find $RPM_BUILD_ROOT%{_mandir} $RPM_BUILD_ROOT/Documentation -type f | grep -vE "arch|svn|git-cvs|email|gitk" | sed -e s@^$RPM_BUILD_ROOT@@ -e 's/$/*/' ) >> bin-man-doc-files
+%else
+rm -rf $RPM_BUILD_ROOT%{_mandir}
 %endif
 
 %clean

^ permalink raw reply related

* Re: GIt.xs merge status
From: Pavel Roskin @ 2006-06-30  5:08 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Petr Baudis
In-Reply-To: <7vmzbvmny4.fsf_-_@assigned-by-dhcp.cox.net>

On Thu, 2006-06-29 at 18:28 -0700, Junio C Hamano wrote:
> Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/git-1.4.1.rc2.g5762-1-root-junio
> error: Installed (but unpackaged) file(s) found:
>    /usr/lib64/perl5/5.8.6/x86_64-linux-thread-multi/perllocal.pod
>    /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/Error.pm
>    /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/Git.pm
>    /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/auto/Git/.packlist
>    /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/auto/Git/Git.bs
>    /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/auto/Git/Git.so

I guess all this perl stuff should be in a separate module perl-Git to
comply with Red Hat conventions.  This would make git-core depend on
perl-Git, but it's OK.

Error.pm is already provided by perl-Error.  If we require perl(Error)
for building, it won't be installed.  Actually, probing for Error.pm is
incorrect, so I'm fixing it.

Git.bs, .packlist and perllocal.pod should be removed - that's what
other Perl packages do.  Red Hat packages use INSTALLDIRS=vendor so that
"site_perl" becomes "vendor_perl".

While hacking that, I have wound that "--without doc" is broken in pu,
so I'm fixing it as well.  The patches will be sent shortly.

-- 
Regards,
Pavel Roskin

^ permalink raw reply

* Abstract out accesses to object hash array
From: Linus Torvalds @ 2006-06-30  4:38 UTC (permalink / raw)
  To: Junio C Hamano, Git Mailing List


There are a few special places where some programs accessed the object 
hash array directly, which bothered me because I wanted to play with some 
simple re-organizations.

So this patch makes the object hash array data structures all entirely 
local to object.c, and the few users who wanted to look at it now get to 
use a function to query how many object index entries there can be, and to 
actually access the array.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---

It turns out that "lookup_object()" and "memcmp()" are the two hottest 
routines by far in git-rev-list, and the problem is that the object array 
grows pretty big. On its own, the object array would generally fit pretty 
well in the CPU caches, but when it ends up only containing a pointer, and 
we then do a memory compare on the result, the CPU cache ends up being 
toast.

Now, the object array actually has two bits free, and I was going to hide 
two bits of the SHA1 name in there, allowing me to avoid doing a memcmp() 
for 75% of the collision cases.

Sadly, my crazy evil scheme doesn't actually help (the hashes work so well 
that we have comparatively few collisions), but this cleanup seemed a 
worthwhile result of my temporary insanity.

diff --git a/fsck-objects.c b/fsck-objects.c
index 769bb2a..ef54a8a 100644
--- a/fsck-objects.c
+++ b/fsck-objects.c
@@ -60,12 +60,13 @@ static int objwarning(struct object *obj
 
 static void check_connectivity(void)
 {
-	int i;
+	int i, max;
 
 	/* Look up all the requirements, warn about missing objects.. */
-	for (i = 0; i < obj_allocs; i++) {
+	max = get_max_object_index();
+	for (i = 0; i < max; i++) {
 		const struct object_refs *refs;
-		struct object *obj = objs[i];
+		struct object *obj = get_indexed_object(i);
 
 		if (!obj)
 			continue;
diff --git a/name-rev.c b/name-rev.c
index 3a5ac35..6a23f2d 100644
--- a/name-rev.c
+++ b/name-rev.c
@@ -234,12 +234,15 @@ #define ishex(x) (isdigit((x)) || ((x) >
 				fwrite(p_start, p - p_start, 1, stdout);
 		}
 	} else if (all) {
-		int i;
+		int i, max;
 
-		for (i = 0; i < obj_allocs; i++)
-			if (objs[i])
-				printf("%s %s\n", sha1_to_hex(objs[i]->sha1),
-						get_rev_name(objs[i]));
+		max = get_max_object_index();
+		for (i = 0; i < max; i++) {
+			struct object * obj = get_indexed_object(i);
+			if (!obj)
+				continue;
+			printf("%s %s\n", sha1_to_hex(obj->sha1), get_rev_name(obj));
+		}
 	} else {
 		int i;
 		for (i = 0; i < revs.nr; i++)
diff --git a/object.c b/object.c
index 37784ce..31c77ea 100644
--- a/object.c
+++ b/object.c
@@ -5,9 +5,18 @@ #include "tree.h"
 #include "commit.h"
 #include "tag.h"
 
-struct object **objs;
-static int nr_objs;
-int obj_allocs;
+static struct object **objs;
+static int nr_objs, obj_allocs;
+
+unsigned int get_max_object_index(void)
+{
+	return obj_allocs;
+}
+
+struct object *get_indexed_object(unsigned int idx)
+{
+	return objs[idx];
+}
 
 const char *type_names[] = {
 	"none", "blob", "tree", "commit", "bad"
diff --git a/object.h b/object.h
index 6f23a9a..e0125e1 100644
--- a/object.h
+++ b/object.h
@@ -40,10 +40,11 @@ struct object {
 };
 
 extern int track_object_refs;
-extern int obj_allocs;
-extern struct object **objs;
 extern const char *type_names[];
 
+extern unsigned int get_max_object_index(void);
+extern struct object *get_indexed_object(unsigned int);
+
 static inline const char *typename(unsigned int type)
 {
 	return type_names[type > TYPE_TAG ? TYPE_BAD : type];

^ permalink raw reply related

* Re: [PATCH] git-grep: --and to combine patterns with and instead of or
From: Junio C Hamano @ 2006-06-30  4:13 UTC (permalink / raw)
  To: Matthias Lederhofer; +Cc: git
In-Reply-To: <E1Fw8hS-00023y-FY@moooo.ath.cx>

Matthias Lederhofer <matled@gmx.net> writes:

> OR and AND have precedence, so there are two possibilities, I'd take
> the first one.
> 1. OR, AND:
>     This will make it easier to read because OR can be skipped:
>       pat1 pat2 AND pat3 pat4
>     = pat1 OR pat2 AND pat3 OR pat4
>     = (pat1 OR pat2) AND (pat3 OR pat4)
> 2. AND, OR:
>     This is a bit more logic if you think of AND as * and OR as +.

> ... FOO should not be named --and imo but I don't have any idea
> for a good name atm.

I personally feel FOO should not even exist.  An option that
covers the entire expression to make operator precedence in it
sounds quite evil.  

I would say make --and bind tighter than --or and use
parentheses as needed.  Making --or optional sounds fine as that
would make the default "multiple -e" case similar to what GNU
grep does without any --and nor --or.

^ permalink raw reply

* [PATCH] consider previous pack undeltified object state only when reusing delta data
From: Nicolas Pitre @ 2006-06-30  3:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vwtazobkw.fsf@assigned-by-dhcp.cox.net>

Without this there would never be a chance to improve packing for 
previously undeltified objects.

Signed-off-by: Nicolas Pitre <nico@cam.org>

---

On Thu, 29 Jun 2006, Junio C Hamano wrote:

> Nicolas Pitre <nico@cam.org> writes:
> 
> > On Thu, 29 Jun 2006, Linus Torvalds wrote:
> >
> >> 
> >> 
> >> On Thu, 29 Jun 2006, Nicolas Pitre wrote:
> >> >
> >> > On Thu, 29 Jun 2006, Linus Torvalds wrote:
> >> > 
> >> > > Instead of having a separate cache, wouldn't it be much better to just 
> >> > > take the hint from the previous pack-file?
> >> > 
> >> > DOH!  ;-)
> >> 
> >> Btw, I think this could do with a flag to turn it on/off (but probably 
> >> default to on).
> >
> > I think it should simply be coupled with the --no-reuse-delta flag.
> 
> I agree that makes sense.

So here it is.

diff --git a/pack-objects.c b/pack-objects.c
index 6e17676..47da33b 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -989,9 +989,10 @@ static int try_delta(struct unpacked *tr
 
 	/*
 	 * We do not bother to try a delta that we discarded
-	 * on an earlier try.
+	 * on an earlier try, but only when reusing delta data.
 	 */
-	if (trg_entry->in_pack && trg_entry->in_pack == src_entry->in_pack)
+	if (!no_reuse_delta && trg_entry->in_pack &&
+	    trg_entry->in_pack == src_entry->in_pack)
 		return 0;
 
 	/*

^ permalink raw reply related

* Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree
From: Michal Ludvig @ 2006-06-30  3:05 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Herbert Xu, linux-crypto, git
In-Reply-To: <Pine.LNX.4.64.0606291943010.12404@g5.osdl.org>

Linus Torvalds wrote:

> Note that this is why
> 
> 	git log -p --full-diff v2.6.16.. crypto/
> 
> is so great. It will show everything that touched that subdirectory, along 
> with the incidentals. I think that in this case, that's exactly what 
> Michal wants.

Exactly!

I just want to have the latest greatest CryptoAPI on 2.6.16, it's that
simple ;-)

Thanks both for a quick response

Michal

^ permalink raw reply

* Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree
From: Linus Torvalds @ 2006-06-30  2:44 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Michal Ludvig, linux-crypto, git
In-Reply-To: <20060630023228.GA28850@gondor.apana.org.au>



On Fri, 30 Jun 2006, Herbert Xu wrote:

> On Thu, Jun 29, 2006 at 07:25:01PM -0700, Linus Torvalds wrote:
> > 
> > The easiest by far is if you only care about a certain sub-directory. 
> > Then, assuming the branch "crypto" is the top-most commit of the cryptodev 
> > repo, just do
> > 
> > 	git diff v2.6.16..crypto -- crypto/
> 
> Yes, you should always do something like this when backporting to make
> sure that you haven't missed patches merged in ways that you didn't
> anticipate.
> 
> Although I'm not aware of any such patches in the time frame that Michal
> has in mind.

Note that this is why

	git log -p --full-diff v2.6.16.. crypto/

is so great. It will show everything that touched that subdirectory, along 
with the incidentals. I think that in this case, that's exactly what 
Michal wants.

		Linus

^ permalink raw reply

* Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree
From: Herbert Xu @ 2006-06-30  2:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Michal Ludvig, linux-crypto, git
In-Reply-To: <Pine.LNX.4.64.0606291904250.12404@g5.osdl.org>

On Thu, Jun 29, 2006 at 07:25:01PM -0700, Linus Torvalds wrote:
> 
> The easiest by far is if you only care about a certain sub-directory. 
> Then, assuming the branch "crypto" is the top-most commit of the cryptodev 
> repo, just do
> 
> 	git diff v2.6.16..crypto -- crypto/

Yes, you should always do something like this when backporting to make
sure that you haven't missed patches merged in ways that you didn't
anticipate.

Although I'm not aware of any such patches in the time frame that Michal
has in mind.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: Prepare "git-merge-tree" for future work
From: Linus Torvalds @ 2006-06-30  2:32 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vejx7mmaj.fsf@assigned-by-dhcp.cox.net>



On Thu, 29 Jun 2006, Junio C Hamano wrote:

> Linus Torvalds <torvalds@osdl.org> writes:
> 
> > I punted on trying to use the proper git diff interfaces (they are very 
> > tightly tied into the "diff_filespec" model - Junio, it might be nice if 
> > there was some way to use them in a setting where that isn't necessarily 
> > as natural).
> 
> I am not quite sure what you mean.

For what I wanted to do, I didn't see an easy way to add/populate a new 
filespec. It was easier to just use the raw libxdiff interfaces, but 
that's really just because I know the interfaces.

In contrast, the ones to diff_filespec I've never really used, and I did 
not want to compare blob objects, I very much wanted to compare in-memory 
buffers (_and_ potentially blobs).

So if you can show an easy example of how to populate a set of filespec 
pairs (not with blobs - with in-memory generated data) and insert them 
onto the lists, that would be good.

In fact, maybe you can show me what git-merge-tree needs to do..

Hint hint.

		Linus

^ permalink raw reply

* Re: [PATCH] git-grep: --and to combine patterns with and instead of or
From: Matthias Lederhofer @ 2006-06-30  2:25 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vejx7oa3x.fsf@assigned-by-dhcp.cox.net>

So here is my proposal how extended expressions would work:

extended expressions have three operators:
    AND, OR (binary), NOT (unary)
extended expressions do not need an extra option. They will be usable
by adding operators between the expressions; a default operator is
used if no operator is specified. The default operator is by default
OR because currently multiple patterns are combined by OR.

OR and AND have precedence, so there are two possibilities, I'd take
the first one.
1. OR, AND:
    This will make it easier to read because OR can be skipped:
      pat1 pat2 AND pat3 pat4
    = pat1 OR pat2 AND pat3 OR pat4
    = (pat1 OR pat2) AND (pat3 OR pat4)
2. AND, OR:
    This is a bit more logic if you think of AND as * and OR as +.

Parenthesis may be used to explicitly override the default precedence.

With this setup we can add an option -FOO (I don't now how to call it,
it is the --and from the patch) which changes the default operator and
the precedence.  With -FOO you'd get AND as default operator and
precedence AND, OR.  Without this option it was easy to write the
formula in a conjungtive form (conjunction of disjunctions), now it is
easy to write a disjunctive form (disjunction of conjunctions):
  pat1 pat2 OR pat3 pat4
= pat1 AND pat2 OR pat3 AND pat4
= (pat1 AND pat2) OR (pat3 AND pat4)

With all this as plan for extended expressions we may also introduce
-FOO now with exactly the behaviour of --and in my patch because
currently no explicit operators and parenthesis are allowed, so only
the default operator may be used and -FOO would change the default
operator.

A short example:
(pat1 AND pat2 AND pat3) OR pat4
could be written as
-FOO pat1 pat2 pat3 OR pat4
which is imho quite readable.

So the next problem are names for the options. We would need
 - AND: between patterns
 - OR:  between patterns
 - NOT: before a pattern
 - FOO: change default operator and precedence
Unfortunately -o, -a, -n are taken and I think the options should be
unique even though they are only allowed at certain positions of the
argument list. I'll think about it a bit, perhaps someone else has a
good idea. FOO should not be named --and imo but I don't have any idea
for a good name atm.

^ permalink raw reply

* Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree
From: Linus Torvalds @ 2006-06-30  2:25 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Michal Ludvig, linux-crypto, git
In-Reply-To: <20060630013627.GA27527@gondor.apana.org.au>



On Fri, 30 Jun 2006, Herbert Xu wrote:
>
> On Fri, Jun 30, 2006 at 01:18:24PM +1200, Michal Ludvig wrote:
> > 
> > just a quick question: how can I create a patch with all changes in
> > cryptodev-2.6 tree against tag v2.6.16 in Linus tree? I've got
> > git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
> > cloned here and want to extract all your commits in this tree since
> > 2.6.16. Is there a way to do it in Git/Cogito?
> 
> OK, it's easier if you break this into three problems.
> 
> You start by getting all the changes merged right after 2.6.16.  This
> can be done by locating the merge changeset in Linus's tree.  It looks
> like this:

Actually, there are certainly other, potentially easier, ways to do this.

It depends a bit on what Michal wants, though. Since the current trees 
(both mine and the cryptodev tree) have been merging things back and 
forth, it's _not_ as easy as just saying "pick all commits that exist in 
one branch but not the other", but depending on what Michal wants to do, 
git gives other ways to prune out just the info he wants.

The easiest by far is if you only care about a certain sub-directory. 
Then, assuming the branch "crypto" is the top-most commit of the cryptodev 
repo, just do

	git diff v2.6.16..crypto -- crypto/

and that will give you a diff of all the changes since v2.6.16 inside that 
subdirectory. That may or may not be sufficient and what Michal wants.

Now, the cryptodev-2.6.git tree doesn't even contain the v2.6.16 tags, but 
you can fix that by just doing

	git fetch --tags git://git.kernel.org//pub/scm/linux/kernel/git/torvalds/linux-2.6

even if your clone is actually from just the cryptodev-2.6 archive.

Alternatively, if you want to see the individual changes, you can just do

	git log -p --full-diff v2.6.16..crypto -- crypto/

which shows you all the commits that changed the crypto/ subdirectory, AND 
it shows the other changes those same commits did to other subdirectories 
too (which is usually something you want in a case like this).

Finally, what you can also do is that instead of matching for stuff that 
changed the crypto/ subdirectory, you could try to match commits where the 
committer is somebody special, eg Herbert Xu. We don't have that kind of 
thing automated, but here's one way to do it:

	git-rev-list --header v2.6.16..crypto |
		grep -z 'committer Herbert Xu' |
		tr '\0' '\n' |
		sed -n '/^[a-f0-9][a-f0-9]*$/p' |
		git diff-tree --pretty -p --stdin |
		less -S

where the "git-rev-list --header | grep -z" part picks out any commits 
committed by Herbert, the "tr '\0' '\n' | sed -n" part then picks up just 
the commit ID's from those lines, and the "git-diff-tree" part then shows 
those commits as diffs.

(The above should really be quite possible to shorten as

	git log -p --committer="Herbert Xu"

but we don't actually support git-rev-list doing matching on 
committer/author names - although it should be easy to do in case somebody 
wants to have a small git project to get their toes wet, hint hint)

			Linus

^ permalink raw reply

* Re: Prepare "git-merge-tree" for future work
From: Junio C Hamano @ 2006-06-30  2:04 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0606281401540.12404@g5.osdl.org>

Linus Torvalds <torvalds@osdl.org> writes:

> I punted on trying to use the proper git diff interfaces (they are very 
> tightly tied into the "diff_filespec" model - Junio, it might be nice if 
> there was some way to use them in a setting where that isn't necessarily 
> as natural).

I am not quite sure what you mean.  You have a sets of
filepairs, each of which is a pair of filespec, each of which
describes the blob.  And diff is about comparing them, possibly
after running rename detection, pickaxe filtering and such.  If
the merge-tree's internal representation for each blob is more
efficient or easier to use we could switch to use it as an
improved implementation of filespec but I do not think that is
what you meant, because I suspect that approach does not break
diff from the "model".  Care to elaborate a bit more please?

^ permalink raw reply

* Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree
From: Herbert Xu @ 2006-06-30  1:36 UTC (permalink / raw)
  To: Michal Ludvig; +Cc: linux-crypto, git
In-Reply-To: <44A47BE0.9060504@logix.cz>

On Fri, Jun 30, 2006 at 01:18:24PM +1200, Michal Ludvig wrote:
> 
> just a quick question: how can I create a patch with all changes in
> cryptodev-2.6 tree against tag v2.6.16 in Linus tree? I've got
> git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
> cloned here and want to extract all your commits in this tree since
> 2.6.16. Is there a way to do it in Git/Cogito?

OK, it's easier if you break this into three problems.

You start by getting all the changes merged right after 2.6.16.  This
can be done by locating the merge changeset in Linus's tree.  It looks
like this:

commit ec1248e70edc5cf7b485efcc7b41e44e10f422e5
Merge: 3d1f337b3e7378923c89f37afb573a918ef40be5 55e9dce37ddf3ab358ba1d1e9eef4ee4bd8174a6
Author: Linus Torvalds <torvalds@g5.osdl.org>
Date:   Tue Mar 21 09:33:19 2006 -0800

    Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6

    * master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6:
      [CRYPTO] aes: Fixed array boundary violation
      [CRYPTO] tcrypt: Fix key alignment
      [CRYPTO] all: Add missing cra_alignmask
      [CRYPTO] all: Use kzalloc where possible
      [CRYPTO] api: Align tfm context as wide as possible
      [CRYPTO] twofish: Use rol32/ror32 where appropriate

You can get the diff for this merge by doing

$ git-diff-tree -p 3d1f337b3e7378923c89f37afb573a918ef40be5 ec1248e70edc5cf7b485efcc7b41e44e10f422e5

You then repeat this for 2.6.17 where the merge changeset is:

commit 972d19e837833b93466c6f6a8ef2a7d653000aa3
Merge: cdf4f383a4b0ffbf458f65380ecffbeee1f79841 b9d0a25a484a90c1d60b974d115eff2fe580ce16
Author: Linus Torvalds <torvalds@g5.osdl.org>
Date:   Mon Jun 26 11:03:29 2006 -0700

Finally you get the changes since that merge by find the common changeset
between cryptodev-2.6 and Linus's tree and getting all the changes after
that.

This method works because all crypto changes since 2.6.16 were merged
from my tree.  If this wasn't the case, then you'd have to search
through the history since 2.6.16 to identify the crypto patches that
were merged from other sources.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* GIt.xs merge status
From: Junio C Hamano @ 2006-06-30  1:28 UTC (permalink / raw)
  To: git; +Cc: Petr Baudis
In-Reply-To: <7vhd2atid1.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> writes:

> Pasky, can we first iron out kinks in the build procedure and
> installation before converting existing programs further?  The
> things I worry about currently are:
>
>  - the SITELIBARCH gotcha I sent you a message about (and you
>    responded to it already -- was that an Acked-by?);

I think this finally was cleared thanks to Pavel Roskin (and an
unrelated workaround at the tip of "pu" by me).

>  - RPM target -- we probably acquired a new build-dependency in
>    which case the .spec file needs to be updated;

I am having trouble with this.  I'd appreciate help from RPM
savvy people (the build failure log at the end).

>  - Make sure Git.xs builds and installed result works fine on
>    all platforms we care about, including Cygwin and other
>    non-Linux boxes.

Help wanted from the list here.  One thing to note is that I
understand Pasky is working on not using Devel::PPPort to make
the code work with 5.6, so if your build dies with problems in
that area you might want to wait until that is fixed.

> I'd even suggest we revert the changes to git-fmt-merge-msg to
> keep it working for now, until the above worries are resolved.
> Otherwise we cannot have it in "next" safely (and I REALLY _do_
> want to have Git.pm infrastructure in "next" soonish).

I am still undecided about the reverting, since in the places I
personally care about the program works ;-).

I test-built the tip of "pu" 57628f0e; the RPM build log ends
like this:

Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: /bin/sh git-core = 1.4.1.rc2.g5762-1 tk >= 8.4
Processing files: git-debuginfo-1.4.1.rc2.g5762-1
Provides: Git.so.debug()(64bit)
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/git-1.4.1.rc2.g5762-1-root-junio
error: Installed (but unpackaged) file(s) found:
   /usr/lib64/perl5/5.8.6/x86_64-linux-thread-multi/perllocal.pod
   /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/Error.pm
   /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/Git.pm
   /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/auto/Git/.packlist
   /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/auto/Git/Git.bs
   /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/auto/Git/Git.so


RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/lib64/perl5/5.8.6/x86_64-linux-thread-multi/perllocal.pod
   /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/Error.pm
   /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/Git.pm
   /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/auto/Git/.packlist
   /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/auto/Git/Git.bs
   /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi/auto/Git/Git.so
make: *** [rpm] Error 1

^ permalink raw reply

* Creating diff from 2.6.16 from cryptodev-2.6 git tree
From: Michal Ludvig @ 2006-06-30  1:18 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-crypto, git

Hi Herbert and others,

just a quick question: how can I create a patch with all changes in
cryptodev-2.6 tree against tag v2.6.16 in Linus tree? I've got
git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
cloned here and want to extract all your commits in this tree since
2.6.16. Is there a way to do it in Git/Cogito?

I was playing with cg-mkpatch but that gave me only the last commit
(Twofish updates). I'm sure I could search for your commits in the log
and create those patches one by one but that doesn't seem to be too
efficient. Also tried "cg-mkpatch -r 6246b61[...].." which is your merge
of v2.6.17-rc1 into cryptodev-2.6 but that extracted _all_ commits since
that tag, not only those in your tree.

Any help appreciated :-)

Thanks

Michal

^ permalink raw reply

* Re: [PATCH 2/4] make filepairs detachable
From: Junio C Hamano @ 2006-06-30  1:16 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git, Johannes Schindelin
In-Reply-To: <20060630002736.GB22618@steel.home>

fork0@t-online.de (Alex Riesen) writes:

> Actually, just make sure diff_flush does not crash for diff queue
> entries which were cleared.

Somehow I really feel uneasy about this one.  I think it is the
responsibility of the one who mangles the queue to adjust the
entries and count consistent.

^ permalink raw reply

* Re: rebasing trouble
From: Junio C Hamano @ 2006-06-30  1:12 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: git
In-Reply-To: <20060629234502.GB10041@fieldses.org>

"J. Bruce Fields" <bfields@fieldses.org> writes:

> I don't know why I find that syntax so counterintuitive.  Something like
>
> 	git checkout -b newgood master
> 	git cherry-pick next..good
>
> would seem more obvious.

Yes.  Everybody loves to hate this syntax.

^ permalink raw reply

* Re: [PATCH 4/4] save another call to git-update-index
From: Johannes Schindelin @ 2006-06-30  0:37 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git
In-Reply-To: <20060630002756.GD22618@steel.home>

Hi,

FYI I've been just battling this pipe for a couple of hours. The first 
steps were easy, but since I wanted to do it incrementally, the index has 
to be written every so often, and I seem not to be able to get that right.

But now it's time to go to bed, so this will wait for tomorrow.

Ciao,
Dscho

^ permalink raw reply

* [PATCH 8] autoconf: ./configure script outputs to config.mac.auto
From: Jakub Narebski @ 2006-06-30  0:32 UTC (permalink / raw)
  To: git
In-Reply-To: <200606300211.21922.jnareb@gmail.com>

---
So now to actually use ./configure output you either have to add
  -include config.mak.auto
to Makefile before including config.mak, link config.mak.auto to config.mak, 
or rename (move) config.mak.auto to config.mak after done with ./configure

 configure.ac |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 58ec57a..799bc87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ AC_INIT([git], [1.4.0], [git@vger.kernel
 
 AC_CONFIG_SRCDIR([git.c])
 
-config_file=config.mak
+config_file=config.mak.auto
 config_append=config.mak.append
 config_in=config.mak.in
 
-- 
1.4.0

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox