perf: reduce the number of calls to git-check-attr #602
Labels
No labels
Compat/Breaking
Kind
Bad merge
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
New language
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mergiraf/mergiraf#602
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "perf_git-check-attr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #599.
Looking good:) Just a couple of nits
@ -108,4 +113,3 @@
.current_dir(repo_dir)
.output()
.ok()
.filter(|output| output.status.success())?;
I think the question mark would still work here?
The return type of the function is now
HashMap<…>
.🤦♀️ of course
@ -1,6 +1,7 @@
use core::str;
use itertools::Itertools as _;
use itertools::Itertools;
I don't think this change is necessary? We're not naming the trait in the code
@ -100,3 +101,2 @@
file_name: &Path,
attr: &str,
) -> Option<String> {
attrs: &[&'a str],
We know that
'a
is actually'static
here, so I'd say let's write that to avoid complicating the function signature. We could always change that back if need arises@ -126,2 +141,3 @@
let attributes = read_attributes_for_file(repo_dir, file_name, attr_names);
read_attr("mergiraf.language").or_else(|| read_attr("linguist-language"))
attr_names
With this change, it imo becomes less intuitive that what we're doing is looking for the value of
mergiraf.language
first, andlinguist-language
second. Could you please add a small note explaining that?