Git development
 help / color / mirror / Atom feed
* [PATCH] Add script for patch submission via e-mail.
From: Junio C Hamano @ 2005-06-11  1:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

This git-format-patch-script is what I use to prepare patches
for e-mail submission.

Typical usage is:

$ git-format-patch-script -B -C --find-copies-harder HEAD linus

to prepare each commit with its patch since "HEAD" forked from
"linus", one file per patch for e-mail submission.  Each output
file is numbered sequentially from 1, and uses the first line of
the commit message (massaged for pathname safety) as the
filename.

$ git-format-patch-script -B -C --find-copies-harder HEAD linus .patch/

creates output files in .patch/ directory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
*** Linus I am submitting this one because some patches on
*** read-tree I am going to send you will need this for
*** formatting into a form that is easier to review.  And this
*** in turn can use diff-tree --find-copies-harder, which I
*** indeed used to generate the patches that follow.

 Makefile                |    3 +-
 git-format-patch-script |   93 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 95 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,8 @@ INSTALL=install
 SCRIPTS=git git-apply-patch-script git-merge-one-file-script git-prune-script \
 	git-pull-script git-tag-script git-resolve-script git-whatchanged \
 	git-deltafy-script git-fetch-script git-status-script git-commit-script \
-	git-log-script git-shortlog git-cvsimport-script
+	git-log-script git-shortlog git-cvsimport-script \
+	git-format-patch-script
 
 PROG=   git-update-cache git-diff-files git-init-db git-write-tree \
 	git-read-tree git-commit-tree git-cat-file git-fsck-cache \
diff --git a/git-format-patch-script b/git-format-patch-script
new file mode 100755
--- /dev/null
+++ b/git-format-patch-script
@@ -0,0 +1,93 @@
+#!/bin/sh
+#
+# Copyright (c) 2005 Junio C Hamano
+#
+# Typical usage is:
+#
+# $ git-format-patch-script -B -C --find-copies-harder HEAD linus
+#
+# to prepare each commit with its patch since "HEAD" forked from
+# "linus", one file per patch for e-mail submission.  Each output file is
+# numbered sequentially from 1, and uses the first line of the commit
+# message (massaged for pathname safety) as the filename.
+#
+# $ git-format-patch-script -B -C --find-copies-harder HEAD linus .patch/
+#
+# creates output files in .patch/ directory.
+
+diff_opts=
+IFS='
+'
+LF='
+'
+while case "$#" in 0) break;; esac
+do
+    case "$1" in
+    -*)	diff_opts="$diff_opts$LF$1" ;;
+    *) break ;;
+    esac
+    shift
+done
+
+junio="$1"
+linus="$2"
+outdir="${3:-./}"
+
+tmp=.tmp-series$$
+trap 'rm -f $tmp-*' 0 1 2 3 15
+
+series=$tmp-series
+
+titleScript='
+	1,/^$/d
+	: loop
+	/^$/b loop
+	s/[^-a-z.A-Z_0-9]/-/g
+	s/^--*//g
+	s/--*$//g
+	s/---*/-/g
+	s/$/.txt/
+        s/\.\.\.*/\./g
+	q
+'
+
+_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
+_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
+stripCommitHead='/^'"$_x40"' (from '"$_x40"')$/d'
+
+O=
+if test -f .git/patch-order
+then
+    O=-O.git/patch-order
+fi
+git-rev-list "$junio" "^$linus" >$series
+total=`wc -l <$series`
+i=$total
+while read commit
+do
+    title=`git-cat-file commit "$commit" | sed -e "$titleScript"`
+    num=`printf "%d/%d" $i $total`
+    file=`printf '%04d-%s' $i "$title"`
+    i=`expr "$i" - 1`
+    echo "$file"
+    {
+	mailScript='
+	1,/^$/d
+	: loop
+	/^$/b loop
+	s|^|[PATCH '"$num"'] |
+	: body
+	p
+	n
+	b body'
+
+	git-cat-file commit "$commit" | sed -ne "$mailScript"
+	echo '---'
+	echo
+	git-diff-tree -p $diff_opts $O "$commit" | git-apply --stat
+	echo
+	git-diff-tree -p $diff_opts $O "$commit" | sed -e "$stripCommitHead"
+	echo '------------'
+    } >"$outdir$file"
+done <$series
+
------------


^ permalink raw reply

* [PATCH 1/3] Clean up read-tree two-way tests.
From: Junio C Hamano @ 2005-06-11  1:34 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

This is in preparation for "2-way fast-forward emulated with
3-way mechanism" series.  It does not change what the tests for
pure 2-way do.  It only changes how it tests things, to make
reviewing of differences of the two tests easier in later steps.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

 t/t1001-read-tree-m-2way.sh |   77 +++++++++++++++++++++++--------------------
 1 files changed, 42 insertions(+), 35 deletions(-)

diff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh
--- a/t/t1001-read-tree-m-2way.sh
+++ b/t/t1001-read-tree-m-2way.sh
@@ -22,12 +22,18 @@ In the test, these paths are used:
 '
 . ./test-lib.sh
 
+read_tree_twoway () {
+    git-read-tree -m "$1" "$2" && git-ls-files --stage
+}
+
 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
 compare_change () {
-	sed >current \
+    	cat current
+	sed -n >current \
 	    -e '/^--- /d; /^+++ /d; /^@@ /d;' \
-	    -e 's/^\(.[0-7][0-7][0-7][0-7][0-7][0-7]\) '"$_x40"' /\1 X /' "$1"
+	    -e 's/^\([-+][0-7][0-7][0-7][0-7][0-7][0-7]\) '"$_x40"' /\1 X /p' \
+	    "$1"
 	diff -u expected current
 }
 
@@ -68,9 +74,9 @@ test_expect_success \
 test_expect_success \
     '1, 2, 3 - no carry forward' \
     'rm -f .git/index &&
-     git-read-tree -m $treeH $treeM &&
+     read_tree_twoway $treeH $treeM &&
      git-ls-files --stage >1-3.out &&
-     cmp M.out 1-3.out &&
+     diff -u M.out 1-3.out &&
      check_cache_at bozbar dirty &&
      check_cache_at frotz dirty &&
      check_cache_at nitfol dirty'
@@ -81,9 +87,9 @@ test_expect_success \
     '4 - carry forward local addition.' \
     'rm -f .git/index &&
      git-update-cache --add yomin &&
-     git-read-tree -m $treeH $treeM &&
+     read_tree_twoway $treeH $treeM &&
      git-ls-files --stage >4.out || exit
-     diff --unified=0 M.out 4.out >4diff.out
+     diff -u M.out 4.out >4diff.out
      compare_change 4diff.out expected &&
      check_cache_at yomin clean'
 
@@ -93,9 +99,9 @@ test_expect_success \
      echo yomin >yomin &&
      git-update-cache --add yomin &&
      echo yomin yomin >yomin &&
-     git-read-tree -m $treeH $treeM &&
+     read_tree_twoway $treeH $treeM &&
      git-ls-files --stage >5.out || exit
-     diff --unified=0 M.out 5.out >5diff.out
+     diff -u M.out 5.out >5diff.out
      compare_change 5diff.out expected &&
      check_cache_at yomin dirty'
 
@@ -103,9 +109,9 @@ test_expect_success \
     '6 - local addition already has the same.' \
     'rm -f .git/index &&
      git-update-cache --add frotz &&
-     git-read-tree -m $treeH $treeM &&
+     read_tree_twoway $treeH $treeM &&
      git-ls-files --stage >6.out &&
-     diff --unified=0 M.out 6.out &&
+     diff -u M.out 6.out &&
      check_cache_at frotz clean'
 
 test_expect_success \
@@ -114,9 +120,9 @@ test_expect_success \
      echo frotz >frotz &&
      git-update-cache --add frotz &&
      echo frotz frotz >frotz &&
-     git-read-tree -m $treeH $treeM &&
+     read_tree_twoway $treeH $treeM &&
      git-ls-files --stage >7.out &&
-     diff --unified=0 M.out 7.out &&
+     diff -u M.out 7.out &&
      check_cache_at frotz dirty'
 
 test_expect_success \
@@ -124,7 +130,7 @@ test_expect_success \
     'rm -f .git/index &&
      echo frotz frotz >frotz &&
      git-update-cache --add frotz &&
-     if git-read-tree -m $treeH $treeM; then false; else :; fi'
+     if read_tree_twoway $treeH $treeM; then false; else :; fi'
 
 test_expect_success \
     '9 - conflicting addition.' \
@@ -132,16 +138,16 @@ test_expect_success \
      echo frotz frotz >frotz &&
      git-update-cache --add frotz &&
      echo frotz >frotz &&
-     if git-read-tree -m $treeH $treeM; then false; else :; fi'
+     if read_tree_twoway $treeH $treeM; then false; else :; fi'
 
 test_expect_success \
     '10 - path removed.' \
     'rm -f .git/index &&
      echo rezrov >rezrov &&
      git-update-cache --add rezrov &&
-     git-read-tree -m $treeH $treeM &&
+     read_tree_twoway $treeH $treeM &&
      git-ls-files --stage >10.out &&
-     cmp M.out 10.out'
+     diff -u M.out 10.out'
 
 test_expect_success \
     '11 - dirty path removed.' \
@@ -149,14 +155,14 @@ test_expect_success \
      echo rezrov >rezrov &&
      git-update-cache --add rezrov &&
      echo rezrov rezrov >rezrov &&
-     if git-read-tree -m $treeH $treeM; then false; else :; fi'
+     if read_tree_twoway $treeH $treeM; then false; else :; fi'
 
 test_expect_success \
     '12 - unmatching local changes being removed.' \
     'rm -f .git/index &&
      echo rezrov rezrov >rezrov &&
      git-update-cache --add rezrov &&
-     if git-read-tree -m $treeH $treeM; then false; else :; fi'
+     if read_tree_twoway $treeH $treeM; then false; else :; fi'
 
 test_expect_success \
     '13 - unmatching local changes being removed.' \
@@ -164,7 +170,7 @@ test_expect_success \
      echo rezrov rezrov >rezrov &&
      git-update-cache --add rezrov &&
      echo rezrov >rezrov &&
-     if git-read-tree -m $treeH $treeM; then false; else :; fi'
+     if read_tree_twoway $treeH $treeM; then false; else :; fi'
 
 cat >expected <<EOF
 -100644 X 0	nitfol
@@ -176,9 +182,9 @@ test_expect_success \
     'rm -f .git/index &&
      echo nitfol nitfol >nitfol &&
      git-update-cache --add nitfol &&
-     git-read-tree -m $treeH $treeM &&
+     read_tree_twoway $treeH $treeM &&
      git-ls-files --stage >14.out || exit
-     diff --unified=0 M.out 14.out >14diff.out
+     diff -u M.out 14.out >14diff.out
      compare_change 14diff.out expected &&
      check_cache_at nitfol clean'
 
@@ -188,9 +194,9 @@ test_expect_success \
      echo nitfol nitfol >nitfol &&
      git-update-cache --add nitfol &&
      echo nitfol nitfol nitfol >nitfol &&
-     git-read-tree -m $treeH $treeM &&
+     read_tree_twoway $treeH $treeM &&
      git-ls-files --stage >15.out || exit
-     diff --unified=0 M.out 15.out >15diff.out
+     diff -u M.out 15.out >15diff.out
      compare_change 15diff.out expected &&
      check_cache_at nitfol dirty'
 
@@ -199,7 +205,7 @@ test_expect_success \
     'rm -f .git/index &&
      echo bozbar bozbar >bozbar &&
      git-update-cache --add bozbar &&
-     if git-read-tree -m $treeH $treeM; then false; else :; fi'
+     if read_tree_twoway $treeH $treeM; then false; else :; fi'
 
 test_expect_success \
     '17 - conflicting local change.' \
@@ -207,16 +213,16 @@ test_expect_success \
      echo bozbar bozbar >bozbar &&
      git-update-cache --add bozbar &&
      echo bozbar bozbar bozbar >bozbar &&
-     if git-read-tree -m $treeH $treeM; then false; else :; fi'
+     if read_tree_twoway $treeH $treeM; then false; else :; fi'
 
 test_expect_success \
     '18 - local change already having a good result.' \
     'rm -f .git/index &&
      echo gnusto >bozbar &&
      git-update-cache --add bozbar &&
-     git-read-tree -m $treeH $treeM &&
+     read_tree_twoway $treeH $treeM &&
      git-ls-files --stage >18.out &&
-     diff --unified=0 M.out 18.out &&
+     diff -u M.out 18.out &&
      check_cache_at bozbar clean'
 
 test_expect_success \
@@ -225,9 +231,9 @@ test_expect_success \
      echo gnusto >bozbar &&
      git-update-cache --add bozbar &&
      echo gnusto gnusto >bozbar &&
-     git-read-tree -m $treeH $treeM &&
+     read_tree_twoway $treeH $treeM &&
      git-ls-files --stage >19.out &&
-     diff --unified=0 M.out 19.out &&
+     diff -u M.out 19.out &&
      check_cache_at bozbar dirty'
 
 test_expect_success \
@@ -235,9 +241,9 @@ test_expect_success \
     'rm -f .git/index &&
      echo bozbar >bozbar &&
      git-update-cache --add bozbar &&
-     git-read-tree -m $treeH $treeM &&
+     read_tree_twoway $treeH $treeM &&
      git-ls-files --stage >20.out &&
-     diff --unified=0 M.out 20.out &&
+     diff -u M.out 20.out &&
      check_cache_at bozbar dirty'
 
 test_expect_success \
@@ -246,7 +252,7 @@ test_expect_success \
      echo bozbar >bozbar &&
      git-update-cache --add bozbar &&
      echo gnusto gnusto >bozbar &&
-     if git-read-tree -m $treeH $treeM; then false; else :; fi'
+     if read_tree_twoway $treeH $treeM; then false; else :; fi'
 
 # Also make sure we did not break DF vs DF/DF case.
 test_expect_success \
@@ -273,9 +279,10 @@ test_expect_success \
      rm -fr DF &&
      echo DF >DF &&
      git-update-cache --add DF &&
-     git-read-tree -m $treeDF $treeDFDF &&
+     read_tree_twoway $treeDF $treeDFDF &&
      git-ls-files --stage >DFDFcheck.out &&
-     diff --unified=0 DFDF.out DFDFcheck.out &&
-     check_cache_at DF/DF dirty'
+     diff -u DFDF.out DFDFcheck.out &&
+     check_cache_at DF/DF dirty &&
+     :'
 
 test_done
------------


^ permalink raw reply

* [PATCH 2/3] read-tree --emu23.
From: Junio C Hamano @ 2005-06-11  1:36 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

This new flag causes two-way fast forward to internally use the
three-way merge mechanism.  This behaviour is intended to offer
a better fast forward semantics when used in a dirty work tree.

The new test t1005 is parallel to the existing t1001 "pure
2-way" tests, but some parts that are commented out would fail.
These failures are due to three-way merge enforcing too strict
index requirements for cases that could succeed.  This problem
will be addressed by later patches.

Without even changing three-way mechanism, the --emu23 two-way
fast forward already gives the user an easier-to-handle merge
result when a file that "merged head" updates has local
modifications.  This is demonstrated as "case 16" test in t1005.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

 read-tree.c                       |   81 +++++++++++++++++++++++++++++++++++--
 t/t1001-read-tree-m-2way.sh       |   44 ++++++++++++++++----
 2 files changed, 113 insertions(+), 12 deletions(-)

diff --git a/read-tree.c b/read-tree.c
--- a/read-tree.c
+++ b/read-tree.c
@@ -210,6 +210,58 @@ static int twoway_merge(struct cache_ent
 }
 
 /*
+ * Two-way merge emulated with three-way merge.
+ *
+ * This treats "read-tree -m H M" by transforming it internally
+ * into "read-tree -m H I+H M", where I+H is a tree that would
+ * contain the contents of the current index file, overlayed on
+ * top of H.  Unlike the traditional two-way merge, this leaves
+ * the stages in the resulting index file and lets the user resolve
+ * the merge conflicts using standard tools for three-way merge.
+ *
+ * This function is just to set-up such an arrangement, and the
+ * actual merge uses threeway_merge() function.
+ */
+static void setup_emu23(void)
+{
+	/* stage0 contains I, stage1 H, stage2 M.
+	 * move stage2 to stage3, and create stage2 entries
+	 * by scanning stage0 and stage1 entries.
+	 */
+	int i, namelen, size;
+	struct cache_entry *ce, *stage2;
+
+	for (i = 0; i < active_nr; i++) {
+		ce = active_cache[i];
+		if (ce_stage(ce) != 2)
+			continue;
+		/* hoist them up to stage 3 */
+		namelen = ce_namelen(ce);
+		ce->ce_flags = create_ce_flags(namelen, 3);
+	}
+
+	for (i = 0; i < active_nr; i++) {
+		ce = active_cache[i];
+		if (ce_stage(ce) > 1)
+			continue;
+		namelen = ce_namelen(ce);
+		size = cache_entry_size(namelen);
+		stage2 = xmalloc(size);
+		memcpy(stage2, ce, size);
+		stage2->ce_flags = create_ce_flags(namelen, 2);
+		if (add_cache_entry(stage2, ADD_CACHE_OK_TO_ADD) < 0)
+			die("cannot merge index and our head tree");
+
+		/* We are done with this name, so skip to next name */
+		while (i < active_nr &&
+		       ce_namelen(active_cache[i]) == namelen &&
+		       !memcmp(active_cache[i]->name, ce->name, namelen))
+			i++;
+		i--; /* compensate for the loop control */
+	}
+}
+
+/*
  * One-way merge.
  *
  * The rule is:
@@ -315,7 +367,7 @@ static struct cache_file cache_file;
 
 int main(int argc, char **argv)
 {
-	int i, newfd, merge, reset;
+	int i, newfd, merge, reset, emu23;
 	unsigned char sha1[20];
 
 	newfd = hold_index_file_for_update(&cache_file, get_index_file());
@@ -324,6 +376,7 @@ int main(int argc, char **argv)
 
 	merge = 0;
 	reset = 0;
+	emu23 = 0;
 	for (i = 1; i < argc; i++) {
 		const char *arg = argv[i];
 
@@ -335,7 +388,7 @@ int main(int argc, char **argv)
 
 		/* This differs from "-m" in that we'll silently ignore unmerged entries */
 		if (!strcmp(arg, "--reset")) {
-			if (stage || merge)
+			if (stage || merge || emu23)
 				usage(read_tree_usage);
 			reset = 1;
 			merge = 1;
@@ -345,7 +398,7 @@ int main(int argc, char **argv)
 
 		/* "-m" stands for "merge", meaning we start in stage 1 */
 		if (!strcmp(arg, "-m")) {
-			if (stage || merge)
+			if (stage || merge || emu23)
 				usage(read_tree_usage);
 			if (read_cache_unmerged())
 				die("you need to resolve your current index first");
@@ -353,6 +406,17 @@ int main(int argc, char **argv)
 			merge = 1;
 			continue;
 		}
+
+		/* "-emu23" uses 3-way merge logic to perform fast-forward */
+		if (!strcmp(arg, "--emu23")) {
+			if (stage || merge || emu23)
+				usage(read_tree_usage);
+			if (read_cache_unmerged())
+				die("you need to resolve your current index first");
+			merge = emu23 = stage = 1;
+			continue;
+		}
+
 		if (get_sha1(arg, sha1) < 0)
 			usage(read_tree_usage);
 		if (stage > 3)
@@ -369,9 +433,18 @@ int main(int argc, char **argv)
 			[2] = twoway_merge,
 			[3] = threeway_merge,
 		};
+		merge_fn_t fn;
+
 		if (stage < 2 || stage > 4)
 			die("just how do you expect me to merge %d trees?", stage-1);
-		merge_cache(active_cache, active_nr, merge_function[stage-1]);
+		if (emu23 && stage != 3)
+			die("--emu23 takes only two trees");
+		fn = merge_function[stage-1];
+		if (stage == 3 && emu23) { 
+			setup_emu23();
+			fn = merge_function[3];
+		}
+		merge_cache(active_cache, active_nr, fn);
 	}
 	if (write_cache(newfd, active_cache, active_nr) ||
 	    commit_index_file(&cache_file))
diff --git a/t/t1001-read-tree-m-2way.sh b/t/t1005-read-tree-m-2way-emu23.sh
similarity index 86%
copy from t/t1001-read-tree-m-2way.sh
copy to t/t1005-read-tree-m-2way-emu23.sh
--- a/t/t1001-read-tree-m-2way.sh
+++ b/t/t1005-read-tree-m-2way-emu23.sh
@@ -3,7 +3,7 @@
 # Copyright (c) 2005 Junio C Hamano
 #
 
-test_description='Two way merge with read-tree -m $H $M
+test_description='Two way merge with read-tree --emu23 $H $M
 
 This test tries two-way merge (aka fast forward with carry forward).
 
@@ -23,7 +23,10 @@ In the test, these paths are used:
 . ./test-lib.sh
 
 read_tree_twoway () {
-    git-read-tree -m "$1" "$2" && git-ls-files --stage
+    git-read-tree --emu23 "$1" "$2" &&
+    git-ls-files --stage &&
+    git-merge-cache git-merge-one-file-script -a &&
+    git-ls-files --stage
 }
 
 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
@@ -51,6 +54,12 @@ check_cache_at () {
 	esac
 }
 
+check_stages () {
+    cat >expected_stages
+    git-ls-files --stage | sed -e "s/ $_x40 / X /" >current_stages
+    diff -u expected_stages current_stages
+}
+
 test_expect_success \
     setup \
     'echo frotz >frotz &&
@@ -78,7 +87,7 @@ test_expect_success \
      git-ls-files --stage >1-3.out &&
      diff -u M.out 1-3.out &&
      check_cache_at bozbar dirty &&
-     check_cache_at frotz dirty &&
+     check_cache_at frotz clean && # different from pure 2-way
      check_cache_at nitfol dirty'
 
 echo '+100644 X 0	yomin' >expected
@@ -93,7 +102,9 @@ test_expect_success \
      compare_change 4diff.out expected &&
      check_cache_at yomin clean'
 
-test_expect_success \
+# "read-tree -m H I+H M" where !H && !M; so (I+H) not being up-to-date
+# should not matter, but without #3ALT this does not work.
+: test_expect_success \
     '5 - carry forward local addition.' \
     'rm -f .git/index &&
      echo yomin >yomin &&
@@ -105,7 +116,10 @@ test_expect_success \
      compare_change 5diff.out expected &&
      check_cache_at yomin dirty'
 
-test_expect_success \
+# "read-tree -m H I+H M" where !H && M && (I+H) == M, so this should
+# succeed (even the entry is clean), but without #5ALT this does not
+# work.
+: test_expect_success \
     '6 - local addition already has the same.' \
     'rm -f .git/index &&
      git-update-cache --add frotz &&
@@ -114,7 +128,9 @@ test_expect_success \
      diff -u M.out 6.out &&
      check_cache_at frotz clean'
 
-test_expect_success \
+# Exactly the same pattern as above but with dirty cache.  This also
+# should succeed, but without #5ALT it does not.
+: test_expect_success \
     '7 - local addition already has the same.' \
     'rm -f .git/index &&
      echo frotz >frotz &&
@@ -200,12 +216,24 @@ test_expect_success \
      compare_change 15diff.out expected &&
      check_cache_at nitfol dirty'
 
+# This is different from straight 2-way merge in that it leaves
+# three stages of bozbar in the index file without failing, so
+# the user can run git-diff-stages to examine the situation.
 test_expect_success \
     '16 - conflicting local change.' \
     'rm -f .git/index &&
      echo bozbar bozbar >bozbar &&
      git-update-cache --add bozbar &&
-     if read_tree_twoway $treeH $treeM; then false; else :; fi'
+     git-read-tree --emu23 $treeH $treeM &&
+     check_stages' <<\EOF
+100644 X 1	bozbar
+100644 X 2	bozbar
+100644 X 3	bozbar
+100644 X 3	frotz
+100644 X 0	nitfol
+100644 X 1	rezrov
+100644 X 2	rezrov
+EOF
 
 test_expect_success \
     '17 - conflicting local change.' \
@@ -282,7 +310,7 @@ test_expect_success \
      read_tree_twoway $treeDF $treeDFDF &&
      git-ls-files --stage >DFDFcheck.out &&
      diff -u DFDF.out DFDFcheck.out &&
-     check_cache_at DF/DF dirty &&
+     check_cache_at DF/DF clean && # different from pure 2-way
      :'
 
 test_done
------------


^ permalink raw reply

* [PATCH 3/3] read-tree: fix too strong index requirement #5ALT
From: Junio C Hamano @ 2005-06-11  1:37 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

This fixes too strong index requirement 3-way merge enforces in
one case: the same file is added in both branches.

In this case, the original code insisted that if the index file
has that path, it must match our branch and be up-to-date.
However in this particular case, it only has to match it, and
can be dirty.  We just need to make sure that we keep the
work-tree copy instead of checking out the merge result.

The resolution of such a path, however, cannot be left to
outside script, because we will not keep the original stage0
entries for unmerged paths when read-tree finishes, and at that
point, the knowledge of "if we resolve it to match the new file
added in both branches, the merge succeeds and the work tree
would not lose information, but we should _not_ update the work
tree from the resulting index file" is lost.  For this reason,
the now code needs to resolve this case (#5ALT) internally.

This affects some existing tests in the test suite, but all in
positive ways.  In t1000 (3-way test), this #5ALT case now gets
one stage0 entry, instead of an identical stage2 and stage3
entry pair, for such a path, and one test that checked for merge
failure (because the test assumed the "stricter-than-necessary"
behaviour) does not have to fail anymore.  In t1005 (emu23
test), two tests that involves a case where the work tree
already had a change introduced in the upstream (aka "merged
head"), the merge succeeds instead of failing.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

 read-tree.c                       |   20 ++++++++++++++++++--
 t/t1000-read-tree-m-3way.sh       |   17 +++++++++--------
 t/t1005-read-tree-m-2way-emu23.sh |    9 ++++-----
 3 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/read-tree.c b/read-tree.c
--- a/read-tree.c
+++ b/read-tree.c
@@ -102,7 +102,7 @@ static void reject_merge(struct cache_en
 	die("Entry '%s' would be overwritten by merge. Cannot merge.", ce->name);
 }
 
-static int merged_entry(struct cache_entry *merge, struct cache_entry *old, struct cache_entry **dst)
+static int merged_entry_internal(struct cache_entry *merge, struct cache_entry *old, struct cache_entry **dst, int allow_dirty)
 {
 	merge->ce_flags |= htons(CE_UPDATE);
 	if (old) {
@@ -115,7 +115,7 @@ static int merged_entry(struct cache_ent
 		 */
 		if (same(old, merge)) {
 			*merge = *old;
-		} else {
+		} else if (!allow_dirty) {
 			verify_uptodate(old);
 		}
 	}
@@ -124,6 +124,16 @@ static int merged_entry(struct cache_ent
 	return 1;
 }
 
+static int merged_entry_allow_dirty(struct cache_entry *merge, struct cache_entry *old, struct cache_entry **dst)
+{
+	return merged_entry_internal(merge, old, dst, 1);
+}
+
+static int merged_entry(struct cache_entry *merge, struct cache_entry *old, struct cache_entry **dst)
+{
+	return merged_entry_internal(merge, old, dst, 0);
+}
+
 static int deleted_entry(struct cache_entry *ce, struct cache_entry *old, struct cache_entry **dst)
 {
 	if (old)
@@ -140,6 +150,12 @@ static int threeway_merge(struct cache_e
 	struct cache_entry *merge;
 	int count;
 
+	/* #5ALT */
+	if (!a && b && c && same(b, c)) {
+		if (old && !same(b, old))
+			return -1;
+		return merged_entry_allow_dirty(b, old, dst);
+	}
 	/*
 	 * If we have an entry in the index cache ("old"), then we want
 	 * to make sure that it matches any entries in stage 2 ("first
diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh
--- a/t/t1000-read-tree-m-3way.sh
+++ b/t/t1000-read-tree-m-3way.sh
@@ -75,7 +75,8 @@ In addition:
 . ../lib-read-tree-m-3way.sh
 
 ################################################################
-# This is the "no trivial merge unless all three exists" table.
+# Trivial "majority when 3 stages exist" merge plus #5ALT trivial
+# merge.
 
 cat >expected <<\EOF
 100644 X 2	AA
@@ -88,8 +89,7 @@ cat >expected <<\EOF
 100644 X 3	DM
 100644 X 1	DN
 100644 X 3	DN
-100644 X 2	LL
-100644 X 3	LL
+100644 X 0	LL
 100644 X 1	MD
 100644 X 2	MD
 100644 X 1	MM
@@ -289,23 +289,24 @@ test_expect_failure \
      git-read-tree -m $tree_O $tree_A $tree_B"
 
 test_expect_success \
-    '5 - must match and be up-to-date in !O && A && B && A==B case.' \
+    '5 - must match in !O && A && B && A==B case.' \
     "rm -f .git/index LL &&
      cp .orig-A/LL LL &&
      git-update-cache --add LL &&
      git-read-tree -m $tree_O $tree_A $tree_B &&
      check_result"
 
-test_expect_failure \
-    '5 (fail) - must match and be up-to-date in !O && A && B && A==B case.' \
+test_expect_success \
+    '5 - must match in !O && A && B && A==B case.' \
     "rm -f .git/index LL &&
      cp .orig-A/LL LL &&
      git-update-cache --add LL &&
      echo extra >>LL &&
-     git-read-tree -m $tree_O $tree_A $tree_B"
+     git-read-tree -m $tree_O $tree_A $tree_B &&
+     check_result"
 
 test_expect_failure \
-    '5 (fail) - must match and be up-to-date in !O && A && B && A==B case.' \
+    '5 (fail) - must match A in !O && A && B && A==B case.' \
     "rm -f .git/index LL &&
      cp .orig-A/LL LL &&
      echo extra >>LL &&
diff --git a/t/t1005-read-tree-m-2way-emu23.sh b/t/t1005-read-tree-m-2way-emu23.sh
--- a/t/t1005-read-tree-m-2way-emu23.sh
+++ b/t/t1005-read-tree-m-2way-emu23.sh
@@ -117,9 +117,8 @@ test_expect_success \
      check_cache_at yomin dirty'
 
 # "read-tree -m H I+H M" where !H && M && (I+H) == M, so this should
-# succeed (even the entry is clean), but without #5ALT this does not
-# work.
-: test_expect_success \
+# succeed (even the entry is clean), now thanks to #5ALT.
+test_expect_success \
     '6 - local addition already has the same.' \
     'rm -f .git/index &&
      git-update-cache --add frotz &&
@@ -129,8 +128,8 @@ test_expect_success \
      check_cache_at frotz clean'
 
 # Exactly the same pattern as above but with dirty cache.  This also
-# should succeed, but without #5ALT it does not.
-: test_expect_success \
+# should succeed, now thanks to #5ALT.
+test_expect_success \
     '7 - local addition already has the same.' \
     'rm -f .git/index &&
      echo frotz >frotz &&
------------


^ permalink raw reply

* [PATCH] diff-stages: unuglify the too big main() function.
From: Junio C Hamano @ 2005-06-11  1:44 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git
In-Reply-To: <7vekbbb2me.fsf_-_@assigned-by-dhcp.cox.net>

Split the core of the program, diff_stage, from one big "main()"
function that does it all and leave only the parameter parsing,
setup and finalize part in the main().

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

 diff-stages.c |   75 ++++++++++++++++++++++++++++++---------------------------
 1 files changed, 40 insertions(+), 35 deletions(-)

diff --git a/diff-stages.c b/diff-stages.c
--- a/diff-stages.c
+++ b/diff-stages.c
@@ -17,9 +17,47 @@ static const char *orderfile = NULL;
 static char *diff_stages_usage =
 "git-diff-stages [-p] [-r] [-z] [-M] [-C] [-R] [-S<string>] [-O<orderfile>] <stage1> <stage2> [<path>...]";
 
+static void diff_stages(int stage1, int stage2)
+{
+	int i = 0;
+	while (i < active_nr) {
+		struct cache_entry *ce, *stages[4] = { NULL, };
+		struct cache_entry *one, *two;
+		const char *name;
+		int len;
+		ce = active_cache[i];
+		len = ce_namelen(ce);
+		name = ce->name;
+		for (;;) {
+			int stage = ce_stage(ce);
+			stages[stage] = ce;
+			if (active_nr <= ++i)
+				break;
+			ce = active_cache[i];
+			if (ce_namelen(ce) != len ||
+			    memcmp(name, ce->name, len))
+				break;
+		}
+		one = stages[stage1];
+		two = stages[stage2];
+		if (!one && !two)
+			continue;
+		if (!one)
+			diff_addremove('+', ntohl(two->ce_mode),
+				       two->sha1, name, NULL);
+		else if (!two)
+			diff_addremove('-', ntohl(one->ce_mode),
+				       one->sha1, name, NULL);
+		else if (memcmp(one->sha1, two->sha1, 20) ||
+			 (one->ce_mode != two->ce_mode))
+			 diff_change(ntohl(one->ce_mode), ntohl(two->ce_mode),
+				     one->sha1, two->sha1, name, NULL);
+	}
+}
+
 int main(int ac, const char **av)
 {
-	int stage1, stage2, i;
+	int stage1, stage2;
 
 	read_cache();
 	while (1 < ac && av[1][0] == '-') {
@@ -67,40 +105,7 @@ int main(int ac, const char **av)
 	av += 3; /* The rest from av[0] are for paths restriction. */
 	diff_setup(diff_setup_opt);
 
-	i = 0;
-	while (i < active_nr) {
-		struct cache_entry *ce, *stages[4] = { NULL, };
-		struct cache_entry *one, *two;
-		const char *name;
-		int len;
-		ce = active_cache[i];
-		len = ce_namelen(ce);
-		name = ce->name;
-		for (;;) {
-			int stage = ce_stage(ce);
-			stages[stage] = ce;
-			if (active_nr <= ++i)
-				break;
-			ce = active_cache[i];
-			if (ce_namelen(ce) != len ||
-			    memcmp(name, ce->name, len))
-				break;
-		}
-		one = stages[stage1];
-		two = stages[stage2];
-		if (!one && !two)
-			continue;
-		if (!one)
-			diff_addremove('+', ntohl(two->ce_mode),
-				       two->sha1, name, NULL);
-		else if (!two)
-			diff_addremove('-', ntohl(one->ce_mode),
-				       one->sha1, name, NULL);
-		else if (memcmp(one->sha1, two->sha1, 20) ||
-			 (one->ce_mode != two->ce_mode))
-			 diff_change(ntohl(one->ce_mode), ntohl(two->ce_mode),
-				     one->sha1, two->sha1, name, NULL);
-	}
+	diff_stages(stage1, stage2);
 
 	diffcore_std(av,
 		     detect_rename, diff_score_opt,
------------


^ permalink raw reply

* [PATCH] Convert commands to optparse
From: Jonas Fonseca @ 2005-06-11  1:52 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

Convert all remaining commands providing options to optparse.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---

Tested lightly ...

 cg-admin-ls       |   15 +++++++++------
 cg-admin-uncommit |   11 +++++++----
 cg-clone          |   16 ++++++++++------
 cg-commit         |   30 +++++++++++-------------------
 cg-merge          |   23 +++++++++++------------
 cg-pull           |   14 ++++++++------
 cg-update         |   13 ++++++++-----
 7 files changed, 64 insertions(+), 58 deletions(-)

diff --git a/cg-admin-ls b/cg-admin-ls
--- a/cg-admin-ls
+++ b/cg-admin-ls
@@ -34,11 +34,14 @@ USAGE="cg-admin-ls [-t TREE_ID] [PATH]"
 . ${COGITO_LIB}cg-Xlib
 
 tree_id=
-if [ "$1" = "-t" ]; then
-	shift
-	tree_id=$1
-	shift
-fi
+while optparse; do
+	if optparse -t=; then
+		tree_id="$OPTARG"
+	else
+		optfail
+	fi
+done
+
 id=$(tree-id $tree_id) || exit 1
 
-git-ls-tree "$id" "$@"
+git-ls-tree "$id" "${ARGS[@]}"
diff --git a/cg-admin-uncommit b/cg-admin-uncommit
--- a/cg-admin-uncommit
+++ b/cg-admin-uncommit
@@ -24,10 +24,13 @@ USAGE="cg-admin-uncommit [-t] [COMMIT_ID
 [ -s $_git/blocked ] && die "uncommitting blocked: $(cat $_git/blocked)"
 
 rollback_tree=
-if [ "$1" = "-t" ]; then
-	shift
-	rollback_tree=1
-fi
+while optparse; do
+	if optparse -t; then
+		rollback_tree=1
+	else
+		optfail
+	fi
+done
 
 
 base=$(commit-id) || exit 1
diff --git a/cg-clone b/cg-clone
--- a/cg-clone
+++ b/cg-clone
@@ -23,16 +23,20 @@ _git_repo_unneeded=1
 . ${COGITO_LIB}cg-Xlib
 
 same_dir=
-if [ "$1" = "-s" ]; then
-	shift
-	same_dir=1
-fi
+while optparse; do
+	if optparse -s; then
+		same_dir=1
+	else
+		optfail
+	fi
+done
+
+location=${ARGS[0]}
 
-location=$1
 [ "$location" ] || usage
 location=${location%/}
 
-destdir=$2
+destdir=${ARGS[1]}
 if [ "$destdir" ]; then
 	[ ! "$same_dir" ] || die "specifying both -s and DESTDIR makes no sense"
 	dir=$destdir
diff --git a/cg-commit b/cg-commit
--- a/cg-commit
+++ b/cg-commit
@@ -83,34 +83,26 @@ forceeditor=
 ignorecache=
 commitalways=
 msgs=()
-while [ "$1" ]; do
-	case "$1" in
-	-C)
+while optparse; do
+	if optparse -C; then
 		ignorecache=1
-		shift
-		;;
-	-e)
+	elif optparse -e; then
 		forceeditor=1
-		shift
-		;;
-	-E)
+	elif optparse -E; then
 		forceeditor=1
 		commitalways=1
-		shift
-		;;
-	-m*)
-		msgs=("${msgs[@]}" "${1#-m}")
-		shift
-		;;
-	*)	break;;
-	esac
+	elif optparse -m=; then
+		msgs=("${msgs[@]}" "$OPTARG")
+	else
+		optfail
+	fi
 done
 
-if [ "$1" ]; then
+if [ "$ARGS" ]; then
 	[ "$ignorecache" ] && die "-C and listing files to commit does not make sense"
 	[ -s $_git/merging ] && die "cannot commit individual files when merging"
 
-	eval commitfiles=($(git-diff-cache -r -m HEAD -- "$@" | \
+	eval commitfiles=($(git-diff-cache -r -m HEAD -- "${ARGS[@]}" | \
 		sed 's/^\([^	]*\)\(.	.*\)\(	.*\)*$/"\2"/'))
 	customfiles=1
 
diff --git a/cg-merge b/cg-merge
--- a/cg-merge
+++ b/cg-merge
@@ -27,20 +27,19 @@ head=$(commit-id)
 
 
 careful=
-if [ "$1" = "-c" ]; then
-	shift
-	careful=1
-fi
-
 base=
-if [ "$1" = "-b" ]; then
-	shift
-	[ "$1" ] || usage
-	base=$(commit-id "$1") || exit 1; shift
-fi
+while optparse; do
+	if optparse -c; then
+		careful=1
+	elif optparse -b=; then
+		base=$(commit-id "$OPTARG") || exit 1
+	else
+		optfail
+	fi
+done
 
-[ "$1" ] || usage
-branchname="$1"
+[ "$ARGS" ] || usage
+branchname="${ARGS[0]}"
 branch=$(commit-id "$branchname") || exit 1
 
 [ "$base" ] || base=$(git-merge-base "$head" "$branch")
diff --git a/cg-pull b/cg-pull
--- a/cg-pull
+++ b/cg-pull
@@ -17,13 +17,15 @@ USAGE="cg-pull [-f] [BRANCH_NAME]"
 . ${COGITO_LIB}cg-Xlib
 
 force=
-if [ "$1" = "-f" ]; then
-	force=1
-	shift
-fi
-
-name=$1
+while optparse; do
+	if optparse -f; then
+		force=1
+	else
+		optfail
+	fi
+done
 
+name=${ARGS[0]}
 
 [ "$name" ] || { [ -s $_git/refs/heads/origin ] && name=origin; }
 [ "$name" ] || die "where to pull from?"
diff --git a/cg-update b/cg-update
--- a/cg-update
+++ b/cg-update
@@ -18,12 +18,15 @@ USAGE="cg-update [-f] [BRANCH_NAME]"
 . ${COGITO_LIB}cg-Xlib
 
 force=
-if [ "$1" = "-f" ]; then
-	force=$1
-	shift
-fi
+while optparse; do
+	if optparse -f; then
+		force=-f
+	else
+		optfail
+	fi
+done
 
-name=$1
+name=${ARGS[0]}
 [ "$name" ] || { [ -s $_git/refs/heads/origin ] && name=origin; }
 [ "$name" ] || die "where to update from?"
 
-- 
Jonas Fonseca

^ permalink raw reply

* Re: do people use the 'git' command?
From: Junio C Hamano @ 2005-06-11  3:15 UTC (permalink / raw)
  To: Sebastian Kuzminsky; +Cc: git
In-Reply-To: <E1DgodI-0003ov-Fl@highlab.com>

>>>>> "SK" == Sebastian Kuzminsky <seb@highlab.com> writes:

SK> Can we drop the "git" program?

No chance, especially with a patch that is not accompanied with
necessary changes to Documentation/tutorial.txt that already
tells the user to type "git commit" and "git log" ;-).


^ permalink raw reply

* Re: RFE: git relink
From: Junio C Hamano @ 2005-06-11  3:44 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: git
In-Reply-To: <42A88C07.5050907@pobox.com>

>>>>> "JG" == Jeff Garzik <jgarzik@pobox.com> writes:

JG> It would be nice if somebody were motivated enough to create a command
JG> that functions like:

JG> 	git relink repoA repoB repoC repoD... repoX

JG> which would examine

JG> 	repoA/.git
JG> 	repoB/.git
JG> 	repoC/.git
JG> 	repoD/.git

JG> and verify (updating, if necessary) that each of the A/B/C/D repos are
JG> hardlinked to repoX.

Whoever is doing this script needs to be a bit careful.

If you end up unlinking a full object and hard-linking a
deltified object representation (delta) in its place, the
repository can get corrupted, because it might not have the
necessary base object for the delta.

There are two strategies to solve this.  Either (1) the relinker
refuses to replace a full object with a delta, or (2) the
relinker notices a delta, and makes an additional hard link to
the base object when replacing a full object with a delta (this
needs to be done recursively until you hit a full base object).

(1) is simpler and cleaner, but does not get full advantage of
the delta compression.  (2) gives you delta compression but it
will add possibly "unwanted" objects to a repository that
happens to slurp in a delta (fsck would not complain, though).

My knee-jerk vote goes to (1), but in either case the relinker
needs to check if it is dealing with a delta; this cannot be
done with git-cat-file -t AFAIK.

Ryan Anderson code will notice delta vs full object case most of
the time because it checks and makes sure the sizes of
corresponding files from two repositories match.  The problem
with the code is that it dies, instead of just ignoring, when
size differs.  Dying is good for ordinary case (two full object
representations of the same file should not have different
sizes), but it is not the right thing to do when it sees one
side using the full object representation and the other side
using a delta.


^ permalink raw reply

* minor doc fixes
From: Sebastian Kuzminsky @ 2005-06-11  4:19 UTC (permalink / raw)
  To: git

Here are some minor fixes to the docs in Linus' git.  Mostly I've
added the manpage section to the asciidoc links, but there are also a
few typo fixes.


 cvs-migration.txt             |    2 -
 git-apply-patch-script.txt    |    2 -
 git-cat-file.txt              |    2 -
 git-check-files.txt           |    4 +-
 git-checkout-cache.txt        |    2 -
 git-commit-tree.txt           |    6 +--
 git-convert-cache.txt         |    2 -
 git-diff-cache.txt            |    2 -
 git-diff-files.txt            |    2 -
 git-diff-helper.txt           |    4 +-
 git-diff-tree.txt             |    2 -
 git-export.txt                |    2 -
 git-fsck-cache.txt            |    2 -
 git-http-pull.txt             |    2 -
 git-init-db.txt               |    2 -
 git-local-pull.txt            |    2 -
 git-ls-files.txt              |    2 -
 git-ls-tree.txt               |    2 -
 git-merge-base.txt            |    2 -
 git-merge-cache.txt           |    2 -
 git-merge-one-file-script.txt |    2 -
 git-mkdelta.txt               |    2 -
 git-mktag.txt                 |    2 -
 git-prune-script.txt          |    2 -
 git-pull-script.txt           |    2 -
 git-read-tree.txt             |    4 +-
 git-resolve-script.txt        |    2 -
 git-rev-list.txt              |    2 -
 git-rev-tree.txt              |    2 -
 git-tag-script.txt            |    2 -
 git-tar-tree.txt              |    2 -
 git-unpack-file.txt           |    2 -
 git-update-cache.txt          |    2 -
 git-write-blob.txt            |    2 -
 git-write-tree.txt            |    2 -
 git.txt                       |   82 +++++++++++++++++++++---------------------
 36 files changed, 81 insertions(+), 81 deletions(-)


diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
--- a/Documentation/cvs-migration.txt
+++ b/Documentation/cvs-migration.txt
@@ -14,7 +14,7 @@ does a lot of things differently. 
 One particular suckage of CVS is very hard to work around: CVS is
 basically a tool for tracking _file_ history, while git is a tool for
 tracking _project_ history.  This sometimes causes problems if you are
-used to doign very strange things in CVS, in particular if you're doing
+used to doing very strange things in CVS, in particular if you're doing
 things like making branches of just a subset of the project.  Git can't
 track that, since git never tracks things on the level of an individual
 file, only on the whole project level. 
diff --git a/Documentation/git-apply-patch-script.txt b/Documentation/git-apply-patch-script.txt
--- a/Documentation/git-apply-patch-script.txt
+++ b/Documentation/git-apply-patch-script.txt
@@ -28,5 +28,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt
--- a/Documentation/git-cat-file.txt
+++ b/Documentation/git-cat-file.txt
@@ -51,5 +51,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-check-files.txt b/Documentation/git-check-files.txt
--- a/Documentation/git-check-files.txt
+++ b/Documentation/git-check-files.txt
@@ -33,7 +33,7 @@ up-to-date.
 
 See Also
 --------
-link:git-update-cache.html[git-update-cache]
+link:git-update-cache.html[git-update-cache(1)]
 
 
 Author
@@ -46,5 +46,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-checkout-cache.txt b/Documentation/git-checkout-cache.txt
--- a/Documentation/git-checkout-cache.txt
+++ b/Documentation/git-checkout-cache.txt
@@ -102,5 +102,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt
--- a/Documentation/git-commit-tree.txt
+++ b/Documentation/git-commit-tree.txt
@@ -9,7 +9,7 @@ git-commit-tree - Creates a new commit o
 
 SYNOPSIS
 --------
-'git-commit-tree' <tree> [-p <parent commit>]\   < changelog
+'git-commit-tree' <tree> [-p <parent commit>]  < changelog
 
 DESCRIPTION
 -----------
@@ -71,7 +71,7 @@ You don't exist. Go away!::
 
 See Also
 --------
-link:git-write-tree.html[git-write-tree]
+link:git-write-tree.html[git-write-tree(1)]
 
 
 Author
@@ -84,5 +84,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-convert-cache.txt b/Documentation/git-convert-cache.txt
--- a/Documentation/git-convert-cache.txt
+++ b/Documentation/git-convert-cache.txt
@@ -26,5 +26,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-diff-cache.txt b/Documentation/git-diff-cache.txt
--- a/Documentation/git-diff-cache.txt
+++ b/Documentation/git-diff-cache.txt
@@ -164,5 +164,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-diff-files.txt b/Documentation/git-diff-files.txt
--- a/Documentation/git-diff-files.txt
+++ b/Documentation/git-diff-files.txt
@@ -72,5 +72,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-diff-helper.txt b/Documentation/git-diff-helper.txt
--- a/Documentation/git-diff-helper.txt
+++ b/Documentation/git-diff-helper.txt
@@ -30,7 +30,7 @@ OPTIONS
 
 See Also
 --------
-The section on generating patches in link:git-diff-cache.html[git-diff-cache]
+The section on generating patches in link:git-diff-cache.html[git-diff-cache(1)]
 
 
 Author
@@ -44,5 +44,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt
--- a/Documentation/git-diff-tree.txt
+++ b/Documentation/git-diff-tree.txt
@@ -153,5 +153,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-export.txt b/Documentation/git-export.txt
--- a/Documentation/git-export.txt
+++ b/Documentation/git-export.txt
@@ -27,5 +27,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-fsck-cache.txt b/Documentation/git-fsck-cache.txt
--- a/Documentation/git-fsck-cache.txt
+++ b/Documentation/git-fsck-cache.txt
@@ -124,5 +124,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-http-pull.txt b/Documentation/git-http-pull.txt
--- a/Documentation/git-http-pull.txt
+++ b/Documentation/git-http-pull.txt
@@ -42,5 +42,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-init-db.txt b/Documentation/git-init-db.txt
--- a/Documentation/git-init-db.txt
+++ b/Documentation/git-init-db.txt
@@ -36,5 +36,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-local-pull.txt b/Documentation/git-local-pull.txt
--- a/Documentation/git-local-pull.txt
+++ b/Documentation/git-local-pull.txt
@@ -43,5 +43,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt
--- a/Documentation/git-ls-files.txt
+++ b/Documentation/git-ls-files.txt
@@ -104,5 +104,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
--- a/Documentation/git-ls-tree.txt
+++ b/Documentation/git-ls-tree.txt
@@ -51,5 +51,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-merge-base.txt b/Documentation/git-merge-base.txt
--- a/Documentation/git-merge-base.txt
+++ b/Documentation/git-merge-base.txt
@@ -30,5 +30,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-merge-cache.txt b/Documentation/git-merge-cache.txt
--- a/Documentation/git-merge-cache.txt
+++ b/Documentation/git-merge-cache.txt
@@ -80,5 +80,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-merge-one-file-script.txt b/Documentation/git-merge-one-file-script.txt
--- a/Documentation/git-merge-one-file-script.txt
+++ b/Documentation/git-merge-one-file-script.txt
@@ -26,5 +26,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-mkdelta.txt b/Documentation/git-mkdelta.txt
--- a/Documentation/git-mkdelta.txt
+++ b/Documentation/git-mkdelta.txt
@@ -41,5 +41,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-mktag.txt b/Documentation/git-mktag.txt
--- a/Documentation/git-mktag.txt
+++ b/Documentation/git-mktag.txt
@@ -44,5 +44,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-prune-script.txt b/Documentation/git-prune-script.txt
--- a/Documentation/git-prune-script.txt
+++ b/Documentation/git-prune-script.txt
@@ -28,5 +28,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-pull-script.txt b/Documentation/git-pull-script.txt
--- a/Documentation/git-pull-script.txt
+++ b/Documentation/git-pull-script.txt
@@ -27,5 +27,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
--- a/Documentation/git-read-tree.txt
+++ b/Documentation/git-read-tree.txt
@@ -251,7 +251,7 @@ updated to the result of the merge.
 
 See Also
 --------
-link:git-write-tree.html[git-write-tree]; link:git-ls-files.html[git-ls-files]
+link:git-write-tree.html[git-write-tree(1)]; link:git-ls-files.html[git-ls-files(1)]
 
 
 Author
@@ -264,5 +264,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-resolve-script.txt b/Documentation/git-resolve-script.txt
--- a/Documentation/git-resolve-script.txt
+++ b/Documentation/git-resolve-script.txt
@@ -26,5 +26,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -71,5 +71,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-rev-tree.txt b/Documentation/git-rev-tree.txt
--- a/Documentation/git-rev-tree.txt
+++ b/Documentation/git-rev-tree.txt
@@ -84,5 +84,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-tag-script.txt b/Documentation/git-tag-script.txt
--- a/Documentation/git-tag-script.txt
+++ b/Documentation/git-tag-script.txt
@@ -28,5 +28,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-tar-tree.txt b/Documentation/git-tar-tree.txt
--- a/Documentation/git-tar-tree.txt
+++ b/Documentation/git-tar-tree.txt
@@ -35,5 +35,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-unpack-file.txt b/Documentation/git-unpack-file.txt
--- a/Documentation/git-unpack-file.txt
+++ b/Documentation/git-unpack-file.txt
@@ -33,5 +33,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-update-cache.txt b/Documentation/git-update-cache.txt
--- a/Documentation/git-update-cache.txt
+++ b/Documentation/git-update-cache.txt
@@ -104,5 +104,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-write-blob.txt b/Documentation/git-write-blob.txt
--- a/Documentation/git-write-blob.txt
+++ b/Documentation/git-write-blob.txt
@@ -29,5 +29,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git-write-tree.txt b/Documentation/git-write-tree.txt
--- a/Documentation/git-write-tree.txt
+++ b/Documentation/git-write-tree.txt
@@ -48,5 +48,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 
diff --git a/Documentation/git.txt b/Documentation/git.txt
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -18,8 +18,8 @@ This is reference information for the co
 
 The Discussion section below contains much useful definition and
 clarification info - read that first.  And of the commands, I suggest
-reading link:git-update-cache.html[git-update-cache] and
-link:git-read-tree.html[git-read-tree] first - I wish I had!
+reading link:git-update-cache.html[git-update-cache(1)] and
+link:git-read-tree.html[git-read-tree(1)] first - I wish I had!
 
 David Greaves <david@dgreaves.com>
 08/05/05
@@ -39,78 +39,78 @@ SCMs layered over git.
 
 Manipulation commands
 ~~~~~~~~~~~~~~~~~~~~~
-link:git-checkout-cache.html[git-checkout-cache]::
+link:git-checkout-cache.html[git-checkout-cache(1)]::
 	Copy files from the cache to the working directory
 
-link:git-commit-tree.html[git-commit-tree]::
+link:git-commit-tree.html[git-commit-tree(1)]::
 	Creates a new commit object
 
-link:git-init-db.html[git-init-db]::
+link:git-init-db.html[git-init-db(1)]::
 	Creates an empty git object database
 
-link:git-merge-base.html[git-merge-base]::
+link:git-merge-base.html[git-merge-base(1)]::
 	Finds as good a common ancestor as possible for a merge
 
-link:git-mkdelta.html[git-mkdelta]::
+link:git-mkdelta.html[git-mkdelta(1)]::
 	Creates a delta object
 
-link:git-mktag.html[git-mktag]::
+link:git-mktag.html[git-mktag(1)]::
 	Creates a tag object
 
-link:git-read-tree.html[git-read-tree]::
+link:git-read-tree.html[git-read-tree(1)]::
 	Reads tree information into the directory cache
 
-link:git-update-cache.html[git-update-cache]::
+link:git-update-cache.html[git-update-cache(1)]::
 	Modifies the index or directory cache
 
-link:git-write-blob.html[git-write-blob]::
+link:git-write-blob.html[git-write-blob(1)]::
 	Creates a blob from a file
 
-link:git-write-tree.html[git-write-tree]::
+link:git-write-tree.html[git-write-tree(1)]::
 	Creates a tree from the current cache
 
 Interrogation commands
 ~~~~~~~~~~~~~~~~~~~~~~
-link:git-cat-file.html[git-cat-file]::
+link:git-cat-file.html[git-cat-file(1)]::
 	Provide content or type information for repository objects
 
-link:git-check-files.html[git-check-files]::
+link:git-check-files.html[git-check-files(1)]::
 	Verify a list of files are up-to-date
 
-link:git-diff-cache.html[git-diff-cache]::
+link:git-diff-cache.html[git-diff-cache(1)]::
 	Compares content and mode of blobs between the cache and repository
 
-link:git-diff-files.html[git-diff-files]::
+link:git-diff-files.html[git-diff-files(1)]::
 	Compares files in the working tree and the cache
 
-link:git-diff-tree.html[git-diff-tree]::
+link:git-diff-tree.html[git-diff-tree(1)]::
 	Compares the content and mode of blobs found via two tree objects
 
-link:git-export.html[git-export]::
+link:git-export.html[git-export(1)]::
 	Exports each commit and a diff against each of its parents
 
-link:git-fsck-cache.html[git-fsck-cache]::
+link:git-fsck-cache.html[git-fsck-cache(1)]::
 	Verifies the connectivity and validity of the objects in the database
 
-link:git-ls-files.html[git-ls-files]::
+link:git-ls-files.html[git-ls-files(1)]::
 	Information about files in the cache/working directory
 
-link:git-ls-tree.html[git-ls-tree]::
+link:git-ls-tree.html[git-ls-tree(1)]::
 	Displays a tree object in human readable form
 
-link:git-merge-cache.html[git-merge-cache]::
+link:git-merge-cache.html[git-merge-cache(1)]::
 	Runs a merge for files needing merging
 
-link:git-rev-list.html[git-rev-list]::
+link:git-rev-list.html[git-rev-list(1)]::
 	Lists commit objects in reverse chronological order
 
-link:git-rev-tree.html[git-rev-tree]::
+link:git-rev-tree.html[git-rev-tree(1)]::
 	Provides the revision tree for one or more commits
 
-link:git-tar-tree.html[git-tar-tree]::
+link:git-tar-tree.html[git-tar-tree(1)]::
 	Creates a tar archive of the files in the named tree
 
-link:git-unpack-file.html[git-unpack-file]::
+link:git-unpack-file.html[git-unpack-file(1)]::
 	Creates a temporary file with a blob's contents
 
 The interrogate commands may create files - and you can force them to
@@ -121,31 +121,31 @@ Ancilliary Commands
 -------------------
 Manipulators:
 
-link:git-apply-patch-script.html[git-apply-patch-script]::
+link:git-apply-patch-script.html[git-apply-patch-script(1)]::
 	Sample script to apply the diffs from git-diff-*
 
-link:git-convert-cache.html[git-convert-cache]::
+link:git-convert-cache.html[git-convert-cache(1)]::
 	Converts old-style GIT repository
 
-link:git-http-pull.html[git-http-pull]::
+link:git-http-pull.html[git-http-pull(1)]::
 	Downloads a remote GIT repository via HTTP
 
-link:git-local-pull.html[git-local-pull]::
+link:git-local-pull.html[git-local-pull(1)]::
 	Duplicates another GIT repository on a local system
 
-link:git-merge-one-file-script.html[git-merge-one-file-script]::
+link:git-merge-one-file-script.html[git-merge-one-file-script(1)]::
 	The standard helper program to use with "git-merge-cache"
 
-link:git-pull-script.html[git-pull-script]::
+link:git-pull-script.html[git-pull-script(1)]::
 	Script used by Linus to pull and merge a remote repository
 
-link:git-prune-script.html[git-prune-script]::
+link:git-prune-script.html[git-prune-script(1)]::
 	Prunes all unreachable objects from the object database
 
-link:git-resolve-script.html[git-resolve-script]::
+link:git-resolve-script.html[git-resolve-script(1)]::
 	Script used to merge two trees
 
-link:git-tag-script.html[git-tag-script]::
+link:git-tag-script.html[git-tag-script(1)]::
 	An example script to create a tag object signed with GPG
 
 link:git-ssh-pull.html[git-ssh-pull]::
@@ -153,7 +153,7 @@ link:git-ssh-pull.html[git-ssh-pull]::
 
 Interogators:
 
-link:git-diff-helper.html[git-diff-helper]::
+link:git-diff-helper.html[git-diff-helper(1)]::
 	Generates patch format output for git-diff-*
 
 link:git-ssh-push.html[git-ssh-push]::
@@ -279,16 +279,16 @@ git Commits
 'GIT_AUTHOR_DATE'::
 'GIT_COMMITTER_NAME'::
 'GIT_COMMITTER_EMAIL'::
-	see link:git-commit-tree.html[git-commit-tree]
+	see link:git-commit-tree.html[git-commit-tree(1)]
 
 git Diffs
 ~~~~~~~~~
 'GIT_DIFF_OPTS'::
 'GIT_EXTERNAL_DIFF'::
 	see the "generating patches" section in :
-	link:git-diff-cache.html[git-diff-cache];
-	link:git-diff-files.html[git-diff-files];
-	link:git-diff-tree.html[git-diff-tree]
+	link:git-diff-cache.html[git-diff-cache(1)];
+	link:git-diff-files.html[git-diff-files(1)];
+	link:git-diff-tree.html[git-diff-tree(1)]
 
 Discussion
 ----------
@@ -304,5 +304,5 @@ Documentation by David Greaves, Junio C 
 
 GIT
 ---
-Part of the link:git.html[git] suite
+Part of the link:git.html[git(7)] suite
 

-- 
Sebastian Kuzminsky

^ permalink raw reply

* minor doc patch for cogito
From: Sebastian Kuzminsky @ 2005-06-11  4:23 UTC (permalink / raw)
  To: git

Here are some minor changes to the Cogito docs, to add the manpage
section to the asciidoc links.  It also adds a 'txt' target to
Documentation/Makefile, so we can make the Cogito .txt docs if we want.


 Makefile             |    4 +++-
 make-cg-asciidoc     |    4 ++--
 make-cogito-asciidoc |   15 +++++++++++----
 3 files changed, 16 insertions(+), 7 deletions(-)


diff --git a/Documentation/Makefile b/Documentation/Makefile
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -18,7 +18,9 @@ DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT
 # yourself - yes, all 6 characters of it!
 #
 
-all: html man
+all: txt html man
+
+txt: $(MAN1_TXT) $(MAN7_TXT)
 
 html: $(DOC_HTML)
 
diff --git a/Documentation/make-cg-asciidoc b/Documentation/make-cg-asciidoc
--- a/Documentation/make-cg-asciidoc
+++ b/Documentation/make-cg-asciidoc
@@ -40,7 +40,7 @@ CAPTION=$(echo "$HEADER" | head -n 1 | t
 # were referenced as "`cg-command`". This way references from cg-* combos in
 # code listings will be ignored.
 BODY=$(echo "$HEADER" | sed '0,/^$/d' \
-		      | sed 's/`\(cg-[a-z-]\+\)`/link:\1.html[\1]/')
+		      | sed 's/`\(cg-[a-z-]\+\)`/link:\1.html[\1(1)]/')
 
 DESCRIPTION=
 OPTIONS=
@@ -109,5 +109,5 @@ $COPYRIGHT
 SEE ALSO
 --------
 $COMMAND command is part of link:cogito.html[cogito(7)],
-a toolkit for managing link:git.html[git(1)] trees.
+a toolkit for managing link:git.html[git(7)] trees.
 __END__
diff --git a/Documentation/make-cogito-asciidoc b/Documentation/make-cogito-asciidoc
--- a/Documentation/make-cogito-asciidoc
+++ b/Documentation/make-cogito-asciidoc
@@ -11,7 +11,14 @@ HELPER_COMMANDS="$(ls ../cg-X*) $(ls ../
 link()
 {
 	command="$1"
-	echo "link:$command.html['$command']"
+
+        if [ ! -z "$2" ]; then
+            section="($2)"
+        else
+            section=""
+        fi
+
+	echo "link:$command.html['$command$section']"
 }
 
 # Print description list entry.
@@ -62,7 +69,7 @@ storage system. Amongst some of the note
 for branching, tagging and multiple backends for distributing repositories
 (local files, rsync, HTTP, ssh).
 
-'Cogito' is implemented as a series of 'bash(1)' scripts on top of $(link git)
+'Cogito' is implemented as a series of 'bash(1)' scripts on top of $(link git 7)
 (a content-tracking filesystem) with the goal of providing an interface for
 working with the 'GIT' database in a manner similar to other SCM tools (like
 'CVS', 'BitKeeper' or 'Monotone').
@@ -107,13 +114,13 @@ $(print_command_listing $HELPER_COMMANDS
 Command Identifiers
 -------------------
 BRANCH_NAME::
-	Indicates a branch name added with the $(link cg-branch-add) command.
+	Indicates a branch name added with the $(link cg-branch-add 1) command.
 
 COMMAND::
 	Indicates a 'Cogito' command. The \`cg-\` prefix is optional.
 
 LOCATION::
-	Indicates a local file path or a URI. See $(link cg-branch-add) for a
+	Indicates a local file path or a URI. See $(link cg-branch-add 1) for a
 	list of supported URI schemes.
 
 COMMIT_ID, FROM_ID, TO_ID, BASE_COMMIT::
-- 
Sebastian Kuzminsky

-- 
Sebastian Kuzminsky

^ permalink raw reply

* Re: do people use the 'git' command?
From: Sebastian Kuzminsky @ 2005-06-11  5:26 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vy89h4m9r.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> wrote:
> >>>>> "SK" == Sebastian Kuzminsky <seb@highlab.com> writes:
> 
> SK> Can we drop the "git" program?
> 
> No chance, especially with a patch that is not accompanied with
> necessary changes to Documentation/tutorial.txt that already
> tells the user to type "git commit" and "git log" ;-).

Of course, you're right.  How about this?  Against Cogito but applies
cleanly to Linus' git:


 b/Documentation/cvs-migration.txt |    4 ++--
 b/Documentation/tutorial.txt      |    6 +++---
 b/Makefile                        |    2 +-
 git                               |    4 ----
 4 files changed, 6 insertions(+), 10 deletions(-)


diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
--- a/Documentation/cvs-migration.txt
+++ b/Documentation/cvs-migration.txt
@@ -63,7 +63,7 @@
 any more familiar with it, but make sure it is in your path. After that,
 the magic command line is
 
-	git cvsimport <cvsroot> <module>
+	git-cvsimport-script <cvsroot> <module>
 
 which will do exactly what you'd think it does: it will create a git
 archive of the named CVS module. The new archive will be created in a
@@ -90,7 +90,7 @@
 
 So, something has gone wrong, and you don't know whom to blame, and
 you're an ex-CVS user and used to do "cvs annotate" to see who caused
-the breakage. You're looking for the "git annotate", and it's just
+the breakage. You're looking for the "git-annotate", and it's just
 claiming not to find such a script. You're annoyed.
 
 Yes, that's right.  Core git doesn't do "annotate", although it's
diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -362,7 +362,7 @@
 for you, and starts up an editor to let you write your commit message
 yourself, so let's just use that:
 
-	git commit
+	git-commit-script
 
 Write whatever message you want, and all the lines that start with '#'
 will be pruned out, and the rest will be used as the commit message for
@@ -417,7 +417,7 @@
 To see the whole history of our pitiful little git-tutorial project, you
 can do
 
-	git log
+	git-log-script
 
 which shows just the log messages, or if we want to see the log together
 with the associated patches use the more complex (and much more
@@ -465,7 +465,7 @@
    history outside of the project you created.
 
  - if you want to move or duplicate a git archive, you can do so. There
-   is no "git clone" command: if you want to create a copy of your
+   is no "git-clone" command: if you want to create a copy of your
    archive (with all the full history that went along with it), you can
    do so with a regular "cp -a git-tutorial new-git-tutorial".
 
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@
 AR?=ar
 INSTALL?=install
 
-SCRIPTS=git git-apply-patch-script git-merge-one-file-script git-prune-script \
+SCRIPTS=git-apply-patch-script git-merge-one-file-script git-prune-script \
 	git-pull-script git-tag-script git-resolve-script git-whatchanged \
 	git-deltafy-script git-fetch-script git-status-script git-commit-script \
 	git-log-script git-shortlog git-cvsimport-script
diff --git a/git b/git
deleted file mode 100755
--- a/git
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-cmd="git-$1-script"
-shift
-exec $cmd "$@"


-- 
Sebastian Kuzminsky

^ permalink raw reply

* Heads up on work in progress - was: [PATCH 2/2] Add support ... [rev 11]
From: Jon Seymour @ 2005-06-11  5:28 UTC (permalink / raw)
  To: git; +Cc: Linus Torvalds, Petr Baudis, Junio C Hamano
In-Reply-To: <20050610092343.3935.qmail@blackcubes.dyndns.org>

Folks,

Thought I'd just give you a heads up that I am presently undertaking a
further substantial re factorisation and generalization of epoch.c.
The changes in this work we be largely limited to epoch.c and
epoch.c-related parts of rev-list.c.

The upcoming changes will not substantially change the existing tools
interfaces, so it would be safe to apply the [rev 11] to the git HEAD
provided there is agreement that the tools interfaces proposed in [rev
11] are acceptable.

However, if you want to perform a detailed review of epoch.c, it might
be better to hold off until my next batch of changes are ready. That
said, if you would like to provide feedback on what I have already
done, please feel welcome to.

In my forthcoming changes I intend to:

1. rename epoch.c to commit-graph.c
2. improve separation of concerns between rev-list.c and commit-graph.c
   * commit-graph.c will understand everything about incremental graph
traversals, including merge order search and "localized" perspectives
   * rev-list.c will be responsible for output limiting [ that is:
stopping the traversal according to user-defined (e.g. parameterised
criteria) ]
3. the epoch_methods structure in [rev11] will be generalized to a
per-traversal "traversal object" (struct graph_traversal) that will
have additional methods such as:
   * visit_edge - called on each edge
   * visit_commit - called on each visit to a commit
   * clean_commit - called to clean any resources allocated during a
call to visit_edge, visit_commit

I'll try to do the right thing and break the changes into a series of
small patches to rev11.

Please forgive me for my previous practice of submitting large changes
- I am quite new to the development-by-patch style of development, and
haven't quite got into the swing of it yet.

jon.

^ permalink raw reply

* patch to remove cg from cogito
From: Sebastian Kuzminsky @ 2005-06-11  5:30 UTC (permalink / raw)
  To: git

Cogito wants to install an executable named "cg", but that's already taken
by cgvg <http://uzix.org/cgvg.html>.  I guess if people dont mind git
conflicting with that other git, probably no one will mind this either...
Just thought I'd put this out there:


 b/Makefile |    2 +-
 cg         |    7 -------
 2 files changed, 1 insertion(+), 8 deletions(-)


diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -61,7 +61,7 @@
 	cg-branch-add cg-branch-ls cg-cancel cg-clone cg-commit cg-diff \
 	cg-export cg-help cg-init cg-log cg-merge cg-mkpatch cg-patch \
 	cg-pull cg-restore cg-rm cg-seek cg-status cg-tag cg-tag-ls cg-update \
-	cg cg-admin-ls
+	cg-admin-ls
 
 LIB_SCRIPT=cg-Xlib cg-Xmergefile cg-Xnormid
 
diff --git a/cg b/cg
deleted file mode 100755
--- a/cg
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-cmd="$1"; shift
-( [ x"$cmd" = x"--help" ] || [ x"$cmd" = x ] ) && exec cg-help
-
-exe="cg-$cmd"
-exec $exe "$@"


-- 
Sebastian Kuzminsky

^ permalink raw reply

* Re: Heads up on work in progress - was: [PATCH 2/2] Add support ... [rev 11]
From: Jon Seymour @ 2005-06-11  5:31 UTC (permalink / raw)
  To: git
In-Reply-To: <2cfc4032050610222853a882b7@mail.gmail.com>

> 2. improve separation of concerns between rev-list.c and commit-graph.c
>    * commit-graph.c will understand everything about incremental graph
> traversals, including merge order search and "localized" perspectives
>    * rev-list.c will be responsible for output limiting [ that is:
> stopping the traversal according to user-defined (e.g. parameterised
> criteria) ]

That'd be - merge order _sort_.

jon.

^ permalink raw reply

* Re: do people use the 'git' command?
From: Jon Seymour @ 2005-06-11  6:34 UTC (permalink / raw)
  To: Sebastian Kuzminsky; +Cc: Junio C Hamano, git
In-Reply-To: <E1DgyW0-0004PE-Ct@highlab.com>

Sebastian,

What is the justification for removing it?

As it stands, git serves a useful function in that it provides a
single point through which access to all git-*-scripts is channeled,
yet still allows each script to be maintained as a separate entity,
coherent entity.

jon.

^ permalink raw reply

* Re: do people use the 'git' command?
From: Jon Seymour @ 2005-06-11  6:36 UTC (permalink / raw)
  To: Sebastian Kuzminsky; +Cc: Git Mailing List
In-Reply-To: <2cfc403205061023346c03a25b@mail.gmail.com>

I meant to say:
> yet still allows each script to be maintained as a separate,
> coherent entity.
> 

...but then I tend towards in the randomly incoherent.

jon.

^ permalink raw reply

* Re: do people use the 'git' command?
From: Jon Seymour @ 2005-06-11  6:36 UTC (permalink / raw)
  To: Sebastian Kuzminsky; +Cc: Git Mailing List
In-Reply-To: <2cfc4032050610233651423b5a@mail.gmail.com>

> 
> ...but then I tend towards in the randomly incoherent.
> 
> jon.
> 
bollocks :-)!

^ permalink raw reply

* Re: do people use the 'git' command?
From: Junio C Hamano @ 2005-06-11  7:02 UTC (permalink / raw)
  To: jon; +Cc: Sebastian Kuzminsky, git
In-Reply-To: <2cfc403205061023346c03a25b@mail.gmail.com>

>>>>> "JS" == Jon Seymour <jon.seymour@gmail.com> writes:

JS> Sebastian,
JS> What is the justification for removing it?

JS> As it stands, git serves a useful function in that it provides a
JS> single point through which access to all git-*-scripts is channeled,
JS> yet still allows each script to be maintained as a separate entity,
JS> coherent entity.

If I understand him correctly, Sebastian's point was that it
channels only to git-*-scripts without channelling to any of the
git-* binaries.

But the real point of "git" wrapper is merely to present CVS and
SVN refugees the structure they are familiar with: a single
command having a set of subcommands.

It is just an "introductory" thing and there is no compelling
reason to expose the low level core GIT commands.  When the
refugees are comfortable with how GIT does things, they will
either use Porcelain and not touch the Plumbing, or they will
learn to use git-* commands themselves.  In the former case, not
having access to core GIT commands through "git" wrapper is not
an issue.  In the latter case, they will learn to type
git-*-script in no time, and at that point "git" wrapper will be
just a short-hand; again not having access to core GIT commands
through "git" wrapper is not an issue either.

Personally I think removal of "git" script is a bad idea.


^ permalink raw reply

* Re: do people use the 'git' command?
From: Russ Allbery @ 2005-06-11  7:20 UTC (permalink / raw)
  To: git
In-Reply-To: <2cfc403205061023346c03a25b@mail.gmail.com>

Jon Seymour <jon.seymour@gmail.com> writes:

> What is the justification for removing it?

The conflict with the existing GIT package is painful for distributions.
Packagers try hard to avoid any file conflicts between packages, since it
means that both packages cannot be used at the same time, and it turns out
in discussion on the Debian mailing lists that people actually do use GIT.

Managing the conflict between two programs that do completely different
things and are named the same thing is really annoying.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

^ permalink raw reply

* Re: do people use the 'git' command?
From: Jon Seymour @ 2005-06-11  7:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Sebastian Kuzminsky, Git Mailing List
In-Reply-To: <7vpsutz88z.fsf@assigned-by-dhcp.cox.net>

On 6/11/05, Junio C Hamano <junkio@cox.net> wrote:
> >>>>> "JS" == Jon Seymour <jon.seymour@gmail.com> writes:
> 
> JS> Sebastian,
> JS> What is the justification for removing it?
> 
> JS> As it stands, git serves a useful function in that it provides a
> JS> single point through which access to all git-*-scripts is channeled,
> JS> yet still allows each script to be maintained as a separate entity,
> JS> coherent entity.
> 
> If I understand him correctly, Sebastian's point was that it
> channels only to git-*-scripts without channelling to any of the
> git-* binaries.
> 

What about generalizing it a little, so that:

     git word

calls:

    git-word-script if it exists and is executable in the path

or, if not,

    git-word if it exists and is executable in the path.

Then:

    git update-cache 

would work as expected.

jon.

^ permalink raw reply

* Re: do people use the 'git' command?
From: Jon Seymour @ 2005-06-11  7:29 UTC (permalink / raw)
  To: Russ Allbery; +Cc: Git Mailing List, Sebastian Kuzminsky
In-Reply-To: <87r7f9xsux.fsf@windlord.stanford.edu>

On 6/11/05, Russ Allbery <rra@stanford.edu> wrote:
> Jon Seymour <jon.seymour@gmail.com> writes:
> 
> > What is the justification for removing it?
> 
> The conflict with the existing GIT package is painful for distributions.
> Packagers try hard to avoid any file conflicts between packages, since it
> means that both packages cannot be used at the same time, and it turns out
> in discussion on the Debian mailing lists that people actually do use GIT.
> 
> Managing the conflict between two programs that do completely different
> things and are named the same thing is really annoying.
> 

Ah, ok...sorry didn't realise there was a naming conflict.

How about renaming:
    "git" to "g.t"
 
And then explaining the idiosyncratic name in git(7).

jon.

^ permalink raw reply

* Re: do people use the 'git' command?
From: Junio C Hamano @ 2005-06-11  7:50 UTC (permalink / raw)
  To: jon; +Cc: Sebastian Kuzminsky, Git Mailing List
In-Reply-To: <2cfc403205061100204cd43334@mail.gmail.com>

>>>>> "JS" == Jon Seymour <jon.seymour@gmail.com> writes:

JS> Then:

JS>     git update-cache 

JS> would work as expected.

I'd rather teach the user to say git-update-cache once they
learned how git works.

Let's stop and think.  Compare lower level binaries and
git-*-script commands, especially paying attention to the level
of operation of what they do.  Notice the difference?

The git-*-script commands are already more or less Porcelain
themselves, and for that reason alone, they deserve to have
CVS/SVN familiarity wrapper.  They are designed to be usable
even by people who are still not familiar with the GIT way of
doing things, and the purpose of the "git" wrapper is to help
these people try putting their toes in the water.  Once they
understand how these scripts work, they either care about
Plumbing because they want to do something existing Porcelain
layers do not offer (in which case they would write their own
Porcelain extensions using Plumbing commands).  Or with luck,
they may not have to worry about Plumbing at all.

I grant you that what the current "git" wrapper offers is not
Porcelain enough, and to perform anything meaningful you either
need to use Porcelain or bare Plumbing commands yourself.  But
when that day comes, "git update-cache" is not something you
would want to have anyway.  You would rather want to have things
like "git add" and "git remove", which are written in terms of
git-update-cache.

See what I am saying?


^ permalink raw reply

* Re: qgit-0.4
From: Marco Costalba @ 2005-06-11  8:01 UTC (permalink / raw)
  To: git; +Cc: berkus

Marco Costalba wrote:

>Here is qgit-0.4, a git GUI viewer
>
>New in this version:
>
>- file history
>
>- command line arguments passed to git-rev-list, eg: qgit v2.6.12-rc6 ^v2.6.12-rc4
>
>- complete rewrite of start-up thread, should be faster now, expecially with warm start
>
>You can download from 
>http://prdownloads.sourceforge.net/qgit/qgit-0.4.tar.gz?download
>
>To try qgit:
>
>1) Unpack downloaded tar file
>2) ./configure
>3) make
>4) cd bin
>5) copy qgit file anywhere in your path
>
>There are also some screenshots:
>http://sourceforge.net/project/screenshots.php?group_id=139897&ssid=13524
>
>Have fun
>Marco
>

thanks to Stanislav Karchebny we have a new scons update, no more

scons: *** No tool named 'qt': No module named qt


here is the link

http://prdownloads.sourceforge.net/qgit/qgit-0.41.tar.gz?download


tested by at least one with the previous mentioned problem, confirmed to disappear.

Marco







		
__________________________________ 
Discover Yahoo! 
Use Yahoo! to plan a weekend, have fun online and more. Check it out! 
http://discover.yahoo.com/

^ permalink raw reply

* Re: [PATCH 3/6] Make showdate use "Linus format"
From: Dan Holmsand @ 2005-06-11  8:28 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git
In-Reply-To: <20050610225938.GE22111@pasky.ji.cz>

Petr Baudis wrote:
> Thanks, applied.
> 
> Dear diary, on Thu, Jun 09, 2005 at 01:19:30PM CEST, I got a letter
> where Dan Holmsand <holmsand@gmail.com> told me that...
> 
>>This makes showdate use the same date format as
>>git-rev-list --pretty, and gives some speedup. It might also
>>be more portable.
> 
> 
> I dropped the format change bit, because I really think the Linus' date
> format is bad. The current standardized, international and most widely
> used (even your mailer agent used it in your Date: header) date format
> is RFC 822, so please let's stick with it. It's perfect for our use, and
> better human-readable too. The date part isn't split all around but
> concentrated in the first half while the second half is dedicated to
> time.

Ok, I really have nothing against RFC822. But if Linus' format is bad, 
then git-rev-list --pretty should be fixed (or, rather, date.c). It 
doesn't make any sense to me to have different formats between cogito 
and core git.

And I'd really, really like to use as much of git-rev-list --pretty 
output as possible in cg-log. That makes the whole thing some orders of 
magnitude faster, and thus more usable.

>>Note that this changes the calling convention: the previous
>>version used seconds from $1, but timezone from the global
>>variable $date. cg-mkpatch is modified to the new way.
> 
> 
> You forgot to modify cg-log accordingly. (I fixed that.)

Thanks. I did the "hope he takes my other patch too" thing... Sorry 
'bout that.

/dan

^ permalink raw reply

* Re: do people use the 'git' command?
From: Jon Seymour @ 2005-06-11  8:48 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Sebastian Kuzminsky, Git Mailing List
In-Reply-To: <7vu0k5xrfz.fsf@assigned-by-dhcp.cox.net>

> I grant you that what the current "git" wrapper offers is not
> Porcelain enough, and to perform anything meaningful you either
> need to use Porcelain or bare Plumbing commands yourself.  But
> when that day comes, "git update-cache" is not something you
> would want to have anyway.  You would rather want to have things
> like "git add" and "git remove", which are written in terms of
> git-update-cache.
> 
> See what I am saying?

Ok, that's fair enough. It is a sound to expose bits of plumbing to
the porcelain in a very slow and deliberate way as the porcelain is
polished, rather than automatically surfacing plumbing as it gets
created by over-enthusiastic plumbers.

My own learning experience has been exactly the other way around to
the intended use of the git script - I have been learning to use the
core git commands, writing my own wrappers where that is convenient
and adopting those of others only when I completely understand what
they are doing - I have been learning it inside out, I guess.

For example, I only recently discovered what git-commit-script does  [
and I like it - btw - nice behaviour ]!

jon.
-- 
homepage: http://www.zeta.org.au/~jon/
blog: http://orwelliantremors.blogspot.com/

^ permalink raw reply


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