You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过IntelliJ或GitLab统计季度新增Cucumber自动化特性文件数量?

Absolutely! You’ve got a few solid options here using Git (which plays nice with both IntelliJ and GitLab) and direct GitLab UI tools. Let’s break down the easiest, most reliable ways to count those new Cucumber .feature files from the last quarter:

1. Git Command Line (Most Accurate, Works Everywhere)

This is the gold standard because Git tracks every file’s creation history directly. Open up a terminal (either in IntelliJ’s built-in terminal, GitLab’s web terminal, or your local machine) and run this command, adjusting the date range to match your quarter:

git log --since="2024-01-01" --until="2024-03-31" --diff-filter=A --name-only -- '*.feature' | sort | uniq | wc -l

Let’s break down what each part does so you can tweak it:

  • --since/--until: Lock in your quarter’s start and end dates (use YYYY-MM-DD format for consistency)
  • --diff-filter=A: Only show files that were added (no edits or deletions)
  • --name-only: Skip all commit messages, just output the file paths
  • '*.feature': Target only Cucumber feature files (no other file types)
  • sort | uniq: Remove duplicate entries (rare, but safe if a file was re-added accidentally)
  • wc -l: Counts the number of lines (each line is a unique new file)

Pro tip: If all your feature files live in a specific folder (like src/test/resources/features), narrow the search to that path for extra precision:

git log --since="2024-01-01" --until="2024-03-31" --diff-filter=A --name-only -- 'src/test/resources/features/*.feature' | sort | uniq | wc -l
2. GitLab Web Interface (No Terminal Needed)

Great for team members who prefer a GUI. Here’s how to do it:

  1. Go to your GitLab project and click Repository > Files in the left sidebar
  2. Click the Filter button at the top of the file list
  3. Under the "Created" dropdown, select your quarter’s start and end dates
  4. In the file search bar, type *.feature to filter only Cucumber files
  5. Look at the top-right corner of the results—GitLab will show you the total number of matching files (e.g., "12 results")

Note: This counts files first created in the date range, which is exactly what you want for tracking new features.

3. IntelliJ IDEA (Local Workflow)

If you’re working locally in IntelliJ, you’ve got two options:

3.1 Using Git Log in IntelliJ

For precise counts tied to your Git history:

  • Open the Git Log tool by pressing Alt+9 (or go to Git > Log in the menu bar)
  • Click the Filter icon (funnel shape) at the top of the log panel
  • Set your date range under "Date Range"
  • In the "Path Filter" field, type *.feature
  • To get the count, you can either run the Git command from IntelliJ’s terminal (as in Section 1) or manually tally the unique new files shown in the diffs. The terminal method is way faster for large datasets.

3.2 Using Local History (For Local Changes Only)

If you want to track files you’ve added locally (not yet pushed to GitLab):

  • Right-click your project root or features folder
  • Select Local History > Show History
  • Use the calendar icon in the history panel to set your quarter’s date range
  • Search for .feature in the history search bar
  • New files will be marked with a green icon—select all of them, and IntelliJ will show the total count in the bottom status bar.

内容的提问来源于stack exchange,提问作者gppanter

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:59:14