mathiasbynens / mathiasbynens/dotfiles

`git dm` misleading error if 0 branches

Open
#1,072 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
31.5k
Forks
8.4k
PR merge metrics
No merged PRs in 30d

Description

It prints "fatal: branch name required", if there are 0 branches to delete, because the pipe isn't "feeding" it any names.

According to GNU's xargs --help (from findutils), this is an easy fix:

-r, --no-run-if-empty        if there are no arguments, then do not run COMMAND;
                                 if this option is not given, COMMAND will be
                                 run at least once

IDK, if this works for other implementations

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the git dm definition and the xargs invocation it uses. Reproduce the command with zero branches, then verify that the command exits without printing the misleading “branch name required” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, shell
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.