this post was submitted on 22 May 2024
987 points (98.0% liked)

Science Memes

11161 readers
2644 users here now

Welcome to c/science_memes @ Mander.xyz!

A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.



Rules

  1. Don't throw mud. Behave like an intellectual and remember the human.
  2. Keep it rooted (on topic).
  3. No spam.
  4. Infographics welcome, get schooled.

This is a science community. We use the Dawkins definition of meme.



Research Committee

Other Mander Communities

Science and Research

Biology and Life Sciences

Physical Sciences

Humanities and Social Sciences

Practical and Applied Sciences

Memes

Miscellaneous

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 18 points 6 months ago* (last edited 6 months ago) (3 children)

Doesn't matter, to git they are still binary files, which means it'll check in each revision as an entirely new copy.

Yes, you might only see the most recent one in your working directory, but under the hood, all the other ones are still there in the repo.

[–] [email protected] 7 points 6 months ago* (last edited 6 months ago) (4 children)

Someone could probably build a tool which sits in between you and Git, which unzips the file before committing and after pulling, so Git sees the raw xml file, but you always see the zipped docx.

edit: never mind. Just read @[email protected]'s comment explaining why this is a bad idea.

[–] [email protected] 7 points 6 months ago* (last edited 6 months ago)

Yeah, I made such a tool - and kept polishing edge cases until I gave up. So just wanted to warn everyone.

[–] [email protected] 3 points 6 months ago

I'm sure you could, but yes, it's likely not worth the trouble.

[–] refalo 1 points 6 months ago

a pre hook filter that beautifies and sanitizes the xml should fix that

[–] JackbyDev 6 points 6 months ago (1 children)

Which isn't any different than keeping them as separate files space wise so what's the problem?

(Other than Word having built-in versioning.)

[–] [email protected] 7 points 6 months ago (1 children)

what's the problem?

It's basically just keeping a bunch of separate files but with extra steps.

[–] JackbyDev 4 points 6 months ago (1 children)

I would genuinely rather use git in such a scenario than not because there are plenty of other useful features over a bunch of files in a folder. Sure, obviously if the file is massive it is inconvenient, but that's not a fair comparison because we're comparing multiple copies "FINAL FINAL FOR REAL" in a folder anyways. There isn't suddenly less size that way. It seems incredibly silly to describe it as "keeping files with extra steps" because people aren't using git for space saving, they're using it for version tracking. Everything git does is "keeping files with extra steps."

[–] [email protected] 0 points 6 months ago (2 children)

Everything git does is "keeping files with extra steps."

Not quite, because text files are stored as incremental diffs, which not only saves massive amounts of space but allows for effective comparisons of what exactly has changed between versions. While the former is more of a nice bonus these days with storage being extremely cheap, the latter is in fact the main reason one would use git to begin with.

[–] [email protected] 2 points 6 months ago (1 children)

Binary files too can be stored as incremental diffs

[–] [email protected] -2 points 6 months ago (1 children)

Yes but without the ability to quickly see what’s changed between different versions (on a semantic level), all it will do for you is safe you some storage.

With a bunch of separate files, you can at least open two of them quickly and do a manual scan, but with git you can only ever have one version checked out at the same time, so now you’ll be checking out an older version, making a temporary copy of that, and then checking out the version you want to compare it to and STILL end up doing just that.

From a workflow perspective, it’s really just extra overhead, with little to no practical benefit.

[–] [email protected] 1 points 6 months ago (1 children)

With a bunch of separate files, you can at least open two of them quickly and do a manual scan, but with git you can only ever have one version checked out at the same time, so now you’ll be checking out an older version, making a temporary copy of that, and then checking out the version you want to compare it to and STILL end up doing just that.

What? I don't understand what are you trying to say. Are you trying to do manual scan of xml inside? It's useless, internal format is not intended to be human-readable. But you can use regular git diff anyway.

Or if you want to compare rendered documents, then you probably need to make git diff driver. Or checkout multiple worktrees and use libreoffice's comparasion.

[–] [email protected] 1 points 6 months ago (1 children)

I meant the last one of those. If you have a directory of lose files, you can just open any of them and compare them directly, but if they're all in git, you'll either have to make a copy of your current version before checking out the other one (because it would be overwritten otherwise), or like you said, use multiple worktrees, which is a rather advanced feature (that I honestly didn't even know existed until now).

Either way it's a bunch of extra work and it's only necessary because you chose the wrong tool for the job.

[–] [email protected] 1 points 6 months ago* (last edited 6 months ago) (1 children)

Or call libreoffice as diff driver.

[–] [email protected] 2 points 6 months ago (1 children)
[–] [email protected] 1 points 6 months ago

I imagine script that outputs pandiff into pdf and opens okular. Yep.

[–] JackbyDev 1 points 6 months ago (1 children)

I don't want to engage in this conversation if you're going to ignore everything else I said about how binary files since that what were talking about.

[–] [email protected] 2 points 6 months ago (1 children)

Sorry, I just woke up and clearly didn't parse your entire comment correctly. Should have had my coffee first.

[–] JackbyDev 1 points 6 months ago

❤️ no worries, I get it. I've done the same lol

[–] [email protected] 2 points 6 months ago (1 children)

I think you can write clean/smudge filter that will turn docx into tree(folder)

[–] [email protected] 1 points 6 months ago (1 children)

You probably can but here’s why that’s still not gonna be all that effective.

[–] [email protected] 1 points 6 months ago (1 children)

Still better than having 30 copies of same document and forgetting which was the last one.

[–] [email protected] 1 points 6 months ago

Sort by -> Date modified