Full files in changesets?

Michael Ellerman michael at ellerman.id.au
Sun May 29 04:57:37 BST 2005


On Tue, 24 May 2005 03:22, Aaron Bentley wrote:
> I'm thinking, in particular, about renames.  We could represent them as
> a non-patch change, but 'patch' would ignore it, and produce the wrong
> output. Or we could include a patch to delete the file under its 
> original name and recreate it under a new name.  This would play nice
> with 'patch', but make it hard to see the changes that were actually
> made to the file.

Ok, I was about to yell at you for the second sentence, but I see your point 
about readability. 

# renamed foo to bar

vs.

+++ foo
--- bar
<insert 10,000 lines of diff>

> There's no way of escaping the fact that we need to be able to produce
> 'patch'-incompatible changesets, e.g. for binaries.  So it might make
> sense to introduce a patch 'syntax error' into patch-incompatible
> changesets.  (and change the wording to 'you can apply this patch with
> "bzr receive", but NOT "patch"')

That would suck a lot. It looks like a patch, smells like a patch, but when I 
apply it with patch it breaks. -ENOTDWIM

## you can apply this patch with "bzr receive" BUT NOT "patch" 
                      ^^^^^

IMHO, renames are resonably rare (and binaries even rarer), so making the 
changset format incompatible with patch just to make renames look nicer would 
be not good.

I think the best option would be to put all rename patches at the end and make 
a comment about renames in the top of the patch (or maybe an intelligent 
diffstat?), so you can eyeball the renames straight away, and when scanning 
the diff you can stop as soon as you see:

## renamed file foo.c to bar.c

because you know that the diff and any following it are just for renames.

## bzr annotated diff
## you can apply this patch with "bzr receive" or "patch"
##
## Hi,
##
## Lorem ipsum dolor sit amet, consectetuer adipiscing elit,
## sed diam nonummy nibh euismod tincidunt ut laoreet dolore magn.
##
##
## branch.py   |  135 +++++++++++++++++++++++++++--
## commands.py |  277 ++++++++++++++++++++++++++++++++++++++++----------------
## foo.py renamed to bar.py
##
## 2 files changed, 1 files renamed, 330 insertions(+), 82 deletions(-)


It would be super nice if the bzr changset format was sufficently human 
readable, patch compatible and crack free that it can be sent as-is to LKML 
or similar places. And it would be good PR for bzr too!

cheers

-- 
Michael Ellerman
IBM OzLabs

email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050529/5eeec8cb/attachment.pgp 


More information about the bazaar mailing list