From 70f75cc96a3c590ac1c54c09c39446626f155ef7 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Thu, 18 May 2006 16:58:51 +1000 Subject: [PATCH 1/6] Provide a way to flush git-diff-tree's output Gitk wants to use git-diff-tree as a filter to tell it which ids from a given list affect a set of files or directories. We don't want to fork and exec a new git-diff-tree process for each batch of ids, since there could be a lot of relatively small batches. For example, a batch could contain as many ids as fit in gitk's headline display window, i.e. 20 or so, and we would be processing a new batch every time the user scrolls that window. The --stdin flag to git-diff-tree is suitable for this, but the main difficulty is that the output of git-diff-tree gets buffered and doesn't get sent until the buffer is full. This provides a way to get git-diff-tree to flush its output buffers. If a blank line is supplied on git-diff-tree's standard input, it will flush its output buffers and then accept further input. Signed-off-by: Paul Mackerras Signed-off-by: Junio C Hamano --- diff-tree.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/diff-tree.c b/diff-tree.c index 7207867a74..69bb74b310 100644 --- a/diff-tree.c +++ b/diff-tree.c @@ -138,7 +138,10 @@ int main(int argc, const char **argv) opt->diffopt.setup |= (DIFF_SETUP_USE_SIZE_CACHE | DIFF_SETUP_USE_CACHE); while (fgets(line, sizeof(line), stdin)) - diff_tree_stdin(line); + if (line[0] == '\n') + fflush(stdout); + else + diff_tree_stdin(line); return 0; } From 065e0b126f47e0c280da6830956766ff2ea8cf17 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 18 May 2006 14:35:37 -0700 Subject: [PATCH 2/6] builtin-diff: do not say files are renamed when blob and file are given Signed-off-by: Junio C Hamano --- builtin-diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-diff.c b/builtin-diff.c index b0c9cade02..de81b05e32 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -122,7 +122,7 @@ static int builtin_diff_b_f(struct rev_info *revs, stuff_change(&revs->diffopt, canon_mode(st.st_mode), canon_mode(st.st_mode), blob[0].sha1, null_sha1, - blob[0].name, path); + path, path); diffcore_std(&revs->diffopt); diff_flush(&revs->diffopt); return 0; From 5fb61b8dcfdf7bcec0793c071813e255d1803859 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 18 May 2006 14:19:20 -0700 Subject: [PATCH 3/6] Make "git rev-list" be a builtin This was surprisingly easy. The diff is truly minimal: rename "main()" to "cmd_rev_list()" in rev-list.c, and rename the whole file to reflect its new built-in status. Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- Makefile | 6 +++--- rev-list.c => builtin-rev-list.c | 5 +++-- builtin.h | 1 + git.c | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) rename rev-list.c => builtin-rev-list.c (98%) diff --git a/Makefile b/Makefile index 9ba608c805..6efc8e0275 100644 --- a/Makefile +++ b/Makefile @@ -158,7 +158,7 @@ PROGRAMS = \ git-ls-files$X git-ls-tree$X git-mailinfo$X git-merge-base$X \ git-merge-index$X git-mktag$X git-mktree$X git-pack-objects$X git-patch-id$X \ git-peek-remote$X git-prune-packed$X git-read-tree$X \ - git-receive-pack$X git-rev-list$X git-rev-parse$X \ + git-receive-pack$X git-rev-parse$X \ git-send-pack$X git-show-branch$X git-shell$X \ git-show-index$X git-ssh-fetch$X \ git-ssh-upload$X git-tar-tree$X git-unpack-file$X \ @@ -170,7 +170,7 @@ PROGRAMS = \ BUILT_INS = git-log$X git-whatchanged$X git-show$X \ git-count-objects$X git-diff$X git-push$X \ - git-grep$X + git-grep$X git-rev-list$X # what 'all' will build and 'install' will install, in gitexecdir ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS) @@ -218,7 +218,7 @@ LIB_OBJS = \ BUILTIN_OBJS = \ builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-push.o \ - builtin-grep.o + builtin-grep.o builtin-rev-list.o GITLIBS = $(LIB_FILE) $(XDIFF_LIB) LIBS = $(GITLIBS) -lz diff --git a/rev-list.c b/builtin-rev-list.c similarity index 98% rename from rev-list.c rename to builtin-rev-list.c index 8b0ec388fa..446802d377 100644 --- a/rev-list.c +++ b/builtin-rev-list.c @@ -7,6 +7,7 @@ #include "tree-walk.h" #include "diff.h" #include "revision.h" +#include "builtin.h" /* bits #0-15 in revision.h */ @@ -36,7 +37,7 @@ static const char rev_list_usage[] = " --bisect" ; -struct rev_info revs; +static struct rev_info revs; static int bisect_list = 0; static int show_timestamp = 0; @@ -291,7 +292,7 @@ static void mark_edges_uninteresting(struct commit_list *list) } } -int main(int argc, const char **argv) +int cmd_rev_list(int argc, const char **argv, char **envp) { struct commit_list *list; int i; diff --git a/builtin.h b/builtin.h index 7744f7d2f6..7dff121520 100644 --- a/builtin.h +++ b/builtin.h @@ -24,5 +24,6 @@ extern int cmd_count_objects(int argc, const char **argv, char **envp); extern int cmd_push(int argc, const char **argv, char **envp); extern int cmd_grep(int argc, const char **argv, char **envp); +extern int cmd_rev_list(int argc, const char **argv, char **envp); #endif diff --git a/git.c b/git.c index a94d9ee5a7..c94e3a531b 100644 --- a/git.c +++ b/git.c @@ -50,6 +50,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp) { "count-objects", cmd_count_objects }, { "diff", cmd_diff }, { "grep", cmd_grep }, + { "rev-list", cmd_rev_list }, }; int i; From 9370bae2cef351617272aa142fbe4ce039833d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Sandstr=C3=B6m?= Date: Thu, 18 May 2006 14:15:55 +0200 Subject: [PATCH 4/6] Make git-check-format-ref a builtin. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lukas Sandström Signed-off-by: Junio C Hamano --- Makefile | 6 +++--- builtin-check-ref-format.c | 14 ++++++++++++++ builtin.h | 1 + check-ref-format.c | 17 ----------------- git.c | 1 + 5 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 builtin-check-ref-format.c delete mode 100644 check-ref-format.c diff --git a/Makefile b/Makefile index 6efc8e0275..2149fb8cea 100644 --- a/Makefile +++ b/Makefile @@ -164,13 +164,13 @@ PROGRAMS = \ git-ssh-upload$X git-tar-tree$X git-unpack-file$X \ git-unpack-objects$X git-update-index$X git-update-server-info$X \ git-upload-pack$X git-verify-pack$X git-write-tree$X \ - git-update-ref$X git-symbolic-ref$X git-check-ref-format$X \ + git-update-ref$X git-symbolic-ref$X \ git-name-rev$X git-pack-redundant$X git-repo-config$X git-var$X \ git-describe$X git-merge-tree$X git-blame$X git-imap-send$X BUILT_INS = git-log$X git-whatchanged$X git-show$X \ git-count-objects$X git-diff$X git-push$X \ - git-grep$X git-rev-list$X + git-grep$X git-rev-list$X git-check-ref-format$X # what 'all' will build and 'install' will install, in gitexecdir ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS) @@ -218,7 +218,7 @@ LIB_OBJS = \ BUILTIN_OBJS = \ builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-push.o \ - builtin-grep.o builtin-rev-list.o + builtin-grep.o builtin-rev-list.o builtin-check-ref-format.o GITLIBS = $(LIB_FILE) $(XDIFF_LIB) LIBS = $(GITLIBS) -lz diff --git a/builtin-check-ref-format.c b/builtin-check-ref-format.c new file mode 100644 index 0000000000..4a23936aff --- /dev/null +++ b/builtin-check-ref-format.c @@ -0,0 +1,14 @@ +/* + * GIT - The information manager from hell + */ + +#include "cache.h" +#include "refs.h" +#include "builtin.h" + +int cmd_check_ref_format(int argc, const char **argv, char **envp) +{ + if (argc != 2) + usage("git check-ref-format refname"); + return !!check_ref_format(argv[1]); +} diff --git a/builtin.h b/builtin.h index 7dff121520..ff559dec7e 100644 --- a/builtin.h +++ b/builtin.h @@ -25,5 +25,6 @@ extern int cmd_count_objects(int argc, const char **argv, char **envp); extern int cmd_push(int argc, const char **argv, char **envp); extern int cmd_grep(int argc, const char **argv, char **envp); extern int cmd_rev_list(int argc, const char **argv, char **envp); +extern int cmd_check_ref_format(int argc, const char **argv, char **envp); #endif diff --git a/check-ref-format.c b/check-ref-format.c deleted file mode 100644 index a0adb3dcb3..0000000000 --- a/check-ref-format.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * GIT - The information manager from hell - */ - -#include "cache.h" -#include "refs.h" - -#include - -int main(int ac, char **av) -{ - if (ac != 2) - usage("git-check-ref-format refname"); - if (check_ref_format(av[1])) - exit(1); - return 0; -} diff --git a/git.c b/git.c index c94e3a531b..d0650bb409 100644 --- a/git.c +++ b/git.c @@ -51,6 +51,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp) { "diff", cmd_diff }, { "grep", cmd_grep }, { "rev-list", cmd_rev_list }, + { "check-ref-format", cmd_check_ref_format } }; int i; From ff62b7f37899de2faa88cbb5be1f3bcfa246012c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Sandstr=C3=B6m?= Date: Thu, 18 May 2006 14:23:59 +0200 Subject: [PATCH 5/6] SubmittingPatches: The download location of External Editor has moved MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lukas Sandström Signed-off-by: Junio C Hamano --- Documentation/SubmittingPatches | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index 318b04fdeb..8601949e80 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches @@ -266,8 +266,8 @@ This recipe appears to work with the current [*1*] Thunderbird from Suse. The following Thunderbird extensions are needed: AboutConfig 0.5 http://aboutconfig.mozdev.org/ - External Editor 0.5.4 - http://extensionroom.mozdev.org/more-info/exteditor + External Editor 0.7.2 + http://globs.org/articles.php?lng=en&pg=8 1) Prepare the patch as a text file using your method of choice. From 52db0495dcb88f38590bc00607052fc5758b07d1 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Thu, 18 May 2006 12:57:04 +0200 Subject: [PATCH 6/6] Documentation/Makefile: create tarballs for the man pages and html files [jc: rewrote by stealing from what I run to update html and man branches automatically] Signed-off-by: Tilman Sauerbeck Signed-off-by: Junio C Hamano --- Documentation/install-webdoc.sh | 8 ++++++-- Makefile | 22 +++++++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Documentation/install-webdoc.sh b/Documentation/install-webdoc.sh index 50638c78d5..60211a5058 100755 --- a/Documentation/install-webdoc.sh +++ b/Documentation/install-webdoc.sh @@ -4,12 +4,16 @@ T="$1" for h in *.html *.txt howto/*.txt howto/*.html do - diff -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h" || { + if test -f "$T/$h" && + diff -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h" + then + :; # up to date + else echo >&2 "# install $h $T/$h" rm -f "$T/$h" mkdir -p `dirname "$T/$h"` cp "$h" "$T/$h" - } + fi done strip_leading=`echo "$T/" | sed -e 's|.|.|g'` for th in "$T"/*.html "$T"/*.txt "$T"/howto/*.txt "$T"/howto/*.html diff --git a/Makefile b/Makefile index 2149fb8cea..c33a4d2b3e 100644 --- a/Makefile +++ b/Makefile @@ -652,6 +652,25 @@ dist: git.spec git-tar-tree rpm: dist $(RPMBUILD) -ta $(GIT_TARNAME).tar.gz +htmldocs = git-htmldocs-$(GIT_VERSION) +manpages = git-manpages-$(GIT_VERSION) +dist-doc: + rm -fr .doc-tmp-dir + mkdir .doc-tmp-dir + $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc + cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar . + gzip -n -9 -f $(htmldocs).tar + : + rm -fr .doc-tmp-dir + mkdir .doc-tmp-dir .doc-tmp-dir/man1 .doc-tmp-dir/man7 + $(MAKE) -C Documentation DESTDIR=. \ + man1=../.doc-tmp-dir/man1 \ + man7=../.doc-tmp-dir/man7 \ + install + cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar . + gzip -n -9 -f $(manpages).tar + rm -fr .doc-tmp-dir + ### Cleaning rules clean: @@ -659,8 +678,9 @@ clean: $(LIB_FILE) $(XDIFF_LIB) rm -f $(ALL_PROGRAMS) $(BUILT_INS) git$X rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags - rm -rf $(GIT_TARNAME) + rm -rf $(GIT_TARNAME) .doc-tmp-dir rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz + rm -f $(htmldocs).tar $(manpages).tar $(MAKE) -C Documentation/ clean $(MAKE) -C templates clean $(MAKE) -C t/ clean