* Re: [B.A.T.M.A.N.] [PATCH 0/6] DAT: Distributed ARP Table
From: Simon Wunderlich @ 2011-10-31 0:03 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
In-Reply-To: <1319964962-5092-1-git-send-email-ordex@autistici.org>
[-- Attachment #1: Type: text/plain, Size: 1709 bytes --]
Hello Antonio,
thanks for the patchset! I've tested it again in my kvm setup, it worked very
well.
There are some issues remaining, I'll comment the individual patches for this.
About the general stuff:
* maybe we should rename arp.{c|h} to dat.{c|h} to avoid confusion with
other code in the linux kernel?
* please do a checkpatch.pl --strict check on the patches, there were some
warnings about too long lines and bad spaces
Cheers,
Simon
On Sun, Oct 30, 2011 at 09:55:56AM +0100, Antonio Quartulli wrote:
> Hello people,
> as most of you may already know, last summer I've been working on the
> B.A.T.M.A.N.-Adv GSoC project named "DAT: Distributed ARP Table". For who wants
> to get deeper into the details of the project there are two links:
> - The GSoC proposal [1]
> - The DAT wikipage on open-mesh.org [2], with status and ideas description
>
> Just to recap: DAT is a distributes hash table meant to store ARP entries for
> fast lookup. In a normal scenario, whenever a node wants to communicate with
> another one, it first needs to issue a broadcast ARP request in order to
> retrieve its PHY/MAC address. In a sparse network a broadcast message could be
> lost several times before reaching the real destination so creating high
> latencies. With DAT, every ARP entries (a pair [IP addr, MAC addr]) is stored on
> a "computed" set of nodes, therefore in case of ARP request theses nodes can
> directly be contacted (in unicast) and the needed information can be quickly
> fetched.
>
> Cheers,
> Antonio
>
> [1] http://www.google-melange.com/gsoc/project/google/gsoc2011/ordex/4001
> [2] http://www.open-mesh.org/wiki/batman-adv/DAT
>
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: [PATCH v2 00/14] Support Fujitsu Stand Alone Dump Format
From: tachibana @ 2011-10-28 12:05 UTC (permalink / raw)
To: HATAYAMA Daisuke; +Cc: kexec
In-Reply-To: <20111028094454.20940.1209.stgit@localhost6.localdomain6>
Hi HATAYAMA-san
Thank you for updating patches.
I will review them.
Thanks.
tachibana
On 2011/10/28 18:48:04 +0900, HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> wrote:
> Hello Tachibana-san,
>
> Since there's certain time until Tachibana-san's review, I made some
> cleanups and bugfixes to the previous version. Could you review this
> instead to reduce the review time?
>
> ==
> The following series implements Fujitsu stand-alone dump (sadump)
> format support for makedumpfile, converting sadump-related formats
> into kdump-compressed format.
>
> Based on makedumpfile version 1.4.0.
>
> Here is summary of the changes.
>
> No debug information on sadump-related formats
> ==============================================
>
> Unlike other dump mechanisms, VMCORE created by sadump has NO debug
> information including VMCOREINFO. So, -x VMLINUX is definitely
> necessary.
>
> Debug information gained from VMLINUX is used for:
>
> 1. creating VMCOREINFO dynamically, saved in resulting dumpfiles
> in kdump-compressed format, and
>
> 2. gaining symbolic and type information necessary to refer to ELF
> note information contained in VMCORE generated by kdump at
> crash, and to estimate phys_base value.
>
> If no VMLINUX is specified, dumpfile with no VMCOREINFO and ELF note
> is generated on the current implementation.
>
>
> Command-line interface change
> =============================
>
> Introduce --diskset=VMCORE to pass multiple VMCOREs in a single
> commnad-line input.
>
> makedumpfile [OPTION] -x VMLINUX --diskset=VMCORE1 --diskset=VMCORE2 \
> [--diskset=VMCORE3 ..] DUMPFILE
>
>
> Architectures
> =============
>
> X86 and X86_64.
>
> On the other unsupported architectures, sadump-related source files
> are never compiled and linked into makedumpfile executable.
>
> ---
>
> HATAYAMA Daisuke (14):
> Add description of sadump-related formats in manual page
> Add description of sadump-related formts in usage information
> Read kexec backup region
> Procees CPUs based on online ones
> Generate and save VMCOREINFO and ELF note information
> Estimate phys_base based on linux_banner position
> Implement readmem() interface on sadump-related formats
> Initialize debug information for ELF note extraction
> Initialize internal data according to sadump-related formats
> Export helpers for bitmap table handling
> Verify and read VMCORE(s) in sadump-related formats
> Implement command-line processing
> Extend DumpInfo structure
> Add sadump module header file
>
>
> Makefile | 6
> elf_info.c | 2
> makedumpfile.8 | 22 +
> makedumpfile.c | 455 +++++++++++--
> makedumpfile.h | 207 ++++++
> print_info.c | 10
> sadump_info.c | 1945 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> sadump_info.h | 165 +++++
> sadump_mod.h | 186 +++++
> 9 files changed, 2907 insertions(+), 91 deletions(-)
> create mode 100644 sadump_info.c
> create mode 100644 sadump_info.h
> create mode 100644 sadump_mod.h
>
> --
> Thanks.
> HATAYAMA, Daisuke
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply
* Re: [B.A.T.M.A.N.] [RFC 02/11] batman-adv: add basic bridge loop avoidance code
From: Simon Wunderlich @ 2011-10-31 0:00 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
In-Reply-To: <201110310020.25024.lindner_marek@yahoo.de>
[-- Attachment #1: Type: text/plain, Size: 826 bytes --]
Hi,
On Mon, Oct 31, 2011 at 12:20:24AM +0100, Marek Lindner wrote:
>
> Hi,
>
> > * always become a backbone gw for a VLAN when there is traffic,
> > even if there are no claims, to let at least let other backbone gw
> > nodes that we are able to receive on that VLAN and avoid broadcast
> > loops.
>
> could you give some more details on this change ? Why is it not necessary
> without VLANs ?
Actually it's also useful for cases without VLANs, e.g. if there has not
been any traffic yet. However if there is traffic it soon happens in both
directions and therefore claims are added and situation resolves automatically.
I had the situation that on some VLANs there were no traffic at all for some time
and when it suddenly started, the bla system did some weird things.
Cheers
Simon
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: [PATCH] Fix a typo in line 117 of git-gui/lib/sshkeys.tcl.
From: Erik Faye-Lund @ 2011-10-30 23:57 UTC (permalink / raw)
To: Dejan Ribič; +Cc: Git ML
In-Reply-To: <1319995124-7509-1-git-send-email-dejan.ribic@gmail.com>
Thanks for re-posting inline and with a sign-off. But there's still a
few minor nits:
2011/10/30 Dejan Ribič <dejan.ribic@gmail.com>:
> "succeded" changed to "succeeded".
We write commit messages in imperative mood, so this should be
something like 'change "succeded" to "succeeded"' instead. This is
documented in Documentation/SubmittingPatches.
> modified: git-gui/lib/sshkey.tcl
We don't normally include a list of changed files in the commit
message; the diffstat already provides that information.
^ permalink raw reply
* Re: [kbd] [PATCH] ignore all files ending in ~
From: Alexey Gladkov @ 2011-10-30 23:56 UTC (permalink / raw)
To: kbd
In-Reply-To: <1320017787-16466-1-git-send-email-vapier@gentoo.org>
31.10.2011 03:36, Mike Frysinger wrote:
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> .gitignore | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks!
--
Rgrds, legion
^ permalink raw reply
* [U-Boot] [PATCH 2/2] RFC: Add XON/XOFF support
From: Albert ARIBAUD @ 2011-10-30 23:53 UTC (permalink / raw)
To: u-boot
In-Reply-To: <1319514744-18697-2-git-send-email-sjg@chromium.org>
Hi Simon,
Le 25/10/2011 05:52, Simon Glass a ?crit :
> This is just for testing - please try it out and report back with results.
> For me it works on Minicom but not ser2net.
Exactly how does it not work, i.e. what happens that you did not expect,
or what does not happen that you did expect?
> This needs to be controlled by an environment variable, CONFIG option or
> both. We may need a way of specifying flow control on a per-device basis.
Hmm... We want XON/XOFF on the console only. What other device would
require this?
> We may need to do something special for X-modem transfers, etc. This might
> turn out to be a can of worms.
I think any U-Boot command that uses the console as a means of data
transfer should 'resume console' when starting, and can safely do so
because if the command was invoked, then most certainly the other end of
the console is not going to fire away; it is going to wait for U-Boot to
get ready for transfer. Suspending the console after transfer should be
done if resume was done.
BTW:
> Signed-off-by: Simon Glass<sjg@chromium.org>
> ---
> common/command.c | 1 +
> common/console.c | 12 ++++++++++++
> common/main.c | 3 +++
> include/common.h | 2 ++
> 4 files changed, 18 insertions(+), 0 deletions(-)
>
> diff --git a/common/command.c b/common/command.c
> index acc1c15..7b7c24e 100644
> --- a/common/command.c
> +++ b/common/command.c
> @@ -492,6 +492,7 @@ int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> {
> int result;
>
> + console_suspend_input();
> result = (cmdtp->cmd)(cmdtp, flag, argc, argv);
> if (result)
> debug("Command failed, result=%d", result);
> diff --git a/common/console.c b/common/console.c
> index f17875e..eeb58e6 100644
> --- a/common/console.c
> +++ b/common/console.c
> @@ -199,6 +199,18 @@ static inline void console_doenv(int file, struct stdio_dev *dev)
> }
> #endif /* defined(CONFIG_CONSOLE_MUX) */
>
> +void console_suspend_input(void)
> +{
> + /* Send XOFF to tell the other end to stop sending */
> + console_putc(stdout, 'S' - '@');
> +}
Please define XOFF and XON.
> +void console_resume_input(void)
> +{
> + /* Send XON to tell the other end to start sending */
> + console_putc(stdout, 'Q' - '@');
> +}
> +
> /** U-Boot INITIAL CONSOLE-NOT COMPATIBLE FUNCTIONS *************************/
>
> int serial_printf(const char *fmt, ...)
> diff --git a/common/main.c b/common/main.c
> index 3b60d27..b030176 100644
> --- a/common/main.c
> +++ b/common/main.c
> @@ -948,6 +948,7 @@ int readline_into_buffer (const char *const prompt, char * buffer)
>
> if (prompt)
> puts (prompt);
> + console_resume_input();
This makes XON sent on each readline. XOFF should be sent only if XOFF
was sent before, IMO (and then, XOFF should only be sent if it was not
sent already.
Plus, why send it on readlines? Why not just surround the 'result =
(cmdtp->cmd)(cmdtp, flag, argc, argv);' above with a 'suspend' before
and a 'resume' after?
> rc = cread_line(prompt, p,&len);
> return rc< 0 ? rc : len;
> @@ -967,6 +968,8 @@ int readline_into_buffer (const char *const prompt, char * buffer)
> }
> col = plen;
>
> + console_resume_input();
> +
> for (;;) {
> #ifdef CONFIG_BOOT_RETRY_TIME
> while (!tstc()) { /* while no incoming data */
> diff --git a/include/common.h b/include/common.h
> index a1683a2..970ec0d 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -738,6 +738,8 @@ int ctrlc (void);
> int had_ctrlc (void); /* have we had a Control-C since last clear? */
> void clear_ctrlc (void); /* clear the Control-C condition */
> int disable_ctrlc (int); /* 1 to disable, 0 to enable Control-C detect */
> +void console_suspend_input(void);
> +void console_resume_input(void);
>
> /*
> * STDIO based functions (can always be used)
Amicalement,
--
Albert.
^ permalink raw reply
* Deadlock due to device removal - race condition in scsi/block layer?
From: Anton Altaparmakov @ 2011-10-30 23:52 UTC (permalink / raw)
To: James E.J. Bottomley, Jens Axboe; +Cc: linux-scsi, LKML, linux-fsdevel
Hi,
We have seen a deadlock when doing "unplug whilst writing" testing.
I have analysed is and what appears to be happening is this:
File system does read_mapping_page() which calls the file system readpage function which uses fs/buffer.c::end_buffer_async_read() as i/o completion handler for the buffers of the page. In this case the block size is 1kiB and the PAGE_SIZE is 4kiB thus each page has four buffer_heads attached. The ->readpage() completes and do_read_cache_page() then does lock_page() which goes to sleep whilst waiting for all the buffers to complete i/o which then causes end_buffer_async_read() to mark the page error or uptodate and to unlock the page.
However instead of the buffers completing, we only get one buffer completing with an error (due to the device having been unplugged before) and we then see this message in dmesg:
[ 1155.264728] scsi: killing requests for dead queue
And that's it. We now do NOT see the remaining buffers that had i/o in flight completing, i.e. end_buffer_async_read() was only called for one of the buffers but not for the others thus the page remains locked and thus do_read_cache_page() remains sleeping waiting for the page lock.
DEADLOCK. )-:
120 seconds later the kernel starts printing the "task blocked for more than 120 seconds" reports which describe the above explained state.
Why are the i/o completions not happening? It presumably is a direct consequence of the "scsi: killing requests for dead queue" message.
I looked around and the message appears to be coming from:
drivers/scsi/scsi_lib.c::scsi_request_fn()
which at the top does:
if (!sdev) {
printk("scsi: killing requests for dead queue\n");
while ((req = blk_peek_request(q)) != NULL)
scsi_kill_request(req, q);
return;
}
So I imagine either blk_peek_request() is buggy so it is not seeing all the requests or more likely scsi_kill_request() is somehow causing the completion handler not to be called or a combination of the two.
Note this was on a Debian Wheezy out-of-the-box kernel 3.0.0-1-686-pae and we have seen this happen only once so far which suggests that it is a race condition happening only when read_mapping_page() is called just at the "right" (or is that "wrong"? /-;) time when a device is unplugged so that the "scsi: killing requests for dead queue" happens in the middle of the i/os for the page buffers being in progress.
Any ideas would be greatly appreciated!
Thanks a lot in advance!
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer, http://www.linux-ntfs.org/
^ permalink raw reply
* [Qemu-devel] Obama, Steve Jobs, the Clintons, Oprah - All the great communicators in one big event!
From: TJ Walker in Asia @ 2011-10-30 23:20 UTC (permalink / raw)
To: Reader
[-- Attachment #1: Type: text/plain, Size: 2805 bytes --]
Hello friend,
Great speakers are made not born and the best way to become one is by
emulating the masters. EASIER SAID THAN DONE, especially in Malaysia, but
not anymore.
That's because New York based international presentation, speaking and
media coach, TJ Walker is coming to Malaysia.
This bestselling author, who has worked with presidents, prime ministers,
Nobel laureates, corporate leaders & celebrities, will be sharing his
speaking strategies, tips & tricks with you in Kuala Lumpur, Malaysia, on
Wednesday, 7th December, 2011.
A prominent feature of TJ Walker's seminars is the use of video clips of
great communicators such as Barack Obama, Winston Churchill, the Clintons,
Oprah Winfrey and Steve Jobs. TJ dissects each of their performances and
identify their strengths. He then shows you how to easily adopt these
strengths & strategies.
TJ Walker's method is so effective that all of his clients have shown
tremendous improvement shortly after his session and you are about to join
that exclusive club.
This is TJ's first visit to Asia and to mark the occasion he has, for the
first time in his career, agreed to reduce his fee. Tickets are only priced
at RM998 each.
There is however a super saver in the form of a Super Early Bird Offer,
and your price will be only RM389! These tickets are very limited and it's
best to buy yours now.
For tickets and further information, head to www.tjwalkerasia.com now!
Click here
<http://www.e-marketinginc.com/iem/link.php?M=330561&N=109&L=20&F=T> and
Sign up now!
Best regards,
Maverick Foo
TJ Walker & Associates
P.S.: By the way, many of TJ's clients such as U.S. Army, Bank of America,
McGraw-Hill, Ernst and Young, Federal Express and UCLA have engaged him
in-house to talk on hot topics such as Crisis Communication, Setting Up A
Crisis Management Campaign, small group or one-on-one coaching, and more.
If you like to enjoy the same positive results as them by bringing the
expert in to engage your people personally, kindly contact Maverick, at
Mav@Plaseed.com, or via his mobile, +60162252500. You can also download a
one-pager on the TJ Walker's Strategies to Successful Crisis Communication
here <http://www.e-marketinginc.com/iem/link.php?M=330561&N=109&L=24&F=T>.
Click here to Unsubscribe
<http://www.e-marketinginc.com/iem/unsubscribe.php?M=330561&C=e9264b3b7e21991615630b1ad9d6e228&L=7&N=109>,
or simply reply to this email and we will remove you from the list, no
questions asked. To contact us please email training@plaseed.com.
This email is sent from:
TJ Walker & Associates
(A Plaseed Training Partner)
B-5-8, Plaza Mont Kiara,Mont Kiara,
50480 Kuala Lumpur, Malaysia
Powered by Interspire
[-- Attachment #2: Type: text/html, Size: 4462 bytes --]
^ permalink raw reply
* Re: [PATCH/WIP 03/11] t5403: avoid doing "git add foo/bar" where foo/.git exists
From: Junio C Hamano @ 2011-10-30 23:47 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: git
In-Reply-To: <CACsJy8Ae1MPYzjoouZoFCU6Ltr9UznukfuTrJb=OUJYr9VTYSg@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
>> We however *do* know that our working tree is our current directory, so
>> it would be wrong to do this:
>>
>> $ GIT_DIR=clone2/.git git add clone2/2 3; echo $?
>> error: 3 is outside our repository, possibly goverened by .git
>> 1
>>
>> The command should just add clone2/2 and 3 as it was told to.
>
> I am concerned about clone2/2 in this case, not 3. ...
Hmm... If that is the case, I am afraid that I failed to convey my point
in the previous message.
You are concerned about clone2/2 because you think GIT_DIR=clone2/.git
somehow implies that clone2/2 is a file at the toplevel of some repository
that should appear at "2" not at "clone2/2" in the index, no?
If that is the case, it means you are somehow getting the notion that
GIT_WORK_TREE is set to clone2 even though in the example we are
discussing it is _not_. Which in turn would mean "3" that is outside of
that directory should not even get into the picture.
In other words, the wish to register clone2/2 at "2" in the index by
stripping clone2/ and the wish to reject "3" as outside because it is
impossible to strip clone2/ from it are the same thing. You either should
be worrying about _both_ paths, or neither of them.
And I am saying that you should be worried about neither of them in this
case. GIT_DIR=<some where> without GIT_WORK_TREE set has treated the
current directory as the top of the working tree from the beginning of
time, and both clone2/2 and 3 _should_ appear in the index in this
example, which is $GIT_DIR/index, which happens to be at a confusing
location that is clone2/.git/index.
> ... I guess we can
> check if clone2/.git is the repo we are using. If it is, skip it.
^ permalink raw reply
* [PATCHv3 8/8] gitweb: Add navigation to select side-by-side diff
From: Jakub Narebski @ 2011-10-30 23:36 UTC (permalink / raw)
To: git; +Cc: Kato Kazuyoshi, Jakub Narebski
In-Reply-To: <1320017787-18048-1-git-send-email-jnareb@gmail.com>
From: Kato Kazuyoshi <kato.kazuyoshi@gmail.com>
Add to the lower part of navigation bar (the action specific part)
links allowing to switch between 'inline' (ordinary) diff and
'side by side' style diff.
It is not shown for combined / compact combined diff.
Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch was originally part of other commit, but was split into a
separate patch.
Note that "blobdiff" should probably also get this navigation.
gitweb/gitweb.perl | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index ffaea45..f80f259 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -7164,6 +7164,7 @@ sub git_blobdiff {
my $formats_nav =
$cgi->a({-href => href(action=>"blobdiff_plain", -replay=>1)},
"raw");
+ $formats_nav .= diff_style_nav($diff_style);
git_header_html(undef, $expires);
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);
@@ -7221,6 +7222,27 @@ sub git_blobdiff_plain {
git_blobdiff('plain');
}
+# assumes that it is added as later part of already existing navigation,
+# so it returns "| foo | bar" rather than just "foo | bar"
+sub diff_style_nav {
+ my ($diff_style, $is_combined) = @_;
+ $diff_style ||= 'inline';
+
+ return "" if ($is_combined);
+
+ my @styles = (inline => 'inline', 'sidebyside' => 'side by side');
+ my %styles = @styles;
+ @styles =
+ @styles[ map { $_ * 2 } 0..$#styles/2 ];
+
+ return join '',
+ map { " | ".$_ }
+ map {
+ $_ eq $diff_style ? $styles{$_} :
+ $cgi->a({-href => href(-replay=>1, diff_style => $_)}, $styles{$_})
+ } @styles;
+}
+
sub git_commitdiff {
my %params = @_;
my $format = $params{-format} || 'html';
@@ -7250,6 +7272,7 @@ sub git_commitdiff {
$cgi->a({-href => href(action=>"patch", -replay=>1)},
"patch");
}
+ $formats_nav .= diff_style_nav($diff_style, @{$co{'parents'}} > 1);
if (defined $hash_parent &&
$hash_parent ne '-c' && $hash_parent ne '--cc') {
--
1.7.6
^ permalink raw reply related
* [U-Boot] [PATCH 12/18] GCC4.6: Squash warnings in smsc95xx.c
From: Marek Vasut @ 2011-10-30 23:45 UTC (permalink / raw)
To: u-boot
In-Reply-To: <201110301859.48522.vapier@gentoo.org>
> On Sunday 30 October 2011 16:48:50 Marek Vasut wrote:
> > > On Tuesday 25 October 2011 05:39:58 Marek Vasut wrote:
> > > > --- a/drivers/usb/eth/smsc95xx.c
> > > > +++ b/drivers/usb/eth/smsc95xx.c
> > > >
> > > > - addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr));
> > > > + addr_lo = cpu_to_le32(*eth->enetaddr);
> > >
> > > pretty sure this is wrong. enetaddr is a uchar[], so your code now
> > > reads only 1 byte instead of 4.
> > >
> > > that said, this code also seems to not be endian safe ...
> >
> > It's good anyone actually cares to properly review. Anyway, why does
> > noone actually care to fix all the damn warnings in their drivers before
> > submitting them in the first place ?!
>
> the strict alias warnings you are hitting show up only in newer compilers.
> so i'm sure at the time of their development/submission, they didn't
> exist. -mike
This is a different driver than that armada100_fec.c.
^ permalink raw reply
* Re: [ANNOUNCE] xf86-video-intel 2.16.901
From: Chun-Yu Shei @ 2011-10-30 23:30 UTC (permalink / raw)
To: intel-gfx
In-Reply-To: <20111030165702.GA16833@cantiga.alporthouse.com>
I had to disable sna in 2.16.0 when running compiz or I'd get some
graphics corruption, and the problem seems to still exist in 2.16.901 as
well. Here's a screenshot I just took on the RC with sna enabled:
http://i.imgur.com/UtQpv.png
I'm on a ThinkPad X220 (i5-2540M) running Gentoo with the following:
pixman 0.23.6
mesa 7.11
libdrm 2.4.26
xorg-server 1.10.4
Similar reports:
http://forums.gentoo.org/viewtopic-t-890280-highlight-sna.html
http://forums.gentoo.org/viewtopic-t-898012-highlight-sna.html
Is there anything I can do to help track this down?
Chun-Yu
On 10/30/2011 12:57 PM, Chris Wilson wrote:
> This is the first release candidate in preparation for the upcoming
> 2.17.0 release. We will appreciate any feedback we can get from
> testing of this snapshot.
>
> The basis of this release are to push out a couple of critical stability
> fixes for SandyBridge and IvyBridge. There is very little else to see
> here. Those 200+ other commits do not exist...
> -Chris
>
> Bugs fixed in this snapshot (compared to 2.16.0)
> --------------------------------------------------
>
> * Workaround blitter hang on SandyBridge and IvyBridge
> https://bugzilla.kernel.org/show_bug.cgi?id=27892
> https://bugs.freedesktop.org/show_bug.cgi
>
> * Workaround pipe control issues on SandyBridge
>
> * Use correct maximum PS thread count on IvyBridge
>
> * Protect against failed pixmap allocation for XV
> https://bugs.freedesktop.org/show_bug.cgi?id=40439
>
> Complete list of changes since 2.16.0
> -------------------------------------
>
> Chris Wilson (252):
> sna/damage: Take advantage of marking all-damaged
> sna/gradient: Use a high-precision ramp for a color step rather than fallback
> sna/trapezoids: Speedup tor rasteriser
> sna/render: allow CLAMP_TO_EDGE for outside samples of extract regions as well
> sna/gen3: reset blend state after applying CA pass
> sna/display: Destroy shadow data
> sna/dri2: Add some debug around the use of the Resource database
> sna: Clear structures across server reset
> sna/video: Flush the video state at the end of the operation
> sna/accel: Simplify single pixel read-back
> sna/trapezoids: Reduce imprecise sampling to 4x4
> sna/trapezoids: Use the tor scan converter to compute the low precision mask
> video: check that the pixmap exists before use
> sna/video: Defend against PutImage to a broken screen
> sna: Cleanup up the cache upon close
> sna: Free the buffers immediately upon release
> sna: Retain the GTT space used for an upload buffer
> sna/trapezoids: Allocate sufficient space for a8 mask for mono traps
> sna/trapezoids: Reject invalid traps after projecting onto the sample grid
> sna/trapezoids: Refactor to project the trapezoid only once
> sna/gen6: Prefer the BLT ring, except for copies on behalf of DRI
> sna: Use the shadow buffer for PutImage
> sna/trapezoids: Edges may lie out of bounds
> sna: Add missing implementation for Triangles
> sna/trapezoids: Check for alignment after projection
> sna/gen2: Improve batch decoder.
> sna/gen2: Flush the batch when we run out of vertex space
> sna/gen3: Do not assume video updates are always vsync'ed
> sna/traps: Use the trapezoid path for AddTraps
> sna/trapezoids: Fast upload path for gpu busy bo
> sna/trapezoids: Hook up Imprecise AddTraps in lieu of spans
> sna: Record git-tree used for compilation
> sna: Prefer memcpy_blt over fbBlt
> sna/gen5: Prefer BLT for solids
> sna/gen3: Use a clear pattern for ill-defined radial gradients
> sna: Mark the bo as reusable after extracting the handle from the buffer
> gitignore: add git_version.h
> sna/trapezoids: Prevent a memleak if feed lots of degenerate boxes
> sna: Fix compilation without timerfd()
> sna: Provide a direct lookup cache of alpha values
> sna: Use single precision for computing the texcoord scale factor
> sna/gen6: Prefer RENDER for copies as it compacts better
> sna: Avoid the call overhead for the trivial clip case
> sna/gen5: Avoid bitfields for simple assignments
> sna/gen5: Fix debug compilation
> sna/accel: Use correct enum for requesting a write-buffer
> sna: Don't clear the kernel-needs-flush flag if we emit a MI_FLUSH
> sna: Reuse the smallest bo that fits the request
> sna/trapezoids: Implement a mono-rasteriser to skip opacity spans
> sna/video: Stop advertising unsupported Xv attributes
> video: Stop advertising unsupported Xv attributes
> sna: Add a couple of debug statements for why we may not flush the scanout
> sna/debug: Assert that BLT commands on gen2/3 are properly fenced
> sna: Clear the list of buffers upon server regen
> sna/gen3: Reset the shader after playing video
> sna: assert that the memcpy upload path points to valid regions
> sna: Yet another s/x/y/ typo
> sna/trapezoids: Amalgamate adjacent mono spans
> configure: Introduce --with-builderstring
> sna: Remove bad assert
> sna: Debug option to disable tiling
> sna: Can't free bo from the active list
> sna/glyphs: Correct offset of fallback-via-mask glyphs
> sna/glyphs: Disable the glyph cache for debugging
> sna: Add debug option to force allocaiton of gpu-only pixmaps
> sna/trapezoids: Ensure we do not overrun the vertical edges for mono
> sna: Apply the screen offset for direct upload of a composited pixmap
> sna: perform a warnings reduction pass
> sna: compile fixes for debugging
> sna/trapezoids: Fix overflow during sorting of mono edge step
> sna: Move an assertion to the point of import
> sna: Use pot buckets for active cache
> sna/dri: Play with marking bo reusable
> sna/dri: Bump DRI2INFOREC_VERSION
> sna: move an assert
> sna/accel: fix assert to include the offset of copy
> sna/accel: Only skip undamaging the GPU for reads
> sna/accel: Always subtract the enlarged region from the outstanding GPU damage
> sna/accel: Use the PolyFillRect to handle tiled spans
> sna: Add a debug option to disable caching
> sna/glyphs: Convert all sub-8bpp masks to a8
> sna/gen5: Debug option to disable state caching
> sna: Paranoid debug flush after every op (as well as before)
> sna/kgem: Check all operation bo in a single amalgamation
> sna/glyph: Avoid useless attempt at GPU glyph rendering to a1 destinations
> sna/glyphs: Add glyphs directly onto a client temporary buffer
> sna/accel: Debug option to force CPU fallbacks
> sna/accel: Fix s/x/y/ typo in computing relative drawing coordinates
> sna/gen7: Fix up a couple instances of my inability to count
> sna/gen7: Confusion reigns as trying to fix errors found by an outdated checker
> sna: Check for request retires after every batch
> sna/gen6: Fix offset of Scan-Line-Compare register
> sna/io: Only mark the buffer as LAST if we know we will flush the IO
> sna: Sort partials by remaining space
> sna/accel: Use the mi*Line routines to convert the line into spans for gpu bo
> sna/accel: Convert segments into spans similarly to PolyLine
> sna/accel: Use miPolyArc to convert arcs into spans for gpu bo
> sna/accel: Don't attempt converting to spans if we will only fallback
> sna/accel: Micro-optimise sna_fill_spans_blt
> sna/accel: Only disable the flush migitration if nothing changed
> sna/accel: Add an compile option to disable use of spans
> sna/accel: Add a compile option to force flushing on every blockhandler
> sna/accel: Only throttle after flushing
> sna/accel: Correct syntax for constifying BoxPtr
> sna/blt: Use SETUP_MONO to reduce the number of fill relocations
> sna/blt: SETUP_BLT needs 9 dwords of batch space, not 3!
> sna/blt: Suppress repeated SETUP_BLT
> sna: Move the source to the GPU if it is reused
> sna/gen[23]: Fix compilation with debugging enabled
> sna: Increase reserved space in batch to accommodate gen5 workaround
> sna: Use BLT operations to avoid fallbacks in core glyph rendering
> sna: Support a fast composite hook for solitary boxes
> sna/gen6: Add render support for fill-one-box
> sna/gen7: Add render support for fill one
> sna/gen3: avoid applying zero offset to common spans
> sna/trapezoid: Perform the NULL check for damage in the caller
> sna: Mark the spans render functions as fastcall
> sna: use correct insertion point for sorting partials
> sna/accel: If the data is already on the GPU, use it for the source
> sna: Enable single fill fast path for PolySegment
> sna/gen3: Avoid RENDER/BLT context switch for fill boxes
> sna: Micro-optimise checking for singular clip boxes
> sna: More micro-optimisation of messing around with clip regions
> sna: And free the clip after creation for PolySegments
> sna: compare against the right array of cache buckets
> Remove vestigial includes from DRI1
> sna/gen2: Trim some surplus state commands
> sna/blt: Check for reloc overflow when initialising solid fills
> sna/accel: Check for reloc overflow when adding a new glyph run
> sna/accel: Correctly offset the damage intersection for glyph runs
> sna/accel: Actually apply the clip to the glyph extents
> sna/accel: Fix sense of nothing-to-do due to clipping
> sna: Ensure that the scanout is flushed before we sleep
> sna/tiling: Hook up composite_box
> sna/trapezoids: Fallback if the composite operation is not supported
> sna/blt: Add a pair of operator reductions for opaque fills
> Remove a couple of trivial compile warnings for unused variables
> sna/gen7: Add missing tail to 3DSTATE_SBE
> sna/gen2: Fix fill-one-box
> sna/gen2: Eliminate redundant diffuse and rectlist emission
> sna/accel: Fall-forward for handling a non-copy CopyArea to a dst gpu bo
> sna/accel: Upload source to GPU for !copy CopyAreas
> sna: Simplify busy tracking by trusting the bo->gpu flag
> sna: Prefer to accelerate non-RENDER operations if already using the GPU
> sna: Defer CPU fallback if fb calls into mi
> configure: Add a check for pixman version
> sna/gen3: Improve reduction of render operator to blt
> sna/gen3: Store floats_per_rect alongside floats_per_vertex
> sna/gen3: Micro-optimise gen3_rectangle_begin()
> snb,ivb: Workaround unknown blitter death
> sna/damage: Clear damage->all when subtracting
> sna/gen3: Remove memset(0) from fill_boxes
> sna: Improve debug output for mi/fb fallbacks
> sna/accel: Implement a simpler path for CopyArea between the same pixmaps
> sna: Fast path common colour conversions
> sna/gen5: Rearrange the BLT->RENDER workaround
> sna/gen3: More removal of memset(0)
> sna/gen3: Use immediates for black/white solid sources
> sna: Only retire the flush handler if nothing was submitted within the period
> sna: Some more debug output for request/bo retirement
> sna/gen3: Prefer to use the BLT to clear the scratch glyph pixmaps
> sna/gen3: Prefer to use the BLT where possible for composite ops
> sna/gen2: Prefer to use the BLT
> sna/gen2: Precompute floats-per-rect
> sna/gen6: Micro-optimise gen6_rectangle_begin
> sna/gen6: Try continuing with the BLT if the last batch was also BLT
> sna/gen5: Add fill-one implementation
> sna/gen6: Precompute floats_per_rect
> sna/gen4: Add fill-one
> sna/blt: Move the conditional out of the fill-many hotpath
> sna/gen6: Don't modify composite arguments whilst checking for BLT
> sna: Micro-optimise fill-spans
> sna: Use the unlikely wedged() throughout
> sna: Compute region extents in place to eliminate redundant stack space
> sna/gen6: Apply the unknown blitter death workaround
> sna/damage: Avoid reducing the damage for simple tests
> sna: Enlarge the minimum pixmap size to migrate for Render
> sna: Don't rewrite the solid colour cache if it hasn't changed
> sna: Reset the ring flag upon idling
> sna: The initial aperture check for a set of bo is unlikely to fail
> sna/blt: Use SCANLINE_BLT for multiple fill boxes
> sna: Clean up some debug messages for 64bit
> sna: Add some debug to discern the nature of the Cr fallback
> sna: Reuse any partial write buffer for readback
> sna/dri: Perform a little dance to restore the gpu status on release of the bo
> sna: Actually apply the composite offset for the self-copy
> sna/damage: Only track the mode globally
> sna/damage: Stash the last freed damage for quick reallocation
> sna: Speed-up blitting of unclipped lines
> sna: Check whether we can blt whilst determining the PolyLine extents
> sna: Pass a BoxRec to the fill op
> sna: Remove the memset(0) of the fill op
> sna: Micro-optimise PolyLine blt
> sna: Short-circuit GetWindowPixmap() to speed-up pixmap retrieval
> sna: Fast-path unclipped fill spans
> sna: Optimise reduce_damage() to handle all-damaged pixmaps
> sna: Fast path for unclipped rectangles
> sna: Fast path unclipped points
> sna: Treat a bo marked as being last seen on the GPU as requiring a flush
> sna: Fix debug compilation
> sna: Execute blits directly for PolyRectangle
> sna/blt: Upload the box using a single 64-bit instruction
> sna: Flatten the branching for fill-spans
> sna: Convert diagonal zero-width lines into blits
> self-copy-damage
> sna: Use the new fill->boxes for PolyRectangle
> sna: Use fill->boxes to unroll PolyPoint
> sna: Use fill->boxes to unroll FillSpans
> sna: Inline box_intersect()
> sna/blt: Share the common fill->boxes between blt and render paths
> sna/blt: Rename the composite paths
> sna: Handle degenerate copy area whilst wedged
> sna: Fix debug compilation, again.
> sna/composite: Discard opaque masks
> sna/gen2: Cache the last solid colour for spans
> sna: Suppress an overwritten fill
> sna/blt: Convert Copy with color 0 into a Clear
> sna/blt: After submitting the batch, it will be empty
> sna: Further improve use of fill->boxes for PolyRectangle
> sna/io: Update batch mode after submitting partial requests
> sna: Handle singular clip regions for PolyRectangles
> sna: Clip PolyLines to the current clip box
> sna: Use fill->boxes for rectilinear blits
> sna: Use fill->boxes to pack PolyFillRectangle
> sna: Fix PolyPoint not to always send 512 boxes
> sna: Fix advance through clip boxes for fill->boxes
> sna: Tweak zero line spans to include missing last segment
> sna: Create scratch pixmap on the CPU
> sna: Use private identifier for internal scratch pixmaps
> sna: Fast path typically unclipped tiled rects
> sna/gen2: Reset BLT registers across 2D/3D context switches
> sna: Faster unclipped spans
> sna: Call directly into tiled rects for tiled spans.
> sna: Faster unclipped PolyPoint
> sna: Faster unclipped PolyFillRect
> sna: Call miZeroArcLine where appropriate for GPU paths
> sna: Faster unclipped rectilinear segments
> sna: Don't flush the render caches if in the process of writing again
> sna: Retire and search inactive again before creating new buffer
> sna: Increment clip box when short-circuiting the iteration
> sna: Further clipping bugs
> sna: Tweak PolyRectangle blitting
> sna/genX: Improve reduction of Render operator to BLT alu
> sna/gen3: Set the src flags for fill
> sna/composite: Fix incorrect operator reduction for RenderFillRectangles
> Revert "sna: Don't flush the render caches if in the process of writing again"
> sna: Push overflow detection to the end of extents
> sna: Rewrite box32_add_rect() to enable int32_t promotion
> sna: Fix compilation
> sna: Convert PolyRectangles to use Box32
> NEWS: Add release notes for 2.16.901
> configure: Bump version to 2.16.901
>
> Daniel Vetter (5):
> snb: implement PIPE_CONTROL workaround
> i810: kill dead i830 defines
> i810: rip out PIO access functions
> i810: use vgahw functions instead of roll-your-own
> i810: kill mmio vga access helpers
>
> Jeremy Huddleston (1):
> Use malloc/calloc/realloc/free directly
>
> Kenneth Graunke (1):
> Fix incorrect maximum PS thread count on IvyBridge
>
> Paulo Zanoni (2):
> Fix "always false" conditionals
> Remove useless assertion
>
> Stefan Dirsch (1):
> Fix array size calculation for intel_pci_probe().
>
> git tag: 2.16.901
>
> http://xorg.freedesktop.org/archive/individual/driver/xf86-video-intel-2.16.901.tar.bz2
> MD5: ae2c2e7493b1e8caa4926b4b7692fd6c xf86-video-intel-2.16.901.tar.bz2
> SHA1: 2ff7b124029f25b67394e98c72e9a9ecc618f55e xf86-video-intel-2.16.901.tar.bz2
>
> http://xorg.freedesktop.org/archive/individual/driver/xf86-video-intel-2.16.901.tar.gz
> MD5: 31a673a7eec88f612b2e74c1196637bc xf86-video-intel-2.16.901.tar.gz
> SHA1: 9db74ef6246e8a59d95847a0b7387a7b150c2ef3 xf86-video-intel-2.16.901.tar.gz
>
>
>
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH 1/2] Avoid use after free
From: NeilBrown @ 2011-10-30 23:43 UTC (permalink / raw)
To: Jes.Sorensen; +Cc: linux-raid, dledford
In-Reply-To: <1319831451-26704-2-git-send-email-Jes.Sorensen@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]
On Fri, 28 Oct 2011 21:50:50 +0200 Jes.Sorensen@redhat.com wrote:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> If picking just one spare disk from the container, jump out of the
> loop once freeing the list. Otherwise we end up accessing the list
> that we just freed.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
> ---
> util.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/util.c b/util.c
> index 2cf617d..1bbd87f 100644
> --- a/util.c
> +++ b/util.c
> @@ -1766,6 +1766,7 @@ struct mdinfo *container_choose_spares(struct supertype *st,
> if (get_one) {
> sysfs_free(*dp);
> d->next = NULL;
> + goto out;
> }
> } else {
> *dp = d->next;
> @@ -1773,5 +1774,6 @@ struct mdinfo *container_choose_spares(struct supertype *st,
> sysfs_free(d);
> }
> }
> +out:
> return disks;
> }
Hi Jes,
I dont' think patch is needed.
The while loop that it jumps out of is
while (*dp)
at the place you put the goto,
dp == &d->next
As d->next was just set to NULL, *dp will be NULL, so the loop will
exit with the need for a goto.
I have applied the second patch - the GPT stack overflow one, thanks.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* [PATCHv3 7/8] gitweb: Use href(-replay=>1,...) for formats links in "commitdiff"
From: Jakub Narebski @ 2011-10-30 23:36 UTC (permalink / raw)
To: git; +Cc: Kato Kazuyoshi, Jakub Narebski
In-Reply-To: <1320017787-18048-1-git-send-email-jnareb@gmail.com>
Use href(-replay->1,...) in (sub)navigation links (like changing style
of view, or going to parent commit) so that extra options are
preserved.
This is needed so clicking on such (sub)navigation link would preserve
style of diff; for example when using "side-by-side" diff style then
going to parent commit would now also use this style.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch is new in this series, and independent on side-by-side stuff.
It can (and perhaps should) be moved earlier in this series.
gitweb/gitweb.perl | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index f69ed08..ffaea45 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -7267,8 +7267,8 @@ sub git_commitdiff {
}
}
$formats_nav .= ': ' .
- $cgi->a({-href => href(action=>"commitdiff",
- hash=>$hash_parent)},
+ $cgi->a({-href => href(-replay=>1,
+ hash=>$hash_parent, hash_base=>undef)},
esc_html($hash_parent_short)) .
')';
} elsif (!$co{'parent'}) {
@@ -7278,28 +7278,28 @@ sub git_commitdiff {
# single parent commit
$formats_nav .=
' (parent: ' .
- $cgi->a({-href => href(action=>"commitdiff",
- hash=>$co{'parent'})},
+ $cgi->a({-href => href(-replay=>1,
+ hash=>$co{'parent'}, hash_base=>undef)},
esc_html(substr($co{'parent'}, 0, 7))) .
')';
} else {
# merge commit
if ($hash_parent eq '--cc') {
$formats_nav .= ' | ' .
- $cgi->a({-href => href(action=>"commitdiff",
+ $cgi->a({-href => href(-replay=>1,
hash=>$hash, hash_parent=>'-c')},
'combined');
} else { # $hash_parent eq '-c'
$formats_nav .= ' | ' .
- $cgi->a({-href => href(action=>"commitdiff",
+ $cgi->a({-href => href(-replay=>1,
hash=>$hash, hash_parent=>'--cc')},
'compact');
}
$formats_nav .=
' (merge: ' .
join(' ', map {
- $cgi->a({-href => href(action=>"commitdiff",
- hash=>$_)},
+ $cgi->a({-href => href(-replay=>1,
+ hash=>$_, hash_base=>undef)},
esc_html(substr($_, 0, 7)));
} @{$co{'parents'}} ) .
')';
--
1.7.6
^ permalink raw reply related
* [PATCHv3 6/8] t9500: Add basic sanity tests for side-by-side diff in gitweb
From: Jakub Narebski @ 2011-10-30 23:36 UTC (permalink / raw)
To: git; +Cc: Kato Kazuyoshi, Jakub Narebski
In-Reply-To: <1320017787-18048-1-git-send-email-jnareb@gmail.com>
Test that side-by-side diff can deal with incomplete lines (and while
at it with pure addition, pure removal, and change), and with merge
commits, producing no errors or warnings.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch is new in this version.
Note this while it does not check if the output is sane, it can help
with manual check; just run test with `--debug' option, and point
gitweb to "t/trash\ directory.t9500-gitweb-standalone-no-errors/.git/"
repository.
t/t9500-gitweb-standalone-no-errors.sh | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index c731507..ab24917 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -329,7 +329,8 @@ test_expect_success \
git add b &&
git commit -a -m "On branch" &&
git checkout master &&
- git pull . b'
+ git pull . b &&
+ git tag merge_commit'
test_expect_success \
'commit(0): merge commit' \
@@ -379,6 +380,29 @@ test_expect_success \
'gitweb_run "p=.git;a=commitdiff;h=b"'
# ----------------------------------------------------------------------
+# side-by-side diff
+
+test_expect_success 'side-by-side: addition of incomplete line' '
+ gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_add;ds=sidebyside"
+'
+
+test_expect_success 'side-by-side: incomplete line as context line' '
+ gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_ctx;ds=sidebyside"
+'
+
+test_expect_success 'side-by-side: changed incomplete line' '
+ gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_chg;ds=sidebyside"
+'
+
+test_expect_success 'side-by-side: removal of incomplete line' '
+ gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_rem;ds=sidebyside"
+'
+
+test_expect_success 'side-by-side: merge commit' '
+ gitweb_run "p=.git;a=commitdiff;h=merge_commit;ds=sidebyside"
+'
+
+# ----------------------------------------------------------------------
# tags testing
test_expect_success \
--
1.7.6
^ permalink raw reply related
* [PATCHv3 5/8] t9500: Add test for handling incomplete lines in diff by gitweb
From: Jakub Narebski @ 2011-10-30 23:36 UTC (permalink / raw)
To: git; +Cc: Kato Kazuyoshi, Jakub Narebski
In-Reply-To: <1320017787-18048-1-git-send-email-jnareb@gmail.com>
Check that "commitdiff" action in gitweb can handle (without errors)
incomplete lines as added and removed lines, and as context lines.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
New in this series, and independent on side-by-side stuff.
t/t9500-gitweb-standalone-no-errors.sh | 47 ++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 5329715..c731507 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -274,6 +274,53 @@ test_expect_success \
'gitweb_run "p=.git;a=commitdiff;hp=foo-becomes-a-directory;h=foo-symlinked-to-bar"'
# ----------------------------------------------------------------------
+# commitdiff testing (incomplete lines)
+
+test_expect_success 'setup incomplete lines' '
+ cat >file<<-\EOF &&
+ Dominus regit me,
+ et nihil mihi deerit.
+ In loco pascuae ibi me collocavit,
+ super aquam refectionis educavit me;
+ animam meam convertit,
+ deduxit me super semitas jusitiae,
+ propter nomen suum.
+ CHANGE_ME
+ EOF
+ git commit -a -m "Preparing for incomplete lines" &&
+ echo "incomplete" | tr -d "\\012" >>file &&
+ git commit -a -m "Add incomplete line" &&
+ git tag incomplete_lines_add &&
+ sed -e s/CHANGE_ME/change_me/ <file >file+ &&
+ mv -f file+ file &&
+ git commit -a -m "Incomplete context line" &&
+ git tag incomplete_lines_ctx &&
+ echo "Dominus regit me," >file &&
+ echo "incomplete line" | tr -d "\\012" >>file &&
+ git commit -a -m "Change incomplete line" &&
+ git tag incomplete_lines_chg
+ echo "Dominus regit me," >file &&
+ git commit -a -m "Remove incomplete line" &&
+ git tag incomplete_lines_rem
+'
+
+test_expect_success 'commitdiff(1): addition of incomplete line' '
+ gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_add"
+'
+
+test_expect_success 'commitdiff(1): incomplete line as context line' '
+ gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_ctx"
+'
+
+test_expect_success 'commitdiff(1): change incomplete line' '
+ gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_chg"
+'
+
+test_expect_success 'commitdiff(1): removal of incomplete line' '
+ gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_rem"
+'
+
+# ----------------------------------------------------------------------
# commit, commitdiff: merge, large
test_expect_success \
'Create a merge' \
--
1.7.6
^ permalink raw reply related
* [PATCHv3 4/8] gitweb: Give side-by-side diff extra CSS styling
From: Jakub Narebski @ 2011-10-30 23:36 UTC (permalink / raw)
To: git; +Cc: Kato Kazuyoshi, Jakub Narebski
In-Reply-To: <1320017787-18048-1-git-send-email-jnareb@gmail.com>
Use separate background colors for pure removal, pure addition and
change for side-by-side diff. This makes reading such diff easier,
allowing to easily distinguish empty lines in diff from vertical
whitespace used to align chunk blocks.
Note that if lines in diff were numbered, the absence of line numbers
[for one side] would help in distinguishing empty lines from vertical
align.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch is new in this version of series.
Note that the code could probably be written with less duplication, at
the cost of being more complicated. I think it is worth tradeoff as
written here.
For how output looks like, compare for example:
http://confluence.atlassian.com/display/FISHEYE/Using+Side+by+Side+Diff+View
gitweb/gitweb.perl | 39 +++++++++++++++++++++++++++++----------
gitweb/static/gitweb.css | 13 +++++++++++++
2 files changed, 42 insertions(+), 10 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 68629f6..f69ed08 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4890,7 +4890,7 @@ sub print_sidebyside_diff_chunk {
# empty contents block on start rem/add block, or end of chunk
if (@ctx && (!$class || $class eq 'rem' || $class eq 'add')) {
print join '',
- '<div class="chunk_block">',
+ '<div class="chunk_block ctx">',
'<div class="old">',
@ctx,
'</div>',
@@ -4902,15 +4902,34 @@ sub print_sidebyside_diff_chunk {
}
# empty add/rem block on start context block, or end of chunk
if ((@rem || @add) && (!$class || $class eq 'ctx')) {
- print join '',
- '<div class="chunk_block">',
- '<div class="old">',
- @rem,
- '</div>',
- '<div class="new">',
- @add,
- '</div>',
- '</div>';
+ if (!@add) {
+ # pure removal
+ print join '',
+ '<div class="chunk_block rem">',
+ '<div class="old">',
+ @rem,
+ '</div>',
+ '</div>';
+ } elsif (!@rem) {
+ # pure addition
+ print join '',
+ '<div class="chunk_block add">',
+ '<div class="new">',
+ @add,
+ '</div>',
+ '</div>';
+ } else {
+ # assume that it is change
+ print join '',
+ '<div class="chunk_block chg">',
+ '<div class="old">',
+ @rem,
+ '</div>',
+ '<div class="new">',
+ @add,
+ '</div>',
+ '</div>';
+ }
@rem = @add = ();
}
diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css
index 21842a6..c7827e8 100644
--- a/gitweb/static/gitweb.css
+++ b/gitweb/static/gitweb.css
@@ -491,6 +491,19 @@ div.chunk_block div.new {
width: 50%;
}
+div.chunk_block.rem div.old div.diff.rem {
+ background-color: #fff5f5;
+}
+div.chunk_block.add div.new div.diff.add {
+ background-color: #f8fff8;
+}
+div.chunk_block.chg div div.diff {
+ background-color: #fffff0;
+}
+div.chunk_block.ctx div div.diff.ctx {
+ color: #404040;
+}
+
div.index_include {
border: solid #d9d8d1;
--
1.7.6
^ permalink raw reply related
* [PATCHv3 3/8] gitweb: Add a feature to show side-by-side diff
From: Jakub Narebski @ 2011-10-30 23:36 UTC (permalink / raw)
To: git; +Cc: Kato Kazuyoshi, Jakub Narebski
In-Reply-To: <1320017787-18048-1-git-send-email-jnareb@gmail.com>
From: Kato Kazuyoshi <kato.kazuyoshi@gmail.com>
This commits adds to support for showing "side-by-side" style diff.
Currently you have to hand-craft the URL; navigation for selecting
diff style is to be added in the next commit.
The diff output in unified format from "git diff-tree" is reorganized to
side-by-side style chunk by chunk with format_sidebyside_diff_chunk().
This reorganization requires knowledge about diff line classification,
so format_diff_line() was renamed to process_diff_line(), and changed to
return tuple (list) consisting of class of diff line and of
HTML-formatted (but not wrapped in <div class="diff ...">...</div>) diff
line. Wrapping is now done by caller, i.e. git_patchset_body().
Gitweb uses float+margin CSS-based layout for "side by side" diff.
You can specify style of diff with "ds" ('diff_style') query
parameter. Currently supported values are 'inline' and 'sidebyside';
the default is 'inline'.
Another solution would be to use "opt" ('extra_options') for that...
though current use of it in gitweb seems to suggest that "opt" is more
about passing extra options to underlying git commands, and "git diff"
doesn't support '--side-by-side' like GNU diff does, (yet?).
Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Heavily changed from original submission by Kato Kazuyoshi, but the
main idea, code structure (somewhat) and CSS-base layout remains.
That's why authorship remains with him; Kato, please speak up if you
would like to change this.
The decision to move some of formatting outside process_diff_line()
(formerly format_diff_line()) was not really necessary, in hindsight...
gitweb/gitweb.perl | 116 +++++++++++++++++++++++++++++++++++++++++----
gitweb/static/gitweb.css | 17 +++++++
2 files changed, 122 insertions(+), 11 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 95d278a..68629f6 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -759,6 +759,7 @@ our @cgi_param_mapping = (
extra_options => "opt",
search_use_regexp => "sr",
ctag => "by_tag",
+ diff_style => "ds",
# this must be last entry (for manipulation from JavaScript)
javascript => "js"
);
@@ -2317,28 +2318,27 @@ sub format_cc_diff_chunk_header {
return $line;
}
-# format patch (diff) line (not to be used for diff headers)
-sub format_diff_line {
+# process patch (diff) line (not to be used for diff headers),
+# returning class and HTML-formatted (but not wrapped) line
+sub process_diff_line {
my $line = shift;
my ($from, $to) = @_;
my $diff_class = diff_line_class($line, $from, $to);
- my $diff_classes = "diff";
- $diff_classes .= " $diff_class" if ($diff_class);
chomp $line;
$line = untabify($line);
if ($from && $to && $line =~ m/^\@{2} /) {
$line = format_unidiff_chunk_header($line, $from, $to);
- return "<div class=\"$diff_classes\">$line</div>\n";
+ return $diff_class, $line;
} elsif ($from && $to && $line =~ m/^\@{3}/) {
$line = format_cc_diff_chunk_header($line, $from, $to);
- return "<div class=\"$diff_classes\">$line</div>\n";
+ return $diff_class, $line;
}
- return "<div class=\"$diff_classes\">" . esc_html($line, -nbsp=>1) . "</div>\n";
+ return $diff_class, esc_html($line, -nbsp=>1);
}
# Generates undef or something like "_snapshot_" or "snapshot (_tbz2_ _zip_)",
@@ -4860,8 +4860,78 @@ sub git_difftree_body {
print "</table>\n";
}
+sub print_sidebyside_diff_chunk {
+ my @chunk = @_;
+ my (@ctx, @rem, @add);
+
+ return unless @chunk;
+
+ # incomplete last line might be among removed or added lines,
+ # or both, or among context lines: find which
+ for (my $i = 1; $i < @chunk; $i++) {
+ if ($chunk[$i][0] eq 'incomplete') {
+ $chunk[$i][0] = $chunk[$i-1][0];
+ }
+ }
+
+ # guardian
+ push @chunk, ["", ""];
+
+ foreach my $line_info (@chunk) {
+ my ($class, $line) = @$line_info;
+
+ # print chunk headers
+ if ($class && $class eq 'chunk_header') {
+ print $line;
+ next;
+ }
+
+ ## print from accumulator when type of class of lines change
+ # empty contents block on start rem/add block, or end of chunk
+ if (@ctx && (!$class || $class eq 'rem' || $class eq 'add')) {
+ print join '',
+ '<div class="chunk_block">',
+ '<div class="old">',
+ @ctx,
+ '</div>',
+ '<div class="new">',
+ @ctx,
+ '</div>',
+ '</div>';
+ @ctx = ();
+ }
+ # empty add/rem block on start context block, or end of chunk
+ if ((@rem || @add) && (!$class || $class eq 'ctx')) {
+ print join '',
+ '<div class="chunk_block">',
+ '<div class="old">',
+ @rem,
+ '</div>',
+ '<div class="new">',
+ @add,
+ '</div>',
+ '</div>';
+ @rem = @add = ();
+ }
+
+ ## adding lines to accumulator
+ # guardian value
+ last unless $line;
+ # rem, add or change
+ if ($class eq 'rem') {
+ push @rem, $line;
+ } elsif ($class eq 'add') {
+ push @add, $line;
+ }
+ # context line
+ if ($class eq 'ctx') {
+ push @ctx, $line;
+ }
+ }
+}
+
sub git_patchset_body {
- my ($fd, $difftree, $hash, @hash_parents) = @_;
+ my ($fd, $diff_style, $difftree, $hash, @hash_parents) = @_;
my ($hash_parent) = $hash_parents[0];
my $is_combined = (@hash_parents > 1);
@@ -4871,6 +4941,7 @@ sub git_patchset_body {
my $diffinfo;
my $to_name;
my (%from, %to);
+ my @chunk; # for side-by-side diff
print "<div class=\"patchset\">\n";
@@ -4977,10 +5048,29 @@ sub git_patchset_body {
next PATCH if ($patch_line =~ m/^diff /);
- print format_diff_line($patch_line, \%from, \%to);
+ my ($class, $line) = process_diff_line($patch_line, \%from, \%to);
+ my $diff_classes = "diff";
+ $diff_classes .= " $class" if ($class);
+ $line = "<div class=\"$diff_classes\">$line</div>\n";
+
+ if ($diff_style eq 'sidebyside' && !$is_combined) {
+ if ($class eq 'chunk_header') {
+ print_sidebyside_diff_chunk(@chunk);
+ @chunk = ( [ $class, $line ] );
+ } else {
+ push @chunk, [ $class, $line ];
+ }
+ } else {
+ # default 'inline' style and unknown styles
+ print $line;
+ }
}
} continue {
+ if (@chunk) {
+ print_sidebyside_diff_chunk(@chunk);
+ @chunk = ();
+ }
print "</div>\n"; # class="patch"
}
@@ -6976,6 +7066,7 @@ sub git_object {
sub git_blobdiff {
my $format = shift || 'html';
+ my $diff_style = $input_params{'diff_style'} || 'inline';
my $fd;
my @difftree;
@@ -7085,7 +7176,8 @@ sub git_blobdiff {
if ($format eq 'html') {
print "<div class=\"page_body\">\n";
- git_patchset_body($fd, [ \%diffinfo ], $hash_base, $hash_parent_base);
+ git_patchset_body($fd, $diff_style,
+ [ \%diffinfo ], $hash_base, $hash_parent_base);
close $fd;
print "</div>\n"; # class="page_body"
@@ -7113,6 +7205,7 @@ sub git_blobdiff_plain {
sub git_commitdiff {
my %params = @_;
my $format = $params{-format} || 'html';
+ my $diff_style = $input_params{'diff_style'} || 'inline';
my ($patch_max) = gitweb_get_feature('patches');
if ($format eq 'patch') {
@@ -7316,7 +7409,8 @@ sub git_commitdiff {
$use_parents ? @{$co{'parents'}} : $hash_parent);
print "<br/>\n";
- git_patchset_body($fd, \@difftree, $hash,
+ git_patchset_body($fd, $diff_style,
+ \@difftree, $hash,
$use_parents ? @{$co{'parents'}} : $hash_parent);
close $fd;
print "</div>\n"; # class="page_body"
diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css
index 7d88509..21842a6 100644
--- a/gitweb/static/gitweb.css
+++ b/gitweb/static/gitweb.css
@@ -475,6 +475,23 @@ div.diff.nodifferences {
color: #600000;
}
+/* side-by-side diff */
+div.chunk_block {
+ overflow: hidden;
+}
+
+div.chunk_block div.old {
+ float: left;
+ width: 50%;
+ overflow: hidden;
+}
+
+div.chunk_block div.new {
+ margin-left: 50%;
+ width: 50%;
+}
+
+
div.index_include {
border: solid #d9d8d1;
border-width: 0px 0px 1px;
--
1.7.6
^ permalink raw reply related
* [PATCHv3 2/8] gitweb: Extract formatting of diff chunk header
From: Jakub Narebski @ 2011-10-30 23:36 UTC (permalink / raw)
To: git; +Cc: Kato Kazuyoshi, Jakub Narebski
In-Reply-To: <1320017787-18048-1-git-send-email-jnareb@gmail.com>
Refactor main parts of HTML-formatting for diff chunk headers
(formatting means here adding links and syntax hightlighting) into
separate subroutines:
* format_unidiff_chunk_header for ordinary diff,
* format_cc_diff_chunk_header for combined diff
(more than one parent)
This makes format_diff_line() subroutine easier to follow.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch is new in this version of side-by-side diff series.
After those changes format_diff_line() fits in one page (has less than
25 lines). Nice, isn't it?
gitweb/gitweb.perl | 114 ++++++++++++++++++++++++++++++---------------------
1 files changed, 67 insertions(+), 47 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 914fd4c..95d278a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2254,6 +2254,69 @@ sub diff_line_class {
return "";
}
+# assumes that $from and $to are defined and correctly filled,
+# and that $line holds a line of chunk header for unified diff
+sub format_unidiff_chunk_header {
+ my ($line, $from, $to) = @_;
+
+ my ($from_text, $from_start, $from_lines, $to_text, $to_start, $to_lines, $section) =
+ $line =~ m/^\@{2} (-(\d+)(?:,(\d+))?) (\+(\d+)(?:,(\d+))?) \@{2}(.*)$/;
+
+ $from_lines = 0 unless defined $from_lines;
+ $to_lines = 0 unless defined $to_lines;
+
+ if ($from->{'href'}) {
+ $from_text = $cgi->a({-href=>"$from->{'href'}#l$from_start",
+ -class=>"list"}, $from_text);
+ }
+ if ($to->{'href'}) {
+ $to_text = $cgi->a({-href=>"$to->{'href'}#l$to_start",
+ -class=>"list"}, $to_text);
+ }
+ $line = "<span class=\"chunk_info\">@@ $from_text $to_text @@</span>" .
+ "<span class=\"section\">" . esc_html($section, -nbsp=>1) . "</span>";
+ return $line;
+}
+
+# assumes that $from and $to are defined and correctly filled,
+# and that $line holds a line of chunk header for combined diff
+sub format_cc_diff_chunk_header {
+ my ($line, $from, $to) = @_;
+
+ my ($prefix, $ranges, $section) = $line =~ m/^(\@+) (.*?) \@+(.*)$/;
+ my (@from_text, @from_start, @from_nlines, $to_text, $to_start, $to_nlines);
+
+ @from_text = split(' ', $ranges);
+ for (my $i = 0; $i < @from_text; ++$i) {
+ ($from_start[$i], $from_nlines[$i]) =
+ (split(',', substr($from_text[$i], 1)), 0);
+ }
+
+ $to_text = pop @from_text;
+ $to_start = pop @from_start;
+ $to_nlines = pop @from_nlines;
+
+ $line = "<span class=\"chunk_info\">$prefix ";
+ for (my $i = 0; $i < @from_text; ++$i) {
+ if ($from->{'href'}[$i]) {
+ $line .= $cgi->a({-href=>"$from->{'href'}[$i]#l$from_start[$i]",
+ -class=>"list"}, $from_text[$i]);
+ } else {
+ $line .= $from_text[$i];
+ }
+ $line .= " ";
+ }
+ if ($to->{'href'}) {
+ $line .= $cgi->a({-href=>"$to->{'href'}#l$to_start",
+ -class=>"list"}, $to_text);
+ } else {
+ $line .= $to_text;
+ }
+ $line .= " $prefix</span>" .
+ "<span class=\"section\">" . esc_html($section, -nbsp=>1) . "</span>";
+ return $line;
+}
+
# format patch (diff) line (not to be used for diff headers)
sub format_diff_line {
my $line = shift;
@@ -2267,56 +2330,13 @@ sub format_diff_line {
$line = untabify($line);
if ($from && $to && $line =~ m/^\@{2} /) {
- my ($from_text, $from_start, $from_lines, $to_text, $to_start, $to_lines, $section) =
- $line =~ m/^\@{2} (-(\d+)(?:,(\d+))?) (\+(\d+)(?:,(\d+))?) \@{2}(.*)$/;
-
- $from_lines = 0 unless defined $from_lines;
- $to_lines = 0 unless defined $to_lines;
-
- if ($from->{'href'}) {
- $from_text = $cgi->a({-href=>"$from->{'href'}#l$from_start",
- -class=>"list"}, $from_text);
- }
- if ($to->{'href'}) {
- $to_text = $cgi->a({-href=>"$to->{'href'}#l$to_start",
- -class=>"list"}, $to_text);
- }
- $line = "<span class=\"chunk_info\">@@ $from_text $to_text @@</span>" .
- "<span class=\"section\">" . esc_html($section, -nbsp=>1) . "</span>";
+ $line = format_unidiff_chunk_header($line, $from, $to);
return "<div class=\"$diff_classes\">$line</div>\n";
+
} elsif ($from && $to && $line =~ m/^\@{3}/) {
- my ($prefix, $ranges, $section) = $line =~ m/^(\@+) (.*?) \@+(.*)$/;
- my (@from_text, @from_start, @from_nlines, $to_text, $to_start, $to_nlines);
-
- @from_text = split(' ', $ranges);
- for (my $i = 0; $i < @from_text; ++$i) {
- ($from_start[$i], $from_nlines[$i]) =
- (split(',', substr($from_text[$i], 1)), 0);
- }
-
- $to_text = pop @from_text;
- $to_start = pop @from_start;
- $to_nlines = pop @from_nlines;
-
- $line = "<span class=\"chunk_info\">$prefix ";
- for (my $i = 0; $i < @from_text; ++$i) {
- if ($from->{'href'}[$i]) {
- $line .= $cgi->a({-href=>"$from->{'href'}[$i]#l$from_start[$i]",
- -class=>"list"}, $from_text[$i]);
- } else {
- $line .= $from_text[$i];
- }
- $line .= " ";
- }
- if ($to->{'href'}) {
- $line .= $cgi->a({-href=>"$to->{'href'}#l$to_start",
- -class=>"list"}, $to_text);
- } else {
- $line .= $to_text;
- }
- $line .= " $prefix</span>" .
- "<span class=\"section\">" . esc_html($section, -nbsp=>1) . "</span>";
+ $line = format_cc_diff_chunk_header($line, $from, $to);
return "<div class=\"$diff_classes\">$line</div>\n";
+
}
return "<div class=\"$diff_classes\">" . esc_html($line, -nbsp=>1) . "</div>\n";
}
--
1.7.6
^ permalink raw reply related
* [PATCHv3 1/8] gitweb: Refactor diff body line classification
From: Jakub Narebski @ 2011-10-30 23:36 UTC (permalink / raw)
To: git; +Cc: Kato Kazuyoshi, Jakub Narebski, Junio C Hamano
In-Reply-To: <1320017787-18048-1-git-send-email-jnareb@gmail.com>
Simplify classification of diff line body in format_diff_line(),
replacing two long if-elsif chains (one for ordinary diff and one for
combined diff of a merge commit) with a single regexp match. Refactor
this code into diff_line_class() function.
While at it:
* Fix an artifact in that $diff_class included leading space to be
able to compose classes like this "class=\"diff$diff_class\"', even
when $diff_class was an empty string. This made code unnecessary
ugly: $diff_class is now just class name or an empty string.
* Introduce "ctx" class for context lines ($diff_class was set to ""
in this case before this commit).
Idea and initial code by Junio C Hamano, polish and testing by Jakub
Narebski. Inspired by patch adding side-by-side diff by Kato Kazuyoshi,
which required $diff_class to be name of class without extra space.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch is new in this version of side-by-side diff series.
Junio, as your proposal was of "what if" variety, and not as a proper
patch, I have taken authorship (after reqorking and testing it).
Should I revert authorship to you?
gitweb/gitweb.perl | 67 ++++++++++++++++++++++++++++-----------------------
1 files changed, 37 insertions(+), 30 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 4f0c3bd..914fd4c 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2225,40 +2225,47 @@ sub format_diff_cc_simplified {
return $result;
}
+sub diff_line_class {
+ my ($line, $from, $to) = @_;
+
+ # ordinary diff
+ my $num_sign = 1;
+ # combined diff
+ if ($from && $to && ref($from->{'href'}) eq "ARRAY") {
+ $num_sign = scalar @{$from->{'href'}};
+ }
+
+ my @diff_line_classifier = (
+ { regexp => qr/^\@\@{$num_sign} /, class => "chunk_header"},
+ { regexp => qr/^\\/, class => "incomplete" },
+ { regexp => qr/^ {$num_sign}/, class => "ctx" },
+ # classifier for context must come before classifier add/rem,
+ # or we would have to use more complicated regexp, for example
+ # qr/(?= {0,$m}\+)[+ ]{$num_sign}/, where $m = $num_sign - 1;
+ { regexp => qr/^[+ ]{$num_sign}/, class => "add" },
+ { regexp => qr/^[- ]{$num_sign}/, class => "rem" },
+ );
+ for my $clsfy (@diff_line_classifier) {
+ return $clsfy->{'class'}
+ if ($line =~ $clsfy->{'regexp'});
+ }
+
+ # fallback
+ return "";
+}
+
# format patch (diff) line (not to be used for diff headers)
sub format_diff_line {
my $line = shift;
my ($from, $to) = @_;
- my $diff_class = "";
+
+ my $diff_class = diff_line_class($line, $from, $to);
+ my $diff_classes = "diff";
+ $diff_classes .= " $diff_class" if ($diff_class);
chomp $line;
-
- if ($from && $to && ref($from->{'href'}) eq "ARRAY") {
- # combined diff
- my $prefix = substr($line, 0, scalar @{$from->{'href'}});
- if ($line =~ m/^\@{3}/) {
- $diff_class = " chunk_header";
- } elsif ($line =~ m/^\\/) {
- $diff_class = " incomplete";
- } elsif ($prefix =~ tr/+/+/) {
- $diff_class = " add";
- } elsif ($prefix =~ tr/-/-/) {
- $diff_class = " rem";
- }
- } else {
- # assume ordinary diff
- my $char = substr($line, 0, 1);
- if ($char eq '+') {
- $diff_class = " add";
- } elsif ($char eq '-') {
- $diff_class = " rem";
- } elsif ($char eq '@') {
- $diff_class = " chunk_header";
- } elsif ($char eq "\\") {
- $diff_class = " incomplete";
- }
- }
$line = untabify($line);
+
if ($from && $to && $line =~ m/^\@{2} /) {
my ($from_text, $from_start, $from_lines, $to_text, $to_start, $to_lines, $section) =
$line =~ m/^\@{2} (-(\d+)(?:,(\d+))?) (\+(\d+)(?:,(\d+))?) \@{2}(.*)$/;
@@ -2276,7 +2283,7 @@ sub format_diff_line {
}
$line = "<span class=\"chunk_info\">@@ $from_text $to_text @@</span>" .
"<span class=\"section\">" . esc_html($section, -nbsp=>1) . "</span>";
- return "<div class=\"diff$diff_class\">$line</div>\n";
+ return "<div class=\"$diff_classes\">$line</div>\n";
} elsif ($from && $to && $line =~ m/^\@{3}/) {
my ($prefix, $ranges, $section) = $line =~ m/^(\@+) (.*?) \@+(.*)$/;
my (@from_text, @from_start, @from_nlines, $to_text, $to_start, $to_nlines);
@@ -2309,9 +2316,9 @@ sub format_diff_line {
}
$line .= " $prefix</span>" .
"<span class=\"section\">" . esc_html($section, -nbsp=>1) . "</span>";
- return "<div class=\"diff$diff_class\">$line</div>\n";
+ return "<div class=\"$diff_classes\">$line</div>\n";
}
- return "<div class=\"diff$diff_class\">" . esc_html($line, -nbsp=>1) . "</div>\n";
+ return "<div class=\"$diff_classes\">" . esc_html($line, -nbsp=>1) . "</div>\n";
}
# Generates undef or something like "_snapshot_" or "snapshot (_tbz2_ _zip_)",
--
1.7.6
^ permalink raw reply related
* Re: where does that "50G" disk space figure come from in QS guide?
From: Robert P. J. Day @ 2011-10-30 23:40 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: Yocto discussion list
In-Reply-To: <20111030231703.4E049180985B@gemini.denx.de>
On Mon, 31 Oct 2011, Wolfgang Denk wrote:
> Dear Robert,
>
> In message <alpine.DEB.2.02.1110301735310.4586@localhost6.localdomain6> you wrote:
> >
> > QS guide suggests build process using sato will use about 50G of
> > disk space. where does that figure come from? i just did a configure
> > and build of core-image-sato for beagleboard on my 64-bit ubuntu 11.10
> > system and it cost me about 3.5G for the tarball download directory,
> > and just under 28G for the entire build directory. so where does 50G
> > come from? and that was *without* economizing using "INHERIT +=
> > rm_work".
>
> After building core-image-sato-sdk, core-image-qte-sdk,
> meta-toolchain-sdk, and meta-toolchain-qte I see 70G used...
i can believe that, i just want to make that claim in the QS guide a
bit more precise and explain what it represents. ah, well, tomorrow's
another day.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply
* [GIT PULL] pending DT patches and cleanup for map_io for v3.2 merge window
From: Arnd Bergmann @ 2011-10-30 23:39 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20111024091704.GF31337@atomide.com>
On Monday 24 October 2011, Tony Lindgren wrote:
> As discussed in the ARM kernel meeting yesterday, here's are
> the pending omap things to pull for v3.2 merge window.
Hi Tony,
I finally got to pull these.
> These would be nice to get still in as other people's work
> such as Nico's map_io changes need #2 below.
>
> 1. Initial DT support posted few weeks ago
>
> Please see the earlier pull request at:
>
> http://lkml.org/lkml/2011/10/4/441
Looks good. I've missed this initially because I had not yet managed
to go through that mail thread (randconfig patches) again and pick
up the patches that got an Ack. The pull request was right in the
middle of 100 other unread emails...
> 2. Cleanup for map_io posted few weeks ago
>
> This depends on the #1 above, and also requires
> the ioremap_exec patch. Russell said he has applied
> into devel-stable (But not pushed out yet?).
>
> When you have the ioremap_exec patch from Russell,
> please pull this from:
>
> git://github.com/tmlind/linux.git sram-map-io
>
> Pull request against #1 attached below.
This had systematic but trivial conflicts against the memory.h
series, which I fixed up. There was also a conflict with 009426a0e
"ARM: omap: Setup consistent dma size at boot time" from Tixy.
That patch added a call to omap_init_consistent_dma_size in a function
that you removed. I have resolved the conflict by adding that call to
omap1_init_early and omap_common_init_early, but I have no idea if that
is a correct resolution. Please check.
Arnd
Arnd
^ permalink raw reply
* Re: [GIT PULL] pending DT patches and cleanup for map_io for v3.2 merge window
From: Arnd Bergmann @ 2011-10-30 23:39 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-omap, Russell King, Jon Medhurst, linux-arm-kernel,
Nicolas Pitre
In-Reply-To: <20111024091704.GF31337@atomide.com>
On Monday 24 October 2011, Tony Lindgren wrote:
> As discussed in the ARM kernel meeting yesterday, here's are
> the pending omap things to pull for v3.2 merge window.
Hi Tony,
I finally got to pull these.
> These would be nice to get still in as other people's work
> such as Nico's map_io changes need #2 below.
>
> 1. Initial DT support posted few weeks ago
>
> Please see the earlier pull request at:
>
> http://lkml.org/lkml/2011/10/4/441
Looks good. I've missed this initially because I had not yet managed
to go through that mail thread (randconfig patches) again and pick
up the patches that got an Ack. The pull request was right in the
middle of 100 other unread emails...
> 2. Cleanup for map_io posted few weeks ago
>
> This depends on the #1 above, and also requires
> the ioremap_exec patch. Russell said he has applied
> into devel-stable (But not pushed out yet?).
>
> When you have the ioremap_exec patch from Russell,
> please pull this from:
>
> git://github.com/tmlind/linux.git sram-map-io
>
> Pull request against #1 attached below.
This had systematic but trivial conflicts against the memory.h
series, which I fixed up. There was also a conflict with 009426a0e
"ARM: omap: Setup consistent dma size at boot time" from Tixy.
That patch added a call to omap_init_consistent_dma_size in a function
that you removed. I have resolved the conflict by adding that call to
omap1_init_early and omap_common_init_early, but I have no idea if that
is a correct resolution. Please check.
Arnd
Arnd
^ permalink raw reply
* [PATCHv3 0/8] gitweb: side-by-side diff
From: Jakub Narebski @ 2011-10-30 23:36 UTC (permalink / raw)
To: git; +Cc: Kato Kazuyoshi, Jakub Narebski
NOTE: As it is feature-freeze period, this patch series is for review.
This is refinement and extension of Kato Kazuyoshi patch series, sent
originally as
[PATCH/RFC] gitweb: add the ability to show side-by-side diff on commitdiff.
http://thread.gmane.org/gmane.comp.version-control.git/183744
and then refined and split into two-patch series
[PATCH/RFC 1/2] gitweb: change format_diff_line() to remove leading SP from $diff_class
http://thread.gmane.org/gmane.comp.version-control.git/183770
[PATCH 2/2] gitweb: add a feature to show side-by-side diff
http://thread.gmane.org/gmane.comp.version-control.git/183769
This patch series originally started as rebasing second patch in above
two part series on top of diff line classification refactoring
suggested by me and proposed by Junio. Then I thought about putting
all code printing side-by-side diff in print_sidebyside_diff_chunk()
subroutine, then...
Main changes from v2 version from Kato Kazuyoshi:
* Built on top of refactoring of code related to diff
output formatting (patches 1 and 2)
* Code reworked so that is in my opinion easier to follow; gitweb now
handles merges and diffs with incomplete lines correctly (patch 3)
- well, it handles merges by turning off side-by-side diff for them.
* Adding background color to distinguish empty context lines from
vertical align, similarly to e.g.
http://community.activestate.com/files/images/sbsdiffs.png
but without refinement (word diff of changes).
* Adds some very basic test for side-by-side diff (patch 6 (and 5))
* Split adding navigation into a separate commit, and uses [nav] links
rather than HTML form for selecting between inline and side-by-side
diff style (diff 8). Thanks to more thorough use of href(-replay=>1,..)
(patch 7) style of diff should be preserved with this series.
Please excuse me for essentially hijacking this patch series.
P.S. I really, really need to finish work on splitting gitweb into
smaller pieces. With around 8,000 lines it becomes quite unwieldy.
But this would probably need total rework of error handling (the
die_error subroutine), and that would need another changes, etc....
Pull request:
~~~~~~~~~~~~~
These changes are available in the git repository(-y/+ies) at:
git://repo.or.cz/git/jnareb-git.git gitweb/side-by-side-diff-v4
git://github.com/jnareb/git gitweb/side-by-side-diff-v4
Table of contents:
~~~~~~~~~~~~~~~~~~
[PATCHv3 1/8] gitweb: Refactor diff body line classification
[PATCHv3 2/8] gitweb: Extract formatting of diff chunk header
[PATCHv3 3/8] gitweb: Add a feature to show side-by-side diff
[PATCHv3 4/8] gitweb: Give side-by-side diff extra CSS styling
[PATCHv3 5/8] t9500: Add test for handling incomplete lines in diff
by gitweb
[PATCHv3 6/8] t9500: Add basic sanity tests for side-by-side diff in
gitweb
[PATCHv3 7/8] gitweb: Use href(-replay=>1,...) for formats links in
"commitdiff"
[PATCHv3 8/8] gitweb: Add navigation to select side-by-side diff
Shortlog:
~~~~~~~~~
Jakub Narebski (6):
gitweb: Refactor diff body line classification
gitweb: Extract formatting of diff chunk header
gitweb: Give side-by-side diff extra CSS styling
t9500: Add test for handling incomplete lines in diff by gitweb
t9500: Add basic sanity tests for side-by-side diff in gitweb
gitweb: Use href(-replay=>1,...) for formats links in "commitdiff"
Kato Kazuyoshi (2):
gitweb: Add a feature to show side-by-side diff
gitweb: Add navigation to select side-by-side diff
Diffstat:
~~~~~~~~~
gitweb/gitweb.perl | 339 +++++++++++++++++++++++--------
gitweb/static/gitweb.css | 30 +++
t/t9500-gitweb-standalone-no-errors.sh | 73 +++++++-
3 files changed, 353 insertions(+), 89 deletions(-)
--
1.7.6
^ permalink raw reply
* [kbd] [PATCH] ignore all files ending in ~
From: Mike Frysinger @ 2011-10-30 23:36 UTC (permalink / raw)
To: kbd
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
.gitignore | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/.gitignore b/.gitignore
index 4bdf45f..a3044e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+*~
*.o
*.1
*.8
@@ -6,7 +7,6 @@ Makefile.in
!po/Makefile.in
aclocal.m4
config.h
-config.h.in~
config.guess
config.status
config.sub
--
1.7.6.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.