Advertisement
DennyCrane

git add -p [edit]

Nov 26th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.40 KB | None | 0 0
  1. # Manual hunk edit mode -- see bottom for a quick guide
  2. @@ -50,6 +67,36 @@
  3.  
  4. -       $tmpl = gc $f_tmpl
  5. -       $dump = gc $f_dump
  6. +       if ( $Result -eq 1 ) {
  7. +               Write-Host "Quick Check zeigt Unterschiede"
  8. +               line_check
  9. +               }
  10. +       else {
  11. +               Write-Host "Firewall OK"
  12. +               }
  13. +}
  14. +
  15. +function quick_check {
  16. +
  17. +       $file_check = Test-Path $f_tmpl
  18. +       if ( ! $file_check ) {
  19. +               Write-Host "ERROR: Konnte die Datei $f_tmpl nicht finden"
  20. +               exit 1
  21. +               }
  22. +
  23. +       fw-export($f_dump)
  24. +
  25. +       $script:tmpl = gc $f_tmpl
  26. +       $script:dump = gc $f_dump
  27. +
  28. +       if ( Compare-Object $tmpl $dump ) {
  29. +               return 1
  30. +               }
  31. +       else {
  32. +               return 0
  33. +               }
  34. +}
  35. +
  36. +function line_check {
  37. +       Write-Host "Starte Line Check"
  38.  
  39.         $max_lines = gc $f_tmpl | Measure-Object -Line | Select-Object -expand L
  40. ines
  41.         $line = 0
  42. # ---
  43. # To remove '-' lines, make them ' ' lines (context).
  44. # To remove '+' lines, delete them.
  45. # Lines starting with # will be removed.
  46. #
  47. # If the patch applies cleanly, the edited hunk will immediately be
  48. # marked for staging. If it does not apply cleanly, you will be given
  49. # an opportunity to edit again. If all lines of the hunk are removed,
  50. # then the edit is aborted and the hunk is left unchanged.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement