diff --git a/src/Composer/Downloader/GitDownloader.php b/src/Composer/Downloader/GitDownloader.php
old mode 100644
new mode 100755
index 756218da5..d00aea793
--- a/src/Composer/Downloader/GitDownloader.php
+++ b/src/Composer/Downloader/GitDownloader.php
@@ -224,4 +224,15 @@ class GitDownloader extends VcsDownloader
$this->process->execute($cmd, $ignoredOutput, $path);
}
}
+
+ protected function getCommitLogs($sourceReference, $targetReference, $path)
+ {
+ $command = sprintf('cd %s && git log %s..%s --pretty=format:"%%h - %%an: %%s"', escapeshellarg($path), $sourceReference, $targetReference);
+
+ if (0 !== $this->process->execute($command, $output)) {
+ throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
+ }
+
+ return $output;
+ }
}
diff --git a/src/Composer/Downloader/HgDownloader.php b/src/Composer/Downloader/HgDownloader.php
old mode 100644
new mode 100755
index 7dc845a98..6e0e7401b
--- a/src/Composer/Downloader/HgDownloader.php
+++ b/src/Composer/Downloader/HgDownloader.php
@@ -59,4 +59,15 @@ class HgDownloader extends VcsDownloader
throw new \RuntimeException('Source directory ' . $path . ' has uncommitted changes');
}
}
+
+ protected function getCommitLogs($sourceReference, $targetReference, $path)
+ {
+ $command = sprintf('cd %s && hg log -r %s:%s --style compact', escapeshellarg($path), $sourceReference, $targetReference);
+
+ if (0 !== $this->process->execute($command, $output)) {
+ throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
+ }
+
+ return $output;
+ }
}
diff --git a/src/Composer/Downloader/SvnDownloader.php b/src/Composer/Downloader/SvnDownloader.php
old mode 100644
new mode 100755
index 63f654221..2f968ed57
--- a/src/Composer/Downloader/SvnDownloader.php
+++ b/src/Composer/Downloader/SvnDownloader.php
@@ -79,4 +79,15 @@ class SvnDownloader extends VcsDownloader
);
}
}
+
+ protected function getCommitLogs($sourceReference, $targetReference, $path)
+ {
+ $command = sprintf('cd %s && svn log -r%s:%s --incremental', escapeshellarg($path), $sourceReference, $targetReference);
+
+ if (0 !== $this->process->execute($command, $output)) {
+ throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
+ }
+
+ return $output;
+ }
}
diff --git a/src/Composer/Downloader/VcsDownloader.php b/src/Composer/Downloader/VcsDownloader.php
old mode 100644
new mode 100755
index d7c9f20c5..ccf7cb74b
--- a/src/Composer/Downloader/VcsDownloader.php
+++ b/src/Composer/Downloader/VcsDownloader.php
@@ -65,9 +65,25 @@ abstract class VcsDownloader implements DownloaderInterface
throw new \InvalidArgumentException('Package '.$target->getPrettyName().' is missing reference information');
}
- $this->io->write(" - Updating " . $target->getName() . " (" . $target->getPrettyVersion() . ")");
+ if ($initial->getPrettyVersion() == $target->getPrettyVersion()) {
+ $from = $initial->getSourceReference();
+ $to = $target->getSourceReference();
+ } else {
+ $from = $initial->getPrettyVersion();
+ $to = $target->getPrettyVersion();
+ }
+
+ $this->io->write(" - Updating " . $target->getName() . " from (" . $from . ") to (" . $to . ")");
+
$this->enforceCleanDirectory($path);
$this->doUpdate($initial, $target, $path);
+
+ //print the commit logs if in verbose mode
+ if ($this->io->isVerbose()) {
+ $logs = $this->getCommitLogs($initial->getSourceReference(), $target->getSourceReference(), $path);
+ $this->io->write($logs);
+ }
+
$this->io->write('');
}
@@ -106,4 +122,14 @@ abstract class VcsDownloader implements DownloaderInterface
* @throws \RuntimeException if the directory is not clean
*/
abstract protected function enforceCleanDirectory($path);
+
+ /**
+ * fetches the commit logs between to commits
+ *
+ * @param string $sourceReference the source reference
+ * @param string $targetReference the target reference
+ * @param string $path the package path
+ * @return string
+ */
+ abstract protected function getCommitLogs($sourceReference, $targetReference, $path);
}