0

How do get the function/method names after doing changes in the c# files.

Vinoth
  • 75
  • 7
  • Please: the edit was done in good faith: you don't put a tag in the title. No need to revert it. – VonC Dec 28 '18 at 09:24
  • See https://meta.stackexchange.com/q/19190/6309: I assure you, this is the best practice followed around here. I will leave you edit the title of your question. – VonC Dec 28 '18 at 09:27

1 Answers1

0

Considering that userdiff.c does include csharp, all you need to add is a .gitattributes file (at the root of your repo) with:

*.cs diff=csharp

Then a git diff will show the function names

With that .gitattributes in place, you can extract the functions names after a diff:

git diff |                  \
grep -E '^(@@)' |           \
grep "(" |                  \
sed 's/@@.*@@//' |          \
sed 's/(.*//' |             \
awk -F " " '{print $NF}' |  \
uniq
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I need list of method names using git command like list of files name shown for git ls-files -m – Vinoth Dec 28 '18 at 10:33