gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Re: missing feature: text file handling


From: Jan Hudec
Subject: Re: [Gnu-arch-users] Re: missing feature: text file handling
Date: Fri, 8 Oct 2004 21:00:58 +0200
User-agent: Mutt/1.5.6+20040907i

On Fri, Oct 08, 2004 at 11:12:23 -0500, John Meinel wrote:
> Jan Hudec wrote:
> >In fact, in presence of data-mangling hooks I do *NOT* expect that. In
> >the presence of such hooks I'd suppose the changes made to the data to
> >be undone after!
> >
> >Ie. if I am on windows and my toolchain needs CR/LF line endings,
> >but the project otherwise uses LF endings, I expect the hook to convert
> >the files, make the changeset and convert them back again, so that
> >I still have my CR/LF in work files, though in archive they have just
> >LFs.
> >
> >This would be easier done by editing the changeset, but it could break
> >that changeset, so I wouldn't do that. In fact, the mangling hooks
> >should best happen **around (or instead of) invocations of diff and
> >patch**. Diff would be replaced by 
> >$ recode > tmp && diff pristine tmp
> >and patch would be replaced by
> >$ recode > tmp && patch tmp < cset && recode tmp > work
> >
> >That's about the only way I see that has some reasonable semantics.
> 
> Well, I would agree that for data mangling operations my tree shouldn't 
> be modified, but only what is put in the archive.
> 
> One very simplistic possibility is to just run dos2unix on all patch 
> files in a precommit hook, an then run unix2dos on the same patch files 
> on some sort of get/update/apply-changeset hook. I ran into problems 
> earlier because the patches had unix mode in the pre part, and dos mode 
> in the post part. If the file was dos, the pre part wouldn't match. But 
> as long as the repository only holds one type, then with some smarts as 
> to which patch files should be modified, this should work okay.
> 
> I think a modified diff & patch might also be easier, as they would be 
> more "at the source" of the issue. But also because right now I don't 
> believe TLA provides a pre-get hook.

Doing the mangling in pre-get, get, pre-commit and such hooks would slow
things down HORRIBLY. Most of the time most of the files are untouched.
And these don't need to be diffed not patched and thus neither
converted. Coverting everything could get really slow.

> My final feeling, though, is that I really like tla to follow the rule 
> of not messing with my stuff. I have a pre-commit hook that makes sure 
> I'm commiting what I think I'm committing. But the thing in the 
> repository stays identical to what is on my filesystem.

That's of course reasonable.

And until there are diff and patch hooks, it's actualy the only
reasonable aproach.

-------------------------------------------------------------------------------
                                                 Jan 'Bulb' Hudec 
<address@hidden>

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]