git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Bits from git-pb
@ 2005-07-29  8:58 Petr Baudis
  2005-07-29  9:00 ` [PATCH 1/2] Trivial tidyups Petr Baudis
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Petr Baudis @ 2005-07-29  8:58 UTC (permalink / raw)
  To: junkio; +Cc: git

  Hi,

  those two bits were long kept local to git-pb. You can either apply
the patches or pull:

	www.kernel.org/pub/scm/cogito/git-pb.git

The bits are mostly cosmetic but I want to get rid of them. :-)

  I'd like to know what to do with the git-pb branch in the future.
Based on what do you think, I can either:

  (i) Keep the git-pb branch polished and nice-to-merge, if you want to
pull from it.

  (ii) Keep the git-pb branch polished and nice-to-merge and rebase it
regularily if you don't want loong edges in your history graph, but
want to pull from it.

  (ii) Do wild things in the git-pb branch and send you patches.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 1/2] Trivial tidyups
  2005-07-29  8:58 [PATCH 0/2] Bits from git-pb Petr Baudis
@ 2005-07-29  9:00 ` Petr Baudis
  2005-07-29  9:01 ` [PATCH 2/2] Unify usage strings declaration Petr Baudis
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Petr Baudis @ 2005-07-29  9:00 UTC (permalink / raw)
  To: junkio; +Cc: git

Simple whitespace-related tidyups ensuring style consistency.

This is carried over from my old git-pb branch.

Signed-off-by: Petr Baudis <pasky@ucw.cz>

---
commit 83b1762040b111b4736d108cd91b8a9d75aad3a9
tree e07192546e9bd6a972e3945dd941fc7a29ec1a4b
parent d854f783af2a441827d66b4b70e9d0d9e3434b15
author Petr Baudis <pasky@suse.cz> Sat, 23 Jul 2005 00:21:48 +0200
committer Petr Baudis <xpasky@machine.sinus.cz> Sat, 23 Jul 2005 00:21:48 +0200

 Documentation/git-write-tree.txt |    3 +--
 git-merge-one-file-script        |    7 +++----
 write-tree.c                     |    4 ++--
 3 files changed, 6 insertions(+), 8 deletions(-)

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
@@ -9,8 +9,7 @@ git-write-tree - Creates a tree from the
 
 SYNOPSIS
 --------
-'git-write-tree'
-		[--missing-ok]
+'git-write-tree' [--missing-ok]
 
 DESCRIPTION
 -----------
diff --git a/git-merge-one-file-script b/git-merge-one-file-script
--- a/git-merge-one-file-script
+++ b/git-merge-one-file-script
@@ -22,11 +22,10 @@ case "${1:-.}${2:-.}${3:-.}" in
 #
 "$1.." | "$1.$1" | "$1$1.")
 	echo "Removing $4"
-	if test -f "$4"
-	then
+	if test -f "$4"; then
 		rm -f -- "$4"
 	fi &&
-	exec git-update-cache --remove -- "$4"
+		exec git-update-cache --remove -- "$4"
 	;;
 
 #
@@ -62,7 +61,7 @@ case "${1:-.}${2:-.}${3:-.}" in
 
 	# We reset the index to the first branch, making
 	# git-diff-file useful
-	git-update-cache --add --cacheinfo "$6" "$2" "$4" 
+	git-update-cache --add --cacheinfo "$6" "$2" "$4"
 		git-checkout-cache -u -f -- "$4" &&
 		merge "$4" "$orig" "$src2"
 	ret=$?
diff --git a/write-tree.c b/write-tree.c
--- a/write-tree.c
+++ b/write-tree.c
@@ -89,14 +89,14 @@ int main(int argc, char **argv)
 	int entries = read_cache();
 	unsigned char sha1[20];
 	
-	if (argc==2) {
+	if (argc == 2) {
 		if (!strcmp(argv[1], "--missing-ok"))
 			missing_ok = 1;
 		else
 			die("unknown option %s", argv[1]);
 	}
 	
-	if (argc>2)
+	if (argc > 2)
 		die("too many options");
 
 	if (entries < 0)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 2/2] Unify usage strings declaration
  2005-07-29  8:58 [PATCH 0/2] Bits from git-pb Petr Baudis
  2005-07-29  9:00 ` [PATCH 1/2] Trivial tidyups Petr Baudis
@ 2005-07-29  9:01 ` Petr Baudis
  2005-07-30  2:11   ` Junio C Hamano
  2005-07-29 12:53 ` [PATCH 3/2] git-merge-cache -q doesn't complain about failing merge program Petr Baudis
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Petr Baudis @ 2005-07-29  9:01 UTC (permalink / raw)
  To: junkio; +Cc: git

All usage strings are now declared as static const char [].

This is carried over from my old git-pb branch.

Signed-off-by: Petr Baudis <pasky@ucw.cz>

---
commit 1e02de8f49a8fca696b3cb363545fad3c98fd662
tree feee1ccdea90d33fae2bf41621a876c5aa2ecfe5
parent 83b1762040b111b4736d108cd91b8a9d75aad3a9
author Petr Baudis <pasky@suse.cz> Sat, 23 Jul 2005 00:30:06 +0200
committer Petr Baudis <xpasky@machine.sinus.cz> Sat, 23 Jul 2005 00:30:06 +0200

 checkout-cache.c |    2 +-
 commit-tree.c    |    2 +-
 diff-cache.c     |    2 +-
 diff-files.c     |    2 +-
 diff-helper.c    |    2 +-
 diff-stages.c    |    2 +-
 diff-tree.c      |    2 +-
 hash-object.c    |    2 +-
 local-pull.c     |    2 +-
 ls-files.c       |    2 +-
 ls-tree.c        |    2 +-
 read-tree.c      |    2 +-
 ssh-push.c       |    2 +-
 tar-tree.c       |    2 +-
 test-delta.c     |    2 +-
 var.c            |    2 +-
 verify-pack.c    |    2 +-
 17 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/checkout-cache.c b/checkout-cache.c
--- a/checkout-cache.c
+++ b/checkout-cache.c
@@ -75,7 +75,7 @@ static int checkout_all(void)
 	return 0;
 }
 
-static const char *checkout_cache_usage =
+static const char checkout_cache_usage[] =
 "git-checkout-cache [-u] [-q] [-a] [-f] [-n] [--prefix=<string>] [--] <file>...";
 
 int main(int argc, char **argv)
diff --git a/commit-tree.c b/commit-tree.c
--- a/commit-tree.c
+++ b/commit-tree.c
@@ -64,7 +64,7 @@ static void check_valid(unsigned char *s
 #define MAXPARENT (16)
 static unsigned char parent_sha1[MAXPARENT][20];
 
-static char *commit_tree_usage = "git-commit-tree <sha1> [-p <sha1>]* < changelog";
+static const char commit_tree_usage[] = "git-commit-tree <sha1> [-p <sha1>]* < changelog";
 
 static int new_parent(int idx)
 {
diff --git a/diff-cache.c b/diff-cache.c
--- a/diff-cache.c
+++ b/diff-cache.c
@@ -163,7 +163,7 @@ static void mark_merge_entries(void)
 	}
 }
 
-static char *diff_cache_usage =
+static const char diff_cache_usage[] =
 "git-diff-cache [-m] [--cached] "
 "[<common diff options>] <tree-ish> [<path>...]"
 COMMON_DIFF_OPTIONS_HELP;
diff --git a/diff-files.c b/diff-files.c
--- a/diff-files.c
+++ b/diff-files.c
@@ -6,7 +6,7 @@
 #include "cache.h"
 #include "diff.h"
 
-static const char *diff_files_usage =
+static const char diff_files_usage[] =
 "git-diff-files [-q] "
 "[<common diff options>] [<path>...]"
 COMMON_DIFF_OPTIONS_HELP;
diff --git a/diff-helper.c b/diff-helper.c
--- a/diff-helper.c
+++ b/diff-helper.c
@@ -20,7 +20,7 @@ static void flush_them(int ac, const cha
 	diff_flush(DIFF_FORMAT_PATCH, '\n');
 }
 
-static const char *diff_helper_usage =
+static const char diff_helper_usage[] =
 "git-diff-helper [-z] [-O<orderfile>] [-S<string>] [--pickaxe-all] [<path>...]";
 
 int main(int ac, const char **av) {
diff --git a/diff-stages.c b/diff-stages.c
--- a/diff-stages.c
+++ b/diff-stages.c
@@ -17,7 +17,7 @@ static int diff_break_opt = -1;
 static const char *orderfile = NULL;
 static const char *diff_filter = NULL;
 
-static char *diff_stages_usage =
+static const char diff_stages_usage[] =
 "git-diff-stages [<common diff options>] <stage1> <stage2> [<path>...]"
 COMMON_DIFF_OPTIONS_HELP;
 
diff --git a/diff-tree.c b/diff-tree.c
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -395,7 +395,7 @@ static int diff_tree_stdin(char *line)
 	return diff_tree_commit(commit, line);
 }
 
-static char *diff_tree_usage =
+static const char diff_tree_usage[] =
 "git-diff-tree [--stdin] [-m] [-s] [-v] [--pretty] [-t] "
 "[<common diff options>] <tree-ish> <tree-ish>"
 COMMON_DIFF_OPTIONS_HELP;
diff --git a/hash-object.c b/hash-object.c
--- a/hash-object.c
+++ b/hash-object.c
@@ -21,7 +21,7 @@ static void hash_object(const char *path
 	printf("%s\n", sha1_to_hex(sha1));
 }
 
-static const char *hash_object_usage =
+static const char hash_object_usage[] =
 "git-hash-object [-t <type>] [-w] <file>...";
 
 int main(int argc, char **argv)
diff --git a/local-pull.c b/local-pull.c
--- a/local-pull.c
+++ b/local-pull.c
@@ -101,7 +101,7 @@ int fetch_ref(char *ref, unsigned char *
 	return 0;
 }
 
-static const char *local_pull_usage = 
+static const char local_pull_usage[] =
 "git-local-pull [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] [-l] [-s] [-n] commit-id path";
 
 /* 
diff --git a/ls-files.c b/ls-files.c
--- a/ls-files.c
+++ b/ls-files.c
@@ -285,7 +285,7 @@ static void show_files(void)
 	}
 }
 
-static const char *ls_files_usage =
+static const char ls_files_usage[] =
 	"git-ls-files [-z] [-t] (--[cached|deleted|others|stage|unmerged|killed])* "
 	"[ --ignored [--exclude=<pattern>] [--exclude-from=<file>) ]";
 
diff --git a/ls-tree.c b/ls-tree.c
--- a/ls-tree.c
+++ b/ls-tree.c
@@ -208,7 +208,7 @@ static int list(char **path)
 	return err;
 }
 
-static const char *ls_tree_usage =
+static const char ls_tree_usage[] =
 	"git-ls-tree [-d] [-r] [-z] <tree-ish> [path...]";
 
 int main(int argc, char **argv)
diff --git a/read-tree.c b/read-tree.c
--- a/read-tree.c
+++ b/read-tree.c
@@ -510,7 +510,7 @@ static int read_cache_unmerged(void)
 	return deleted;
 }
 
-static char *read_tree_usage = "git-read-tree (<sha> | -m [-u] <sha1> [<sha2> [<sha3>]])";
+static const char read_tree_usage[] = "git-read-tree (<sha> | -m [-u] <sha1> [<sha2> [<sha3>]])";
 
 static struct cache_file cache_file;
 
diff --git a/ssh-push.c b/ssh-push.c
--- a/ssh-push.c
+++ b/ssh-push.c
@@ -96,7 +96,7 @@ static void service(int fd_in, int fd_ou
 	} while (1);
 }
 
-static const char *ssh_push_usage =
+static const char ssh_push_usage[] =
 	"git-ssh-push [-c] [-t] [-a] [-w ref] commit-id url";
 
 int main(int argc, char **argv)
diff --git a/tar-tree.c b/tar-tree.c
--- a/tar-tree.c
+++ b/tar-tree.c
@@ -17,7 +17,7 @@
 #define EXT_HEADER_PATH		1
 #define EXT_HEADER_LINKPATH	2
 
-static const char *tar_tree_usage = "git-tar-tree <key> [basedir]";
+static const char tar_tree_usage[] = "git-tar-tree <key> [basedir]";
 
 static char block[BLOCKSIZE];
 static unsigned long offset;
diff --git a/test-delta.c b/test-delta.c
--- a/test-delta.c
+++ b/test-delta.c
@@ -17,7 +17,7 @@
 #include <sys/mman.h>
 #include "delta.h"
 
-static const char *usage =
+static const char usage[] =
 	"test-delta (-d|-p) <from_file> <data_file> <out_file>";
 
 int main(int argc, char *argv[])
diff --git a/var.c b/var.c
--- a/var.c
+++ b/var.c
@@ -8,7 +8,7 @@
 #include <errno.h>
 #include <string.h>
 
-static char *var_usage = "git-var [-l | <variable>]";
+static const char var_usage[] = "git-var [-l | <variable>]";
 
 struct git_var {
 	const char *name;
diff --git a/verify-pack.c b/verify-pack.c
--- a/verify-pack.c
+++ b/verify-pack.c
@@ -27,7 +27,7 @@ static int verify_one_pack(char *arg, in
 	return verify_pack(g, verbose);
 }
 
-static const char *verify_pack_usage = "git-verify-pack [-v] <pack>...";
+static const char verify_pack_usage[] = "git-verify-pack [-v] <pack>...";
 
 int main(int ac, char **av)
 {

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3/2] git-merge-cache -q doesn't complain about failing merge program
  2005-07-29  8:58 [PATCH 0/2] Bits from git-pb Petr Baudis
  2005-07-29  9:00 ` [PATCH 1/2] Trivial tidyups Petr Baudis
  2005-07-29  9:01 ` [PATCH 2/2] Unify usage strings declaration Petr Baudis
@ 2005-07-29 12:53 ` Petr Baudis
  2005-07-30  2:11   ` Junio C Hamano
  2005-07-29 15:48 ` [PATCH 4/2] Improve the compilation-time settings interface Petr Baudis
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Petr Baudis @ 2005-07-29 12:53 UTC (permalink / raw)
  To: junkio; +Cc: git

git-merge-cache reporting failed merge program is undesirable for
Cogito, since it emits its own more appropriate error message in that
case. However, I want to show other possible git-merge-cache error
messages. So -q will just silence this particular error.

Signed-off-by: Petr Baudis <pasky@ucw.cz>

---

There's more of patches to come. All those which are overflowing this
series are in the git-pb branch as well and you'd get them by pulling
it.

commit 8ddefe85adc8e035864be615c87844ef982f4bc6
tree d5e6c49f93d2e4138ad63faa7fcfb893f4843c88
parent 527a155a0400df1af2e1da64fc02f2dd003413a8
author Petr Baudis <pasky@suse.cz> Fri, 29 Jul 2005 14:52:53 +0200
committer Petr Baudis <xpasky@machine.sinus.cz> Fri, 29 Jul 2005 14:52:53 +0200

 Documentation/git-merge-cache.txt |    9 +++++++--
 merge-cache.c                     |   23 +++++++++++++++--------
 2 files changed, 22 insertions(+), 10 deletions(-)

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
@@ -9,7 +9,7 @@ git-merge-cache - Runs a merge for files
 
 SYNOPSIS
 --------
-'git-merge-cache' [-o] <merge-program> (-a | -- | <file>\*) 
+'git-merge-cache' [-o] [-q] <merge-program> (-a | -- | <file>\*) 
 
 DESCRIPTION
 -----------
@@ -32,6 +32,11 @@ OPTIONS
 	returned errors, and only return the error code after all the
 	merges are over.
 
+-q::
+	Do not complain about failed merge program (the merge program
+	failure usually indicates conflicts during merge). This is for
+	porcelains which might want to emit custom messages.
+
 If "git-merge-cache" is called with multiple <file>s (or -a) then it
 processes them in turn only stopping if merge returns a non-zero exit
 code.
@@ -40,7 +45,7 @@ Typically this is run with the a script 
 the RCS package.
 
 A sample script called "git-merge-one-file-script" is included in the
-ditribution.
+distribution.
 
 ALERT ALERT ALERT! The git "merge object order" is different from the
 RCS "merge" program merge object order. In the above ordering, the
diff --git a/merge-cache.c b/merge-cache.c
--- a/merge-cache.c
+++ b/merge-cache.c
@@ -5,7 +5,7 @@
 
 static const char *pgm = NULL;
 static const char *arguments[8];
-static int one_shot;
+static int one_shot, quiet;
 static int err;
 
 static void run_program(void)
@@ -27,10 +27,13 @@ static void run_program(void)
 		die("unable to execute '%s'", pgm);
 	}
 	if (waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) || WEXITSTATUS(status)) {
-		if (one_shot)
+		if (one_shot) {
 			err++;
-		else
-			die("merge program failed");
+		} else {
+			if (quiet)
+				die("merge program failed");
+			exit(1);
+		}
 	}
 }
 
@@ -97,15 +100,19 @@ int main(int argc, char **argv)
 	int i, force_file = 0;
 
 	if (argc < 3)
-		usage("git-merge-cache [-o] <merge-program> (-a | <filename>*)");
+		usage("git-merge-cache [-o] [-q] <merge-program> (-a | <filename>*)");
 
 	read_cache();
 
 	i = 1;
-	if (!strcmp(argv[1], "-o")) {
+	if (!strcmp(argv[i], "-o")) {
 		one_shot = 1;
 		i++;
 	}
+	if (!strcmp(argv[i], "-q")) {
+		quiet = 1;
+		i++;
+	}
 	pgm = argv[i++];
 	for (; i < argc; i++) {
 		char *arg = argv[i];
@@ -122,7 +129,7 @@ int main(int argc, char **argv)
 		}
 		merge_file(arg);
 	}
-	if (err)
+	if (err && quiet)
 		die("merge program failed");
-	return 0;
+	return err;
 }

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 4/2] Improve the compilation-time settings interface
  2005-07-29  8:58 [PATCH 0/2] Bits from git-pb Petr Baudis
                   ` (2 preceding siblings ...)
  2005-07-29 12:53 ` [PATCH 3/2] git-merge-cache -q doesn't complain about failing merge program Petr Baudis
@ 2005-07-29 15:48 ` Petr Baudis
  2005-07-29 18:23   ` Petr Baudis
  2005-07-29 15:48 ` [PATCH 5/2] Remove the explicit Makefile dependencies description Petr Baudis
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Petr Baudis @ 2005-07-29 15:48 UTC (permalink / raw)
  To: junkio; +Cc: git

Describe variables which make itself takes and adjusts compilation
accordingly (MOZILLA_SHA1, NO_OPENSSL, PPC_SHA1), and make adding
defines more convenient through the $DEFINES variable. $COPTS includes
-g as well now and is not overriden if it was already declared in the
environment. Also, $CFLAGS is appended to rather than reset, so that if
there was already a $CFLAGS environment variable, it's appended to. Some
more variables are also made overridable through the environment. Renamed
$bin to $bindir which is the name commonly used for this.

This is part of the Cogito Makefile changes port.

Signed-off-by: Petr Baudis <pasky@ucw.cz>

---
commit 601722751e42dfef8bcd2fe3d6b070b07eb9198e
tree ebe576c5bd841b4daeb855e49635491c02a322b5
parent 8ddefe85adc8e035864be615c87844ef982f4bc6
author Petr Baudis <pasky@suse.cz> Fri, 29 Jul 2005 15:45:42 +0200
committer Petr Baudis <xpasky@machine.sinus.cz> Fri, 29 Jul 2005 15:45:42 +0200

 Makefile |   56 ++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1,33 +1,53 @@
-# -DCOLLISION_CHECK if you believe that SHA1's
-# 1461501637330902918203684832716283019655932542976 hashes do not give you
-# enough guarantees about no collisions between objects ever hapenning.
+# Define MOZILLA_SHA1 environment variable when running make to make use of
+# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
+# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
+# choice) has very fast version optimized for i586.
 #
-# -DUSE_NSEC if you want git to care about sub-second file mtimes and ctimes.
-# -DUSE_STDEV if you want git to care about st_dev changing
+# Define NO_OPENSSL environment variable if you do not have OpenSSL. You will
+# miss out git-rev-list --merge-order. This also implies MOZILLA_SHA1.
 #
-# Note that you need some new glibc (at least >2.2.4) for this, and it will
-# BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely randomly
-# break unless your underlying filesystem supports those sub-second times
-# (my ext3 doesn't).
+# Define PPC_SHA1 environment variable when running make to make use of
+# a bundled SHA1 routine optimized for PowerPC.
+
+
+# Define COLLISION_CHECK below if you believe that SHA1's
+# 1461501637330902918203684832716283019655932542976 hashes do not give you
+# sufficient guarantee that no collisions between objects will ever happen.
+
+# DEFINES += -DCOLLISION_CHECK
+
+# Define USE_NSEC below if you want git to care about sub-second file mtimes
+# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
+# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
+# randomly break unless your underlying filesystem supports those sub-second
+# times (my ext3 doesn't).
+
+# DEFINES += -DUSE_NSEC
+
+# Define USE_STDEV below if you want git to care about the underlying device
+# change being considered an inode change from the update-cache perspective.
+
+# DEFINES += -DUSE_STDEV
+
 GIT_VERSION=0.99.2
 
-COPTS=-O2
-CFLAGS=-g $(COPTS) -Wall
+COPTS?=-g -O2
+CFLAGS+=$(COPTS) -Wall $(DEFINES)
 
 prefix=$(HOME)
-bin=$(prefix)/bin
+bindir=$(prefix)/bin
 # dest=
 
-CC=gcc
-AR=ar
-INSTALL=install
-RPMBUILD=rpmbuild
+CC?=gcc
+AR?=ar
+INSTALL?=install
+RPMBUILD?=rpmbuild
 
 #
 # sparse is architecture-neutral, which means that we need to tell it
 # explicitly what architecture to check for. Fix this up for yours..
 #
-SPARSE_FLAGS=-D__BIG_ENDIAN__ -D__powerpc__
+SPARSE_FLAGS?=-D__BIG_ENDIAN__ -D__powerpc__
 
 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 \
@@ -57,7 +77,7 @@ PROG=   git-update-cache git-diff-files 
 all: $(PROG)
 
 install: $(PROG) $(SCRIPTS)
-	$(INSTALL) -m755 -d $(dest)$(bin)
+	$(INSTALL) -m755 -d $(dest)$(bindir)
 	$(INSTALL) $(PROG) $(SCRIPTS) $(dest)$(bin)
 
 LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 5/2] Remove the explicit Makefile dependencies description
  2005-07-29  8:58 [PATCH 0/2] Bits from git-pb Petr Baudis
                   ` (3 preceding siblings ...)
  2005-07-29 15:48 ` [PATCH 4/2] Improve the compilation-time settings interface Petr Baudis
@ 2005-07-29 15:48 ` Petr Baudis
  2005-07-29 15:50 ` [PATCH 6/2] Reorder Makefile rules Petr Baudis
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Petr Baudis @ 2005-07-29 15:48 UTC (permalink / raw)
  To: junkio; +Cc: git

Remove about one gazillion of explicit dependency rules with few lines
describing the general dependency pattern and then the exceptions. This
noticably shortens the Makefile and makes it easier to touch it.

This is part of the Cogito Makefile changes port.

Signed-off-by: Petr Baudis <pasky@ucw.cz>

---
commit ee84cc0f730f0e744fe8d922b24f6f7ebe31d737
tree 0b3edc11a0eba131788e42768b56ba6ceba32b96
parent 601722751e42dfef8bcd2fe3d6b070b07eb9198e
author Petr Baudis <pasky@suse.cz> Fri, 29 Jul 2005 15:46:40 +0200
committer Petr Baudis <xpasky@machine.sinus.cz> Fri, 29 Jul 2005 15:46:40 +0200

 Makefile |   74 +++++++-------------------------------------------------------
 1 files changed, 8 insertions(+), 66 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -97,8 +97,9 @@ LIB_H += quote.h
 LIB_OBJS += quote.o 
 
 LIB_H += diff.h count-delta.h
-LIB_OBJS += diff.o diffcore-rename.o diffcore-pickaxe.o diffcore-pathspec.o \
-	count-delta.o diffcore-break.o diffcore-order.o
+DIFF_OBJS = diff.o diffcore-rename.o diffcore-pickaxe.o diffcore-pathspec.o \
+	diffcore-break.o diffcore-order.o
+LIB_OBJS += $(DIFF_OBJS) count-delta.o
 
 LIB_OBJS += gitenv.o
 LIB_OBJS += server-info.o
@@ -136,75 +137,16 @@ test-delta: test-delta.c diff-delta.o pa
 git-%: %.c $(LIB_FILE)
 	$(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
 
-git-update-cache: update-cache.c
-git-diff-files: diff-files.c
-git-init-db: init-db.c
-git-write-tree: write-tree.c
-git-read-tree: read-tree.c
-git-commit-tree: commit-tree.c
-git-cat-file: cat-file.c
-git-fsck-cache: fsck-cache.c
-git-checkout-cache: checkout-cache.c
-git-diff-tree: diff-tree.c
-git-rev-tree: rev-tree.c
-git-ls-files: ls-files.c
-git-check-files: check-files.c
-git-ls-tree: ls-tree.c
-git-merge-base: merge-base.c
-git-merge-cache: merge-cache.c
-git-unpack-file: unpack-file.c
-git-export: export.c
-git-diff-cache: diff-cache.c
-git-convert-cache: convert-cache.c
-git-http-pull: http-pull.c pull.c
-git-local-pull: local-pull.c pull.c
-git-ssh-push: rsh.c
+git-http-pull: pull.c
+git-local-pull: pull.c
 git-ssh-pull: rsh.c pull.c
-git-rev-list: rev-list.c
-git-mktag: mktag.c
-git-diff-helper: diff-helper.c
-git-tar-tree: tar-tree.c
-git-hash-object: hash-object.c
-git-stripspace: stripspace.c
-git-diff-stages: diff-stages.c
-git-rev-parse: rev-parse.c
-git-patch-id: patch-id.c
-git-pack-objects: pack-objects.c
-git-unpack-objects: unpack-objects.c
-git-verify-pack: verify-pack.c
-git-receive-pack: receive-pack.c
-git-send-pack: send-pack.c
-git-prune-packed: prune-packed.c
-git-fetch-pack: fetch-pack.c
-git-var: var.c
-git-peek-remote: peek-remote.c
-git-update-server-info: update-server-info.c
-git-build-rev-cache: build-rev-cache.c
-git-show-rev-cache: show-rev-cache.c
+git-ssh-push: rsh.c
 
 git-http-pull: LIBS += -lcurl
 git-rev-list: LIBS += -lssl
 
-# Library objects..
-blob.o: $(LIB_H)
-tree.o: $(LIB_H)
-commit.o: $(LIB_H)
-tag.o: $(LIB_H)
-object.o: $(LIB_H)
-read-cache.o: $(LIB_H)
-sha1_file.o: $(LIB_H)
-usage.o: $(LIB_H)
-rev-cache.o: $(LIB_H)
-strbuf.o: $(LIB_H)
-gitenv.o: $(LIB_H)
-entry.o: $(LIB_H)
-diff.o: $(LIB_H) diffcore.h
-diffcore-rename.o : $(LIB_H) diffcore.h
-diffcore-pathspec.o : $(LIB_H) diffcore.h
-diffcore-pickaxe.o : $(LIB_H) diffcore.h
-diffcore-break.o : $(LIB_H) diffcore.h
-diffcore-order.o : $(LIB_H) diffcore.h
-epoch.o: $(LIB_H)
+$(LIB_OBJS): $(LIB_H)
+$(DIFF_OBJS): diffcore.h
 
 git-core.spec: git-core.spec.in Makefile
 	sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 6/2] Reorder Makefile rules
  2005-07-29  8:58 [PATCH 0/2] Bits from git-pb Petr Baudis
                   ` (4 preceding siblings ...)
  2005-07-29 15:48 ` [PATCH 5/2] Remove the explicit Makefile dependencies description Petr Baudis
@ 2005-07-29 15:50 ` Petr Baudis
  2005-07-29 15:50 ` [PATCH 7/2] Support for NO_OPENSSL Petr Baudis
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Petr Baudis @ 2005-07-29 15:50 UTC (permalink / raw)
  To: junkio; +Cc: git

The Makefile rules were massively reordered so that they are actually
logically grouped now. Captions were added to separate the sections. No
rule contents was touched during the process.

Signed-off-by: Petr Baudis <pasky@ucw.cz>

---
commit 656a66fe63898954dbc40854dd049dc76eb9b841
tree a5b29a2163c1bbd671a1dc40d0cb6dade3c4aaee
parent ee84cc0f730f0e744fe8d922b24f6f7ebe31d737
author Petr Baudis <pasky@suse.cz> Fri, 29 Jul 2005 17:02:14 +0200
committer Petr Baudis <xpasky@machine.sinus.cz> Fri, 29 Jul 2005 17:02:14 +0200

 Makefile |   87 +++++++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 57 insertions(+), 30 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -43,12 +43,16 @@ AR?=ar
 INSTALL?=install
 RPMBUILD?=rpmbuild
 
-#
 # sparse is architecture-neutral, which means that we need to tell it
 # explicitly what architecture to check for. Fix this up for yours..
-#
 SPARSE_FLAGS?=-D__BIG_ENDIAN__ -D__powerpc__
 
+
+
+### --- END CONFIGURATION SECTION ---
+
+
+
 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-fetch-script git-status-script git-commit-script \
@@ -74,18 +78,12 @@ PROG=   git-update-cache git-diff-files 
 	git-show-index git-daemon git-var git-peek-remote \
 	git-update-server-info git-show-rev-cache git-build-rev-cache
 
-all: $(PROG)
-
-install: $(PROG) $(SCRIPTS)
-	$(INSTALL) -m755 -d $(dest)$(bindir)
-	$(INSTALL) $(PROG) $(SCRIPTS) $(dest)$(bin)
-
-LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
-	 tag.o date.o index.o diff-delta.o patch-delta.o entry.o path.o \
-	 epoch.o refs.o csum-file.o pack-check.o pkt-line.o connect.o ident.o
 LIB_FILE=libgit.a
 LIB_H=cache.h object.h blob.h tree.h commit.h tag.h delta.h epoch.h csum-file.h \
 	pack.h pkt-line.h refs.h
+LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
+	 tag.o date.o index.o diff-delta.o patch-delta.o entry.o path.o \
+	 epoch.o refs.o csum-file.o pack-check.o pkt-line.o connect.o ident.o
 
 LIB_H += rev-cache.h
 LIB_OBJS += rev-cache.o
@@ -122,17 +120,12 @@ endif
 
 CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
 
-$(LIB_FILE): $(LIB_OBJS)
-	$(AR) rcs $@ $(LIB_OBJS)
 
-check:
-	for i in *.c; do sparse $(CFLAGS) $(SPARSE_FLAGS) $$i; done
 
-test-date: test-date.c date.o
-	$(CC) $(CFLAGS) -o $@ test-date.c date.o
+### Build rules
+
+all: $(PROG)
 
-test-delta: test-delta.c diff-delta.o patch-delta.o
-	$(CC) $(CFLAGS) -o $@ $^
 
 git-%: %.c $(LIB_FILE)
 	$(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
@@ -148,6 +141,47 @@ git-rev-list: LIBS += -lssl
 $(LIB_OBJS): $(LIB_H)
 $(DIFF_OBJS): diffcore.h
 
+$(LIB_FILE): $(LIB_OBJS)
+	$(AR) rcs $@ $(LIB_OBJS)
+
+doc:
+	$(MAKE) -C Documentation all
+
+
+
+### Testing rules
+
+test: all
+	$(MAKE) -C t/ all
+
+test-date: test-date.c date.o
+	$(CC) $(CFLAGS) -o $@ test-date.c date.o
+
+test-delta: test-delta.c diff-delta.o patch-delta.o
+	$(CC) $(CFLAGS) -o $@ $^
+
+check:
+	for i in *.c; do sparse $(CFLAGS) $(SPARSE_FLAGS) $$i; done
+
+
+
+### Installation rules
+
+install: $(PROG) $(SCRIPTS)
+	$(INSTALL) -m755 -d $(dest)$(bindir)
+	$(INSTALL) $(PROG) $(SCRIPTS) $(dest)$(bin)
+
+install-tools:
+	$(MAKE) -C tools install
+
+install-doc:
+	$(MAKE) -C Documentation install
+
+
+
+
+### Maintainer's dist rules
+
 git-core.spec: git-core.spec.in Makefile
 	sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@
 
@@ -163,23 +197,16 @@ dist: git-core.spec git-tar-tree
 rpm: dist
 	$(RPMBUILD) -ta git-core-$(GIT_VERSION).tar.gz
 
-test: all
-	$(MAKE) -C t/ all
 
-doc:
-	$(MAKE) -C Documentation all
+backup: clean
+	cd .. ; tar czvf dircache.tar.gz dir-cache
 
-install-tools:
-	$(MAKE) -C tools install
 
-install-doc:
-	$(MAKE) -C Documentation install
+
+### Cleaning rules
 
 clean:
 	rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)
 	rm -f git-core-*.tar.gz git-core.spec
 	$(MAKE) -C tools/ clean
 	$(MAKE) -C Documentation/ clean
-
-backup: clean
-	cd .. ; tar czvf dircache.tar.gz dir-cache

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 7/2] Support for NO_OPENSSL
  2005-07-29  8:58 [PATCH 0/2] Bits from git-pb Petr Baudis
                   ` (5 preceding siblings ...)
  2005-07-29 15:50 ` [PATCH 6/2] Reorder Makefile rules Petr Baudis
@ 2005-07-29 15:50 ` Petr Baudis
  2005-07-30  3:39   ` Linus Torvalds
  2005-07-29 17:21 ` [PATCH 8/2] Build commands through object files Petr Baudis
  2005-07-30 10:31 ` [PATCH 0/2] Bits from git-pb Petr Baudis
  8 siblings, 1 reply; 21+ messages in thread
From: Petr Baudis @ 2005-07-29 15:50 UTC (permalink / raw)
  To: junkio; +Cc: git

Support for completely OpenSSL-less builds. FSF considers distributing GPL
binaries with OpenSSL linked in as a legal problem so this is trouble
e.g. for Debian, or some people might not want to install OpenSSL
anyway. If you

	make NO_OPENSSL=1

you get completely OpenSSL-less build, disabling --merge-order and using
Mozilla's SHA1 implementation.

Ported from Cogito.

Signed-off-by: Petr Baudis <pasky@ucw.cz>

---
commit cd2182ac0e0635faeca6467b68decf8ab9625f4c
tree d0c704c203d2319a77cd8fd9ee8fda8adc2d27b4
parent 656a66fe63898954dbc40854dd049dc76eb9b841
author Petr Baudis <pasky@suse.cz> Fri, 29 Jul 2005 17:42:32 +0200
committer Petr Baudis <xpasky@machine.sinus.cz> Fri, 29 Jul 2005 17:42:32 +0200

 Makefile   |    8 +++++++-
 rev-list.c |    6 +++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -83,7 +83,7 @@ LIB_H=cache.h object.h blob.h tree.h com
 	pack.h pkt-line.h refs.h
 LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
 	 tag.o date.o index.o diff-delta.o patch-delta.o entry.o path.o \
-	 epoch.o refs.o csum-file.o pack-check.o pkt-line.o connect.o ident.o
+	 refs.o csum-file.o pack-check.o pkt-line.o connect.o ident.o
 
 LIB_H += rev-cache.h
 LIB_OBJS += rev-cache.o
@@ -105,6 +105,12 @@ LIB_OBJS += server-info.o
 LIBS = $(LIB_FILE)
 LIBS += -lz
 
+ifndef NO_OPENSSL
+	LIB_OBJS += epoch.o
+else
+	CFLAGS += '-DNO_OPENSSL'
+	MOZILLA_SHA1=1
+endif
 ifdef MOZILLA_SHA1
   SHA1_HEADER="mozilla-sha1/sha1.h"
   LIB_OBJS += mozilla-sha1/sha1.o
diff --git a/rev-list.c b/rev-list.c
--- a/rev-list.c
+++ b/rev-list.c
@@ -537,9 +537,13 @@ int main(int argc, char **argv)
 			sort_in_topological_order(&list);
 		show_commit_list(list);
 	} else {
+#ifndef NO_OPENSSL
 		if (sort_list_in_merge_order(list, &process_commit)) {
-			  die("merge order sort failed\n");
+			die("merge order sort failed\n");
 		}
+#else
+		die("merge order sort unsupported, OpenSSL not linked");
+#endif
 	}
 
 	return 0;

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 8/2] Build commands through object files
  2005-07-29  8:58 [PATCH 0/2] Bits from git-pb Petr Baudis
                   ` (6 preceding siblings ...)
  2005-07-29 15:50 ` [PATCH 7/2] Support for NO_OPENSSL Petr Baudis
@ 2005-07-29 17:21 ` Petr Baudis
  2005-07-30 10:31 ` [PATCH 0/2] Bits from git-pb Petr Baudis
  8 siblings, 0 replies; 21+ messages in thread
From: Petr Baudis @ 2005-07-29 17:21 UTC (permalink / raw)
  To: junkio; +Cc: git

Separate the process of building the commands to compilation and
linkage. This makes it more consistent with the library objects, is the
traditional thing to do, and significantly speeds up the subsequent
rebuilds, especially for us the people who develop git on 300MHz
notebooks.

Ported from Cogito.

Signed-off-by: Petr Baudis <pasky@ucw.cz>

---
commit 02074521a74483bec941ceacea35f92b485ebd48
tree b08deb01bab982b846b5757943571d0c39b9ba76
parent cd2182ac0e0635faeca6467b68decf8ab9625f4c
author Petr Baudis <pasky@suse.cz> Fri, 29 Jul 2005 19:20:28 +0200
committer Petr Baudis <xpasky@machine.sinus.cz> Fri, 29 Jul 2005 19:20:28 +0200

 Makefile |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -133,13 +133,14 @@ CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
 all: $(PROG)
 
 
-git-%: %.c $(LIB_FILE)
-	$(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
-
-git-http-pull: pull.c
-git-local-pull: pull.c
-git-ssh-pull: rsh.c pull.c
-git-ssh-push: rsh.c
+.PRECIOUS: %.o
+git-%: %.o $(LIB_FILE)
+	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
+
+git-http-pull: pull.o
+git-local-pull: pull.o
+git-ssh-pull: rsh.o pull.o
+git-ssh-push: rsh.o
 
 git-http-pull: LIBS += -lcurl
 git-rev-list: LIBS += -lssl

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 4/2] Improve the compilation-time settings interface
  2005-07-29 15:48 ` [PATCH 4/2] Improve the compilation-time settings interface Petr Baudis
@ 2005-07-29 18:23   ` Petr Baudis
  0 siblings, 0 replies; 21+ messages in thread
From: Petr Baudis @ 2005-07-29 18:23 UTC (permalink / raw)
  To: junkio; +Cc: git

Dear diary, on Fri, Jul 29, 2005 at 05:48:26PM CEST, I got a letter
where Petr Baudis <pasky@suse.cz> told me that...
> diff --git a/Makefile b/Makefile
> --- a/Makefile
> +++ b/Makefile
> @@ -1,33 +1,53 @@
> +# Define NO_OPENSSL environment variable if you do not have OpenSSL. You will
> +# miss out git-rev-list --merge-order. This also implies MOZILLA_SHA1.

Sorry for this, I didn't realize until much later that NO_OPENSSL wasn't
actually in git yet. I hope I won't have to resend the patches just
because of this. :-)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 2/2] Unify usage strings declaration
  2005-07-29  9:01 ` [PATCH 2/2] Unify usage strings declaration Petr Baudis
@ 2005-07-30  2:11   ` Junio C Hamano
  2005-07-30  6:03     ` Matthias Urlichs
  0 siblings, 1 reply; 21+ messages in thread
From: Junio C Hamano @ 2005-07-30  2:11 UTC (permalink / raw)
  To: Petr Baudis; +Cc: junkio, git

