Skip to content

show newer commits if on detached head #1964

Open

Description

@extrawurst

Right now the log starts from HEAD - no matter if that's a tip of a branch or not.

For #81 we need to do the revwalk from every tip and come up with a smart data structure that allows us to draw the correct graph without storing the whole graph in memory.

Before tackling #81 we can at least determine if we are on a detached head and then iterate the branches whether one is a descendent of our current HEAD and then start from the branch tip and visualize where HEAD is in the log.

Activity

  1. added this to the v0.25 milestone on Nov 27, 2023
  2. modified the milestones: v0.25, v0.26, v0.27 on Feb 19, 2024
  3. modified the milestones: v0.27, v0.28 on Jan 13, 2025
  4. modified the milestones: v0.28, v0.29 on Oct 22, 2025
  5. MaxAsif commented on Aug 20, 2026

    @MaxAsif

    Hi, I'd like to take this on. Plan: in LogWalker::new, check repo.head_detached(); if detached, iterate local branches via repo.branches(Some(BranchType::Local)) and use repo.graph_descendant_of() (same as the existing usage in commit_files.rs) to find a branch tip that descends from HEAD, then seed the walk from that tip instead of raw HEAD. Will do the same for LogWalkerWithoutFilter. Happy to adjust the approach if you have other ideas on how HEAD's position should be indicated in the resulting log.

  6. MaxAsif commented on Aug 20, 2026

    @MaxAsif

    On reflection I'll hold off on this one for now rather than sit on it - happy for anyone else to pick it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions