Git development
 help / color / mirror / Atom feed
* Re: specify charset for commits
From: Uwe Kleine-König @ 2006-12-22 15:09 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, Alexander Litvinov, git
In-Reply-To: <Pine.LNX.4.63.0612220351520.19693@wbgn013.biozentrum.uni-wuerzburg.de>

Hello Johannes,

Johannes Schindelin wrote:
> The problem is: you cannot easily recognize if it is UTF8 or not, 
> programatically. There is a good indicator _against_ UTF8, namely the 
> first byte can _only_ be 0xxxxxxx, 110xxxxx, 1110xxxx, 11110xxx. But there 
> is no _positive_ sign that it is UTF8. For example, many umlauts and other 
> special modifications to letters, stay in the range 0x7f-0xff.
That's not the only indication.  Here comes a (Python) function that
checks is string s is correctly UTF-8 encoded:

	def is_utf8_str(s):
	  cnt_furtherbytes = 0
	  for c in s:
	    if cnt_furtherbytes > 0:
	      if ord(c) & 0xc0 == 0x80:
		cnt_furtherbytes -= 1
	      else:
		return False
	    else:
	      if ord(c) < 0x80:
		continue
	      elif ord(c) < 0xc0:
	        return False
	      elif ord(c) < 0xe0:
		cnt_furtherbytes = 1
	      elif ord(c) < 0xf0:
		cnt_furtherbytes = 2
	      elif ord(c) < 0xf8:
		cnt_furtherbytes = 3
	      elif ord(c) < 0xfc:
		cnt_furtherbytes = 4
	      elif ord(c) < 0xfe:
		cnt_furtherbytes = 5
	      else:
		return False
	  return True

An UTF-8 character is either one byte long with the msb 0 or a sequence
starting with a value between 0xc0 and 0xfd (inclusive) and depending on
that first value up to six further bytes in the range 0x80 to 0xbf.

You could even be more strict by checking for Unicode 3.1 conformance
(i.e. a character has to be encoded in it's shortest form).

Look at utf8(7) for further details.  (This manpage is included in the
Debian manpages package.)

Best regards
Uwe

-- 
Uwe Kleine-König

http://www.google.com/search?q=5+choose+3

^ permalink raw reply

* Re: Change in git-svn dcommit semantics?
From: Brian Gernhardt @ 2006-12-22 14:09 UTC (permalink / raw)
  To: Jakub Narebski, git
In-Reply-To: <20061220115731.GA29786@coredump.intra.peff.net>

On Dec 20, 2006, at 6:57 AM, Jeff King wrote:

> On Wed, Dec 20, 2006 at 06:47:45AM -0500, Brian Gernhardt wrote:
>
>>>> The --full-diff option helps because it shows the diff for other
>>>> files (that do not have different number of substring COLLISION
>>>> in the pre and postimage) in the same commit as well.
>>>
>>> Yet another undocumented option. Sigh...
>>
>> I'd send in a patch to fix that (little gnome work is what I do in
>> Wikipedia, and seems to be what I do here), but the option seems to
>> be in setup_revision.c:setup_revisions, which is used in several
>> places.  Is there a central place to put that in the documentation?
>> Should there be?
>
> Please read the rest of the thread for some explanation from Junio on
> how this option works.

I was trying to write quick documentation for this option, placing it  
in Documentation/diff-options.txt (is that the right place for it?),  
when I ran across --pickaxe-all.  How do the two options differ?

~~ Brian

^ permalink raw reply

* [PATCH] Make git-show-branch options similar to git-branch.
From: Brian Gernhardt @ 2006-12-22 13:58 UTC (permalink / raw)
  To: git

Branch has "-r" for remote branches and "-a" for local and remote.
Seems logical to mirror that in show-branch.  Also removes the
dubiously useful "--tags" option (as part of changing the meaning for
"--all").

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
---

 Similar to my eariler patch but instead of wanting to add --remotes
 for completeness I now want to add it to mirror "git branch".  By the
 prinicple of least surprise, "git branch -a" and "git show-branch -a"
 should display the same refs.  (Same for "-r".)

 Documentation/git-show-branch.txt |   10 +++++---
 builtin-show-branch.c             |   40 ++++++++++++++++++++++++-------------
 2 files changed, 32 insertions(+), 18 deletions(-)

diff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt
index 948ff10..dafacd4 100644
--- a/Documentation/git-show-branch.txt
+++ b/Documentation/git-show-branch.txt
@@ -8,7 +8,7 @@ git-show-branch - Show branches and their commits
 SYNOPSIS
 --------
 [verse]
-'git-show-branch' [--all] [--heads] [--tags] [--topo-order] [--current]
+'git-show-branch' [--all] [--remotes] [--topo-order] [--current]
 		[--more=<n> | --list | --independent | --merge-base]
 		[--no-name | --sha1-name] [--topics] [<rev> | <glob>]...
 
@@ -37,9 +37,11 @@ OPTIONS
 	branches under $GIT_DIR/refs/heads/topic, giving
 	`topic/*` would show all of them.
 
---all --heads --tags::
-	Show all refs under $GIT_DIR/refs, $GIT_DIR/refs/heads,
-	and $GIT_DIR/refs/tags, respectively.
+-r|--remotes::
+	Show the remote-tracking branches.
+
+-a|--all::
+	Show both remote-tracking branches and local branches.
 
 --current::
 	With this option, the command includes the current
diff --git a/builtin-show-branch.c b/builtin-show-branch.c
index b9d9781..c67f2fa 100644
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
@@ -4,7 +4,7 @@
 #include "builtin.h"
 
 static const char show_branch_usage[] =
-"git-show-branch [--sparse] [--current] [--all] [--heads] [--tags] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [<refs>...] | --reflog[=n] <branch>";
+"git-show-branch [--sparse] [--current] [--all] [--remotes] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [<refs>...] | --reflog[=n] <branch>";
 
 static int default_num;
 static int default_alloc;
@@ -383,6 +383,20 @@ static int append_head_ref(const char *refname, const unsigned char *sha1, int f
 	return append_ref(refname + ofs, sha1, flag, cb_data);
 }
 