Petr Baudis <pasky@suse.cz> writes:

> All usage strings are now declared as static const char [].

I do not have preference either way, and I've already merged
them, but why char[] not char*?

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/2] git-merge-cache -q doesn't complain about failing merge program
  2005-07-29 12:53 ` [PATCH 3/2] git-merge-cache -q doesn't complain about failing merge program Petr Baudis
@ 2005-07-30  2:11   ` Junio C Hamano
  0 siblings, 0 replies; 21+ messages in thread
From: Junio C Hamano @ 2005-07-30  2:11 UTC (permalink / raw)
  To: Petr Baudis; +Cc: junkio, git

Petr Baudis <pasky@suse.cz> writes:

> git-merge-cache reporting failed merge program is undesirable for
> Cogito, since it emits its own more appropriate error message in that
> case. However, I want to show other possible git-merge-cache error
> messages. So -q will just silence this particular error.

That description makes it sound more like it is a Cogito
specific hack, which other Porcelains may not benefit from,
meaning they may want to suppress some other errors but this
patch does not give that possibility.

I do not mind about the above too much, but I'll sit on this one
for now just in case if anybody comes up with a different patch
to give a bit cleaner solution.

I wonder how many die()'s we have in our C code.  It _might_ be
cleaner to say (the first parameter being exit(2) parameter):

    die("unable to execute '%s'", pgm);
    die_with(47, "merge program failed");

and have the calling Porcelain, if it wants to, supress error
messages by redirecting 2>/dev/null, and say whatever it wants
to say based on $?.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 7/2] Support for NO_OPENSSL
  2005-07-29 15:50 ` [PATCH 7/2] Support for NO_OPENSSL Petr Baudis
@ 2005-07-30  3:39   ` Linus Torvalds
  2005-07-30  4:17     ` Junio C Hamano
  2005-07-30  5:02     ` [PATCH] Under NO_OPENSSL -lssl should not be used Junio C Hamano
  0 siblings, 2 replies; 21+ messages in thread
From: Linus Torvalds @ 2005-07-30  3:39 UTC (permalink / raw)
  To: Petr Baudis; +Cc: junkio, git


This doesn't work at least in the form that Junio merged it (and from 
what I can tell, he merged your patch as-is):

  torvalds@shell0:~/src/git> make NO_OPENSSL=1
  cc -g -O2 -Wall '-DNO_OPENSSL' '-DSHA1_HEADER="mozilla-sha1/sha1.h"' -o git-rev-list rev-list.o libgit.a -lz -lssl
  /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: cannot find -lssl

it needs to disable the -lssl too..

		Linus

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 7/2] Support for NO_OPENSSL
  2005-07-30  3:39   ` Linus Torvalds
@ 2005-07-30  4:17     ` Junio C Hamano
  2005-07-30  5:02     ` [PATCH] Under NO_OPENSSL -lssl should not be used Junio C Hamano
  1 sibling, 0 replies; 21+ messages in thread
From: Junio C Hamano @ 2005-07-30  4:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

Linus Torvalds <torvalds@osdl.org> writes:

> This doesn't work at least in the form that Junio merged it (and from 
> what I can tell, he merged your patch as-is):

Slipped my filter.  Sorry.  Will fix.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH] Under NO_OPENSSL -lssl should not be used
  2005-07-30  3:39   ` Linus Torvalds
  2005-07-30  4:17     ` Junio C Hamano
@ 2005-07-30  5:02     ` Junio C Hamano
  2005-07-30 16:09       ` Linus Torvalds
  2005-08-02 22:43       ` Jon Seymour
  1 sibling, 2 replies; 21+ messages in thread
From: Junio C Hamano @ 2005-07-30  5:02 UTC (permalink / raw)
  To: Petr Baudis, Jon Seymour; +Cc: Linus Torvalds, git

Linus Torvalds <torvalds@osdl.org> writes:

> This doesn't work at least in the form that Junio merged it (and from 
> what I can tell, he merged your patch as-is):
>
>   torvalds@shell0:~/src/git> make NO_OPENSSL=1
>   cc -g -O2 -Wall '-DNO_OPENSSL' '-DSHA1_HEADER="mozilla-sha1/sha1.h"' -o git-rev-list rev-list.o libgit.a -lz -lssl
>   /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: cannot find -lssl
>
> it needs to disable the -lssl too..

Would this be OK?  I think it is ugly but it gets the job done.

Jon, do we really need bignum to do the flow computation?  From
a quick glance, it appears to me that the fraction manipulation
part is quite well isolated.  Do you think adding the support
for using other bignum implementation be reasonable (assuming
you do need to use bignum based fraction)?

------------
This is quick and dirty but under NO_OPENSSL we should not
attempt to link with -lssl (nor -lcrypto).

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
cd /opt/packrat/playpen/public/in-place/git/git.junio/
jit-diff
# - pu: Fetch from a packed repository on dumb servers.
# + (working tree)
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -108,9 +108,11 @@ LIBS += -lz
 
 ifndef NO_OPENSSL
 	LIB_OBJS += epoch.o
+	OPENSSL_LIBSSL=-lssl
 else
 	CFLAGS += '-DNO_OPENSSL'
 	MOZILLA_SHA1=1
+	OPENSSL_LIBSSL=
 endif
 ifdef MOZILLA_SHA1
   SHA1_HEADER="mozilla-sha1/sha1.h"
@@ -148,7 +150,7 @@ git-ssh-pull: rsh.o pull.o
 git-ssh-push: rsh.o
 
 git-http-pull: LIBS += -lcurl
-git-rev-list: LIBS += -lssl
+git-rev-list: LIBS += $(OPENSSL_LIBSSL)
 
 $(LIB_OBJS): $(LIB_H)
 $(DIFF_OBJS): diffcore.h

Compilation finished at Fri Jul 29 21:48:01

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 2/2] Unify usage strings declaration
  2005-07-30  2:11   ` Junio C Hamano
@ 2005-07-30  6:03     ` Matthias Urlichs
  0 siblings, 0 replies; 21+ messages in thread
From: Matthias Urlichs @ 2005-07-30  6:03 UTC (permalink / raw)
  To: git

Hi, Junio C Hamano wrote:

> I do not have preference either way, and I've already merged
> them, but why char[] not char*?

A char* is a variable which points to the char[].
That's four (or eight) bytes we don't need. ;-)

C conflates the two concepts somewhat, which is one of the reasons
optimizing compiled C is somewhat more challenging than, say, FORTRAN.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Giving every man a vote has no more made men wise
and free than Christianity has made them good.
		-- H.L. Mencken

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 0/2] Bits from git-pb
  2005-07-29  8:58 [PATCH 0/2] Bits from git-pb Petr Baudis
                   ` (7 preceding siblings ...)
  2005-07-29 17:21 ` [PATCH 8/2] Build commands through object files Petr Baudis
@ 2005-07-30 10:31 ` Petr Baudis
  2005-07-30 17:33   ` Junio C Hamano
  8 siblings, 1 reply; 21+ messages in thread
From: Petr Baudis @ 2005-07-30 10:31 UTC (permalink / raw)
  To: junkio; +Cc: git

Dear diary, on Fri, Jul 29, 2005 at 10:58:19AM CEST, I got a letter
where Petr Baudis <pasky@ucw.cz> told me that...
>   (i) Keep the git-pb branch polished and nice-to-merge, if you want to
> pull from it.
> 
>   (ii) Keep the git-pb branch polished and nice-to-merge and rebase it
> regularily if you don't want loong edges in your history graph, but
> want to pull from it.
> 
>   (iii) Do wild things in the git-pb branch and send you patches.

So I assume (iii) holds?

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Under NO_OPENSSL -lssl should not be used
  2005-07-30  5:02     ` [PATCH] Under NO_OPENSSL -lssl should not be used Junio C Hamano
@ 2005-07-30 16:09       ` Linus Torvalds
  2005-08-02 22:43       ` Jon Seymour
  1 sibling, 0 replies; 21+ messages in thread
From: Linus Torvalds @ 2005-07-30 16:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Petr Baudis, Jon Seymour, git



On Fri, 29 Jul 2005, Junio C Hamano wrote:
> 
> Would this be OK?  I think it is ugly but it gets the job done.

Looks ok. I'd suggest having some option to turn of "curl" too - I have 
one machine that doesn't have curl installed, and I just turn the things 
that depend on it off by hand by editing the makefile right now..

		Linus

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 0/2] Bits from git-pb
  2005-07-30 10:31 ` [PATCH 0/2] Bits from git-pb Petr Baudis
@ 2005-07-30 17:33   ` Junio C Hamano
  2005-07-30 17:59     ` Junio C Hamano
  0 siblings, 1 reply; 21+ messages in thread
From: Junio C Hamano @ 2005-07-30 17:33 UTC (permalink / raw)
  To: Petr Baudis; +Cc: junkio, git

Petr Baudis <pasky@suse.cz> writes:

>>   (iii) Do wild things in the git-pb branch and send you patches.
>
> So I assume (iii) holds?

I have not answered this because I have not made up my mind.
Certainly (iii) is probably the least work for me.

My gut feeling is that I can deal with any of the above, but
even when I pull from your tree, I expect to pull into "pu"
first and after that the patches will go through my regular
reshuffling cycle just like other patches I receive from
e-mails.  This may or may not cause "interesting" troubles when
I merge again from git-pb, but we will see.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 0/2] Bits from git-pb
  2005-07-30 17:33   ` Junio C Hamano
@ 2005-07-30 17:59     ` Junio C Hamano
  0 siblings, 0 replies; 21+ messages in thread
From: Junio C Hamano @ 2005-07-30 17:59 UTC (permalink / raw)
  To: Petr Baudis; +Cc: junkio, git

Junio C Hamano <junkio@cox.net> writes:

> I have not answered this because I have not made up my mind.
> Certainly (iii) is probably the least work for me.

Certainly?  Probably?  Which one?  I should not start typing
before having a cup of coffee.  **BLUSH**

Anyway, yes I would appreciate if you take (iii) for the time
being but if that is too much work for you then don't worry I'll
learn to cope with any of the above.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Under NO_OPENSSL -lssl should not be used
  2005-07-30  5:02     ` [PATCH] Under NO_OPENSSL -lssl should not be used Junio C Hamano
  2005-07-30 16:09       ` Linus Torvalds
@ 2005-08-02 22:43       ` Jon Seymour
  1 sibling, 0 replies; 21+ messages in thread
From: Jon Seymour @ 2005-08-02 22:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Petr Baudis, Linus Torvalds, git

G'day Junio,

> 
> Jon, do we really need bignum to do the flow computation?  From
> a quick glance, it appears to me that the fraction manipulation
> part is quite well isolated.  Do you think adding the support
> for using other bignum implementation be reasonable (assuming
> you do need to use bignum based fraction)?
>

Sorry, only just saw this. An alternative bignum implementation would
be ok, I just used the ssl stuff since it happened to do what I want
and was available. I also have a patch in the pipes that gets around
the need for arbitrary precision fractions completely.

jon.

> ------------
> This is quick and dirty but under NO_OPENSSL we should not
> attempt to link with -lssl (nor -lcrypto).
> 
> Signed-off-by: Junio C Hamano <junkio@cox.net>
> ---
> cd /opt/packrat/playpen/public/in-place/git/git.junio/
> jit-diff
> # - pu: Fetch from a packed repository on dumb servers.
> # + (working tree)
> diff --git a/Makefile b/Makefile
> --- a/Makefile
> +++ b/Makefile
> @@ -108,9 +108,11 @@ LIBS += -lz
> 
>  ifndef NO_OPENSSL
>         LIB_OBJS += epoch.o
> +       OPENSSL_LIBSSL=-lssl
>  else
>         CFLAGS += '-DNO_OPENSSL'
>         MOZILLA_SHA1=1
> +       OPENSSL_LIBSSL=
>  endif
>  ifdef MOZILLA_SHA1
>    SHA1_HEADER="mozilla-sha1/sha1.h"
> @@ -148,7 +150,7 @@ git-ssh-pull: rsh.o pull.o
>  git-ssh-push: rsh.o
> 
>  git-http-pull: LIBS += -lcurl
> -git-rev-list: LIBS += -lssl
> +git-rev-list: LIBS += $(OPENSSL_LIBSSL)
> 
>  $(LIB_OBJS): $(LIB_H)
>  $(DIFF_OBJS): diffcore.h
> 
> Compilation finished at Fri Jul 29 21:48:01
> 
> 


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

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2005-08-02 22:43 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-29  8:58 [PATCH 0/2] Bits from git-pb Petr Baudis
2005-07-29  9:00 ` [PATCH 1/2] Trivial tidyups Petr Baudis
2005-07-29  9:01 ` [PATCH 2/2] Unify usage strings declaration Petr Baudis
2005-07-30  2:11   ` Junio C Hamano
2005-07-30  6:03     ` Matthias Urlichs
2005-07-29 12:53 ` [PATCH 3/2] git-merge-cache -q doesn't complain about failing merge program Petr Baudis
2005-07-30  2:11   ` Junio C Hamano
2005-07-29 15:48 ` [PATCH 4/2] Improve the compilation-time settings interface Petr Baudis
2005-07-29 18:23   ` Petr Baudis
2005-07-29 15:48 ` [PATCH 5/2] Remove the explicit Makefile dependencies description Petr Baudis
2005-07-29 15:50 ` [PATCH 6/2] Reorder Makefile rules Petr Baudis
2005-07-29 15:50 ` [PATCH 7/2] Support for NO_OPENSSL Petr Baudis
2005-07-30  3:39   ` Linus Torvalds
2005-07-30  4:17     ` Junio C Hamano
2005-07-30  5:02     ` [PATCH] Under NO_OPENSSL -lssl should not be used Junio C Hamano
2005-07-30 16:09       ` Linus Torvalds
2005-08-02 22:43       ` Jon Seymour
2005-07-29 17:21 ` [PATCH 8/2] Build commands through object files Petr Baudis
2005-07-30 10:31 ` [PATCH 0/2] Bits from git-pb Petr Baudis
2005-07-30 17:33   ` Junio C Hamano
2005-07-30 17:59     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).