Commit graph

10 commits

Author SHA1 Message Date
Đoàn Trần Công Danh 2380f8cb1a changed_templates: use $GIT_CMD instead of git everywhere 2021-10-27 07:37:34 +07:00
Đoàn Trần Công Danh 4b009994e5 changed_templates: exit early if no merge-base could be found
GitHub Action and fetch_upstream.sh script limits fetch depth to 200.
With such depth, should the PR was based on very old tree, we couldn't
find the merge-base to diff again.

In theory, we could replace actions/checkout and fetch_upstream.sh to
fetch more than 200 depth. However, there isn't much gain from such
change and it will increase the time to fetch upstream for all PR.
Arguably, such problematic PR couldn't be built because other steps
would build changed packages' dependencies, too.

Let's complain and exit early instead.
2021-06-01 08:31:00 +07:00
Đoàn Trần Công Danh 987dfd294f changed_templates: use current tip for non-merge commit
Some people uses this scripts to detect changes locally.
Let's not break their script.
2021-06-01 08:31:00 +07:00
Đoàn Trần Công Danh 7f8e1f56fa ci/changed-templates: use tip of feature branch as tip
The HEAD given by GitHub Action is always non-fast-forward merge commit.
In the next change, lint-commits will use the tip from
"changed_templates.sh".

Let pick the correct tip for interrogation.
2021-05-31 17:47:56 +07:00
Piotr Wójcik 2dbe48e260 common/changed_templates.sh: store merge-base in file 2021-05-27 21:18:38 +02:00
Đoàn Trần Công Danh f5417b7b99 travis/changed_templates: correct left tree-ish
From b881f32687 (travis/changed_templates: filter by git itself,
2020-05-23), we replaced git-diff(1) with git-diff-tree(1).

The change wasn't equivalence, though.
We used to compare between merge-base of FETCH_HEAD and HEAD.
From that commit, we started to compare FETCH_HEAD and HEAD instead.

Fix them by changing left tree-ish to the merge-base.
2020-06-10 16:40:39 +00:00
Đoàn Trần Công Danh b881f32687 travis/changed_templates: filter by git itself
- Use plumbing git-diff-tree(1) instead of porcelain git-diff(1)
- Disable rename detection, gains some speed up and fix missing template
  with name-status Renamed and Copied.
- Use "--diff-filter" to filter by Git itself.
- Tell Git to only check 'srcpkgs/*/template', this glob will only look
  into template file inside direct sub-directory of srcpkgs
- With all of those options, we don't need a grep and a pipe
2020-05-31 02:10:29 +00:00
maxice8 81e021bd8a common/travis/changed_templates.sh: try chroot-git then git 2019-03-07 17:26:45 -08:00
Enno Boland bb71db78dd common/travis: use the same shebang format for all travis scripts. 2015-04-10 15:42:12 +02:00
Enno Boland 8351befa28 .travis.yml: test build packages on travis. 2015-04-10 10:37:26 +02:00