+static int append_remote_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
+{
+	unsigned char tmp[20];
+	int ofs = 13;
+	if (strncmp(refname, "refs/remotes/", ofs))
+		return 0;
+	/* If both heads/foo and tags/foo exists, get_sha1 would
+	 * get confused.
+	 */
+	if (get_sha1(refname + ofs, tmp) || hashcmp(tmp, sha1))
+		ofs = 5;
+	return append_ref(refname + ofs, sha1, flag, cb_data);
+}
+
 static int append_tag_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
 {
 	if (strncmp(refname, "refs/tags/", 10))
@@ -423,16 +437,16 @@ static int append_matching_ref(const char *refname, const unsigned char *sha1, i
 	return append_ref(refname, sha1, flag, cb_data);
 }
 
-static void snarf_refs(int head, int tag)
+static void snarf_refs(int head, int remotes)
 {
 	if (head) {
 		int orig_cnt = ref_name_cnt;
 		for_each_ref(append_head_ref, NULL);
 		sort_ref_range(orig_cnt, ref_name_cnt);
 	}
-	if (tag) {
+	if (remotes) {
 		int orig_cnt = ref_name_cnt;
-		for_each_ref(append_tag_ref, NULL);
+		for_each_ref(append_remote_ref, NULL);
 		sort_ref_range(orig_cnt, ref_name_cnt);
 	}
 }
@@ -554,7 +568,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
 	struct commit_list *list = NULL, *seen = NULL;
 	unsigned int rev_mask[MAX_REVS];
 	int num_rev, i, extra = 0;
-	int all_heads = 0, all_tags = 0;
+	int all_heads = 0, all_remotes = 0;
 	int all_mask, all_revs;
 	int lifo = 1;
 	char head[128];
@@ -586,12 +600,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
 			ac--; av++;
 			break;
 		}
-		else if (!strcmp(arg, "--all"))
-			all_heads = all_tags = 1;
-		else if (!strcmp(arg, "--heads"))
-			all_heads = 1;
-		else if (!strcmp(arg, "--tags"))
-			all_tags = 1;
+		else if (!strcmp(arg, "--all") || !strcmp(arg, "-a"))
+			all_heads = all_remotes = 1;
+		else if (!strcmp(arg, "--remotes") || !strcmp(arg, "-r"))
+			all_remotes = 1;
 		else if (!strcmp(arg, "--more"))
 			extra = 1;
 		else if (!strcmp(arg, "--list"))
@@ -636,11 +648,11 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
 		usage(show_branch_usage);
 
 	/* If nothing is specified, show all branches by default */
-	if (ac + all_heads + all_tags == 0)
+	if (ac + all_heads + all_remotes == 0)
 		all_heads = 1;
 
-	if (all_heads + all_tags)
-		snarf_refs(all_heads, all_tags);
+	if (all_heads + all_remotes)
+		snarf_refs(all_heads, all_remotes);
 	if (reflog) {
 		int reflen;
 		if (!ac)
-- 
1.4.4.GIT

^ permalink raw reply related

* [PATCH] Keep "git --git-dir" from causing a bus error.
From: Brian Gernhardt @ 2006-12-22 13:56 UTC (permalink / raw)
  To: git

The option checking code for --git-dir had an off by 1 error that
would cause it to access uninitialized memory if it was the last
argument.  This causes it to display an error and display the usage
string instead.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
---

 I would have made this display the git directory, but the code to
 do that seems to be unique to rev-parse and involve more set up than is
 done at the time the option is parsed.

 git.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/git.c b/git.c
index 73cf4d4..2b3c9f9 100644
--- a/git.c
+++ b/git.c
@@ -59,11 +59,14 @@ static int handle_options(const char*** argv, int* argc)
 		} else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) {
 			setup_pager();
 		} else if (!strcmp(cmd, "--git-dir")) {
-			if (*argc < 1)
-				return -1;
-			setenv("GIT_DIR", (*argv)[1], 1);
-			(*argv)++;
-			(*argc)--;
+			if (*argc < 2) {
+				fprintf(stderr, "No directory given for --git-dir.\n" );
+				usage(git_usage_string);
+			} else {
+				setenv("GIT_DIR", (*argv)[1], 1);
+				(*argv)++;
+				(*argc)--;
+			}
 		} else if (!strncmp(cmd, "--git-dir=", 10)) {
 			setenv("GIT_DIR", cmd + 10, 1);
 		} else if (!strcmp(cmd, "--bare")) {
-- 
1.4.4.GIT

^ permalink raw reply related

* Re: [PATCH] fix vc git
From: Alexandre Julliard @ 2006-12-22 13:56 UTC (permalink / raw)
  To: Duncan Mak; +Cc: git
In-Reply-To: <8e745ecf0612220451v367479dq13af2d829a9547c2@mail.gmail.com>

"Duncan Mak" <duncan@a-chinaman.com> writes:

> Yeah, but the issue is that, as you know, to create a new file in
> emacs, you give find-file  a non-existent file and emacs will open up
> a buffer for you and let you save it when you're done.

OK, but in that case vc-git-registered needs to return failure, you
cannot call git-ls-files as it may find the file in the wrong
directory. I'd suggest something like this:


>From abf4311add221102957145255d5418a7ec06fe1d Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Fri, 22 Dec 2006 14:51:23 +0100
Subject: [PATCH] vc-git: Ignore errors caused by a non-existent directory in vc-git-registered.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 contrib/emacs/vc-git.el |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/emacs/vc-git.el b/contrib/emacs/vc-git.el
index 8b63619..3eb4bd1 100644
--- a/contrib/emacs/vc-git.el
+++ b/contrib/emacs/vc-git.el
@@ -58,8 +58,9 @@
   (with-temp-buffer
     (let* ((dir (file-name-directory file))
            (name (file-relative-name file dir)))
-      (when dir (cd dir))
-      (and (ignore-errors (eq 0 (call-process "git" nil '(t nil) nil "ls-files" "-c" "-z" "--" name)))
+      (and (ignore-errors
+             (when dir (cd dir))
+             (eq 0 (call-process "git" nil '(t nil) nil "ls-files" "-c" "-z" "--" name)))
            (let ((str (buffer-string)))
              (and (> (length str) (length name))
                   (string= (substring str 0 (1+ (length name))) (concat name "\0"))))))))
-- 
1.4.4.2.g28ce

-- 
Alexandre Julliard
julliard@winehq.org

^ permalink raw reply related

* Re: [PATCH] Don't define _XOPEN_SOURCE on MacOSX and FreeBSD as it is too restricting
From: Marco Roeland @ 2006-12-22 13:14 UTC (permalink / raw)
  To: Marco Roeland, Junio C Hamano, Terje Sten Bjerkseth,
	Randal L. Schwartz, Linus Torvalds, git
In-Reply-To: <20061222125505.GB3773@peter.daprodeges.fqdn.th-h.de>

On Friday December 22nd 2006 at 12:55 Rocco Rutte wrote:

> I'm still in favour of simply adding '!defined(__FreeBSD__)' to 
> git-compat-util.h as soon as possible to push out a maintaince release 
> that at least compiles (on FreeBSD)...

Agreed. It's the more practical thing to do and Just Works (TM).

Perhaps in the long run we could create platform specific header files
to deal with whatever excentricities these provide or need, and include
in git-compat-util.h things like for every candidate that needs it:

#ifdef __CrappIX__
#include "compat/crappix.h"
#endif

For the _XOPEN_SOURCE specific things it might also be better to reverse
the logic, so not exclude it for a number of platforms but only include
it for the specific platforms that seem to need it.

So, again on top of Terjes patch in "master":

diff --git a/git-compat-util.h b/git-compat-util.h
index 41fa7f6..c7930d2 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -11,7 +11,7 @@
 
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
 
-#ifndef __APPLE_CC__
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
-- 
Marco Roeland

^ permalink raw reply related

* Re: [PATCH] fix vc git
From: Alexandre Julliard @ 2006-12-22 12:39 UTC (permalink / raw)
  To: Duncan Mak; +Cc: Junio C Hamano, git
In-Reply-To: <8e745ecf0612212011q26f81d91uce143b4212fc5e8b@mail.gmail.com>

"Duncan Mak" <duncan@a-chinaman.com> writes:

> I don't think vc-git-registered-file will ever be called with a
> filename without a directory, as it is used as a hook on
> vc-next-action, which works on a real file.

Well, if it's a real file I'd expect the directory to exist, and if it
doesn't, I'm not sure there's much point in calling git-ls-files at
all. In which case do you get a non-existent directory here?

-- 
Alexandre Julliard
julliard@winehq.org

^ permalink raw reply

* Re: [PATCH] Don't define _XOPEN_SOURCE on MacOSX and FreeBSD as it is too restricting
From: Rocco Rutte @ 2006-12-22 12:55 UTC (permalink / raw)
  To: Marco Roeland
  Cc: Junio C Hamano, Terje Sten Bjerkseth, Randal L. Schwartz,
	Linus Torvalds, git
In-Reply-To: <20061222114722.GA11274@fiberbit.xs4all.nl>

Hi,

* Marco Roeland [06-12-22 12:47:22 +0100] wrote:

>In fact on FreeBSD the problem seems to be only that when _XOPEN_SOURCE
>is defined, than the macro __BSD_VISIBLE is unset or 0. Adding just

>#ifdef __FreeBSD__
>#define __BSD_VISIBLE   1
>#endif

The first patch I sent in did exactly that via -D__BSD_VISIBLE set in 
the Makefile and Junio correctly complained that the __-prefix is meant 
to be for internal use only. I bet he'll say the same about this flavour 
of defining __BSD_VISIBLE. :)

I was just too lazy to recursively go through the #define/#ifdef parts 
of header files to find why __BSD_VISIBLE is needed.

Second, in <sys/cdefs.h> _XOPEN_SOURCE indirectly influences 
__BSD_VISIBLE through _POSIX_C_SOURCE. The latter is defined for values 
of >=500 for _XOPEN_SOURCE so that even

   #define _XOPEN_SOURCE 499

works fine on FreeBSD.

I'm still in favour of simply adding '!defined(__FreeBSD__)' to 
git-compat-util.h as soon as possible to push out a maintaince release 
that at least compiles (on FreeBSD)...

   bye, Rocco
-- 
:wq!

^ permalink raw reply

* Re: [PATCH] fix vc git
From: Duncan Mak @ 2006-12-22 12:51 UTC (permalink / raw)
  To: Alexandre Julliard; +Cc: git
In-Reply-To: <87ejqsumu3.fsf@wine.dyndns.org>

On 12/22/06, Alexandre Julliard <julliard@winehq.org> wrote:
>
> Well, if it's a real file I'd expect the directory to exist, and if it
> doesn't, I'm not sure there's much point in calling git-ls-files at
> all. In which case do you get a non-existent directory here?
>

Yeah, but the issue is that, as you know, to create a new file in
emacs, you give find-file  a non-existent file and emacs will open up
a buffer for you and let you save it when you're done.

Once I installed the git vc backend, that feature stopped working for
me - that's the reason why I made this patch.

Duncan.

^ permalink raw reply

* git-svn dcommit ignors svn.authorsfile config and -A / --author-file cmd-line-option
From: Nicolas Vilz @ 2006-12-22 12:28 UTC (permalink / raw)
  To: git

Hello again,

I wonder, if git dcommit supports the option or the repo-config key
svn.authors.file... i think it does not, or i do something wrong...

<username> = <name> <email>

did work on git-svn fetch iirc ... but does it on git-svn dcommit, too?

Sincerly
Nicolas

^ permalink raw reply

* Re: [PATCH] sha1_name(): accept ':directory/' to get at the cache_tree
From: Johannes Schindelin @ 2006-12-22 12:18 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git, junkio
In-Reply-To: <20061222084425.GA4644@steel.home>

Hi,

On Fri, 22 Dec 2006, Alex Riesen wrote:

> Johannes Schindelin, Fri, Dec 22, 2006 03:19:21 +0100:
> > 
> > If the cache tree is not up-to-date, it will be updated first. So, now
> > 
> > 	$ git show :Documentation/
> > 
> > will in effect show what files/directories are in the index' version
> > of the directory Documentation. The three commands
> > 
> > 	$ git show :./
> > 	$ git show :.
> > 	$ git show :
> > 
> > are all equivalent and show the index' idea of the root directory.
> 
> That is a bit unexpected if you're not in the root directory of
> repository, but in some subdir of the working directory.
> Why root? Why not the current directory relative to root?

Why root? Because you are not asking for the working directory. Use "ls" 
for that. You are asking for the index. If you git-show a commit, you 
don't expect the output to be restricted by the subdirectory you're in, 
either, right?

CIao,
Dscho

^ permalink raw reply

* Re: [PATCH] sha1_name(): accept ':directory/' to get at the cache_tree
From: Johannes Schindelin @ 2006-12-22 12:16 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <emg4qp$f8v$2@sea.gmane.org>

Hi,

On Fri, 22 Dec 2006, Jakub Narebski wrote:

> Junio C Hamano wrote:
> 
> > (2) What does this do when the index is unmerged?
> 
> I think it should show "git ls-files --unmerged --abbrev", perhaps...

Nah. I'd rather fail out, saying that because there are unmerged entries, 
there is no valid tree in the index.

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH] git-tag: support -F <file> option
From: Johannes Schindelin @ 2006-12-22 12:15 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Han-Wen Nienhuys, git
In-Reply-To: <7vvek45svl.fsf@assigned-by-dhcp.cox.net>

Hi,

On Thu, 21 Dec 2006, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > This imitates the behaviour of git-commit.
> >
> > Noticed by Han-Wen Nienhuys.
> >
> > Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> 
> Ok, but what the **** is "die ...; exit 2" sequence?

;-) I did not even bother reading the code when I copied it.

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH] sha1_name(): accept ':directory/' to get at the cache_tree
From: Johannes Schindelin @ 2006-12-22 12:14 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vzm9g7duz.fsf@assigned-by-dhcp.cox.net>

Hi,

On Thu, 21 Dec 2006, Junio C Hamano wrote:

> (1) Why is this needed?

It was asked recently. It also serves well when you want to show the 
index.

> (2) What does this do when the index is unmerged?

I have no idea, and ATM no time to test. Will do later.

Ciao,
Dscho

^ permalink raw reply

* Re: specify charset for commits
From: Johannes Schindelin @ 2006-12-22 12:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Alexander Litvinov, Uwe Kleine-König, git
In-Reply-To: <7vejqtaz7q.fsf@assigned-by-dhcp.cox.net>

Hi,

On Thu, 21 Dec 2006, Junio C Hamano wrote:

>  (2) update commit-tree to reject non utf-8 log messages and
>      author/committer names when i18n.commitEncoding is _NOT_
>      set, or set to utf-8.

The problem is: you cannot easily recognize if it is UTF8 or not, 
programatically. There is a good indicator _against_ UTF8, namely the 
first byte can _only_ be 0xxxxxxx, 110xxxxx, 1110xxxx, 11110xxx. But there 
is no _positive_ sign that it is UTF8. For example, many umlauts and other 
special modifications to letters, stay in the range 0x7f-0xff.

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH] Don't define _XOPEN_SOURCE on MacOSX and FreeBSD as it is too restricting
From: Marco Roeland @ 2006-12-22 11:47 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Marco Roeland, Terje Sten Bjerkseth, Randal L. Schwartz,
	Linus Torvalds, Rocco Rutte, git
In-Reply-To: <7v4pro5nsa.fsf@assigned-by-dhcp.cox.net>

On Friday December 22nd 2006 at 00:37 Junio C Hamano wrote:

> (offtopic) Yeah, but my point was that ANSI C reserves _all_
> symbols that begin with str ("Names reserved for expansion"),
> not just a specific set of functions like strcmp, strcpy, etc.,
> so if a program tries to be compliant with it, it cannot use,
> for example, strncasecmp (was that the symbol we had trouble
> with?)  for its own purpose anyway -- which means the system
> header implementation should not have to worry about namespace
> pollution.  I do not see any reason for them to hide
> strncasecmp, for example.

(ontopic for offtopic, that makes it still offtopic probably) I think
the intention from Apple might have been to provide a strict least
common denominator environment for developing software that will run
on strictly standardized POSIX standards. Think of someone that has
to develop a program on Darwin and that should also run on OS/400. If
strcasestr(3) isn't in the libraries there it might make some sense to
not make it available in this strict compatibility mode (expose no less
but also no more environment). A sort of combination of '-pedantic' with
'-Werror' as it were. Note that I do not defend it, just trying to find
some sense of logic in it. ;-)

> > On Apple compiling git works fine both with and without
> > _XOPEN_SOURCES_EXTENDED. But looking in the headers, in contrast to the
> > _XOPEN_SOURCE define which restricts functionality to some predefined
> > set, the _XOPEN_SOURCES_EXTENDED only adds functionality and doesn't
> > remove it. So I thought it might be best to keep as much symbols as
> > possible to be the same for all platforms for future expandibility.
> >
> > Probably FreeBSD behaves the same with respect to
> > _XOPEN_SOURCE_EXTENDED. Will check later today.
> 
> Ok, thanks.

Checking for compilation with FreeBSD as target should have the macro
"__FreeBSD__" as value. No other value, as already pointed out by Rocco
Rutte.

The behaviour of _XOPEN_SOURCE_EXTENDED on FreeBSD is exactly like on
Apple. This means for git we can either include it or not, it won't make
a difference.

There is a subtle and interesting difference with respect to
the usage of _XOPEN_SOURCE on FreeBSD as compared to Darwin. The only
thing that I see on FreeBSD is that it (indirectly through yet another
macro __XSI_VISIBLE) influences some functions (amongst which
strcasestr(3) in daemon.c) to be declared in the system header
<strings.h> instead of in <string.h>. The FreeBSD header claim that this
should be the POSIX behaviour for _XOPEN_SOURCE. As we do not include
<strings.h> the compilation fails on FreeBSD.

In fact on FreeBSD the problem seems to be only that when _XOPEN_SOURCE
is defined, than the macro __BSD_VISIBLE is unset or 0. Adding just

#ifdef __FreeBSD__
#define __BSD_VISIBLE   1
#endif

before setting _XOPEN_SOURCE in also results in git compiling perfectly
on FreeBSD. In that case for example <string.h> automatically includes
<strings.h>.

So on top of Terjes patch in "master":

diff --git a/git-compat-util.h b/git-compat-util.h
index 41fa7f6..2303951 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -11,6 +11,10 @@
 
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
 
+#ifdef __FreeBSD__
+#define __BSD_VISIBLE	1	/* needed in combination with _XOPEN_SOURCE */
+#endif
+
 #ifndef __APPLE_CC__
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
-- 
Marco Roeland

^ permalink raw reply related

* Re: newbie question - git-pull and local branch merge
From: Pelle Svensson @ 2006-12-22 11:26 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vejqs1a3r.fsf@assigned-by-dhcp.cox.net>

Problem is that git-pull failed to merge closed to what you describe in case 2
and I really like to know hat has been done between the 2 last versions
on the Linus side.

The problematic file is include/asm-arm/system.h

I attached some output below. Last (D) is a file diff between the time when
I first pulled the Linus tree and a copy of that which I'm now working in.
I think the resolve/edit part is easy because Linus tree seem to added
an extern declaration of 'adjust_cr' closed to line 152 and the other
conflict code (++<<<...) should be removed.

But is it not possible to show changes/diff version by version of
what has been done in the Linus tree?

Can you tell me if the last pull of Linus code is in the repository
or not. For me it looks like it is because all related files are touched.

/Thanks

A. git-status output
B. git-diff output
C. And if I do git-pull again
D. diff output between file stamp 12-dec and 21-dec

A. git-status output
============

# On branch refs/heads/ep93xx-pmp
#
# Updated but not checked in:
#   (will commit)
#
#	modified: Documentation/block/biodoc.txt
#	modified: Documentation/kernel-parameters.txt
#	modified: Documentation/powerpc/booting-without-of.txt
#	modified: Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
#	modified: MAINTAINERS
#	modified: arch/arm/configs/ep93xx_defconfig
#	modified: arch/arm/configs/iop13xx_defconfig
#	modified: arch/arm/configs/iop32x_defconfig
#	modified: arch/arm/configs/iop33x_defconfig
#	modified: arch/arm/configs/ixp2000_defconfig
#	modified: arch/arm/configs/ixp23xx_defconfig
#	modified: arch/arm/configs/lpd270_defconfig
#	modified: arch/arm/configs/onearm_defconfig
#	modified: arch/arm/kernel/calls.S
#	modified: arch/arm/kernel/setup.c
#	modified: arch/arm/kernel/sys_arm.c
#	modified: arch/arm/mach-iop13xx/iq81340mc.c
#	modified: arch/arm/mach-iop13xx/iq81340sc.c
#	modified: arch/arm/mach-iop13xx/irq.c
#	modified: arch/arm/mach-iop13xx/setup.c
#	modified: arch/arm/mach-s3c2410/Kconfig
#	modified: arch/arm/mach-s3c2410/cpu.c
#	modified: arch/arm/mach-s3c2410/devs.c
#	modified: arch/arm/mach-s3c2410/dma.c
#	modified: arch/arm/mach-s3c2410/irq.h
#	modified: arch/arm/mach-s3c2410/mach-anubis.c
#	modified: arch/arm/mach-s3c2410/mach-bast.c
#	modified: arch/arm/mach-s3c2410/mach-h1940.c
#	modified: arch/arm/mach-s3c2410/mach-n30.c
#	modified: arch/arm/mach-s3c2410/mach-nexcoder.c
#	modified: arch/arm/mach-s3c2410/mach-osiris.c
#	modified: arch/arm/mach-s3c2410/mach-otom.c
#	modified: arch/arm/mach-s3c2410/mach-smdk2410.c
#	modified: arch/arm/mach-s3c2410/mach-smdk2413.c
#	modified: arch/arm/mach-s3c2410/mach-smdk2440.c
#	modified: arch/arm/mach-s3c2410/mach-vr1000.c
#	modified: arch/arm/mach-s3c2410/mach-vstms.c
#	modified: arch/arm/mach-s3c2410/pm-simtec.c
#	modified: arch/arm/mach-s3c2410/pm.c
#	modified: arch/arm/mach-s3c2410/s3c2410-clock.c
#	modified: arch/arm/mach-s3c2410/s3c2410-dma.c
#	modified: arch/arm/mach-s3c2410/s3c2410-pm.c
#	modified: arch/arm/mach-s3c2410/s3c2410.c
#	modified: arch/arm/mach-s3c2410/s3c2412-clock.c
#	modified: arch/arm/mach-s3c2410/s3c2412-dma.c
#	modified: arch/arm/mach-s3c2410/s3c2412.c
#	modified: arch/arm/mach-s3c2410/s3c2440-clock.c
#	modified: arch/arm/mach-s3c2410/s3c2440-dma.c
#	modified: arch/arm/mach-s3c2410/s3c2440.c
#	modified: arch/arm/mach-s3c2410/s3c2440.h
#	modified: arch/arm/mach-s3c2410/s3c2442-clock.c
#	modified: arch/arm/mach-s3c2410/s3c2442.c
#	modified: arch/arm/mach-s3c2410/s3c244x.c
#	modified: arch/arm/mach-s3c2410/usb-simtec.h
#	modified: arch/arm/mm/ioremap.c
#	modified: arch/arm/mm/mmu.c
#	modified: arch/arm/mm/proc-xsc3.S
#	modified: arch/i386/pci/fixup.c
#	modified: arch/powerpc/boot/Makefile
#	modified: arch/powerpc/configs/cell_defconfig
#	modified: arch/powerpc/kernel/of_platform.c
#	modified: arch/powerpc/kernel/pci_64.c
#	modified: arch/powerpc/kernel/prom_parse.c
#	modified: arch/powerpc/kernel/signal_32.c
#	modified: arch/powerpc/platforms/Makefile
#	modified: arch/powerpc/platforms/cell/io-workarounds.c
#	modified: arch/powerpc/platforms/cell/spu_priv1_mmio.c
#	modified: arch/powerpc/platforms/iseries/Kconfig
#	modified: arch/powerpc/sysdev/mpic.c
#	modified: arch/x86_64/Kconfig
#	modified: arch/x86_64/kernel/pci-calgary.c
#	modified: block/cfq-iosched.c
#	modified: block/elevator.c
#	modified: block/ll_rw_blk.c
#	modified: block/scsi_ioctl.c
#	modified: drivers/acpi/ibm_acpi.c
#	modified: drivers/ata/ahci.c
#	modified: drivers/ata/libata-scsi.c
#	modified: drivers/ata/pata_cs5530.c
#	modified: drivers/ata/pata_via.c
#	modified: drivers/ata/sata_nv.c
#	modified: drivers/ata/sata_svw.c
#	modified: drivers/ata/sata_vsc.c
#	modified: drivers/block/cciss.c
#	modified: drivers/block/viodasd.c
#	modified: drivers/bluetooth/hci_usb.c
#	modified: drivers/cdrom/cdrom.c
#	modified: drivers/cdrom/viocd.c
#	modified: drivers/char/drm/drmP.h
#	modified: drivers/char/drm/drm_lock.c
#	modified: drivers/char/drm/drm_stub.c
#	modified: drivers/char/drm/drm_sysfs.c
#	modified: drivers/char/drm/i915_irq.c
#	modified: drivers/char/drm/r128_drm.h
#	modified: drivers/char/drm/r128_drv.h
#	modified: drivers/char/drm/r128_state.c
#	modified: drivers/char/drm/r300_cmdbuf.c
#	modified: drivers/char/drm/radeon_drv.h
#	modified: drivers/char/drm/radeon_irq.c
#	modified: drivers/char/drm/radeon_mem.c
#	modified: drivers/char/drm/radeon_state.c
#	modified: drivers/char/drm/savage_bci.c
#	modified: drivers/char/viocons.c
#	modified: drivers/char/viotape.c
#	modified: drivers/ide/pci/atiixp.c
#	modified: drivers/net/iseries_veth.c
#	modified: drivers/pci/hotplug/acpiphp_glue.c
#	modified: drivers/pci/hotplug/rpaphp_slot.c
#	modified: drivers/pci/hotplug/shpchp.h
#	modified: drivers/pci/hotplug/shpchp_core.c
#	modified: drivers/pci/hotplug/shpchp_ctrl.c
#	modified: drivers/pci/hotplug/shpchp_hpc.c
#	modified: drivers/pci/htirq.c
#	modified: drivers/pci/pci-driver.c
#	modified: drivers/pci/pci.c
#	modified: drivers/pci/pcie/portdrv_pci.c
#	modified: drivers/pci/probe.c
#	modified: drivers/pci/quirks.c
#	modified: drivers/pci/search.c
#	modified: drivers/pci/setup-res.c
#	modified: drivers/scsi/scsi_lib.c
#	modified: drivers/usb/class/usblp.c
#	modified: drivers/usb/core/devio.c
#	modified: drivers/usb/gadget/at91_udc.c
#	modified: drivers/usb/gadget/at91_udc.h
#	modified: drivers/usb/gadget/dummy_hcd.c
#	modified: drivers/usb/gadget/file_storage.c
#	modified: drivers/usb/gadget/gmidi.c
#	modified: drivers/usb/gadget/goku_udc.c
#	modified: drivers/usb/gadget/lh7a40x_udc.c
#	modified: drivers/usb/gadget/net2280.c
#	modified: drivers/usb/gadget/omap_udc.c
#	modified: drivers/usb/gadget/pxa2xx_udc.c
#	modified: drivers/usb/gadget/serial.c
#	modified: drivers/usb/host/ohci-at91.c
#	modified: drivers/usb/host/ohci-au1xxx.c
#	modified: drivers/usb/host/ohci-dbg.c
#	modified: drivers/usb/host/ohci-ep93xx.c
#	modified: drivers/usb/host/ohci-hcd.c
#	modified: drivers/usb/host/ohci-hub.c
#	modified: drivers/usb/host/ohci-lh7a404.c
#	modified: drivers/usb/host/ohci-mem.c
#	modified: drivers/usb/host/ohci-omap.c
#	modified: drivers/usb/host/ohci-pci.c
#	modified: drivers/usb/host/ohci-pnx4008.c
#	new file: drivers/usb/host/ohci-pnx8550.c
#	modified: drivers/usb/host/ohci-ppc-soc.c
#	modified: drivers/usb/host/ohci-pxa27x.c
#	modified: drivers/usb/host/ohci-q.c
#	modified: drivers/usb/host/ohci-s3c2410.c
#	modified: drivers/usb/host/ohci-sa1111.c
#	modified: drivers/usb/host/ohci.h
#	modified: drivers/usb/host/u132-hcd.c
#	modified: drivers/usb/host/uhci-hcd.c
#	modified: drivers/usb/host/uhci-hub.c
#	modified: drivers/usb/input/wacom_sys.c
#	modified: drivers/usb/input/wacom_wac.c
#	modified: drivers/usb/misc/auerswald.c
#	modified: drivers/usb/misc/ftdi-elan.c
#	modified: drivers/usb/misc/phidgetservo.c
#	modified: drivers/usb/misc/trancevibrator.c
#	modified: drivers/usb/net/gl620a.c
#	modified: drivers/usb/net/rtl8150.c
#	modified: drivers/usb/serial/airprime.c
#	modified: drivers/usb/serial/cp2101.c
#	modified: drivers/usb/serial/cypress_m8.c
#	modified: drivers/usb/serial/ftdi_sio.c
#	modified: drivers/usb/serial/ftdi_sio.h
#	modified: drivers/usb/serial/funsoft.c
#	modified: drivers/usb/serial/kl5kusb105.c
#	modified: drivers/usb/serial/mos7840.c
#	modified: drivers/usb/serial/option.c
#	modified: drivers/usb/storage/unusual_devs.h
#	modified: drivers/video/pxafb.c
#	modified: drivers/video/sa1100fb.c
#	modified: fs/dlm/lowcomms-tcp.c
#	modified: fs/gfs2/Kconfig
#	modified: fs/pipe.c
#	modified: include/asm-arm/arch-iop13xx/iq81340.h
#	modified: include/asm-arm/arch-ixp23xx/memory.h
#	modified: include/asm-arm/arch-s3c2410/anubis-cpld.h
#	modified: include/asm-arm/arch-s3c2410/anubis-irq.h
#	modified: include/asm-arm/arch-s3c2410/anubis-map.h
#	modified: include/asm-arm/arch-s3c2410/audio.h
#	modified: include/asm-arm/arch-s3c2410/bast-cpld.h
#	modified: include/asm-arm/arch-s3c2410/bast-irq.h
#	modified: include/asm-arm/arch-s3c2410/bast-map.h
#	modified: include/asm-arm/arch-s3c2410/bast-pmu.h
#	modified: include/asm-arm/arch-s3c2410/h1940-latch.h
#	modified: include/asm-arm/arch-s3c2410/hardware.h
#	modified: include/asm-arm/arch-s3c2410/iic.h
#	modified: include/asm-arm/arch-s3c2410/leds-gpio.h
#	modified: include/asm-arm/arch-s3c2410/map.h
#	modified: include/asm-arm/arch-s3c2410/nand.h
#	modified: include/asm-arm/arch-s3c2410/osiris-cpld.h
#	modified: include/asm-arm/arch-s3c2410/regs-serial.h
#	modified: include/asm-arm/arch-s3c2410/system.h
#	modified: include/asm-arm/arch-s3c2410/timex.h
#	modified: include/asm-arm/arch-s3c2410/uncompress.h
#	modified: include/asm-arm/arch-s3c2410/usb-control.h
#	modified: include/asm-arm/arch-s3c2410/vr1000-cpld.h
#	modified: include/asm-arm/arch-s3c2410/vr1000-irq.h
#	modified: include/asm-arm/arch-s3c2410/vr1000-map.h
#	modified: include/asm-arm/elf.h
#	modified: include/asm-arm/unistd.h
#	modified: include/asm-generic/vmlinux.lds.h
#	modified: include/asm-powerpc/spu.h
#	modified: include/linux/Kbuild
#	modified: include/linux/blkdev.h
#	modified: include/linux/device.h
#	modified: include/linux/elevator.h
#	modified: include/linux/ioport.h
#	modified: include/linux/kobject.h
#	modified: include/linux/pci.h
#	modified: include/linux/pci_ids.h
#	modified: include/linux/pci_regs.h
#	modified: include/sound/pcm_oss.h
#	modified: include/sound/version.h
#	modified: include/sound/ymfpci.h
#	modified: init/main.c
#	modified: kernel/irq/chip.c
#	modified: kernel/sched.c
#	modified: kernel/workqueue.c
#	modified: lib/kobject_uevent.c
#	modified: lib/kref.c
#	modified: sound/aoa/codecs/snd-aoa-codec-onyx.h
#	modified: sound/aoa/codecs/snd-aoa-codec-tas.c
#	modified: sound/core/control.c
#	modified: sound/core/oss/pcm_oss.c
#	modified: sound/core/pcm.c
#	modified: sound/core/pcm_lib.c
#	modified: sound/core/rawmidi.c
#	modified: sound/core/seq/seq_memory.c
#	modified: sound/core/sgbuf.c
#	modified: sound/isa/gus/gus_mem.c
#	modified: sound/isa/sb/sb_common.c
#	modified: sound/isa/wavefront/wavefront_synth.c
#	modified: sound/pci/ac97/ac97_codec.c
#	modified: sound/pci/ac97/ac97_patch.c
#	modified: sound/pci/ad1889.c
#	modified: sound/pci/ali5451/ali5451.c
#	modified: sound/pci/als300.c
#	modified: sound/pci/atiixp.c
#	modified: sound/pci/atiixp_modem.c
#	modified: sound/pci/au88x0/au88x0.c
#	modified: sound/pci/azt3328.c
#	modified: sound/pci/bt87x.c
#	modified: sound/pci/ca0106/ca0106.h
#	modified: sound/pci/ca0106/ca0106_main.c
#	modified: sound/pci/cmipci.c
#	modified: sound/pci/cs4281.c
#	modified: sound/pci/cs46xx/cs46xx_lib.c
#	modified: sound/pci/cs5535audio/cs5535audio.c
#	modified: sound/pci/echoaudio/echoaudio.c
#	modified: sound/pci/emu10k1/emu10k1_main.c
#	modified: sound/pci/emu10k1/emu10k1x.c
#	modified: sound/pci/ens1370.c
#	modified: sound/pci/es1938.c
#	modified: sound/pci/es1968.c
#	modified: sound/pci/fm801.c
#	modified: sound/pci/hda/hda_codec.c
#	modified: sound/pci/hda/hda_intel.c
#	modified: sound/pci/hda/hda_proc.c
#	modified: sound/pci/hda/patch_analog.c
#	modified: sound/pci/hda/patch_realtek.c
#	modified: sound/pci/hda/patch_si3054.c
#	modified: sound/pci/ice1712/ice1712.c
#	modified: sound/pci/ice1712/ice1724.c
#	modified: sound/pci/intel8x0.c
#	modified: sound/pci/intel8x0m.c
#	modified: sound/pci/korg1212/korg1212.c
#	modified: sound/pci/maestro3.c
#	modified: sound/pci/mixart/mixart.c
#	modified: sound/pci/nm256/nm256.c
#	modified: sound/pci/pcxhr/pcxhr.c
#	modified: sound/pci/riptide/riptide.c
#	modified: sound/pci/rme32.c
#	modified: sound/pci/rme96.c
#	modified: sound/pci/rme9652/hdsp.c
#	modified: sound/pci/rme9652/hdspm.c
#	modified: sound/pci/rme9652/rme9652.c
#	modified: sound/pci/sonicvibes.c
#	modified: sound/pci/trident/trident_main.c
#	modified: sound/pci/via82xx.c
#	modified: sound/pci/via82xx_modem.c
#	modified: sound/pci/vx222/vx222.c
#	modified: sound/pci/ymfpci/ymfpci.c
#	modified: sound/pci/ymfpci/ymfpci_main.c
#	modified: sound/usb/usbaudio.c
#
#
# Changed but not updated:
#   (use git-update-index to mark for commit)
#
#	unmerged: arch/arm/mach-ep93xx/core.c
#	modified: arch/arm/mach-ep93xx/ep93xx_devices.c
#	modified: drivers/net/arm/ep93xx_eth.c
#	modified: drivers/video/ep93xxfb.c
#	unmerged: include/asm-arm/system.h
#	modified: include/asm-arm/system.h
#
#
# Untracked files:
#   (use "git add" to add to commit)
#
#	build.sh
#	dogit.sh
#	include/asm-arm/arch-ep93xx/not-in-used/
#	log-status


B. git-diff output
==========

diff --cc include/asm-arm/system.h
index 04d6d2c,aa223fc..0000000
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@@ -170,31 -178,6 +178,34 @@@
  	  : : "r" (val) : "cc");
  }

++<<<<<<< HEAD/include/asm-arm/system.h
 +extern unsigned long cr_no_alignment;	/* defined in entry-armv.S */
 +extern unsigned long cr_alignment;	/* defined in entry-armv.S */
 +
 +#include <linux/irqflags.h>
 +
 +#ifndef CONFIG_SMP
 +static inline void adjust_cr(unsigned long mask, unsigned long set)
 +{
 +	unsigned long flags;
 +
 +	mask &= ~CR_A;
 +
 +	set &= mask;
 +
 +	raw_local_irq_save(flags);
 +
 +	cr_no_alignment = (cr_no_alignment & ~mask) | set;
 +	cr_alignment = (cr_alignment & ~mask) | set;
 +
 +	set_cr((get_cr() & ~mask) | set);
 +
 +	raw_local_irq_restore(flags);
 +}
 +#endif
 +
++=======
++>>>>>>> 9bfb18392ef586467277fa25d8f3a7a93611f6df/include/asm-arm/system.h
  #define UDBG_UNDEFINED	(1 << 0)
  #define UDBG_SYSCALL	(1 << 1)
  #define UDBG_BADABORT	(1 << 2)

C. And if I do git-pull again
=================

Trying really trivial in-index merge...
arch/arm/mach-ep93xx/core.c: needs merge
arch/arm/mach-ep93xx/ep93xx_devices.c: needs update
drivers/net/arm/ep93xx_eth.c: needs update
drivers/video/ep93xxfb.c: needs update
include/asm-arm/system.h: needs merge
Nope.
Merging HEAD with 3e67c0987d7567ad666641164a153dca9a43b11d
Merging:
87d627b097b52c47610037bfb890940752fbf4c8 added .orig to gitignore
3e67c0987d7567ad666641164a153dca9a43b11d [PATCH] truncate: clear page
dirtiness before running try_to_free_buffers()
found 1 common ancestor(s):
f238085415c56618e042252894f2fcc971add645 Merge branch 'for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid


D. diff output between file stamp 12-dec and 21-dec
=====================================

--- linux-2.6/include/asm-arm/system.h	2006-12-19 11:31:18.000000000 +0100
+++ linux-2.6-ep93xx/include/asm-arm/system.h	2006-12-21
15:37:18.000000000 +0100
@@ -73,6 +73,7 @@
 #ifndef __ASSEMBLY__

 #include <linux/linkage.h>
+#include <linux/irqflags.h>

 struct thread_info;
 struct task_struct;
@@ -139,6 +140,9 @@
 #define	cpu_is_xscale()	1
 #endif

+extern unsigned long cr_no_alignment;	/* defined in entry-armv.S */
+extern unsigned long cr_alignment;	/* defined in entry-armv.S */
+
 static inline unsigned int get_cr(void)
 {
 	unsigned int val;
@@ -152,6 +156,10 @@
 	  : : "r" (val) : "cc");
 }

+#ifndef CONFIG_SMP
+extern void adjust_cr(unsigned long mask, unsigned long set);
+#endif
+
 #define CPACC_FULL(n)		(3 << (n * 2))
 #define CPACC_SVC(n)		(1 << (n * 2))
 #define CPACC_DISABLE(n)	(0 << (n * 2))
@@ -170,29 +178,34 @@
 	  : : "r" (val) : "cc");
 }

