threads / discuss / 8686

help with cvsimport

Subject: help with cvsimport

## tl;dr

3 messages between Jun 23, 2007 and Jun 24, 2007.

replies: 2people: 2as markdown or json

Raimund Bauer· Jun 23, 2007, 09:11 UTC · lore
Hi,
I unfortunately have to work with several cvs-repositories and was
wondering if there was a way to have the files processed on import:
- strip trailing whitespace
- convert to newline-only line endings

Knowing git there probably is already a way to do that - I'd appreciate any rtfm-pointers ...

Many thanks in advance
-- 
best regards

  Ray
Johannes Schindelin· Jun 23, 2007, 11:27 UTC · re: Raimund Bauer · lore

Re: help with cvsimport

Hi,
On Sat, 23 Jun 2007, Raimund Bauer wrote:
> I unfortunately have to work with several cvs-repositories and was
> wondering if there was a way to have the files processed on import:
> - strip trailing whitespace
> - convert to newline-only line endings

If you want to use cvsimport incrementally, I'd rather not process the "origin" branch like this, but rather use git-filter-branch (with a simple index filter) to do that.

Even if you do not want to use it incrementally, it seems easier and cleaner (if somewhat slower) to me.

So, something like
	git filter-branch --index-filter 'git ls-files |
		while read name; do
			perl -pi -e "s/[ \009\015]*$//" "$name"
		done
		git add -u' cleaned-up-origin
should do.

Hth, Dscho

Raimund Bauer· Jun 24, 2007, 09:37 UTC · re: Johannes Schindelin · lore

Re: help with cvsimport

Hi,
* Johannes Schindelin wrote, On 23.06.2007 13:27:
Show 28 quoted lines
> Hi,
>
> On Sat, 23 Jun 2007, Raimund Bauer wrote:
>
>   
>> I unfortunately have to work with several cvs-repositories and was
>> wondering if there was a way to have the files processed on import:
>> - strip trailing whitespace
>> - convert to newline-only line endings
>>     
>
> If you want to use cvsimport incrementally, I'd rather not process the 
> "origin" branch like this, but rather use git-filter-branch (with a simple 
> index filter) to do that.
>
> Even if you do not want to use it incrementally, it seems easier and 
> cleaner (if somewhat slower) to me.
>
> So, something like
>
> 	git filter-branch --index-filter 'git ls-files |
> 		while read name; do
> 			perl -pi -e "s/[ \009\015]*$//" "$name"
> 		done
> 		git add -u' cleaned-up-origin
>
> should do.
>   

Thanks, will try that out. Tough I'm not very happy about having to create an extra branch for every branch I want to work with. And a git-solution would also respect git-attributes ...

> Hth,
> Dscho
>   
-- 
best regards

  Ray

← back to recent threads