public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/3] buildman: Allow branch names which conflict with directories
@ 2016-03-13  1:50 Simon Glass
  2016-03-13  1:50 ` [U-Boot] [PATCH v2 2/3] buildman: Add a way to specific a full toolchain prefix Simon Glass
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Simon Glass @ 2016-03-13  1:50 UTC (permalink / raw)
  To: u-boot

At present if you try to use buildman with the branch 'test' it will
complain that it is unsure whether you mean the branch or the directory.
This is a feature of the 'git log' command that buildman uses. Fix it
by resolving the ambiguity.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
---

Changes in v2:
- Fix test breakage

 tools/buildman/func_test.py | 2 ++
 tools/patman/gitutil.py     | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
index 75eb3a9..a0bd46c 100644
--- a/tools/buildman/func_test.py
+++ b/tools/buildman/func_test.py
@@ -255,6 +255,8 @@ class TestFunctional(unittest.TestCase):
         self.assertEqual(gitutil.use_no_decorate, True)
 
     def _HandleCommandGitLog(self, args):
+        if args[-1] == '--':
+            args = args[:-1]
         if '-n0' in args:
             return command.CommandResult(return_code=0)
         elif args[-1] == 'upstream/master..%s' % self._test_branch:
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 5f1b4f6..e088bae 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -44,6 +44,11 @@ def LogCmd(commit_range, git_dir=None, oneline=False, reverse=False,
         cmd.append('-n%d' % count)
     if commit_range:
         cmd.append(commit_range)
+
+    # Add this in case we have a branch with the same name as a directory.
+    # This avoids messages like this, for example:
+    #   fatal: ambiguous argument 'test': both revision and filename
+    cmd.append('--')
     return cmd
 
 def CountCommitsToBranch():
-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-03-20  0:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-13  1:50 [U-Boot] [PATCH v2 1/3] buildman: Allow branch names which conflict with directories Simon Glass
2016-03-13  1:50 ` [U-Boot] [PATCH v2 2/3] buildman: Add a way to specific a full toolchain prefix Simon Glass
2016-03-14 16:56   ` Stephen Warren
2016-03-20  0:25     ` Simon Glass
2016-03-13  1:50 ` [U-Boot] [PATCH v2 3/3] buildman: Clarify the use of -V Simon Glass
2016-03-14 16:56   ` Stephen Warren
2016-03-20  0:26     ` Simon Glass
2016-03-20  0:25 ` [U-Boot] [PATCH v2 1/3] buildman: Allow branch names which conflict with directories Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox