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: John Meinel
Subject: Re: [Gnu-arch-users] Re: missing feature: text file handling
Date: Fri, 08 Oct 2004 11:12:23 -0500
User-agent: Mozilla Thunderbird 0.8 (Windows/20040913)

Jan Hudec wrote:
On Fri, Oct 08, 2004 at 13:59:13 +0200, Matthieu Moy wrote:

Aaron Bentley <address@hidden> writes:


Does this behaviour make sense to people?  True, it provides a chance
to edit the changeset,

Which is, by the way, extremely dangerous: I expect the tree after a
commit to be exactly sync-ed with the archive. If you edit the
changeset, and not the tree, this probably won't be the case.


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.

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

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.

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.

John
=:->

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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