+<<<<<<< HEAD/include/asm-arm/system.h
 extern unsigned long cr_no_alignment;	/* defined in entry-armv.S */
 extern unsigned long cr_alignment;	/* defined in entry-armv.S */

+#include <linux/irqflags.h>
+
 #ifndef CONFIG_SMP
 static inline void adjust_cr(unsigned long mask, unsigned long set)
 {
-	unsigned long flags, cr;
+	unsigned long flags;

 	mask &= ~CR_A;

 	set &= mask;

-	local_irq_save(flags);
+	raw_local_irq_save(flags);

 	cr_no_alignment = (cr_no_alignment & ~mask) | set;
 	cr_alignment = (cr_alignment & ~mask) | set;

 	set_cr((get_cr() & ~mask) | set);

-	local_irq_restore(flags);
+	raw_local_irq_restore(flags);
 }
 #endif

+=======
+>>>>>>> 9bfb18392ef586467277fa25d8f3a7a93611f6df/include/asm-arm/system.h
 #define UDBG_UNDEFINED	(1 << 0)
 #define UDBG_SYSCALL	(1 << 1)
 #define UDBG_BADABORT	(1 << 2)
@@ -248,8 +261,6 @@
 {
 }

-#include <linux/irqflags.h>
-
 #ifdef CONFIG_SMP

 #define smp_mb()		mb()

