Staging
v0.5.2
https://github.com/git/git
Revision 7bd9641df5b7cca91b21bfdc587962c59700786c authored by Junio C Hamano on 08 November 2006, 00:20:02 UTC, committed by Junio C Hamano on 08 November 2006, 00:24:37 UTC
With this,

	git pickaxe -L '/--progress/,+20' v1.4.0 -- pack-objects.c

gives you 20 lines starting from the first occurrence of
'--progress' in pack-objects, digging from v1.4.0 version.

You can also say

	git pickaxe -L '/--progress/,-5' v1.4.0 -- pack-objects.c

Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 931233b
Raw File
Tip revision: 7bd9641df5b7cca91b21bfdc587962c59700786c authored by Junio C Hamano on 08 November 2006, 00:20:02 UTC
git-pickaxe: allow "-L <something>,+N"
Tip revision: 7bd9641
show-index.c
#include "cache.h"

int main(int argc, char **argv)
{
	int i;
	unsigned nr;
	unsigned int entry[6];
	static unsigned int top_index[256];

	if (fread(top_index, sizeof(top_index), 1, stdin) != 1)
		die("unable to read idex");
	nr = 0;
	for (i = 0; i < 256; i++) {
		unsigned n = ntohl(top_index[i]);
		if (n < nr)
			die("corrupt index file");
		nr = n;
	}
	for (i = 0; i < nr; i++) {
		unsigned offset;

		if (fread(entry, 24, 1, stdin) != 1)
			die("unable to read entry %u/%u", i, nr);
		offset = ntohl(entry[0]);
		printf("%u %s\n", offset, sha1_to_hex((void *)(entry+1)));
	}
	return 0;
}
back to top