Skip to content

graphify --help: clone's --branch / --out options are printed under merge-graphs, and --out is listed twice with contradictory descriptions #2636

In review

Description

@rajarshidattapy

Labels: bug, docs, cli, good first issue
Version: 0.9.40

Summary

In the top-level help output, the option block belonging to clone is emitted after
merge-driver and merge-graphs, so it reads as though merge-graphs accepts --branch
and a second, differently-described --out.

Steps to reproduce

$ graphify --help

Actual behavior

  clone <github-url>      clone a GitHub repo locally and print its path for /graphify
  merge-driver <base> <current> <other>  git merge driver: union-merge two graph.json files (set up via hook install)
  merge-graphs <g1> <g2>  merge two or more graph.json files into one cross-repo graph
    --out <path>            output path (default: graphify-out/merged-graph.json)
    --branch <branch>       checkout a specific branch (default: repo default)
    --out <dir>             clone to a custom directory (default: ~/.graphify/repos/<owner>/<repo>)
  add <url>               fetch a URL and save it to ./raw, then update the graph

A reader sees merge-graphs documented with two --out flags that mean different things,
and no way to discover that clone takes --branch at all.

Expected behavior

  clone <github-url>      clone a GitHub repo locally and print its path for /graphify
    --branch <branch>       checkout a specific branch (default: repo default)
    --out <dir>             clone to a custom directory (default: ~/.graphify/repos/<owner>/<repo>)
  merge-driver <base> <current> <other>  git merge driver: union-merge two graph.json files (set up via hook install)
  merge-graphs <g1> <g2>  merge two or more graph.json files into one cross-repo graph
    --out <path>            output path (default: graphify-out/merged-graph.json)

Root cause

graphify/__main__.py:527-532 — the two clone option lines were appended after the
merge-graphs block instead of directly after their own command:

527:  print("  clone <github-url>      clone a GitHub repo locally and print its path for /graphify")
528:  print("  merge-driver <base> <current> <other>  git merge driver: union-merge two graph.json files (set up via hook install)")
529:  print("  merge-graphs <g1> <g2>  merge two or more graph.json files into one cross-repo graph")
530:  print("    --out <path>            output path (default: graphify-out/merged-graph.json)")
531:  print("    --branch <branch>       checkout a specific branch (default: repo default)")   # <- clone's
532:  print("    --out <dir>             clone to a custom directory (default: ~/.graphify/repos/<owner>/<repo>)")  # <- clone's

Fix

Move lines 531-532 to immediately after line 527. Both flags are real and functional on
clone; only the help layout is wrong.

Minor, same block

A few command lines in the same help text are misaligned by one space, which breaks the
description column:

  droid uninstall        remove graphify section from AGENTS.md     # 8 spaces
  trae uninstall         remove graphify section from AGENTS.md     # 9 spaces
  trae-cn uninstall      remove graphify section from AGENTS.md
  diagnose multigraph    report same-endpoint edge collapse risk in graph.json

compared with the two-space-wider column used by every other entry.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions