Home Home > GIT Browse > scripts
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Poirier <bpoirier@suse.com>2019-03-20 10:37:45 +0900
committerBenjamin Poirier <bpoirier@suse.com>2019-05-02 17:33:22 +0900
commit9b0e07aa197d32864f91716352980eb3bd7432b3 (patch)
tree1aa5d5344935ff025de238a1ee42b908714f8bc9
parent50602bdd4045e1c3626f438ea7a801482ff6efd1 (diff)
git-sort: Move mainline remote check to series_sort
git_sort can be used on any git repository. series_sort() OTOH expects the reference repository to be a clone of the mainline Linux kernel repository. Move the warning accordingly and make it an error since further operations would fail. Fixes: 027d52475873 ("scripts: git_sort: Warn about missing upstream repo")
-rwxr-xr-xscripts/git_sort/git_sort.py1
-rw-r--r--scripts/git_sort/lib.py9
2 files changed, 9 insertions, 1 deletions
diff --git a/scripts/git_sort/git_sort.py b/scripts/git_sort/git_sort.py
index 979bb3435c..833339fb44 100755
--- a/scripts/git_sort/git_sort.py
+++ b/scripts/git_sort/git_sort.py
@@ -280,7 +280,6 @@ def get_heads(repo):
result = collections.OrderedDict(
[(Head(RepoURL(None), "HEAD"),
str(repo.revparse_single("HEAD").id),)])
- print("WARNING: Did not find %s in LINUX_GIT remotes." % remotes[0].repo_url.url)
return result
diff --git a/scripts/git_sort/lib.py b/scripts/git_sort/lib.py
index 1b882c1858..9f7da0efb6 100644
--- a/scripts/git_sort/lib.py
+++ b/scripts/git_sort/lib.py
@@ -420,6 +420,15 @@ def series_sort(index, entries):
# no entry.dest
result[entry.dest_head].append(entry.value)
+ mainline = git_sort.remotes[0]
+ if mainline not in index.repo_heads:
+ raise exc.KSError(
+ "Did not find mainline information (ref \"%s\" from the repository "
+ "at \"%s\") in the repository at LINUX_GIT (\"%s\"). For more "
+ "information, please refer to the \"Configuration Requirements\" "
+ "section of \"scripts/git_sort/README.md\"." % (
+ mainline.rev, mainline.repo_url.url, index.repo.path,))
+
for head in index.repo_heads:
result[head] = flatten([
e[1]