* Re: Added macro support to qgit
From: Pavel Roskin @ 2006-06-23 1:00 UTC (permalink / raw)
To: Marco Costalba; +Cc: git
In-Reply-To: <e5bfff550606220704q568d8345o1420a0a3e29544e8@mail.gmail.com>
Hello, Marco!
On Thu, 2006-06-22 at 16:04 +0200, Marco Costalba wrote:
> I have pushed some patches that add macros to qgit.
>
> From menu bar it is possible to run a macro created by a fancy new
> dialog invoked by 'Macros->Setup macros...' menu.
I'm not sure they can be called macros. Macro is something consisting
of several commands that are already implemented. So, a macro-assembler
is a program that allows to combine several supported instructions into
one macro. Macros in editors record actions already implemented by the
editors. You may also want to read this:
http://en.wikipedia.org/wiki/Macro
If I understand correctly, qgit doesn't do that. It calls external
commands that are not implemented internally, and it doesn't aggregate
anything. Then why not call them "external commands"?
The interface is quite confusing. I see 5 buttons on top, all of which
are enabled, plus one button labeled as "...", three checkboxes, one
single-line entry and one multiline entry. I have no I idea where to
start. Should I click "new" or white something and then click "new"?
And where's "Cancel"?.
That's what I have tried:
Enter "foo bar" in the multiline entry.
Click "New"
Enter "foobar"
Click "New"
Enter "abc"
Select "foobar"
Now "Run external script" is selected and "foo bar" is gone! I believe
user input should not be discarded without a warning.
I also tried something more meaningful. I create a "pull" macro as an
external script "stg pull". It didn't work. Am I supposed to supply
full path? Does it understand arguments? It the script supposed to be
in a certain format? OK, stg is written in python, but how about
cg-status, a shell script? It doesn't seen to work either.
I could make macros work when I entered the under "Insert commands to
run". The output window looks nice. But I see no indication whether
the script is running or it has finished. I don't see how to terminate
the script "gently", an equivalent of Ctrl-C.
As far as I understand, the text entries should not be enabled at the
same time. But it saw it happening when there were no macros at all.
And if I delete all macros, "Insert commands to run" doesn't work at
all.
What happens to the arguments qgit is asking for if a multiline entry is
executed? I understand they are prepended to the first line. This is
not quite logical. Wouldn't it be better to have a shell like notation
for them?
I see the macros are saved in the qgit configuration for the
user .qt/qgitrc, like this:
[Macro reset]
commands=echo\nstg pull\necho 123\nsleep 5
patch_flags=9040
script_path=/home/proski/bin/cg-reset
Shouldn't only one of commands and script_path be saved? Whouldn't it
be better to save meaningful boolean options instead of the opaque
binary "patch_flags"
And what is "macro_name=New macro" in [General]?
I think I should write you what I would like to see in qgit, but that
would be a separate e-mail.
--
Regards,
Pavel Roskin
^ permalink raw reply
* Re: [PATCH] Introduce Git.pm (v3)
From: Petr Baudis @ 2006-06-23 1:12 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v1wtghga6.fsf@assigned-by-dhcp.cox.net>
Dear diary, on Fri, Jun 23, 2006 at 02:22:41AM CEST, I got a letter
where Junio C Hamano <junkio@cox.net> said that...
> Petr Baudis <pasky@suse.cz> writes:
>
> >> Eek. It does not compile for me -- maybe there is more
> >> dependencies that need to be listed in INSTALL file?
> >> ...
> >> Git.xs: In function 'XS_Git_xs_hash_object':
> >> Git.xs:27: warning: ISO C90 forbids mixed declarations and code
> >> Git.xs:44: warning: passing argument 1 of 'Perl_io_close' from incompatible pointer type
> >> Git.xs:44: warning: passing argument 2 of 'Perl_io_close' makes pointer from integer without a cast
> >> Git.xs:44: error: too few arguments to function 'Perl_io_close'
> >
> > Oops, sorry. Apparently, I've digged too deep and unleashed a monster of
> > unstable API. Now I've finally discovered perlapio(1) and know I
> > should've just called PerlIO_close(). Below comes a fixed patch, I
> > didn't bother to bump the version number.
>
> Thanks; it compiles now with a few more glitches.
>
> /usr/bin/perl /usr/share/perl/5.8/ExtUtils/xsubpp \
> -typemap /usr/share/perl/5.8/ExtUtils/typemap Git.xs > Git.xsc && \
> mv Git.xsc Git.c
> Please specify prototyping behavior for Git.xs (see perlxs manual)
>
> Says xsubpp.
It's harmless but can be fixed by:
diff --git a/perl/Git.xs b/perl/Git.xs
index 3799ee9..8ab84bb 100644
--- a/perl/Git.xs
+++ b/perl/Git.xs
@@ -17,6 +17,8 @@ #include "ppport.h"
MODULE = Git PACKAGE = Git
+PROTOTYPES: DISABLE
+
# /* TODO: xs_call_gate(). See Git.pm. */
char *
> cc -c -I. -I.. -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS \
> -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include \
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 \
> -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC \
> "-I/usr/lib/perl/5.8/CORE" -Wall
> -Wdeclaration-after-statement \
> -g -DSHA1_HEADER='<openssl/sha.h>' \
> -DGIT_VERSION=\"1.4.1.rc1.g01a1\" Git.c
> Git.xs: In function 'XS_Git_xs__execv_git_cmd':
> Git.xs:57: warning: passing argument 1 of 'free' discards qualifiers from pointer target type
> Git.xs: In function 'XS_Git_xs_hash_object':
> Git.xs:65: warning: ISO C90 forbids mixed declarations and code
>
> I usually compile with -Wdeclaration-after-statement so I
> probably get some more warnings than you saw; it probably is
> primarily xsubpp's fault, but you could work it around by having
> CODE block to be inside an extra set of braces {}.
Sure. Should I resend all the .xs-related patches with the code blocks
in {}, or will you add it at your side?
> Constness reduction of free() is a bit annoying from the point of view of
> the coder who has to cast away constness, so I won't be too
> strict about that, but it would be nicer if we did not have to
> see the warnings.
Sure, it should be trivial to fix.
> rm -f blib/arch/auto/Git/Git.so
> cc -shared -L/usr/local/lib Git.o -o blib/arch/auto/Git/Git.so ../libgit.a \
> -lz -lcrypto \
>
> /usr/bin/ld: ../libgit.a(exec_cmd.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
> ../libgit.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make[1]: *** [blib/arch/auto/Git/Git.so] Error 1
>
> This is a real killer. If we compile everything with -fPIC,
> this goes away, but I do not think we want -fPIC for the core
> level tools. At least not until we are ready to do libgit.so.
Hmm, I didn't get that; I guess that's x86-64 specific. :/ Do you have
any idea what the error actually means? Could the environ be a problem?
(Why aren't we calling just execv()?)
Also, is there any real problem with just using -fPIC?
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
A person is just about as big as the things that make them angry.
^ permalink raw reply related
* Re: Tracking CVS
From: Jon Smirl @ 2006-06-23 2:18 UTC (permalink / raw)
To: Petr Baudis; +Cc: git
In-Reply-To: <20060622135831.GB21864@pasky.or.cz>
On 6/22/06, Petr Baudis <pasky@suse.cz> wrote:
> Dear diary, on Thu, Jun 22, 2006 at 02:41:16PM CEST, I got a letter
> where Jon Smirl <jonsmirl@gmail.com> said that...
> > I'm tracking cvs using this sequence.
> >
> > cvs update
> > cg rm -a
> > cg commit
> > cg add -r .
> > cg commit
> >
> > Is there a way to avoid the two commits? If you do the add with out
> > the intervening commit it just adds the files back.
>
> I think the most straightforward way is:
>
> cvs update
> cg-rm -a
> cg-status -wns \? | xargs cg-add
> cg-commit
This doesn't pick up new directories with recursion.
>
> If you want to be careful about filenames polluted by non-newline
> whitespaces,
>
> cg-status -wns \? | tr '\n' '\0' | xargs -0 cg-add
>
> If you want to be safe even with filenames containing newlines, you need
> to go at the Git level:
>
> git-ls-files -z --others | \
> xargs -0 git-update-index --add --
>
> Perhaps we might make a special command which would sync the index set
> with the working copy set...
>
> --
> Petr "Pasky" Baudis
> Stuff: http://pasky.or.cz/
> A person is just about as big as the things that make them angry.
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* Re: Tracking CVS
From: Jon Smirl @ 2006-06-23 2:24 UTC (permalink / raw)
To: Petr Baudis; +Cc: git
In-Reply-To: <9e4733910606221918r775f49f0l4929f4703281115f@mail.gmail.com>
On 6/22/06, Jon Smirl <jonsmirl@gmail.com> wrote:
> > I think the most straightforward way is:
> >
> > cvs update
> > cg-rm -a
> > cg-status -wns \? | xargs cg-add
> > cg-commit
>
> This doesn't pick up new directories with recursion.
The new directories that came down were empty.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* Re: Tracking CVS
From: Petr Baudis @ 2006-06-23 2:31 UTC (permalink / raw)
To: Jon Smirl; +Cc: git
In-Reply-To: <9e4733910606221918r775f49f0l4929f4703281115f@mail.gmail.com>
Dear diary, on Fri, Jun 23, 2006 at 04:18:32AM CEST, I got a letter
where Jon Smirl <jonsmirl@gmail.com> said that...
> On 6/22/06, Petr Baudis <pasky@suse.cz> wrote:
> > cvs update
> > cg-rm -a
> > cg-status -wns \? | xargs cg-add
> > cg-commit
>
> This doesn't pick up new directories with recursion.
Ah. Either pass -S to cg-status or -r to cg-add.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
A person is just about as big as the things that make them angry.
^ permalink raw reply
* Fixed PPC SHA1
From: linux @ 2006-06-23 0:09 UTC (permalink / raw)
To: git, linuxppc-dev; +Cc: linux
In-Reply-To: <20060619084135.18632.qmail@science.horizon.com>
Okay, here's a tested and working version (the earlier version worked,
too) of a better-scheduled PPC SHA1. This is about 15% faster that the
current sha1ppc.S on a G4, and 5% faster on a G5 when hashing 10 million
bytes, unaligned. (The G5 ratio seems to get better as the sizes fall.)
It's also somewhat smaller, due to using load-multiple instructions.
I have a variant that uses load string (lswi) to load the values to be
hashed that is a few percent faster on a G5, but a few percent slower
on a G4. It's also 52 bytes smaller (out of 4000).
Does anyone have any feeling for the ratio of G4 and G5 machines
out there? I presume for that small a percentage, run-time processor
detection isn't worth it. (Cc: to linuxppc-dev for the experts on
this question.)
I've tried using lmw to load the data, and it's faster if the data is
aligned, but it absolutely dies if the data is not. And due to git's
variable-sized hash prefix, most of git's hashes are of unaligned data.
(No copyright is claimed on the changes to Paul Mackerras' work below.
Enjoy.)
/*
* SHA-1 implementation for PowerPC.
*
* Copyright (C) 2005 Paul Mackerras <paulus@samba.org>
*/
/*
* PowerPC calling convention:
* %r0 - volatile temp
* %r1 - stack pointer.
* %r2 - reserved
* %r3-%r12 - Incoming arguments & return values; volatile.
* %r13-%r31 - Callee-save registers
* %lr - Return address, volatile
* %ctr - volatile
*
* Register usage in this routine:
* %r0 - temp
* %r3 - argument (pointer to 5 words of SHA state)
* %r4 - argument (pointer to data to hash)
* %r5 - Contant K in SHA round (initially number of blocks to hash)
* %r6-%r10 - Working copies of SHA variables A..E (actually E..A order)
* %r11-%r26 - Data being hashed W[].
* %r27-%r31 - Previous copies of A..E, for final add back.
* %ctr - loop count
*/
/*
* We roll the registers for A, B, C, D, E around on each
* iteration; E on iteration t is D on iteration t+1, and so on.
* We use registers 6 - 10 for this. (Registers 27 - 31 hold
* the previous values.)
*/
#define RA(t) (((t)+4)%5+6)
#define RB(t) (((t)+3)%5+6)
#define RC(t) (((t)+2)%5+6)
#define RD(t) (((t)+1)%5+6)
#define RE(t) (((t)+0)%5+6)
/* We use registers 11 - 26 for the W values */
#define W(t) ((t)%16+11)
/* Register 5 is used for the constant k */
/*
* The basic SHA-1 round function is:
* E += ROTL(A,5) + F(B,C,D) + W[i] + K; B = ROTL(B,30)
* Then the variables are renamed: (A,B,C,D,E) = (E,A,B,C,D).
*
* Every 20 rounds, the function F() and the contant K changes:
* - 20 rounds of f0(b,c,d) = "bit wise b ? c : d" = (^b & d) + (b & c)
* - 20 rounds of f1(b,c,d) = b^c^d = (b^d)^c
* - 20 rounds of f2(b,c,d) = majority(b,c,d) = (b&d) + ((b^d)&c)
* - 20 more rounds of f1(b,c,d)
*
* These are all scheduled for near-optimal performance on a G4.
* The G4 is a 3-issue out-of-order machine with 3 ALUs, but it can only
* *consider* starting the oldest 3 instructions per cycle. So to get
* maximum performace out of it, you have to treat it as an in-order
* machine. Which means interleaving the computation round t with the
* computation of W[t+4].
*
* The first 16 rounds use W values loaded directly from memory, while the
* remianing 64 use values computed from those first 16. We preload
* 4 values before starting, so there are three kinds of rounds:
* - The first 12 (all f0) also load the W values from memory.
* - The next 64 compute W(i+4) in parallel. 8*f0, 20*f1, 20*f2, 16*f1.
* - The last 4 (all f1) do not do anything with W.
*
* Therefore, we have 6 different round functions:
* STEPD0_LOAD(t,s) - Perform round t and load W(s). s < 16
* STEPD0_UPDATE(t,s) - Perform round t and compute W(s). s >= 16.
* STEPD1_UPDATE(t,s)
* STEPD2_UPDATE(t,s)
* STEPD1(t) - Perform round t with no load or update.
*
* The G5 is more fully out-of-order, and can find the parallelism
* by itself. The big limit is that it has a 2-cycle ALU latency, so
* even though it's 2-way, the code has to be scheduled as if it's
* 4-way, which can be a limit. To help it, we try to schedule the
* read of RA(t) as late as possible so it doesn't stall waiting for
* the previous round's RE(t-1), and we try to rotate RB(t) as early
* as possible while reading RC(t) (= RB(t-1)) as late as possible.
*/
/* the initial loads. */
#define LOADW(s) \
lwz W(s),(s)*4(%r4)
/*
* Perform a step with F0, and load W(s). Uses W(s) as a temporary
* before loading it.
* This is actually 10 instructions, which is an awkward fit.
* It can execute grouped as listed, or delayed one instruction.
* (If delayed two instructions, there is a stall before the start of the
* second line.) Thus, two iterations take 7 cycles, 3.5 cycles per round.
*/
#define STEPD0_LOAD(t,s) \
add RE(t),RE(t),W(t); andc %r0,RD(t),RB(t); and W(s),RC(t),RB(t); \
add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; rotlwi RB(t),RB(t),30; \
add RE(t),RE(t),W(s); add %r0,%r0,%r5; lwz W(s),(s)*4(%r4); \
add RE(t),RE(t),%r0
/*
* This is likewise awkward, 13 instructions. However, it can also
* execute starting with 2 out of 3 possible moduli, so it does 2 rounds
* in 9 cycles, 4.5 cycles/round.
*/
#define STEPD0_UPDATE(t,s,loadk...) \
add RE(t),RE(t),W(t); andc %r0,RD(t),RB(t); xor W(s),W((s)-16),W((s)-3); \
add RE(t),RE(t),%r0; and %r0,RC(t),RB(t); xor W(s),W(s),W((s)-8); \
add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; xor W(s),W(s),W((s)-14); \
add RE(t),RE(t),%r5; loadk; rotlwi RB(t),RB(t),30; rotlwi W(s),W(s),1; \
add RE(t),RE(t),%r0
/* Nicely optimal. Conveniently, also the most common. */
#define STEPD1_UPDATE(t,s,loadk...) \
add RE(t),RE(t),W(t); xor %r0,RD(t),RB(t); xor W(s),W((s)-16),W((s)-3); \
add RE(t),RE(t),%r5; loadk; xor %r0,%r0,RC(t); xor W(s),W(s),W((s)-8); \
add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; xor W(s),W(s),W((s)-14); \
add RE(t),RE(t),%r0; rotlwi RB(t),RB(t),30; rotlwi W(s),W(s),1
/*
* The naked version, no UPDATE, for the last 4 rounds. 3 cycles per.
* We could use W(s) as a temp register, but we don't need it.
*/
#define STEPD1(t) \
add RE(t),RE(t),W(t); xor %r0,RD(t),RB(t); \
rotlwi RB(t),RB(t),30; add RE(t),RE(t),%r5; xor %r0,%r0,RC(t); \
add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; /* spare slot */ \
add RE(t),RE(t),%r0
/*
* 14 instructions, 5 cycles per. The majority function is a bit
* awkward to compute. This can execute with a 1-instruction delay,
* but it causes a 2-instruction delay, which triggers a stall.
*/
#define STEPD2_UPDATE(t,s,loadk...) \
add RE(t),RE(t),W(t); and %r0,RD(t),RB(t); xor W(s),W((s)-16),W((s)-3); \
add RE(t),RE(t),%r0; xor %r0,RD(t),RB(t); xor W(s),W(s),W((s)-8); \
add RE(t),RE(t),%r5; loadk; and %r0,%r0,RC(t); xor W(s),W(s),W((s)-14); \
add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; rotlwi W(s),W(s),1; \
add RE(t),RE(t),%r0; rotlwi RB(t),RB(t),30
#define STEP0_LOAD4(t,s) \
STEPD0_LOAD(t,s); \
STEPD0_LOAD((t+1),(s)+1); \
STEPD0_LOAD((t)+2,(s)+2); \
STEPD0_LOAD((t)+3,(s)+3)
#define STEPUP4(fn, t, s, loadk...) \
STEP##fn##_UPDATE(t,s,); \
STEP##fn##_UPDATE((t)+1,(s)+1,); \
STEP##fn##_UPDATE((t)+2,(s)+2,); \
STEP##fn##_UPDATE((t)+3,(s)+3,loadk)
#define STEPUP20(fn, t, s, loadk...) \
STEPUP4(fn, t, s,); \
STEPUP4(fn, (t)+4, (s)+4,); \
STEPUP4(fn, (t)+8, (s)+8,); \
STEPUP4(fn, (t)+12, (s)+12,); \
STEPUP4(fn, (t)+16, (s)+16, loadk)
.globl sha1_core
sha1_core:
stwu %r1,-80(%r1)
stmw %r13,4(%r1)
/* Load up A - E */
lmw %r27,0(%r3)
mtctr %r5
1:
LOADW(0)
lis %r5,0x5a82
mr RE(0),%r31
LOADW(1)
mr RD(0),%r30
mr RC(0),%r29
LOADW(2)
ori %r5,%r5,0x7999 /* K0-19 */
mr RB(0),%r28
LOADW(3)
mr RA(0),%r27
STEP0_LOAD4(0, 4)
STEP0_LOAD4(4, 8)
STEP0_LOAD4(8, 12)
STEPUP4(D0, 12, 16,)
STEPUP4(D0, 16, 20, lis %r5,0x6ed9)
ori %r5,%r5,0xeba1 /* K20-39 */
STEPUP20(D1, 20, 24, lis %r5,0x8f1b)
ori %r5,%r5,0xbcdc /* K40-59 */
STEPUP20(D2, 40, 44, lis %r5,0xca62)
ori %r5,%r5,0xc1d6 /* K60-79 */
STEPUP4(D1, 60, 64,)
STEPUP4(D1, 64, 68,)
STEPUP4(D1, 68, 72,)
STEPUP4(D1, 72, 76,)
addi %r4,%r4,64
STEPD1(76)
STEPD1(77)
STEPD1(78)
STEPD1(79)
/* Add results to original values */
add %r31,%r31,RE(0)
add %r30,%r30,RD(0)
add %r29,%r29,RC(0)
add %r28,%r28,RB(0)
add %r27,%r27,RA(0)
bdnz 1b
/* Save final hash, restore registers, and return */
stmw %r27,0(%r3)
lmw %r13,4(%r1)
addi %r1,%r1,80
blr
^ permalink raw reply
* Re: Fixed PPC SHA1
From: linux @ 2006-06-23 0:54 UTC (permalink / raw)
To: git, linuxppc-dev; +Cc: linux
In-Reply-To: <20060623000908.9370.qmail@science.horizon.com>
Here's the lwsi-based version that's slightly faster on a G5, but slightly
slower on a G4.
/*
* SHA-1 implementation for PowerPC.
*
* Copyright (C) 2005 Paul Mackerras <paulus@samba.org>
*/
/*
* PowerPC calling convention:
* %r0 - volatile temp
* %r1 - stack pointer.
* %r2 - reserved
* %r3-%r12 - Incoming arguments & return values; volatile.
* %r13-%r31 - Callee-save registers
* %lr - Return address, volatile
* %ctr - volatile
*
* Register usage in this routine:
* %r0 - temp
* %r3 - argument (pointer to 5 words of SHA state)
* %r4 - argument (pointer to data to hash)
* %r5-%r20 - Data being hashed W[]. (%r5 is initially count of blocks)
* %r21 - Contant K in SHA round
* %r22-%r26 - Working copies of SHA variables A..E (actually E..A order)
* %r27-%r31 - Previous copies of A..E, for final add back.
* %ctr - loop count (copied from %r5 argument)
*
* It's also worth mentioning that PPC assembly accept a bare
* number as a register specifier; the "%r" prefix is actually optional.
* And that number cna be an expression! That simplifies the
* loop unrolling significantly.
*/
/*
* We roll the registers for A, B, C, D, E around on each
* iteration; E on iteration t is D on iteration t+1, and so on.
* We use registers 22 - 26 for this. (Registers 27 - 31 hold
* the previous values.)
*/
#define RA(t) (((t)+4)%5+22)
#define RB(t) (((t)+3)%5+22)
#define RC(t) (((t)+2)%5+22)
#define RD(t) (((t)+1)%5+22)
#define RE(t) (((t)+0)%5+22)
/* Register 21 is used for the constant k */
/* We use registers 5 - 20 for the W values */
#define W(t) ((t)%16+5)
/*
* The basic SHA-1 round function is:
* E += ROTL(A,5) + F(B,C,D) + W[i] + K; B = ROTL(B,30)
* Then the variables are renamed: (A,B,C,D,E) = (E,A,B,C,D).
*
* Every 20 rounds, the function F() and the contant K changes:
* - 20 rounds of f0(b,c,d) = "bit wise b ? c : d" = (^b & d) + (b & c)
* - 20 rounds of f1(b,c,d) = b^c^d = (b^d)^c
* - 20 rounds of f2(b,c,d) = majority(b,c,d) = (b&d) + ((b^d)&c)
* - 20 more rounds of f1(b,c,d)
*
* These are all scheduled for near-optimal performance on a G4.
* The G4 is a 3-issue out-of-order machine with 3 ALUs, but it can only
* *consider* starting the oldest 3 instructions per cycle. So to get
* maximum performace out of it, you have to treat it as an in-order
* machine. Which means interleaving the computation round t with the
* computation of W[t+4].
*
* The first 16 rounds use W values loaded directly from memory, while the
* remianing 64 use values computed from those first 16. We preload
* 4 values before starting, so there are three kinds of rounds:
* - The first 12 (all f0) also load the W values from memory.
* - The next 64 compute W(i+4) in parallel. 8*f0, 20*f1, 20*f2, 16*f1.
* - The last 4 (all f1) do not do anything with W.
*
* Therefore, we have 5 different round functions:
* STEPD0(t,s) - Perform round t
* STEPD0_UPDATE(t,s) - Perform round t and compute W(s). s >= 16.
* STEPD1_UPDATE(t,s)
* STEPD2_UPDATE(t,s)
* STEPD1(t) - Perform round t with no load or update.
*
* There's also provision for inserting an instruction to start loading
* the new K value after it's last used in the given step.
*
* The G5 is more fully out-of-order, and can find the parallelism
* by itself. The big limit is that it has a 2-cycle ALU latency, so
* even though it's 2-way, the code has to be scheduled as if it's
* 4-way, which can be a limit. To help it, we try to schedule the
* read of RA(t) as late as possible so it doesn't stall waiting for
* the previous round's RE(t-1), and we try to rotate RB(t) as early
* as possible while reading RC(t) (= RB(t-1)) as late as possible.
*/
/*
* Okay, we need a naked version of STEPD0. It's 9 instructions.
* Can that be done in 3 cycles, WITHOUT using W(s) as a temp?
* NO. So we need W(s) as a temp. That can be arranged with some
* clever scheduling.
*/
#define STEPD0(t,s) \
/* spare slot */ add RE(t),RE(t),W(t); andc %r0,RD(t),RB(t); \
add RE(t),RE(t),%r0; and W(s),RC(t),RB(t); rotlwi %r0,RA(t),5; \
add RE(t),RE(t),W(s); add %r0,%r0,%r21; rotlwi RB(t),RB(t),30; \
add RE(t),RE(t),%r0;
/*
* This can execute starting with 2 out of 3 possible moduli, so it
* does 2 rounds in 9 cycles, 4.5 cycles/round.
*/
#define STEPD0_UPDATE(t,s,loadk...) \
add RE(t),RE(t),W(t); andc %r0,RD(t),RB(t); xor W(s),W((s)-16),W((s)-3); \
add RE(t),RE(t),%r0; and %r0,RC(t),RB(t); xor W(s),W(s),W((s)-8); \
add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; xor W(s),W(s),W((s)-14); \
add RE(t),RE(t),%r21; loadk; rotlwi RB(t),RB(t),30; rotlwi W(s),W(s),1; \
add RE(t),RE(t),%r0
/* Nicely optimal. Conveniently, also the most common. */
#define STEPD1_UPDATE(t,s,loadk...) \
add RE(t),RE(t),W(t); xor %r0,RD(t),RB(t); xor W(s),W((s)-16),W((s)-3); \
add RE(t),RE(t),%r21; loadk; xor %r0,%r0,RC(t); xor W(s),W(s),W((s)-8); \
add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; xor W(s),W(s),W((s)-14); \
add RE(t),RE(t),%r0; rotlwi RB(t),RB(t),30; rotlwi W(s),W(s),1
/*
* The naked version, no UPDATE, for the last 4 rounds. 3 cycles per.
* We could use W(s) as a temp register, but we don't need it.
*/
#define STEPD1(t) \
add RE(t),RE(t),W(t); xor %r0,RD(t),RB(t); \
add RE(t),RE(t),%r21; xor %r0,%r0,RC(t); rotlwi RB(t),RB(t),30; \
add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; /* spare slot */ \
add RE(t),RE(t),%r0
/* 5 cycles per */
#define STEPD2_UPDATE(t,s,loadk...) \
add RE(t),RE(t),W(t); and %r0,RD(t),RB(t); xor W(s),W((s)-16),W((s)-3); \
add RE(t),RE(t),%r0; xor %r0,RD(t),RB(t); xor W(s),W(s),W((s)-8); \
add RE(t),RE(t),%r21; loadk; and %r0,%r0,RC(t); xor W(s),W(s),W((s)-14); \
add RE(t),RE(t),%r0; rotlwi %r0,RA(t),5; rotlwi W(s),W(s),1; \
add RE(t),RE(t),%r0; rotlwi RB(t),RB(t),30
#define STEP0_LOAD4(t,s) \
STEPD0_LOAD(t,s); \
STEPD0_LOAD((t+1),(s)+1); \
STEPD0_LOAD((t)+2,(s)+2); \
STEPD0_LOAD((t)+3,(s)+3);
#define STEP0_4(t,s) \
STEPD0(t,s); \
STEPD0((t+1),(s)+1); \
STEPD0((t)+2,(s)+2); \
STEPD0((t)+3,(s)+3);
#define STEP1_4(t) \
STEPD1(t); \
STEPD1((t+1)); \
STEPD1((t)+2); \
STEPD1((t)+3);
#define STEPUP4(fn, t, s, loadk...) \
STEP##fn##_UPDATE(t,s,); \
STEP##fn##_UPDATE((t)+1,(s)+1,); \
STEP##fn##_UPDATE((t)+2,(s)+2,); \
STEP##fn##_UPDATE((t)+3,(s)+3,loadk)
#define STEPUP20(fn, t, s, loadk...) \
STEPUP4(fn, t, s,); \
STEPUP4(fn, (t)+4, (s)+4,); \
STEPUP4(fn, (t)+8, (s)+8,); \
STEPUP4(fn, (t)+12, (s)+12,); \
STEPUP4(fn, (t)+16, (s)+16, loadk)
.globl sha1_core
sha1_core:
stwu %r1,-80(%r1)
stmw %r13,4(%r1)
/* Load up A - E */
lmw %r27,0(%r3)
mtctr %r5
1:
lswi W(0),%r4,32
lis %r21,0x5a82
addi %r4,%r4,32
mr RE(0),%r31
mr RD(0),%r30
mr RC(0),%r29
ori %r21,%r21,0x7999 /* K0-19 */
mr RB(0),%r28
mr RA(0),%r27
STEP0_4(0, 8)
STEP0_4(4, 12)
lswi W(8),%r4,32
STEPUP4(D0, 8, 16,)
STEPUP4(D0, 12, 20,)
STEPUP4(D0, 16, 24, lis %r21,0x6ed9)
ori %r21,%r21,0xeba1 /* K20-39 */
STEPUP20(D1, 20, 28, lis %r21,0x8f1b)
ori %r21,%r21,0xbcdc /* K40-59 */
STEPUP20(D2, 40, 48, lis %r21,0xca62)
ori %r21,%r21,0xc1d6 /* K60-79 */
STEPUP4(D1, 60, 68,)
STEPUP4(D1, 64, 72,)
STEPUP4(D1, 68, 76,)
addi %r4,%r4,32
STEP1_4(72);
STEP1_4(76);
/* Add results to original values */
add %r31,%r31,RE(0)
add %r30,%r30,RD(0)
add %r29,%r29,RC(0)
add %r28,%r28,RB(0)
add %r27,%r27,RA(0)
bdnz 1b
/* Save final hash, restore registers, and return */
stmw %r27,0(%r3)
lmw %r13,4(%r1)
addi %r1,%r1,80
blr
^ permalink raw reply
* Ideas for qgit
From: Pavel Roskin @ 2006-06-23 4:08 UTC (permalink / raw)
To: git, Marco Costalba
Hi, Marco!
As promised, here's what I would like to see in qgit:
1) Bookmarks or quick tags (qtags). It may be useful to mark some
commits to make it easier to navigate qgit. Yet I don't want them to
mix with real tags. Perhaps qgit could save them separately, e.g.
in .git/refs/qtags to facilitate navigation. qtags should appear
separately in the popup menu.
2) The "Patch" tab should be redesigned so that the diff can be shown
against the parent or against head/tag/qtag. Users are not supposed to
enter SHA1. If they have to, then it only confirms that qgit needs
qtags.
3) It would be nice to have some minimal navigating capabilities on the
Patch tab. At least it should be possible to go up and down the
revision list and go to any head/tag/qtag/stgit patch. It would
eliminate the need to switch to the "Rev list" too often.
4) Some bisect support would be nice, at least as good as in gitk.
Actually, I'm not using bisect too much, but it's probably because I'm
not debugging Wine these days. Everything else is intelligible :-)
5) Branch view based on reflog. Probably there should be an interface
allowing to limit the displayed revisions to one branch. I think qgit
should still load all revisions that it loads now, but if users start
complaining about performance too much, maybe qgit should have an option
to load only the logged branch. The problem is that some parents will
be unavailable in the view.
6) Try to unload some stuff from the popup menus to the main menu. It
will be too log if we use it for tags, qtags, branch heads and branch
logs.
7) qgit command line should be documented. "qgit --help" should display
help on stdout.
That said, qgit is in a pretty decent shape right now (except the
"macro" interface, but I'm sure it will be improved before the next
release). I actually used qgit as an important argument for one project
to go with git rather than with Subversion of Mercurial. qgit for
Mercurial would be cool, but I'd leave it to Mercurial fans.
--
Regards,
Pavel Roskin
^ permalink raw reply
* Re: [PATCH] Introduce Git.pm (v3)
From: Junio C Hamano @ 2006-06-23 4:41 UTC (permalink / raw)
To: Petr Baudis; +Cc: git
In-Reply-To: <20060623011205.GJ21864@pasky.or.cz>
Petr Baudis <pasky@suse.cz> writes:
>> cc -shared -L/usr/local/lib Git.o -o blib/arch/auto/Git/Git.so ../libgit.a \
>> -lz -lcrypto \
>>
>> /usr/bin/ld: ../libgit.a(exec_cmd.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
>> ../libgit.a: could not read symbols: Bad value
>> collect2: ld returned 1 exit status
>> make[1]: *** [blib/arch/auto/Git/Git.so] Error 1
>>
>> This is a real killer. If we compile everything with -fPIC,
>> this goes away, but I do not think we want -fPIC for the core
>> level tools. At least not until we are ready to do libgit.so.
>
> Hmm, I didn't get that; I guess that's x86-64 specific. :/
So it seems. Both RH machines I have access at kernel.org and
Debian machines I have locally exhibit that x86-32 is OK and
x86-64 is bad. They all run libc-2.3.6 except RH x86-32 is at
libc-2.3.4.
^ permalink raw reply
* Re: [PATCH] Introduce Git.pm (v3)
From: Jakub Narebski @ 2006-06-23 6:03 UTC (permalink / raw)
To: git
In-Reply-To: <7vk678fpqy.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Petr Baudis <pasky@suse.cz> writes:
>
>>> cc -shared -L/usr/local/lib Git.o -o blib/arch/auto/Git/Git.so ../libgit.a \
>>> -lz -lcrypto \
>>>
>>> /usr/bin/ld: ../libgit.a(exec_cmd.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
>>> ../libgit.a: could not read symbols: Bad value
>>> collect2: ld returned 1 exit status
>>> make[1]: *** [blib/arch/auto/Git/Git.so] Error 1
>>>
>>> This is a real killer. If we compile everything with -fPIC,
>>> this goes away, but I do not think we want -fPIC for the core
>>> level tools. At least not until we are ready to do libgit.so.
>>
>> Hmm, I didn't get that; I guess that's x86-64 specific. :/
>
> So it seems. Both RH machines I have access at kernel.org and
> Debian machines I have locally exhibit that x86-32 is OK and
> x86-64 is bad. They all run libc-2.3.6 except RH x86-32 is at
> libc-2.3.4.
Perhaps Git.pm should provide also generic, pure Perl (and slower)
fallback implementation (when for some reason we cannot compile XS).
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH] Introduce Git.pm (v3)
From: Nguyễn Thái Ngọc Duy @ 2006-06-23 6:34 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <e7g079$8qt$1@sea.gmane.org>
On 6/23/06, Jakub Narebski <jnareb@gmail.com> wrote:
> Perhaps Git.pm should provide also generic, pure Perl (and slower)
> fallback implementation (when for some reason we cannot compile XS).
Haven't looked at Git.pm. But I have written receive-pack in perl. It
may have some useful functions for Git.pm
^ permalink raw reply
* [PATCH] git-merge --squash
From: Junio C Hamano @ 2006-06-23 8:50 UTC (permalink / raw)
To: git
Some people tend to do many little commits on a topic branch,
recording all the trials and errors, and when the topic is
reasonably cooked well, would want to record the net effect of
the series as one commit on top of the mainline, removing the
cruft from the history. The topic is then abandoned or forked
off again from that point at the mainline.
The barebone porcelainish that comes with core git tools does
not officially support such operation, but you can fake it by
using "git pull --no-merge" when such a topic branch is not a
strict superset of the mainline, like this:
git checkout mainline
git pull --no-commit . that-topic-branch
: fix conflicts if any
rm -f .git/MERGE_HEAD
git commit -a -m 'consolidated commit log message'
git branch -f that-topic-branch ;# now fully merged
This however does not work when the topic branch is a fast
forward of the mainline, because normal "git pull" will never
create a merge commit in such a case, and there is nothing
special --no-commit could do to begin with.
This patch introduces a new option, --squash, to support such a
workflow officially in both fast-forward case and true merge
case. The user-level operation would be the same in both cases:
git checkout mainline
git pull --squash . that-topic-branch
: fix conflicts if any -- naturally, there would be
: no conflict if fast forward.
git commit -a -m 'consolidated commit log message'
git branch -f that-topic-branch ;# now fully merged
When the current branch is already up-to-date with respect to
the other branch, there truly is nothing to do, so the new
option does not have any effect.
This was brought up in #git IRC channel recently.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
* This is something I am unlikely to use myself, since
"squashing into one" is too coarse grained for the commits I
usually make myself.
If one's habit is to use a sequence of many commits to keep
too-finer-grained snapshots, and the result of a squash
commit out of such a sequence of commits is a coherent,
self-contained unit, then I do not see any reason to
discourage that workflow. I however suspect that people who
make such a sequence of "many too-finer-grained commits"
would inevitably include changes that do not belong together
in in one sequence on a topic branch and end up squashing
them together into one resulting commit. If that is the
case, this facility is actively encouraging a bad workflow
and we should instead teach them to use StGIT or something
saner.
But somebody asked on #git channel, so here is the rope.
Documentation/merge-options.txt | 8 ++++
git-commit.sh | 7 +++-
git-merge.sh | 72 +++++++++++++++++++++++++++++----------
git-pull.sh | 7 +++-
git-reset.sh | 2 +
5 files changed, 72 insertions(+), 24 deletions(-)
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 53cc355..182cef5 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -6,6 +6,14 @@
not autocommit, to give the user a chance to inspect and
further tweak the merge result before committing.
+--squash::
+ Produce the working tree and index state as if a real
+ merge happened, but do not actually make a commit or
+ move the `HEAD`, nor record `$GIT_DIR/MERGE_HEAD` to
+ cause the next `git commit` command to create a merge
+ commit. This allows you to create a single commit on
+ top of the current branch whose effect is the same as
+ merging another branch (or more in case of an octopus).
-s <strategy>, \--strategy=<strategy>::
Use the given merge strategy; can be supplied more than
diff --git a/git-commit.sh b/git-commit.sh
index 6dd04fd..cd7358e 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -564,6 +564,9 @@ then
elif test -f "$GIT_DIR/MERGE_HEAD" && test -f "$GIT_DIR/MERGE_MSG"
then
cat "$GIT_DIR/MERGE_MSG"
+elif test -f "$GIT_DIR/SQUASH_MSG"
+then
+ cat "$GIT_DIR/SQUASH_MSG"
fi | git-stripspace >"$GIT_DIR"/COMMIT_EDITMSG
case "$signoff" in
@@ -661,7 +664,7 @@ else
fi
if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" -a -z "$amend" ]
then
- rm -f "$GIT_DIR/COMMIT_EDITMSG"
+ rm -f "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG"
run_status
exit 1
fi
@@ -727,7 +730,7 @@ else
false
fi
ret="$?"
-rm -f "$GIT_DIR/COMMIT_MSG" "$GIT_DIR/COMMIT_EDITMSG"
+rm -f "$GIT_DIR/COMMIT_MSG" "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG"
if test -d "$GIT_DIR/rr-cache"
then
git-rerere
diff --git a/git-merge.sh b/git-merge.sh
index af1f25b..e6db610 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -3,8 +3,7 @@ #
# Copyright (c) 2005 Junio C Hamano
#
-
-USAGE='[-n] [--no-commit] [-s <strategy>]... <merge-message> <head> <remote>+'
+USAGE='[-n] [--no-commit] [--squash] [-s <strategy>]... <merge-message> <head> <remote>+'
. git-sh-setup
LF='
@@ -42,20 +41,49 @@ restorestate() {
fi
}
+finish_up_to_date () {
+ case "$squash" in
+ t)
+ echo "$1 (nothing to squash)" ;;
+ '')
+ echo "$1" ;;
+ esac
+ dropsave
+}
+
+squash_message () {
+ echo Squashed commit of the following:
+ echo
+ git-log --no-merges ^"$head" $remote
+}
+
finish () {
test '' = "$2" || echo "$2"
- case "$merge_msg" in
- '')
- echo "No merge message -- not updating HEAD"
+ case "$squash" in
+ t)
+ echo "Squash commit -- not updating HEAD"
+ squash_message >"$GIT_DIR/SQUASH_MSG"
;;
- *)
- git-update-ref HEAD "$1" "$head" || exit 1
+ '')
+ case "$merge_msg" in
+ '')
+ echo "No merge message -- not updating HEAD"
+ ;;
+ *)
+ git-update-ref HEAD "$1" "$head" || exit 1
+ ;;
+ esac
;;
esac
-
- case "$no_summary" in
+ case "$1" in
'')
- git-diff-tree -p --stat --summary -M "$head" "$1"
+ ;;
+ ?*)
+ case "$no_summary" in
+ '')
+ git-diff-tree -p --stat --summary -M "$head" "$1"
+ ;;
+ esac
;;
esac
}
@@ -66,6 +94,8 @@ do
-n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\
--no-summa|--no-summar|--no-summary)
no_summary=t ;;
+ --sq|--squ|--squa|--squas|--squash)
+ squash=t no_commit=t ;;
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
no_commit=t ;;
-s=*|--s=*|--st=*|--str=*|--stra=*|--strat=*|--strate=*|\
@@ -152,8 +182,7 @@ f,*)
?,1,"$1",*)
# If head can reach all the merge then we are up to date.
# but first the most common case of merging one remote.
- echo "Already up-to-date."
- dropsave
+ finish_up_to_date "Already up-to-date."
exit 0
;;
?,1,"$head",*)
@@ -205,8 +234,7 @@ f,*)
done
if test "$up_to_date" = t
then
- echo "Already up-to-date. Yeeah!"
- dropsave
+ finish_up_to_date "Already up-to-date. Yeeah!"
exit 0
fi
;;
@@ -310,11 +338,17 @@ case "$best_strategy" in
git-merge-$best_strategy $common -- "$head_arg" "$@"
;;
esac
-for remote
-do
- echo $remote
-done >"$GIT_DIR/MERGE_HEAD"
-echo "$merge_msg" >"$GIT_DIR/MERGE_MSG"
+
+if test "$squash" = t
+then
+ finish
+else
+ for remote
+ do
+ echo $remote
+ done >"$GIT_DIR/MERGE_HEAD"
+ echo "$merge_msg" >"$GIT_DIR/MERGE_MSG"
+fi
if test "$merge_was_ok" = t
then
diff --git a/git-pull.sh b/git-pull.sh
index 4611ae6..1670da1 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -8,7 +8,7 @@ USAGE='[-n | --no-summary] [--no-commit]
LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.'
. git-sh-setup
-strategy_args= no_summary= no_commit=
+strategy_args= no_summary= no_commit= squash=
while case "$#,$1" in 0) break ;; *,-*) ;; *) break ;; esac
do
case "$1" in
@@ -17,6 +17,8 @@ do
no_summary=-n ;;
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
no_commit=--no-commit ;;
+ --sq|--squ|--squa|--squas|--squash)
+ squash=--squash ;;
-s=*|--s=*|--st=*|--str=*|--stra=*|--strat=*|--strate=*|\
--strateg=*|--strategy=*|\
-s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)
@@ -100,4 +102,5 @@ case "$strategy_args" in
esac
merge_name=$(git-fmt-merge-msg <"$GIT_DIR/FETCH_HEAD")
-git-merge $no_summary $no_commit $strategy_args "$merge_name" HEAD $merge_head
+git-merge $no_summary $no_commit $squash $strategy_args \
+ "$merge_name" HEAD $merge_head
diff --git a/git-reset.sh b/git-reset.sh
index 296f3b7..46451d0 100755
--- a/git-reset.sh
+++ b/git-reset.sh
@@ -61,4 +61,4 @@ case "$reset_type" in
;;
esac
-rm -f "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/rr-cache/MERGE_RR"
+rm -f "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/rr-cache/MERGE_RR" "$GIT_DIR/SQUASH_MSG"
--
1.4.1.rc1.g1f33
^ permalink raw reply related
* Re: [PATCH] Introduce Git.pm (v3)
From: Junio C Hamano @ 2006-06-23 8:57 UTC (permalink / raw)
To: Petr Baudis; +Cc: git
In-Reply-To: <20060623011205.GJ21864@pasky.or.cz>
Petr Baudis <pasky@suse.cz> writes:
> Also, is there any real problem with just using -fPIC?
Personally, not really, but I consider it a workaround having to
compile with -fPIC (being able to compile with -fPIC is a
feature).
Doesn't it have performance implications to use -fPIC when you
do not have to?
By the way, you also need to adjust the testsuite so that it
finds the Perl modules from freshly built tree before
installing. I think (but haven't checked yet) the stuff written
in Python does that already, so you might want to mimic it.
^ permalink raw reply
* Re: [PATCH] git-merge --squash
From: Junio C Hamano @ 2006-06-23 9:45 UTC (permalink / raw)
To: git
In-Reply-To: <7virmscl2u.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
> If one's habit is to use a sequence of many commits to keep
> too-finer-grained snapshots, and the result of a squash
> commit out of such a sequence of commits is a coherent,
> self-contained unit, then I do not see any reason to
> discourage that workflow. I however suspect that people who
> make such a sequence of "many too-finer-grained commits"
> would inevitably include changes that do not belong together
> in in one sequence on a topic branch and end up squashing
> them together into one resulting commit. If that is the
> case, this facility is actively encouraging a bad workflow
> and we should instead teach them to use StGIT or something
> saner.
This part of the commentary needs a bit of clarification, as I
realize that I was a bit too negative about this --squash
option.
Suppose you have this bright idea for the new filesystem feature
that involves some VFS layer changes. Let's call that "frob"
feature, and create a topic branch to develop it in.
git checkout -b frob linus
Now, when you are done, you would want the result to be
a nice, neat, logical steps. Perhaps that would introduce
features in a sequence like this:
[PATCH 1/n] vfs: support f_op.frob_read
[PATCH 2/n] vfs: support f_op.frob_write
[PATCH 3/n] ext3: add f_op.frob_read and frob_write
[PATCH 4/n] ramfs: add f_op.frob_read and frob_write
[PATCH 5/n] vfat: add f_op.frob_read and frob_write
...
But would you be able to develop things in a neat sequence like
this? Probably not. In practice (I do not do kernel myself, so
I am just speculating), I would imagine you would pick one
filesystem (say ext3) as your initial target, and do the
codepath for frob_read operation from bottom to top (vfs to
ext3), and then do the same exercise for frob_write codepath, to
have something working first. After that, you would start
migrating another fs to your updated vfs layer, and during that
process you would find your earlier changes to the vfs are
insufficient and need further tweaks to support that other fs.
So your topic branch with many little snapshot commits might
end up looking this way (fictional show-branch output):
! [linus] linux-2.6.17
* [frob] vfs: finishing touches to frob_write
--
* [frob] vfs: finishing touches to frob_write
* [frob~1] vfat: final fix to frob_read to make it work
* [frob~2] vfs: Oops, vfat is special and frob_write needs this hack
* [frob~3] vfat: fix support frob_write for disk full condition
* [frob~4] vfat: support f_op.frob_write
* [frob~5] ext3, ramfs: give frob_read the extra parameter like vfat does.
* [frob~6] vfat: give frob_read the extra parameter
* [frob~7] vfs: frob_read needs an extra parameter for vfat.
* [frob~8] ramfs: add frob_write, that was easy.
* [frob~9] ramfs: add frob_read, that was easy.
* [frob~10] ext3: more frob_write, now ext3 works!
* [frob~11] ext3: starting to add frob_write
* [frob~12] vfs: support frob_write
* [frob~13] vfs: enhance frob_read for special case, now ext3 works!
* [frob~14] ext3: yet more frob_read
* [frob~15] ext3: more frob_read
* [frob~16] ext3: starting to add frob_read
* [frob~17] vfs: support frob_read
+* [linus] linux-2.6.17
The --squash merge alone would not help sorting out something
like this. However, you could do something like this to
separate them out and squash:
git checkout -b temp master
for c in 17 13 7 1; do git cherry-pick frob~$c; done
git checkout master
git pull --sq . temp
git commit -a -m 'vfs: support f_op.frob_read'
git checkout temp
git reset --hard master
for c in 12 2 0; do git cherry-pick frob~$c; done
git checkout master
git pull --sq . temp
git commit -a -m 'vfs: support f_op.frob_write'
git checkout temp
git reset --hard master
for c in 16 15 14 11 10 5; do git cherry-pick frob~$c; done
git checkout master
git pull --sq . temp
edit to remove changes to ramfs portion
git commit -a -m 'ext3: add f_op.frob_read and frob_write'
...
So in that sense I would imagine --squash is not really useless
in such a situation as I made it sound like, but at the same
time I suspect people might be better off to use tools like
StGIT which are specially designed to support such a workflow if
they were to do this.
^ permalink raw reply
* Re: What's in git.git and announcing v1.4.1-rc1
From: Johannes Schindelin @ 2006-06-23 11:10 UTC (permalink / raw)
To: Linus Torvalds
Cc: Junio C Hamano, Git Mailing List, Linux Kernel Mailing List
In-Reply-To: <Pine.LNX.4.64.0606221301500.5498@g5.osdl.org>
Hi,
On Thu, 22 Jun 2006, Linus Torvalds wrote:
> On Thu, 22 Jun 2006, Junio C Hamano wrote:
> >
> > - diff --color (Johannes).
>
> - default to red/green for old/new lines. That's the norm, I'd think.
... and which happens to be useless for 10% of the male population (and
even more if you look specifically at Asian people). But then, I just
pasted that part from somewhere else.
Besides, I rarely have a fondue fork handy when I sit in front of the
computer. I actually do not own one. And when I am sitting in front of the
computer, shops typically are closed (yeah, I am living in Germany, but we
_do_ have cars...). So at least for 100% of the writers of this email,
your warning just does not apply.
Ciao,
Dscho
^ permalink raw reply
* Re: What's in git.git and announcing v1.4.1-rc1
From: Johannes Schindelin @ 2006-06-23 11:10 UTC (permalink / raw)
To: Linus Torvalds
Cc: Petr Baudis, Junio C Hamano, Git Mailing List,
Linux Kernel Mailing List
In-Reply-To: <Pine.LNX.4.64.0606221402140.6483@g5.osdl.org>
Hi,
On Thu, 22 Jun 2006, Linus Torvalds wrote:
> On Thu, 22 Jun 2006, Petr Baudis wrote:
> >
> > Isn't manually numbering the enum choices somewhat pointless, though?
> > (Actually makes it more difficult to do changes in it later.)
>
> Yeah, I just mindlessly followed Johannes' original scheme.
... which wasn't his, to begin with ...
^ permalink raw reply
* The newest Online Casinno. Go and Play It
From: Estela @ 2006-06-23 11:32 UTC (permalink / raw)
To: git
God helps those who help themselves
Online Casino with 85+ games. PPlay It Now! http://ewcnss.com/d1/check
So he that goeth in to his neighbour's wife; whosoever toucheth her shall not be innocent.
^ permalink raw reply
* A series file for git?
From: Eric W. Biederman @ 2006-06-23 11:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Linus Torvalds, Git Mailing List
In-Reply-To: <7vpshtyffk.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
> Linus Torvalds <torvalds@osdl.org> writes:
>
>> (a) git-rev-list --pretty=oneline "$upstream"..ORIG_HEAD > rev-list
>>
>> (b) edit the rev-list, moving the single lines around, deleting them, etc
>>
>> (c) cat rev-list |
>> git-format-patch -k --stdout --stdin --full_index |
>> git-am
>>
> Tentatively my feeling is that we should make it known that the
> list format-patch takes from --stdin is supposed to be _not_
> reversed, and do nothing in format-patch. In other words, the
> list fed is a moral equivalent to quilt "series" file.
Agreed that seem to make a lot of sense.
> What this means is:
>
> git-format-patch $revargs
>
> is not equivalent to
>
> git-rev-list $revargs | git-format-patch --stdin
>
> but is equivalent to
>
> git-rev-list $revargs | tac | git-format-patch --stdin
At least for now the using tac is fine. Longer term I think
having some reverse arguments to rev-list or even better
git-log so we can review patches in order instead backwards
would be very interesting.
> Thoughts from the list?
So I have played with this some and a bit of feedback.
I was using:
git-rev-list $revargs | tac > list
for sha1 in $(cat list); do git-cherry-pick -r $sha1 ; done
Is there any real difference between using git-format-patch | git-am
and using git-am to apply patches. I was using git-cherry-pick simply
because it was easier to sha1 too.
- When you reorder patches minor merge conflicts are common
so a big pipe won't work very often in practice. So you
need a way to handle failures in the middle.
- Keeping patches in git and just remembering their sha1 is nice
but it has the downside that it can be really easy to loose
the sha1, and thus the patch. So some sort of history mechanism
so you can get back to where you were would be nice.
- This is a similar technique to topic branches. However in some
of the more interesting cases a topic branch can't be used because
you have a whole series of little changes, that allow depend on
each other. So topic branches need not apply.
- One of the places where we currently uses series files
(patch-scripts && quilt), and heavy cherry picking is for patch
aging. That is letting patches sit in a testing branch for
a while so people have a chance to test and look at them.
The important pieces there are the ability to reorder the changes
to put the patches with the highest confidence first.
The ability to comment on the patches so that it is possible
to record groups of patches and information about their relative
stability. As once a patch series gets large without at least
a few comments it is too much for a person to remember what
is happening with each patch without a few clues.
- The other place where we use series files is in pure development
where we are breaking up or otherwise creating the needed changes
in a set of simple obviously correct changes.
....
So I think it could be very interesting to have a series file
as something the base git porcelain helps to deal with.
If we create a meta data branch with just the series file
we can remove the risk of loosing things, as we always
have a path back to the old history if we want it.
We can keep track of the series file with a SERIES_HEAD
similar to FETCH_HEAD. This fairly easily allows editing
in different places in the patch stack that normally happens
with quilt or patch-scripts.
We can put comments in a series file to keep track of probationary
patches.
The two tricky pieces I see with this idea are:
- teaching git-fsck-objects that we have a sha1 in a blob objects.
- Where to put the active checkout series file when we are working,
so we don't stumble on it.
...
I'm trying to sort out a sane work flow for developing with a large
number of highly related patches on the development side. I care
because the way I think I usually fix the root cause of problems.
It took me nearly 25 patches to decouple the brain damage the msi
code imposed on x86 irq handling. In the development of that
I had to reorder and edit things extensively as I broke the
work up, and created a sane patch flow.
The trick with rev-list | tac to create a series file for reordering
changes was very useful but it wasn't enough to say it solve the
problem.
One trivial issue was that git-cherry-pick -r always does the full
git-commit so it is much more I/O bound than necessary, because
git-commit does git-status. Which is just silly if you are applying
a bunch of changes that apply without errors.
Eric
^ permalink raw reply
* Never-seen Onlinee Casino. Go and Playy It
From: Walker @ 2006-06-23 11:37 UTC (permalink / raw)
To: glenn
Age is a very high price to pay for maturity If cow-man pass wild meat whah mek me must pick up am.
Online Casino witth 85+ games. Play It Now! http://ewcnss.com/d1/check
Old habits die hard Haste makes waste.
^ permalink raw reply
* Re: [PATCH] Make -p --stat and --stat -p behave like --patch-with-stat
From: Timo Hirvonen @ 2006-06-23 12:00 UTC (permalink / raw)
To: Junio C Hamano; +Cc: junkio, git
In-Reply-To: <7vr71hkofg.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> The diff output has four parts, each of which can independently
> be enabled. When no options are specified on the command line,
> each command has its own default but in general the low-level
> commands default to raw output only, and the higher-level ones
> default to patch output only.
>
> The four parts are controlled with a bit each, and are output in
> the fixed order (iow the order of the options given from the
> command line does not matter): raw, stat, summary and patch.
>
> When --name-only or --name-status is specified, that would be
> the only thing that is output (iow the above four parts would
> not be shown, just names optionally with the status are shown).
>
> The four switches are: --raw, --stat, --summary and --patch.
> Existing flags are supported as obvious shorthands to turn on
> the corresponding bits:
>
> -p, -u --patch
> --patch-with-raw --raw --patch
> --patch-with-stat --stat --patch
>
> Anybody interested in doing a patch?
I'll try. It shouldn't be too hard.
--
http://onion.dynserv.net/~timo/
^ permalink raw reply
* Re: [PATCH] Introduce Git.pm (v3)
From: Eric W. Biederman @ 2006-06-23 12:04 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Petr Baudis, git
In-Reply-To: <7vejxgckq9.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
> Petr Baudis <pasky@suse.cz> writes:
>
>> Also, is there any real problem with just using -fPIC?
>
> Personally, not really, but I consider it a workaround having to
> compile with -fPIC (being able to compile with -fPIC is a
> feature).
>
> Doesn't it have performance implications to use -fPIC when you
> do not have to?
>
> By the way, you also need to adjust the testsuite so that it
> finds the Perl modules from freshly built tree before
> installing. I think (but haven't checked yet) the stuff written
> in Python does that already, so you might want to mimic it.
So what was being compiled was a shared Git.so.
32bit x86 is on of the few architectures that allows you to build
a .so without compiling with -fPIC.
The question is why are we building with a .so?
Eric
^ permalink raw reply
* Re: git-format-patch builtin isn't using git-cherry?
From: Johannes Schindelin @ 2006-06-23 12:05 UTC (permalink / raw)
To: Martin Langhoff; +Cc: git
In-Reply-To: <46a038f90606221732k6d93bcceic2761081d7a7c72b@mail.gmail.com>
Hi,
On Fri, 23 Jun 2006, Martin Langhoff wrote:
> Reading cmd_format_patch() in builtin-log.c, it seems to have lost that
> magic that made it so useful... :( Can a kind soul that speaks C
> fluently help me out here?
My fault. But note that it is much faster now, too! I think I can trick it
back into doing something like the old script, but I'll do that only with
an option (in order to not slow down the now-common case). And it will
take a while. So if anybody wants to give it a try...
Basically, it will involve the following recipe:
- add a DIFF_FORMAT_PATCH_ID
- calculate _all_ the patch ids in upstream since branch point
- in cmd_format_patch, in the get_revision() loop, skip those
commits which have the same patch id
Ciao,
Dscho
^ permalink raw reply
* Re: git-format-patch builtin isn't using git-cherry?
From: Timo Hirvonen @ 2006-06-23 12:23 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: martin.langhoff, git
In-Reply-To: <Pine.LNX.4.63.0606231357420.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Basically, it will involve the following recipe:
>
> - add a DIFF_FORMAT_PATCH_ID
Please don't add any DIFF_FORMAT_*. I'm cleaning the diff output code
and replacing diff_options.output_format with one-bit flags.
--
http://onion.dynserv.net/~timo/
^ permalink raw reply
* Re: [PATCH] git-merge --squash
From: Thomas Glanzmann @ 2006-06-23 12:25 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vd5d09pe2.fsf@assigned-by-dhcp.cox.net>
Hello Junio,
> So in that sense I would imagine --squash is not really useless
> in such a situation as I made it sound like, but at the same
> time I suspect people might be better off to use tools like
> StGIT which are specially designed to support such a workflow if
> they were to do this.
thanks for --squash. So --squash is basically a 'suck multiple deltas
from another branch into ., but don't commit it'. I very often use that
way of work flow. I do small and many commits, and when I am done I
merge them to one a bit bigger one and submit it upstream. I useally use
'one branch per feature'.
Thomas
^ permalink raw reply
* Re: git-format-patch builtin isn't using git-cherry?
From: Johannes Schindelin @ 2006-06-23 12:33 UTC (permalink / raw)
To: Timo Hirvonen; +Cc: martin.langhoff, git
In-Reply-To: <20060623152321.2c20e9f8.tihirvon@gmail.com>
Hi,
On Fri, 23 Jun 2006, Timo Hirvonen wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> > Basically, it will involve the following recipe:
> >
> > - add a DIFF_FORMAT_PATCH_ID
>
> Please don't add any DIFF_FORMAT_*. I'm cleaning the diff output code
> and replacing diff_options.output_format with one-bit flags.
Okay. For the purposes of git-format-patch, this is not needed anyway, but
rather a function which takes two tree objects and returns the patch id.
When you are finished it should be easy to add this as a display format.
Ciao,
Dscho
^ 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