2

I am translating a documentation of some project and I want to check which files are translated by checking the last commit from the original project. So that I can see which percentage of translation is completed. Like there is 1000 files and only 120 of them is edited, so translation is completed by %12.

I tried things like checking the file commits, but I can't sort them.

I am going to write some bash script to automate process and I prefer it to be time efficient. How may I achieve this?

Furkan
  • 352
  • 3
  • 12

1 Answers1

1

You could list the files changed between two branches (or even two commits):

 git diff --name-only branch1 branch2 | wc -l

That way, you get the number of files edited in branch2 since branch1 (or since commit1, which is the commit where none of your files were edited for translation)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • So, to do this I created a new branch and used git checkout to revert that branch to original version. But when I compare the two there is no output. – Furkan Sep 01 '19 at 08:58
  • 1
    @Furkan Yes, but you don't even have to create branches: if *all* your commits were puerely done for translation, you can compare between HEAD and the last commit where no translation took place. – VonC Sep 01 '19 at 09:01
  • @Furkan That being said, creating a branch can be a best practice to isolate that development effort. – VonC Sep 01 '19 at 09:02
  • Okay. I used git reset instead of checkout. Now it works. Thanks. – Furkan Sep 01 '19 at 09:05
  • @VolC yes this works too. I am not the owner of the project so your solution might be better for my situation. – Furkan Sep 01 '19 at 09:10