* Re: [PATCH] Add ALL_LDFLAGS to the git target.
From: Jason Riedy @ 2006-03-28 23:59 UTC (permalink / raw)
To: git
In-Reply-To: <7vbqvqjgvi.fsf@assigned-by-dhcp.cox.net>
And Junio C Hamano writes:
- My preference is to ignore FORTRAN, keep Mark's current rules,
- perhaps with a way to turn it off if people really find it
- annoying (I do not mind having it always on).
Sorry; I had meant my comment as an aside and not a
request. I had never noticed the function definition
in patches, and now I typically use Emacs's tools.
And as of Fortran 90, it's now officially Fortran and
not FORTRAN.
Jason
^ permalink raw reply
* Re: Cherry-pick particular object
From: Petr Baudis @ 2006-03-28 23:28 UTC (permalink / raw)
To: Linus Torvalds; +Cc: sean, Sébastien Pierre, git
In-Reply-To: <Pine.LNX.4.64.0603281512260.15714@g5.osdl.org>
Dear diary, on Wed, Mar 29, 2006 at 01:24:13AM CEST, I got a letter
where Linus Torvalds <torvalds@osdl.org> said that...
> On Wed, 29 Mar 2006, Petr Baudis wrote:
>
> > Dear diary, on Wed, Mar 29, 2006 at 12:44:02AM CEST, I got a letter
> > where Linus Torvalds <torvalds@osdl.org> said that...
> > > Ie you can have a tree like this:
> > >
> > > 100644 blob f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f abc
> > > 120000 blob f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f file
> > >
> > > where the first one is a regular file called "abc" (which contains the
> > > string "abc"), and the second is the _symlink_ that points to "abc".
> > >
> > > They share the exact same blob, and what distinguishes them is the
> > > filemode info from git-read-tree.
> >
> > Huh? Didn't you rather want to say that "file" will point to a blob
> > containing just the "abc" string (the symlink target)? ;-)
>
> Well no, maybe I should have called the first file something else.
>
> Both "abc" and "file" from a git perspective have the same _contents_ (the
> blob containing the data 'abc').
Oh, I've totally missed the '(which contains the string "abc")' part,
sorry. Apparently it's time to sleep for me. :/
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Right now I am having amnesia and deja-vu at the same time. I think
I have forgotten this before.
^ permalink raw reply
* Re: Cherry-pick particular object
From: Linus Torvalds @ 2006-03-28 23:24 UTC (permalink / raw)
To: Petr Baudis; +Cc: sean, Sébastien Pierre, git
In-Reply-To: <20060328225429.GD27689@pasky.or.cz>
On Wed, 29 Mar 2006, Petr Baudis wrote:
> Dear diary, on Wed, Mar 29, 2006 at 12:44:02AM CEST, I got a letter
> where Linus Torvalds <torvalds@osdl.org> said that...
> > Ie you can have a tree like this:
> >
> > 100644 blob f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f abc
> > 120000 blob f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f file
> >
> > where the first one is a regular file called "abc" (which contains the
> > string "abc"), and the second is the _symlink_ that points to "abc".
> >
> > They share the exact same blob, and what distinguishes them is the
> > filemode info from git-read-tree.
>
> Huh? Didn't you rather want to say that "file" will point to a blob
> containing just the "abc" string (the symlink target)? ;-)
Well no, maybe I should have called the first file something else.
Both "abc" and "file" from a git perspective have the same _contents_ (the
blob containing the data 'abc').
But the filemode means that those contents have totally different meaning.
For the pth "file", it means that it's a _symlink_ to "abc", while for the
path "abc" it's a regular file that just has the _contents_ "abc".
So the end _result_ of this is that "file" points to a file called "abc"
that also has the contents "abc", and "cat file abc" will result in
"abcabc".
IOW, this is the result of doing
echo -n abc > abc
ln -s abc file
and importing the mess into git.
Linus
^ permalink raw reply
* Re: [PATCH] Add ALL_LDFLAGS to the git target.
From: Mark Wooding @ 2006-03-28 23:21 UTC (permalink / raw)
To: git
In-Reply-To: <Pine.LNX.4.64.0603281500280.15714@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> wrote:
> I'd really just prefer to make the "-p" switch configurable, the way
> it was before. No regexps, just the same rules as for GNU diff,
The rules for GNU diff aren't actually good enough if you can't
configure them. We used to be able to put runes in GIT_DIFF_OPTS.
> perhaps with the difference being that it would be on by default.
I thought it /was/ on by default:
: static const char *diff_opts = "-pu";
(killed in cebff98db).
> Another possible approach is to say
> - if the first line of the real diff matches the rules, do NOT add
> another line that matches the rule at the @@-line.
>
> since the simple @@-line rule really doesn't make sense for any file that
> is "dense" (ie where most lines start with non-whitespace).
It's true, and that's an easy fix. But it doesn't do any actual harm.
-- [mdw]
^ permalink raw reply
* Re: [PATCH] Add ALL_LDFLAGS to the git target.
From: Junio C Hamano @ 2006-03-28 23:20 UTC (permalink / raw)
To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0603281500280.15714@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> On Tue, 28 Mar 2006, Mark Wooding wrote:
>
>> Jason Riedy <ejr@EECS.Berkeley.EDU> wrote:
>>
>> > P.S. For the whole finding-a-function-name business, some of
>> > us are using git on fixed-format Fortran. Every non-comment
>> > line begins with whitespace... ;) And in free format, many
>> > people don't add that first indentation within subroutines.
>>
>> Urgh. So, which regex library do people want to use? ;-) (My vote's
>> for pcre.)
>
> I'd really just prefer to make the "-p" switch configurable, the way it
> was before. No regexps, just the same rules as for GNU diff, perhaps with
> the difference being that it would be on by default.
Strictly speaking, "No regexps" and "same rules as for GNU diff"
are mutually incompatible, since GNU diff -p defaults to
"^[[:alpha:]$_]" but the regexp is configurable.
My preference is to ignore FORTRAN, keep Mark's current rules,
perhaps with a way to turn it off if people really find it
annoying (I do not mind having it always on).
> Another possible approach is to say
> - if the first line of the real diff matches the rules, do NOT add
> another line that matches the rule at the @@-line.
>
> since the simple @@-line rule really doesn't make sense for any file that
> is "dense" (ie where most lines start with non-whitespace).
I think this is a good rule. If "the first non-empty line" may
be even better; we do not want to see the name of previous
function for a huke like this:
@@ -a,b +c,d @@
int frotz(void)
{
...
^ permalink raw reply
* Re: [PATCH] Add ALL_LDFLAGS to the git target.
From: Linus Torvalds @ 2006-03-28 23:03 UTC (permalink / raw)
To: Mark Wooding; +Cc: git
In-Reply-To: <slrne2jf9t.s3g.mdw@metalzone.distorted.org.uk>
On Tue, 28 Mar 2006, Mark Wooding wrote:
> Jason Riedy <ejr@EECS.Berkeley.EDU> wrote:
>
> > P.S. For the whole finding-a-function-name business, some of
> > us are using git on fixed-format Fortran. Every non-comment
> > line begins with whitespace... ;) And in free format, many
> > people don't add that first indentation within subroutines.
>
> Urgh. So, which regex library do people want to use? ;-) (My vote's
> for pcre.)
I'd really just prefer to make the "-p" switch configurable, the way it
was before. No regexps, just the same rules as for GNU diff, perhaps with
the difference being that it would be on by default.
Another possible approach is to say
- if the first line of the real diff matches the rules, do NOT add
another line that matches the rule at the @@-line.
since the simple @@-line rule really doesn't make sense for any file that
is "dense" (ie where most lines start with non-whitespace).
Linus
^ permalink raw reply
* Re: Cherry-pick particular object
From: Petr Baudis @ 2006-03-28 22:54 UTC (permalink / raw)
To: Linus Torvalds; +Cc: sean, Sébastien Pierre, git
In-Reply-To: <Pine.LNX.4.64.0603281435410.15714@g5.osdl.org>
Dear diary, on Wed, Mar 29, 2006 at 12:44:02AM CEST, I got a letter
where Linus Torvalds <torvalds@osdl.org> said that...
> Ie you can have a tree like this:
>
> 100644 blob f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f abc
> 120000 blob f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f file
>
> where the first one is a regular file called "abc" (which contains the
> string "abc"), and the second is the _symlink_ that points to "abc".
>
> They share the exact same blob, and what distinguishes them is the
> filemode info from git-read-tree.
Huh? Didn't you rather want to say that "file" will point to a blob
containing just the "abc" string (the symlink target)? ;-)
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Right now I am having amnesia and deja-vu at the same time. I think
I have forgotten this before.
^ permalink raw reply
* Re: Gitk strangeness..
From: Paul Mackerras @ 2006-03-28 22:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Linus Torvalds
In-Reply-To: <7vzmjbj9a1.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano writes:
> How about this alternative patch, then? It turned out to be
> quite convoluted as I feared.
That's brilliant. Thank you! With the patch to gitk below, the
graph display on Linus' example looks much saner.
Could you check in your patch to the git.git repository, please?
Thanks,
Paul.
diff --git a/gitk b/gitk
index 03cd475..1989aa5 100755
--- a/gitk
+++ b/gitk
@@ -46,7 +46,7 @@ proc start_rev_list {rlargs} {
}
if {[catch {
set commfd [open [concat | git-rev-list --header $order \
- --parents $rlargs] r]
+ --parents --boundary $rlargs] r]
} err]} {
puts stderr "Error executing git-rev-list: $err"
exit 1
@@ -114,8 +114,13 @@ proc getcommitlines {commfd} {
set start [expr {$i + 1}]
set j [string first "\n" $cmit]
set ok 0
+ set listed 1
if {$j >= 0} {
set ids [string range $cmit 0 [expr {$j - 1}]]
+ if {[string range $ids 0 0] == "-"} {
+ set listed 0
+ set ids [string range $ids 1 end]
+ }
set ok 1
foreach id $ids {
if {[string length $id] != 40} {
@@ -133,8 +138,12 @@ proc getcommitlines {commfd} {
exit 1
}
set id [lindex $ids 0]
- set olds [lrange $ids 1 end]
- set commitlisted($id) 1
+ if {$listed} {
+ set olds [lrange $ids 1 end]
+ set commitlisted($id) 1
+ } else {
+ set olds {}
+ }
updatechildren $id $olds
set commitdata($id) [string range $cmit [expr {$j + 1}] end]
set commitrow($id) $commitidx
^ permalink raw reply related
* Re: [PATCH] Add ALL_LDFLAGS to the git target.
From: Mark Wooding @ 2006-03-28 22:48 UTC (permalink / raw)
To: git
In-Reply-To: <15693.1143575188@lotus.CS.Berkeley.EDU>
Jason Riedy <ejr@EECS.Berkeley.EDU> wrote:
> P.S. For the whole finding-a-function-name business, some of
> us are using git on fixed-format Fortran. Every non-comment
> line begins with whitespace... ;) And in free format, many
> people don't add that first indentation within subroutines.
Urgh. So, which regex library do people want to use? ;-) (My vote's
for pcre.)
-- [mdw]
^ permalink raw reply
* Re: git pull fails
From: Petr Baudis @ 2006-03-28 22:48 UTC (permalink / raw)
To: Radoslaw Szkodzinski; +Cc: git, Timo Hirvonen, Ralf Baechle
In-Reply-To: <200603281700.17233.astralstorm@o2.pl>
Dear diary, on Tue, Mar 28, 2006 at 05:00:11PM CEST, I got a letter
where Radoslaw Szkodzinski <astralstorm@o2.pl> said that...
> On Tuesday 28 March 2006 16:38, Timo Hirvonen wrote yet:
> > Thanks, but forcing everyone to edit their git/remotes/origin file
> > is not very nice solution. I think git-fetch should update refs for the
> > other non-'broken' branches and leave "pu" and "next" refs untouched.
>
> How do you know a non-broken branch from something weird?
If I understand it right, Timo complains that git-fetch got
non-fastforward commits for "pu" and "next" and a good fastforward
commit for "master", but it didn't update the ref for ANY head, not even
the "master".
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Right now I am having amnesia and deja-vu at the same time. I think
I have forgotten this before.
^ permalink raw reply
* Re: Cherry-pick particular object
From: Linus Torvalds @ 2006-03-28 22:44 UTC (permalink / raw)
To: sean; +Cc: Sébastien Pierre, git
In-Reply-To: <BAYC1-PASMTP02B05019F52DE48793CB39AED30@CEZ.ICE>
On Tue, 28 Mar 2006, sean wrote:
>
> $ git cat-file -t 78132af2643
Side note: when using git-ls-tree, the "blob"ness information is already
in the tree output itself and you shouldn't even need to check the type
with "-t". So what is perhaps somewhat more interesting is actually the
mode of the file, since that determines whether the blob should be
interpreted as regular file content or as a symlink.
Ie you can have a tree like this:
100644 blob f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f abc
120000 blob f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f file
where the first one is a regular file called "abc" (which contains the
string "abc"), and the second is the _symlink_ that points to "abc".
They share the exact same blob, and what distinguishes them is the
filemode info from git-read-tree.
Of course, the symlink case isn't very common and likely not very
interesting in this case, but the fact that "git ls-files" is set up so
that you can just cut-and-paste the "blob <sha1-of-blob" part and feed it
to git-cat-file was definitely not just coincidence.
(A number of the early stuff was set up so that I could do things by hand
by just doing cut-and-paste of the output of the previous command. Git has
come a long way in the last 12 months ;)
Linus
^ permalink raw reply
* Re: Cherry-pick particular object
From: Sébastien Pierre @ 2006-03-28 17:23 UTC (permalink / raw)
To: sean; +Cc: Git ML
In-Reply-To: <BAYC1-PASMTP02B05019F52DE48793CB39AED30@CEZ.ICE>
On Tue, 28 Mar 2006 16:34:22 -0500
sean <seanlkml@sympatico.ca> wrote:
> If you used:
>
> $ git cat-file -t 78132af2643
>
> It would tell you that this object is of type "blob".
> To see the contents of blobs you can do something like:
>
> $ git cat-file blob 78132af2643
Thanks. That was exactly what I was looking for :)
-- Sébastien
^ permalink raw reply
* Re: Cherry-pick particular object
From: Tony Luck @ 2006-03-28 21:38 UTC (permalink / raw)
To: Sébastien Pierre; +Cc: git
In-Reply-To: <20060328113107.20ab4c21.sebastien@xprima.com>
> "get the file corresponding to 78132af26431e649a0f85f22dc27e5787d80700f and save it as myfile.txt"
>
> How would one properly do that with core git ?
$ git cat-file blob 78132af2643 > myfile.txt
-Tony
^ permalink raw reply
* Re: Cherry-pick particular object
From: Shawn Pearce @ 2006-03-28 21:37 UTC (permalink / raw)
To: Sébastien Pierre; +Cc: git
In-Reply-To: <20060328113107.20ab4c21.sebastien@xprima.com>
S?bastien Pierre <sebastien@xprima.com> wrote:
> Hi all,
>
> This is a newbie question.
>
> I recently wanted to "cherry" pick a particular file from my
> git-managed project history. Using gitk, I identified which was
> the revision I wanted (95ba0c74e03874e8c1721b91f92f161e9061621f),
> and then using git ls-tree, I managed to get the id of the file I
> wanted (78132af26431e649a0f85f22dc27e5787d80700f).
>
> Now, what I simply wanted was to do something like:
>
> "get the file corresponding to
> 78132af26431e649a0f85f22dc27e5787d80700f and save it as myfile.txt"
>
> How would one properly do that with core git ?
git cat-file blob 78132af26431e649a0f85f22dc27e5787d80700f >myfile.txt
--
Shawn.
^ permalink raw reply
* Re: Cherry-pick particular object
From: sean @ 2006-03-28 21:34 UTC (permalink / raw)
To: Sébastien Pierre; +Cc: git
In-Reply-To: <20060328113107.20ab4c21.sebastien@xprima.com>
On Tue, 28 Mar 2006 11:31:07 -0500
Sébastien Pierre <sebastien@xprima.com> wrote:
> Hi all,
>
> This is a newbie question.
>
> I recently wanted to "cherry" pick a particular file from my
> git-managed project history. Using gitk, I identified which was
> the revision I wanted (95ba0c74e03874e8c1721b91f92f161e9061621f),
> and then using git ls-tree, I managed to get the id of the file I
> wanted (78132af26431e649a0f85f22dc27e5787d80700f).
>
> Now, what I simply wanted was to do something like:
>
> "get the file corresponding to 78132af26431e649a0f85f22dc27e5787d80700f
> and save it as myfile.txt"
>
> How would one properly do that with core git ?
If you used:
$ git cat-file -t 78132af2643
It would tell you that this object is of type "blob".
To see the contents of blobs you can do something like:
$ git cat-file blob 78132af2643
Sean
^ permalink raw reply
* Cherry-pick particular object
From: Sébastien Pierre @ 2006-03-28 16:31 UTC (permalink / raw)
To: git
Hi all,
This is a newbie question.
I recently wanted to "cherry" pick a particular file from my git-managed project history. Using gitk, I identified which was the revision I wanted (95ba0c74e03874e8c1721b91f92f161e9061621f), and then using git ls-tree, I managed to get the id of the file I wanted (78132af26431e649a0f85f22dc27e5787d80700f).
Now, what I simply wanted was to do something like:
"get the file corresponding to 78132af26431e649a0f85f22dc27e5787d80700f and save it as myfile.txt"
How would one properly do that with core git ?
-- Sébastien
^ permalink raw reply
* Re: [PATCH] Add ALL_LDFLAGS to the git target.
From: Jason Riedy @ 2006-03-28 19:46 UTC (permalink / raw)
To: git
In-Reply-To: <7vu09jks1u.fsf@assigned-by-dhcp.cox.net>
And Junio C Hamano writes:
- Hmph. We do fprintf(stderr, "blah\r") to draw them. The
- standard says that "standard error stream is not fully
- buffered", but I guess it does not necessarily mean it is
- unbuffered, so we probably need to fflush(3) there. Would
- something like this help?
I suppose I should have mentioned that I tried flushing
stderr. Your more comprehensive flushing also does not
fix it, giving outputs like:
> Unpacking Total 3333 objects
> , written 33 (delta 1), reused 0 (delta 0)
The problem is that stderr from a child is not tied to any
stream of its parent. Generally, as far as I know, you
cannot make any assumptions about how pipes from separate
processes are interleaved in the output. Some standard may
say something, but I have no idea what or if anyone listens.
And this particular system is a busy SMP node, making the
problem worse.
Line-buffered streams like stdout tend to work, but not
unbuffered streams like stderr. We can't make stderr line-
buffered without breaking the status indicator...
If I add a third fd to all the pipes and dup it to stderr,
the tests work. I never read from that fd, so I never get
the status output... Progress needs to be part of the
protocol so front ends can handle it cleanly rather than
using stderr tricks.
So some possibilities:
1) Add the ability to pass options through the whole
connect system. Then pass -q in the tester.
2) Add a specific "quiet" command to the protocol for
just passing -q from git-fetch-pack. Pass -q in the
tester.
3) Add an option to pack-objects that dumps progress
output to stdout in a special packet format. Then
update everyone who talks through upload-pack to
expect another phase of informational messages after
negotiating object differences and before the pack
data.
The first two are cosmetic fixes only, and #2 is a cheap,
ugly, but easy hack.
This problem is (to me) low priority. It unfortunately
breaks a test case on AIX, but I can live with it for now.
If others here start to listen to the gospel of git, well,
I'll need to fix it. (But I once recommended Arch, and
people stopped listening after they tried it.)
Folks using moderately-loaded SMPs may experience similar
problems. But if they're fetching large packs, the problem
likely won't appear at all.
Jason
P.S. For the whole finding-a-function-name business, some of
us are using git on fixed-format Fortran. Every non-comment
line begins with whitespace... ;) And in free format, many
people don't add that first indentation within subroutines.
^ permalink raw reply
* increase in sexual desire
From: Noel Connolly @ 2006-03-29 0:05 UTC (permalink / raw)
To: geogirb
Carefully chosen herbal ingredients are the key to peniis enlargement success.
Not only the precise blend of ingredients but also many other factors have effect
on the overall potency and strength of peniis enlargement formula.
Some of these factors include growing conditions, geographical location where herbs are grown,
harvest time, the way herbs are stored before processing, the way herbs are processed.
http://ihkmde.webgoodnews.com/?abcfgjldexwqowyizpphkm
op
^ permalink raw reply
* Re: Selecting the minor revs
From: Yasushi SHOJI @ 2006-03-28 16:01 UTC (permalink / raw)
To: sean; +Cc: Greg Lee, git
In-Reply-To: <BAYC1-PASMTP1277D14C35B0D95512243BAED30@CEZ.ICE>
On 3/28/06, sean <seanlkml@sympatico.ca> wrote:
> On Mon, 27 Mar 2006 19:10:09 -0500
> "Greg Lee" <glee@swspec.com> wrote:
>
> > > If you're interested in the stable-series releases of the
> > > kernel, unfortunately they're not in the git repository.
> >
> > As I feared ... I'm curious, why?
>
> Because the stable-series is maintained by people other than Linus.
>
> They may have their own git tree, i'm not sure. Even if they don't,
> you could create a stable-series branch and import the patches
> into your git repo if it was something you needed often.
they do. and you can just do, ie for 2.6.15.y
git fetch git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.15.y.git
master:v2.6.15.y
you might wanna use --tags for fetch. see git-fetch(1) for more detail.
see http://kernel.org/git/ for other stable branches. and thanks for
stable branch maintainers.
--
yashi
^ permalink raw reply
* Re: git pull fails
From: Radoslaw Szkodzinski @ 2006-03-28 15:00 UTC (permalink / raw)
To: git; +Cc: Timo Hirvonen, Ralf Baechle
In-Reply-To: <20060328173827.3d64d91e.tihirvon@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1350 bytes --]
On Tuesday 28 March 2006 16:38, Timo Hirvonen wrote yet:
> Thanks, but forcing everyone to edit their git/remotes/origin file
> is not very nice solution. I think git-fetch should update refs for the
> other non-'broken' branches and leave "pu" and "next" refs untouched.
How do you know a non-broken branch from something weird?
All git knows is that the history is non-linear. You can do at least three
things:
- discard older history
- merge older history with newer
- add another branch
Or instead provide a more useful error message, like what is attached.
(I hope kmail doesn't mangle the tabs.)
diff --git a/git-fetch.sh b/git-fetch.sh
index 0346d4a..88df7f4 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -172,13 +172,15 @@ fast_forward_local () {
;;
esac || {
echo >&2 "* $1: does not fast forward to $3;"
+ echo >&2 " If the branch is known to roll back often,"
+ echo >&2 " add + before the branch name in $GIT_DIR/$1."
case ",$force,$single_force," in
*,t,*)
- echo >&2 " forcing update."
+ echo >&2 " Forcing update."
git-update-ref "$1" "$2" "$local"
;;
*)
- echo >&2 " not updating."
+ echo >&2 " Not updating."
;;
esac
}
--
GPG Key id: 0xD1F10BA2
Fingerprint: 96E2 304A B9C4 949A 10A0 9105 9543 0453 D1F1 0BA2
AstralStorm
[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply related
* Re: [PATCH] xdiff: Show function names in hunk headers.
From: Mark Wooding @ 2006-03-28 15:03 UTC (permalink / raw)
To: git
In-Reply-To: <7vfyl3m7vy.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> GNU diff -p does "^[[:alpha:]$_]"; personally I think any line
> that does not begin with a whitespace is good enough.
Hmm. I think my approach is wrong. I've noticed that targets of the
form `$(FOO): ...' in Makefiles would make nice hunk headers, but my
current hack won't notice them. Without a shift of approach, I think
I run the risk of deluging the list with little fixes to this bit of
code, which sounds like a pile of no fun.
So, I have two main suggestions. The first is /very/ stupid, and just
asks for two non-whitespace characters at the start of a line.
diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index ad5bfb1..822f991 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -83,11 +83,9 @@ static void xdl_find_func(xdfile_t *xf,
*ll = 0;
while (i-- > 0) {
len = xdl_get_rec(xf, i, &rec);
- if (len > 0 &&
- (isalpha((unsigned char)*rec) || /* identifier? */
- *rec == '_' || /* also identifier? */
- *rec == '(' || /* lisp defun? */
- *rec == '#')) { /* #define? */
+ if (len >= 2 &&
+ !isspace((unsigned char)rec[0]) &&
+ !isspace((unsigned char)rec[1])) {
if (len > sz)
len = sz;
if (len && rec[len - 1] == '\n')
The second suggestion is slightly refined, but a little more
complicated. We ask for a line which starts /either/ with two
non-whitespace characters, or with an alphanumeric. Why? Because text
documents have a tendency to have headings of the form `7 Heading!' and
I want to catch them.
diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index ad5bfb1..bcb3e47 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -83,11 +83,10 @@ static void xdl_find_func(xdfile_t *xf,
*ll = 0;
while (i-- > 0) {
len = xdl_get_rec(xf, i, &rec);
- if (len > 0 &&
- (isalpha((unsigned char)*rec) || /* identifier? */
- *rec == '_' || /* also identifier? */
- *rec == '(' || /* lisp defun? */
- *rec == '#')) { /* #define? */
+ if (len && !isspace((unsigned char)*rec) &&
+ ((len >= 2 && !isspace((unsigned char)rec[1])) ||
+ isalnum((unsigned char)*rec) ||
+ *rec == '_')) {
if (len > sz)
len = sz;
if (len && rec[len - 1] == '\n')
Another possibility I just thought of: insist that the line starts with
a non-space, and contains another non-space somewhere. This will get
caught out by `{ /* ... rest of comment */', which I've seen a few
places, though.
diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index ad5bfb1..81b38ce 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -79,15 +79,18 @@ static void xdl_find_func(xdfile_t *xf,
const char *rec;
long len;
+ long j;
*ll = 0;
while (i-- > 0) {
len = xdl_get_rec(xf, i, &rec);
- if (len > 0 &&
- (isalpha((unsigned char)*rec) || /* identifier? */
- *rec == '_' || /* also identifier? */
- *rec == '(' || /* lisp defun? */
- *rec == '#')) { /* #define? */
+ if (len && !isspace((unsigned char)*rec)) {
+ for (j = 1; j < len; j++) {
+ if (!isspace((unsigned char)rec[j]))
+ goto good;
+ }
+ continue;
+ good:
if (len > sz)
len = sz;
if (len && rec[len - 1] == '\n')
I think I like option 2 best, as a nice compromise between stupidity and
actually working. Opinions, anyone?
-- [mdw]
^ permalink raw reply related
* Re: git pull fails
From: Timo Hirvonen @ 2006-03-28 14:38 UTC (permalink / raw)
To: Ralf Baechle; +Cc: git
In-Reply-To: <20060328141140.GC3113@linux-mips.org>
Ralf Baechle <ralf@linux-mips.org> wrote:
> Continuing to walk after breaking a leg isn't a good idea, but that's
> basically what your change did. What has happened to you is the normal
> thing with branches that have been re-based or otherwise re-created.
> The better way to handle this kind of branches is to add a `+´ sign to
> the refspec for the pu branc in .git/remote/origin like:
>
> [ralf@blah git]$ cat .git/remotes/origin
> URL: git://www.kernel.org/pub/scm/git/git.git
> Pull: master:master
> Pull: todo:todo
> Pull: +next:next
> Pull: maint:maint
> Pull: +pu:pu
> Pull: html:html
> Pull: man:man
> [ralf@blah git]$
>
> The next branch is handled the same way, so another `+´ sign.
Thanks, but forcing everyone to edit their git/remotes/origin file
is not very nice solution. I think git-fetch should update refs for the
other non-'broken' branches and leave "pu" and "next" refs untouched.
--
http://onion.dynserv.net/~timo/
^ permalink raw reply
* Re: git pull fails
From: Ralf Baechle @ 2006-03-28 14:11 UTC (permalink / raw)
To: Timo Hirvonen; +Cc: git
In-Reply-To: <20060328162831.af1bd4c0.tihirvon@gmail.com>
On Tue, Mar 28, 2006 at 04:28:31PM +0300, Timo Hirvonen wrote:
> I think fast-forward check in git-fetch is too strict:
>
> 28 16:13 /usr/src/git: git pull
> Unpacking 33 objects
> 100% (33/33) done
> * refs/heads/todo: same as branch 'todo' of git://git.kernel.org/pub/scm/git/git
> * refs/heads/maint: same as branch 'maint' of git://git.kernel.org/pub/scm/git/git
> * refs/heads/origin: same as branch 'master' of git://git.kernel.org/pub/scm/git/git
> * refs/heads/pu: does not fast forward to branch 'pu' of git://git.kernel.org/pub/scm/git/git;
> not updating.
>
> After removing "exit 1" added by a9698bb22fb7b66e5882c3a5e7b2b8b53ea03f90 from
> git-fetch "git pull" worked again.
Continuing to walk after breaking a leg isn't a good idea, but that's
basically what your change did. What has happened to you is the normal
thing with branches that have been re-based or otherwise re-created.
The better way to handle this kind of branches is to add a `+´ sign to
the refspec for the pu branc in .git/remote/origin like:
[ralf@blah git]$ cat .git/remotes/origin
URL: git://www.kernel.org/pub/scm/git/git.git
Pull: master:master
Pull: todo:todo
Pull: +next:next
Pull: maint:maint
Pull: +pu:pu
Pull: html:html
Pull: man:man
[ralf@blah git]$
The next branch is handled the same way, so another `+´ sign.
Ralf
^ permalink raw reply
* git pull fails
From: Timo Hirvonen @ 2006-03-28 13:28 UTC (permalink / raw)
To: git
I think fast-forward check in git-fetch is too strict:
28 16:13 /usr/src/git: git pull
Unpacking 33 objects
100% (33/33) done
* refs/heads/todo: same as branch 'todo' of git://git.kernel.org/pub/scm/git/git
* refs/heads/maint: same as branch 'maint' of git://git.kernel.org/pub/scm/git/git
* refs/heads/origin: same as branch 'master' of git://git.kernel.org/pub/scm/git/git
* refs/heads/pu: does not fast forward to branch 'pu' of git://git.kernel.org/pub/scm/git/git;
not updating.
After removing "exit 1" added by a9698bb22fb7b66e5882c3a5e7b2b8b53ea03f90 from
git-fetch "git pull" worked again.
--
http://onion.dynserv.net/~timo/
^ permalink raw reply
* Re: [PATCH] Reintroduce svn pools to solve the memory leak.
From: Karl Hasselström @ 2006-03-28 12:20 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Santi Béjar, Jan-Benedict Glaw, git
In-Reply-To: <7vhd5joiqt.fsf@assigned-by-dhcp.cox.net>
On 2006-03-27 10:16:58 -0800, Junio C Hamano wrote:
> Karl, were there other reasons you needed to disable the pool here
> (maybe to work around a problem with incompatible version of SVN
> module)? I see some other uses of SVN::Pool still there in the code,
> so I am assuming this was a simple typo, but just in case...
No, it's just a simple mistake (the mistake being me not realizing why
an explicit pool was needed, and simply dropping it when things worked
fine without it).
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox