Skip to content

Commit 756893f

Browse files
git_graph: Remove feature flag (#52972) (cherry-pick to preview) (#53002)
Cherry-pick of #52972 to preview ---- After #52953 gets merged the git graph will be ready for it's preview release, so we can finally remove the feature flag! AKA this PR releases the git graph Self-Review Checklist: - [ ] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Closes #ISSUE Release Notes: - Add Git Graph. Can be accessed through the button on the bottom of the git panel or the `git graph: Open` action Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
1 parent 8180242 commit 756893f

8 files changed

Lines changed: 32 additions & 51 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/feature_flags/src/flags.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ impl FeatureFlag for DiffReviewFeatureFlag {
4747
}
4848
}
4949

50-
pub struct GitGraphFeatureFlag;
51-
52-
impl FeatureFlag for GitGraphFeatureFlag {
53-
const NAME: &'static str = "git-graph";
54-
}
55-
5650
pub struct StreamingEditFileToolFeatureFlag;
5751

5852
impl FeatureFlag for StreamingEditFileToolFeatureFlag {

crates/git_graph/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ anyhow.workspace = true
2424
collections.workspace = true
2525
db.workspace = true
2626
editor.workspace = true
27-
feature_flags.workspace = true
2827
git.workspace = true
2928
git_ui.workspace = true
3029
gpui.workspace = true

crates/git_graph/src/git_graph.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use collections::{BTreeMap, HashMap, IndexSet};
22
use editor::Editor;
3-
use feature_flags::{FeatureFlagAppExt as _, GitGraphFeatureFlag};
43
use git::{
54
BuildCommitPermalinkParams, GitHostingProviderRegistry, GitRemote, Oid, ParsedGitRemote,
65
parse_git_remote_url,
@@ -730,8 +729,7 @@ pub fn init(cx: &mut App) {
730729
cx.observe_new(|workspace: &mut workspace::Workspace, _, _| {
731730
workspace.register_action_renderer(|div, workspace, _, cx| {
732731
div.when(
733-
workspace.project().read(cx).active_repository(cx).is_some()
734-
&& cx.has_flag::<GitGraphFeatureFlag>(),
732+
workspace.project().read(cx).active_repository(cx).is_some(),
735733
|div| {
736734
let workspace = workspace.weak_handle();
737735

crates/git_ui/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ db.workspace = true
2727
editor.workspace = true
2828
file_icons.workspace = true
2929
futures.workspace = true
30-
feature_flags.workspace = true
3130
fuzzy.workspace = true
3231
git.workspace = true
3332
gpui.workspace = true

crates/git_ui/src/commit_view.rs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use buffer_diff::BufferDiff;
33
use collections::HashMap;
44
use editor::display_map::{BlockPlacement, BlockProperties, BlockStyle};
55
use editor::{Addon, Editor, EditorEvent, ExcerptRange, MultiBuffer, multibuffer_context_lines};
6-
use feature_flags::{FeatureFlagAppExt as _, GitGraphFeatureFlag};
76
use git::repository::{CommitDetails, CommitDiff, RepoPath, is_binary_content};
87
use git::status::{FileStatus, StatusCode, TrackedStatus};
98
use git::{
@@ -1042,21 +1041,19 @@ impl Render for CommitViewToolbar {
10421041
}),
10431042
)
10441043
.when(!is_stash, |this| {
1045-
this.when(cx.has_flag::<GitGraphFeatureFlag>(), |this| {
1046-
this.child(
1047-
IconButton::new("show-in-git-graph", IconName::GitGraph)
1048-
.icon_size(IconSize::Small)
1049-
.tooltip(Tooltip::text("Show in Git Graph"))
1050-
.on_click(move |_, window, cx| {
1051-
window.dispatch_action(
1052-
Box::new(crate::git_panel::OpenAtCommit {
1053-
sha: sha_for_graph.clone(),
1054-
}),
1055-
cx,
1056-
);
1057-
}),
1058-
)
1059-
})
1044+
this.child(
1045+
IconButton::new("show-in-git-graph", IconName::GitGraph)
1046+
.icon_size(IconSize::Small)
1047+
.tooltip(Tooltip::text("Show in Git Graph"))
1048+
.on_click(move |_, window, cx| {
1049+
window.dispatch_action(
1050+
Box::new(crate::git_panel::OpenAtCommit {
1051+
sha: sha_for_graph.clone(),
1052+
}),
1053+
cx,
1054+
);
1055+
}),
1056+
)
10601057
.children(remote_info.map(|(provider_name, url)| {
10611058
let icon = match provider_name.as_str() {
10621059
"GitHub" => IconName::Github,

crates/git_ui/src/git_panel.rs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use editor::{
2020
actions::ExpandAllDiffHunks,
2121
};
2222
use editor::{EditorStyle, RewrapOptions};
23-
use feature_flags::{FeatureFlagAppExt as _, GitGraphFeatureFlag};
2423
use file_icons::FileIcons;
2524
use futures::StreamExt as _;
2625
use git::commit::ParsedCommitMessage;
@@ -4529,7 +4528,6 @@ impl GitPanel {
45294528
let commit = branch.most_recent_commit.as_ref()?.clone();
45304529
let workspace = self.workspace.clone();
45314530
let this = cx.entity();
4532-
let can_open_git_graph = cx.has_flag::<GitGraphFeatureFlag>();
45334531

45344532
Some(
45354533
h_flex()
@@ -4607,18 +4605,16 @@ impl GitPanel {
46074605
),
46084606
)
46094607
})
4610-
.when(can_open_git_graph, |this| {
4611-
this.child(
4612-
panel_icon_button("git-graph-button", IconName::GitGraph)
4613-
.icon_size(IconSize::Small)
4614-
.tooltip(|_window, cx| {
4615-
Tooltip::for_action("Open Git Graph", &Open, cx)
4616-
})
4617-
.on_click(|_, window, cx| {
4618-
window.dispatch_action(Open.boxed_clone(), cx)
4619-
}),
4620-
)
4621-
}),
4608+
.child(
4609+
panel_icon_button("git-graph-button", IconName::GitGraph)
4610+
.icon_size(IconSize::Small)
4611+
.tooltip(|_window, cx| {
4612+
Tooltip::for_action("Open Git Graph", &Open, cx)
4613+
})
4614+
.on_click(|_, window, cx| {
4615+
window.dispatch_action(Open.boxed_clone(), cx)
4616+
}),
4617+
),
46224618
),
46234619
)
46244620
}

script/docs-suggest-publish

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ if [[ "$DRY_RUN" == "true" ]]; then
131131
echo "Would auto-apply suggestions to docs via Droid and create a draft PR."
132132
echo "Model: $MODEL"
133133
echo ""
134-
134+
135135
# Show each suggestion file
136136
for file in $(echo "$MANIFEST" | jq -r '.suggestions[].file'); do
137137
echo "--- $file ---"
138138
git show "origin/$SUGGESTIONS_BRANCH:$file" 2>/dev/null || echo "(file not found)"
139139
echo ""
140140
done
141-
141+
142142
echo -e "${YELLOW}=== END DRY RUN ===${NC}"
143143
echo ""
144144
echo "Run without --dry-run to create the PR."
@@ -213,7 +213,7 @@ fi
213213
FLAGGED_PRS=()
214214
FLAGS_FILE="$REPO_ROOT/crates/feature_flags/src/flags.rs"
215215
if [[ -f "$FLAGS_FILE" ]]; then
216-
# Extract feature flag struct names (e.g. SubagentsFeatureFlag, GitGraphFeatureFlag)
216+
# Extract feature flag struct names (e.g. SubagentsFeatureFlag)
217217
FLAG_NAMES=$(grep -oE 'pub struct \w+FeatureFlag' "$FLAGS_FILE" | awk '{print $3}')
218218
if [[ -n "$FLAG_NAMES" ]]; then
219219
FLAG_PATTERN=$(echo "$FLAG_NAMES" | tr '\n' '|' | sed 's/|$//')
@@ -538,10 +538,10 @@ echo -e "${GREEN}PR created:${NC} $PR_URL"
538538
if [[ "$KEEP_QUEUE" != "true" ]]; then
539539
echo ""
540540
echo "Resetting suggestions queue..."
541-
541+
542542
git checkout --orphan "${SUGGESTIONS_BRANCH}-reset"
543543
git rm -rf . > /dev/null 2>&1 || true
544-
544+
545545
cat > README.md << 'EOF'
546546
# Documentation Suggestions Queue
547547
@@ -562,19 +562,19 @@ run `script/docs-suggest-publish` to create a documentation PR from these sugges
562562
3. At preview release, suggestions are collected into a docs PR
563563
4. After docs PR is created, this branch is reset
564564
EOF
565-
565+
566566
mkdir -p suggestions
567567
echo '{"suggestions":[]}' > manifest.json
568568
git add README.md suggestions manifest.json
569569
git commit -m "Reset documentation suggestions queue
570570
571571
Previous suggestions published in: $PR_URL"
572-
572+
573573
# Force push required: replacing the orphan suggestions branch with a clean slate
574574
git push -f origin "${SUGGESTIONS_BRANCH}-reset:$SUGGESTIONS_BRANCH"
575575
git checkout "$ORIGINAL_BRANCH"
576576
git branch -D "${SUGGESTIONS_BRANCH}-reset"
577-
577+
578578
echo "Suggestions queue reset."
579579
else
580580
git checkout "$ORIGINAL_BRANCH"

0 commit comments

Comments
 (0)