Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Fatal: ambiguous argument '%cI': unknown revision or path not in the working tree.
rad11
post 10.07.2018, 04:45:49
Post #1





Grupa: Zarejestrowani
Postów: 1 270
Pomógł: 184
Dołączył: 7.10.2012
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


Próbuję wykonać takie polecenie z poziomu skryptu php:

  1. git log --pretty='format:%H %cI %s' v1.13.3..v1.13.3


ale otrzymuję komunikat

  1. fatal: ambiguous argument '%cI': unknown revision or path not in the working tree.


kod wykonujący wygląda tak:

  1. protected static function run(string $command)
  2. {
  3. $process = proc_open($command, [
  4. 1 => ['pipe', 'w'],
  5. 2 => ['pipe', 'w']
  6. ], $pipes);
  7.  
  8. if (false !== $process) {
  9. list(, $stdout, $stderr) = array_map(function ($resource) {
  10. $content = explode("\n", stream_get_contents($resource));
  11. fclose($resource);
  12.  
  13. return $content;
  14. }, $pipes);
  15.  
  16. $status = proc_close($process);
  17.  
  18. if ($status !== 0) {
  19. $error = count($stderr) ? ': ' . implode("\n", $stderr) : '';
  20. throw new ExecutionException(sprintf("Executing process '%s' failed" . $error, $command));
  21. }
  22.  
  23. return $stdout;
  24. }
  25.  
  26. throw new ExecutionException(sprintf("Failed opening process '%s'", $command));
  27. }


co robię nie tak, dlaczego skrypt nie chce mi wykonać tej komendy ?

Problem rozwiązany potrzeba było na Windows aby argument --pretty był w " "

Ten post edytował rad11 10.07.2018, 08:24:17
Go to the top of the page
+Quote Post
trzczy
post 10.07.2018, 13:22:18
Post #2





Grupa: Zarejestrowani
Postów: 460
Pomógł: 49
Dołączył: 5.06.2011

Ostrzeżenie: (0%)
-----


Coś mi się zdaje, że po %H powinien być hasz. Czyli to co po %H brane jest jako hasz.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 29.03.2024 - 13:04