Open Source Summer School
Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
participants:ioan-stan [2012/06/11 22:35]
istan
participants:ioan-stan [2012/06/11 23:45] (current)
istan
Line 1: Line 1:
 = Ioan-Mihail Stan = = Ioan-Mihail Stan =
  
 +{{ :​participants:​dscf2978.jpg?​350|}}
  
-* **Nume complet**: Stan Ioan-Mihail+* **Nume complet**: Stan Ioan-Mihail ​                               
 * **Alias-uri**:​ John * **Alias-uri**:​ John
 * **Data/​Locul naşterii**:​ 7 iunie 1992, Bucureşti * **Data/​Locul naşterii**:​ 7 iunie 1992, Bucureşti
Line 52: Line 53:
 |Personalitate IT preferată | Dennis Ritchie| |Personalitate IT preferată | Dennis Ritchie|
 |Companie preferată | IBM| |Companie preferată | IBM|
 +
 +
 +* Tema 3 USO:
 +<​code>​
 +#!/bin/bash
 +#Stan Ioan-Mihail
 +#311 CA
 +
 +cd $1
 +git checkout master &> /dev/null
 +
 +#task 1
 +#comenzile imi afiseaza toate linile unde apare cuvantul Author ; separ dupa delimitatorul " " -spatiu in coloane astfel de la 2 pana la final de linie mi se vor afisa practic numele + mailurile autorilor de commituri (apelul functiei cut ), nume pe care le sortez corespunzator si carora le numar aparitiile ( sort | uniq -c | uniq -g -r )
 +if test  $2 = "​-n" ​ ; then
 + if test $4 = "​top_contributors"​ ; then
 + git log | grep "​Author:"​ | head -$3 |sed -e 's/^[ \t]*//'​| cut -n -d ' ' -f 2- | sort | uniq -c | sort -g -r | head -$5
 +#in cazul in care nu exista argumentul 5 ($5) head - va afisa toate liniile fisierului astfel punctez doua situatii posibile ( cand sunt trimisi 4 sau 5 parametrii ) 
 +#exista posibilitatea ca path-ul unui fisier sa fie deplasat spre dreapta cu delimitatorii tab sau space; pentru a lua in considerare acea situatie am apleat la functia sed 
 + fi
 +elif test $2 = "​top_contributors"​ ; then
 + if test $# -eq 3 ; then
 + git log| grep "​Author:"​|sed -e 's/^[ \t]*//'​| cut -n -d ' ' -f 2- | sort | uniq -c | sort -g -r |head -$3 
 + fi
 +fi
 +#task 2
 +#caut liniile care incep cu caractere numerice din statistica numstat a git log-ului; caut practic fisierele dupa statistica insertions
 +if test $2 = "​-n"​ ; then
 + if test $4 = "​added_lines"​ ; then 
 + if test $# -eq 5; then
 + git log -$3 --numstat | grep ^[0-9] | tr "​\t"​ " " | grep " $5" | cut -f 1 | awk '​{contor+=$1} END {print contor}'​
 +#exista posibilitatea ca un fisier cautat intr-o lista cu grep sa se gaseasca in 2 ierarhi de foldere diferite astfel pentru a gasi exact path-ul cerut schimb tab-urile cu spatii si caut exact folderul cerut punand un spatiu inainte de nume 
 + else
 + git log -$3 --numstat | grep ^[0-9] | cut -f 1 | awk '​{contor+=$1} END {print contor}'​
 +#functia awk imi va aduna tot ce se gaseste pe coloana 1 din "​fisierul"​ creat din succesiunea de pipe-uri
 + fi
 + fi
 +else
 + if test  $2 = "​added_lines"​ ; then
 + if test $# -eq 3; then
 +                        git log --numstat | grep ^[0-9] |tr "​\t"​ " " | grep " $3" | cut -f 1 | awk '​{contor+=$1} END {print contor}'​
 +        else
 +                        git log --numstat | grep ^[0-9] | cut -f 1 | awk '​{contor+=$1} END {print contor}'​
 +
 +                fi
 + fi
 +fi
 +#task 3
 +#realizez statistici dupa coloana deletions din statistica numstat
 +if test $2 = "​-n"​ ; then
 + if test $4 = "​deleted_lines"​ ; then 
 + if test $# -eq 5; then
 + git log -$3 --numstat | grep ^[0-9] |tr "​\t"​ " " | grep " $5" | awk '​{print $2, $1, $3}' | cut -d " " -f 1  | awk '​{contor+=$1} END {print contor}'​
 + else
 + git log -$3 --numstat | grep ^[0-9] | awk '​{print $2, $1, $3}'| cut -d " " -f 1  | awk '​{contor+=$1} END {print contor}'​
 +#prima functie awk imi interschimba coloane
 + fi
 + fi
 +else
 + if test  $2 = "​deleted_lines"​ ; then
 + if test $# -eq 3; then
 +                        git log --numstat | grep ^[0-9] | tr "​\t"​ " " | grep " $3" | awk '​{print $2, $1, $3}' | cut -d " " -f 1  | awk '​{contor+=$1} END {print contor}'​
 +
 +                else
 +                        git log --numstat | grep ^[0-9]|tr "​\t"​ " " | awk '​{print $2, $1, $3}'| cut -d " " -f 1  | awk '​{contor+=$1} END {print contor}'​
 + fi
 + fi
 +fi
 +#task 4
 +#statistica numstat a git log imi afiseaza toate fisierele modificate in vreun fel; liniile cu path-ul fisierelor sunt cele care incep cu caractere numerice sau - ; wc -l numara liniile dintr-un fisier
 +if test $2 = "​-n"​ ; then
 + if test $4 = "​touched_files"​ ; then 
 + if test $# -eq 5; then
 + git log -$3 --numstat --author="​$5"​ | grep ^[0-9-] | cut -f 3 | sort | uniq | wc -l
 + else
 + git log -$3 --numstat | grep ^[0-9-] | cut -f 3 | sort | uniq | wc -l
 +  fi
 + fi
 +else
 + if test  $2 = "​touched_files"​ ; then
 + if test $# -eq 3; then
 +                        git log --numstat --author="​$3"​ | grep ^[0-9-] | cut -f 3 | sort |uniq | wc -l
 +                else
 +                        git log --numstat | grep -E ^[0-9-] | cut -f 3 | sort | uniq | wc -l
 +                fi
 + fi
 +fi
 +
 +#task 5
 +#git log branch1..branch2 afiseaza commiturile din branch-ul 2 care nu se gasesc in primul
 +if test $2 = "​diff_branches"​ ; then
 + echo "​Commits only in branch $3:"
 + git log $4..$3 --oneline |  cut -d " " -f 2-
 + echo
 + echo "​Commits only in branch $4:"
 + git log $3..$4 --oneline |  cut -d " " -f 2-
 +fi
 +
 +</​code>​

OS

Calendar
  • June 6 - June 15: Application period
  • Monday, June 22, 2015: intro of OSSS - presentation of people involved
  • June 23-26, June 29-July 3, 2015: presentations and hackathons
  • Friday, July 3, 2015: presentation of project outcomes, diplomas and prizes, closing
Powered by

CS

ROSEdu

Systems

QR Code: URL of current page
QR Code: URL of current page Ioan-Mihail Stan (generated for current page)