powerbi-vcs icon indicating copy to clipboard operation
powerbi-vcs copied to clipboard

Dotnet port

Open Togusa09 opened this issue 7 years ago • 5 comments

Hi,

I've created a dotnet port of this project. https://github.com/Togusa09/powerbi-vcs-dotnet

I was wanting to improve the git diffs for powerbi files by providing it the extracted file contents to diff on. Your scripts were the best resource I could find regarding the makeup of the pbit/pbix files, so I've ported your scripts to c# as a base for me to work off.

The compression back to pbit/pbix is still incomplete in the port, but I intent to finish it when I get a chance.

Regards,

Ben

Togusa09 avatar Dec 10 '17 02:12 Togusa09

Nice! Let's keep this open as a way to cross-pollinate between them. Can you update us if you implement any cool new features?

kodonnell avatar Dec 10 '17 03:12 kodonnell

So far I've just added the ability to write the file contents to the screen to support git diffs. This is almost the same as the output from your original raw_to_vcs methods, but the noop converter outputs a SHA hash.

I've used "-s" as the command line switch to trigger this (s for screen, I'm open to better suggestions).

Togusa09 avatar Dec 10 '17 03:12 Togusa09

I've been going through the metadata file and believe that I've worked out part of the format.

Skip 8 bytes

Read 4 -> 32 bit int -> length of section 1 Foreach part of section 1 Read 1 -> 8 bit int -> number of characters in string Read characters -> Name Read 1 -> 8 bit int -> number of characters in string Read characters -> Guid Key

Read 4 -> 32 bit int -> length of section 2 Foreach part of section 1 Read 1 -> 8 bit int -> number of characters in string Read characters -> Guid Key Read 1 -> 8 bit int -> number of characters in string Read characters -> Name

Skip 1 byte Read 1 byte -> length of section 3 ? Foreach part of section 3 ? Read 1 -> 8 bit int -> number of characters in string Read characters -> Name?

Togusa09 avatar Dec 12 '17 12:12 Togusa09

Nice - I've always thought it'd be good to create a specification file which lists all of these assumptions/findings. Maybe you could start one with the above? Encoding was a big one which I kept forgetting.

kodonnell avatar Dec 12 '17 21:12 kodonnell

FYI @Togusa09 - see updated readme. Your port will may get more traffic!

kodonnell avatar Jan 15 '18 22:01 kodonnell