libgit2 / libgit2/pygit2

[git-cherry-pick recipe] The example in docs produces a misleading result

Open
#1,032 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation feature
Dominant language
Python
Stars
1.7k
Forks
408
Avg merge
2d 57m
Merged PRs (30d)
7

Description

I was following https://www.pygit2.org/recipes/git-cherry-pick.html#cherry-picking-a-commit-without-a-working-copy and it seemed to work at first but then I noticed that it pulls in extra commits that I've never wanted.

I think that this example is incomplete.

My src (https://github.com/sanitizers/patchback-github-app/blob/92934c6/patchback/event_handlers.py#L66-L133) should produce a branch with one cherry-picked commit but instead gets a whole bunch of earlier commits too: https://github.com/webknjaz/backport-test-repo/pull/13/commits.

Contributor guide

Open the contributing guide

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 with the recipe at docs/recipes/git-cherry-pick.html and reproduce the linked cherry-picking example using the behavior described in the issue. Compare the result with the referenced event_handlers.py source and backport-test-repo commit history; the documentation is done when the example no longer misleadingly includes earlier commits or clearly explains the observed result.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.