^ permalink raw reply

* Re: What's cooking in git.git (topics)
From: Andy Parkins @ 2006-12-22 11:11 UTC (permalink / raw)
  To: git
In-Reply-To: <7vzm9g2rv5.fsf@assigned-by-dhcp.cox.net>

On Friday 2006 December 22 09:37, Junio C Hamano wrote:

> * jc/git-add--interactive (Mon Dec 11 17:09:26 2006 -0800) 2 commits
>  + git-add --interactive: hunk splitting
>  + git-add --interactive

I used this to disentangle a load of changes that I made under pressure and 
turned them into lovely isolated commits.  I didn't have any trouble with it, 
and thought it was incredibly useful.

I'd vote for putting it in 1.5 - it's in keeping with the usability theme - 
people love interactive stuff.


Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com

^ permalink raw reply

* Re: newbie question - git-pull and local branch merge
From: Junio C Hamano @ 2006-12-22 10:46 UTC (permalink / raw)
  To: Pelle Svensson; +Cc: git
In-Reply-To: <6bb9c1030612220227h2dc83a78u2e31e0f4e6801412@mail.gmail.com>

"Pelle Svensson" <pelle2004@gmail.com> writes:

> 8. git-pull <- Problem!

And the problem is...???

> Accidentally I had 2 files not committed and one of these also
> had changes in the git-pull master branch which git could
> not merge automatically.

So you had changes to fileA that you already committed, and
further changes in your working tree, and Linus side updated
that same file since you started working on it?

If that is the case, I suspect that the pull stopped saying
something like "Entry ... not uptodate. Cannot merge."  If that
is the case I think your working tree has what you had before
you started the pull.  Deal with your own changes in the files
you dirtied (say, commit them first) and pull again.

Otherwise, what happened was you had changes to fileB that you
already committed, and Linus side also updated the same file in
the meantime, and you did _not_ have any change to that fileB in
your working tree (you might have had some other files locally
modified).  And the pull would have reported something like
"CONFLICT (content)" in such a case.

$ git diff

will show you an output that looks like diff but not really (you
can tell by its hunk header that have three '@' letters instead
of normal two); you have a conflicted merge result, and have the
usual conflict markers in that file.  Edit the file to resolve
conflict.  Then say:

$ git update-index conflicted-file-1.c conflicted-file-2.c ...
$ git commit

to record the merge commit.  Do not update-index the files that
you had your own changes before pulling -- those changes do not
have anything to do with this merge and you do not want to
record them as part of the merge.

^ permalink raw reply

* newbie question - git-pull and local branch merge
From: Pelle Svensson @ 2006-12-22 10:27 UTC (permalink / raw)
  To: git

Hi,

I'm quiet new to git and I have done this so far:

1. Installed git-1.4.4
2. pulled linus kernel tree.
3. Created a local branch 'git-checkout my stuff'
4. Edit a number of files.
5. git-commit -a
6. git-pull
7. Edit a couple more files.
8. git-pull <- Problem!

Accidentally I had 2 files not committed and one of these also
had changes in the git-pull master branch which git could
not merge automatically.

Changes has been done but I'm not fully convinced what has happen.
I see that files has been changed and the failing merge file need's
to be edit.

The really question I need answer is how can I see what changes
has been done in the master branch (the one pulled in) of the
file I suppose to merge manually. Is there no way to get out
the 2 last versions from the master branch and supply them to
KDiff3 or similarly diff program.

Also by reading the documentation I wounder what the difference is of:

- commit and check-in, seem to be same thing.
- update index-file and update the repository.

/Thanks

^ permalink raw reply

* Re: Updated Kernel Hacker's guide to git
From: Junio C Hamano @ 2006-12-22 10:26 UTC (permalink / raw)
  To: Francis Moreau; +Cc: Jay Cliburn, git, Jeff Garzik, Linus Torvalds
In-Reply-To: <38b2ab8a0612220135p6925be4cmf003811f616395ba@mail.gmail.com>

"Francis Moreau" <francis.moro@gmail.com> writes:

> I think this part is really confusing. For a new comer, saying that:
>
> 	git diff a b == git diff a..b
>
> is really not intuitive. Maybe just because adding a new symbol ".."
> in git diff command line means (for me) that we're doing a special
> diff. I would never thought by my own that ".." means a simple "to".

We did not originally have "A B"; you were supposed to always
say "A..B".  But all other SCM had "A B" notation, so we added
support for both because doing so was trivial and there is no
risk of confusion (because diff is about two points while log is
about a set).  These two notations are interchangeable for
"diff".  If it confuses you, you can stick to the "git diff A B"
notation.  Of if you are like Linus, stick to "A..B" notation.
Either way, you can pretend that the other notation does not
even exist and be happy ;-).

Yes, users often wondered why "git diff" accepts "A B", "git
log" wants "A..B" and "git log A B" is a disaster.  But the root
cause of the confusion was not about notation but about the
conceptual difference (two points vs a set).

I do not think changing the meaning of "diff A..B" to what "diff
A...B" means is a good thing.  The notation "..." even _looks_
like a magic, and in diff context, what it does _is_ magic (it
is magic in log context, too).  You are giving two points, but
what actually is used as the two points for diff are different
from what you gave; in that sense, it is a very good notation.
Changing it would confuse and inconvenience people who already
understood and got used to the difference between "diff" and
"log": diff takes two points, so given usual A..B notation it
uses A and B, while log is about a set and means 'the ones
reachable from B, excluding the ones reachable from A'; "A...B"
is magic and does a magical thing in both "diff" and "log",
taking the merge bases between A and B into account.

^ permalink raw reply

* Re: git-svn throwing assertion on old svn tracking branch
From: Nicolas Vilz @ 2006-12-22  9:43 UTC (permalink / raw)
  To: Eric Wong; +Cc: git
In-Reply-To: <20061222083803.GD26800@hand.yhbt.net>

On Fri, Dec 22, 2006 at 12:38:03AM -0800, Eric Wong wrote:
> Nicolas Vilz <niv@iaglans.de> wrote:
> > On Fri, Dec 22, 2006 at 02:35:10AM +0100, Nicolas Vilz wrote:
> > > On Wed, Dec 20, 2006 at 05:05:20PM -0800, Eric Wong wrote:
> > > > Nicolas Vilz <niv@iaglans.de> wrote:
> > [...]
> > > beneath there is svn, version 1.4.2 (r22196) ... on that repository is
> > > Subversion version 1.1.4 (r13838).
> > 
> > i should ammend, that the same error message comes, when i want to
> > dcommit something in this repository...
> 
> Weird, so you have the SVN:: libraries installed? (dcommit requires it).
> Is the repository you're tracking public?  If so, I'd like to have a
> look...
unfortunatelly, its not public...

I noticed, it is not the step of committing anything, but the step to
fetch the revisions in the svn tree. I had a workaround last night... I
used the documentation on Advanced Example: Tracking a Reorganized
Repository to reorganize my tree from broken old repository to
reorganized fresh tree that is working... that all because time was
running out this night and i had to work something.

I keep the old one as a souvenier... The problem lies somewhere there in
the old branch. The history is not lost here in any case.

I backuped my repository and pruned my tree as you suggested it... I
connected to that remote repository... and then the assertion came down
on me. Personally i can live with that reorganized repository. If you
are really keen on digging the error down to ground, i could try to
setup something.

Perhaps back were i worked on that repository, git-svn accessed a little
different from now....

If you are still interested in digging, I think about a private solution
for that.

Sincerly
Nicolas Vilz

^ permalink raw reply

* Re: confusion over the new branch and merge config
From: Lars Hjemli @ 2006-12-22  9:39 UTC (permalink / raw)
  To: Andy Parkins; +Cc: git, Nicolas Pitre
In-Reply-To: <200612220841.46016.andyparkins@gmail.com>

On 12/22/06, Andy Parkins <andyparkins@gmail.com> wrote:
> On Thursday 2006 December 21 22:17, Nicolas Pitre wrote:
> > $ git branch -r
> > * master
> >   origin/HEAD
> >   origin/html
> >   origin/maint
> >   origin/man
> >   origin/master
> >   origin/next
> >   origin/pu
> >   origin/todo
>
> I'm trying to track down why "master" is being shown in this case";

This looks very much like "git branch -a".

I've just tried this:

$ git clone git://git2.kernel.org/pub/scm/git/git.git
Initialized empty Git repository in /home/larsh/src/tmp/git/.git/
remote: Generating pack...
remote: Done counting 34527 objects.
remote: Deltifying 34527 objects.
remote:  100% (34527/34527) done
Indexing 34527 objects.
remote: Total 34527, written 34527 (delta 23920), reused 34111 (delta 23623)
 100% (34527/34527) done
Resolving 23920 deltas.
 100% (23920/23920) done
Checking files out...
 100% (748/748) done
$ cd git
$ git branch -r
  origin/HEAD
  origin/html
  origin/maint
  origin/man
  origin/master
  origin/next
  origin/pu
  origin/todo
$ git branch -a
* master
  origin/HEAD
  origin/html
  origin/maint
  origin/man
  origin/master
  origin/next
  origin/pu
  origin/todo
$ cp .git/refs/heads/master .git/refs/remotes/master
$ git branch -r
  master
  origin/HEAD
  origin/html
  origin/maint
  origin/man
  origin/master
  origin/next
  origin/pu
  origin/todo
$ git symbolic-ref HEAD refs/remotes/master
$ git branch -r
fatal: HEAD not found below refs/heads!
$ git --version
git version 1.4.4.2.gee60


-- 
larsh

^ permalink raw reply

* What's cooking in git.git (topics)
From: Junio C Hamano @ 2006-12-22  9:37 UTC (permalink / raw)
  To: git

Here are the topics that have been cooking.  Commits prefixed
with '-' are only in 'pu' while commits prefixed with '+' are
in 'next'.  The topics list the commits in reverse chronological
order.

* jc/rm (Fri Dec 22 01:02:59 2006 -0800) 2 commits
 - t3600: update the test for updated git rm
 - git-rm: update to saner semantics

This still needs 'require -r to descend into directories'
safety.  I'd really want to have this in v1.5.0.

* jc/fsck-reflog (Fri Dec 22 00:46:33 2006 -0800) 8 commits
 + reflog expire: prune commits that are not incomplete
 + Don't crash during repack of a reflog with pruned commits.
 + git reflog expire
 + Move in_merge_bases() to commit.c
 + reflog: fix warning message.
 + Teach git-repack to preserve objects referred to by reflog
   entries.
 + Protect commits recorded in reflog from pruning.
 + add for_each_reflog_ent() iterator

The latest 'reflog expire' hopefully should revive Shawn's
repository and make prune or repack working again for him.

Tip for 'next' users.  fsck and prune consider commits that are
referenced by reflog entries reachable, but your repositories
may have been pruned by earlier 'prune' already, which may cause
repack to barf and refuse.  Please use 'reflog expire --all' to
prune out reflog entries that refer to commits that are already
lost if repack fails in your repository and try again.

Because we have made the reflog enabled by default, I really
would want to have this in v1.5.0 to prevent unbounded growth of
reflog files.

I think none of the rest are 'must have's for v1.5.0.  Perhaps
except for js/rerere series.

* js/rerere (Wed Dec 20 17:39:41 2006 +0100) 3 commits
 + Make git-rerere a builtin
 + Add a test for git-rerere
 + move read_mmfile() into xdiff-interface
* jc/skip-count (Tue Dec 19 18:25:32 2006 -0800) 1 commit
 + revision: --skip=<n>
* jn/web (Sat Dec 16 17:12:55 2006 +0100) 1 commit
 - gitweb: Add some mod_perl specific support
* jc/git-add--interactive (Mon Dec 11 17:09:26 2006 -0800) 2 commits
 + git-add --interactive: hunk splitting
 + git-add --interactive
* jc/explain (Mon Dec 4 19:35:04 2006 -0800) 1 commit
 - git-explain
* jc/3way (Wed Nov 29 18:53:13 2006 -0800) 1 commit
 + git-merge: preserve and merge local changes when doing fast
   forward
* js/shallow (Fri Nov 24 16:00:13 2006 +0100) 15 commits
 + fetch-pack: Do not fetch tags for shallow clones.
 + get_shallow_commits: Avoid memory leak if a commit has been
   reached already.
 + git-fetch: Reset shallow_depth before auto-following tags.
 + upload-pack: Check for NOT_SHALLOW flag before sending a shallow
   to the client.
 + fetch-pack: Properly remove the shallow file when it becomes
   empty.
 + shallow clone: unparse and reparse an unshallowed commit
 + Why didn't we mark want_obj as ~UNINTERESTING in the old code?
 + Why does it mean we do not have to register shallow if we have
   one?
 + We should make sure that the protocol is still extensible.
 + add tests for shallow stuff
 + Shallow clone: do not ignore shallowness when following tags
 + allow deepening of a shallow repository
 + allow cloning a repository "shallowly"
 + support fetching into a shallow repository
 + upload-pack: no longer call rev-list
* jc/web (Wed Nov 8 14:54:09 2006 -0800) 1 commit
 - gitweb: steal loadavg throttle from kernel.org
* jc/pickaxe (Sun Nov 5 11:52:43 2006 -0800) 1 commit
 - blame: --show-stats for easier optimization work.
* jc/diff (Mon Sep 25 23:03:34 2006 -0700) 1 commit
 - para-walk: walk n trees, index and working tree in parallel
* jc/diff-apply-patch (Fri Sep 22 16:17:58 2006 -0700) 1 commit
 + git-diff/git-apply: make diff output a bit friendlier to GNU patch
   (part 2)

^ permalink raw reply

* Re: Updated Kernel Hacker's guide to git
From: Francis Moreau @ 2006-12-22  9:35 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Jay Cliburn, git, Jeff Garzik
In-Reply-To: <Pine.LNX.4.64.0612211013500.3394@woody.osdl.org>

Linus Torvalds wrote:
>
> In short, for git diff (and ONLY) git diff, all of these are the same:
>
> 	git diff a..b
> 	git diff a b
> 	git diff b ^a
>

I think this part is really confusing. For a new comer, saying that:

	git diff a b == git diff a..b

is really not intuitive. Maybe just because adding a new symbol ".."
in git diff command line means (for me) that we're doing a special
diff. I would never thought by my own that ".." means a simple "to".

> [ ADDITIONALLY git diff _also_ has a magic special case of
>
> 	git diff a b ^c
>
>   which actually means the same as "git diff c..a" (and "b" is
>   totally ignored). That may sound strange, but it's because the
>   expression "a...b" means "b a --not $(git-merge-base a b)", and so what
>   you actually WANT is that if you do
>
> 	git diff a...b
>
>   you should get "diff from merge-base to b", so when "a...b" expands to
>   "b a ^merge-base", then git understands that if it gets that stange
>   command line with THREE commits, and one of them is negated, you really
>   wanted the diff from the negated one to the first one ]
>
> It basically all boils down to:
>
> 	"git diff" is special
>

but this very special part of git diff is also not documented at all
when reading the manual of git-diff... Maybe it can be reached by
others manuals ?

> exactly because unlike almost ALL other git commands, "git diff" does not
> work on a _list_ of commits, it only works on two end-points. That means
> that the "list operations" actually end up meaning something else for git
> diff than they do for "git log" and friends.
>

I think I got your point now: git-diff only works on two end-points.


Why not making it less special as follow:

	git diff a b
	git diff b ^a

These two diff commands are the same. They do a diff between a and b
end-points (maybe commits is better there since we don't add one more
keyword). It's similar to diff command. For me it's quite intuitive.

	git diff a..b

Ok now the command syntax is more special (maybe simply because
traditional diff() does not have a similar syntax, it's really
specific to git). "git log" and friends have a similar syntax and they
do work on a list of commits. For consistency sake, make this commad
works on commit list too. Therefore this command would end up doing
exactly the same thing like "git diff a...b"

	git diff a...b

No more need of this special syntax.


What do you think ?

thanks
-- 
Francis

^ 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