libgit2 / libgit2/libgit2sharp
Question/Feature request: Rebase branch using a Tag as upstream
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 3.5k
- Forks
- 925
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
This is potentially a feature request, if there is no way of accomplishing this using the current version of LibGit2Sharp
I am trying to use LibGit2Sharp to rebase a feature branch using a Tag as upstream. The initial graph looks like this:
* -- * -- * (featureA)
/
/
*--*--*--*--*--*--*--*--*--*--*--*-- (master)
| | | |
tag1 tag2 tag3 tag4
The idea is to rebase featureA branch on master, but not on the HEAD of master (last commit), but rather on the commit corresponding to tag2.
The end result would be something like this:
* -- * -- * (featureA)
/
/
*--*--*--*--*--*--*--*--*--*--*--*-- (master)
| | | |
tag1 tag2 tag3 tag4
The git syntax for this would be (and it works perfectly):
git rebase ref/tags/tag2 featureA
However, LibGit2Sharp syntax only allows passing in a Branch as argument for the upstream param.
var rebaseOptions = new RebaseOptions {...};
var identity = new Identity(...);
Branch branch = repo.Head;
Tag upstreamTag = repo.Tags[ontoTag];
var rebaseResult = repo.Rebase.Start(
branch,
upstream, // <-- this is where I am struggling to pass in this Tag as upstream
null,
identity,
rebaseOptions);
Is this achievable via LibGit2Sharp?
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne bei repo.Rebase.Start und den im Bericht gezeigten Typen RebaseOptions, Branch und Tag; vergleiche den upstream-Parameter mit der Tag-Suche des Repositorys und der entsprechenden git rebase-Syntax. Erledigt ist dies, wenn festgestellt wurde, ob ein Tag als upstream akzeptiert werden kann, und andernfalls die erforderliche API-Änderung sowie deren Validierungsabdeckung definiert sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp, git
- Bereich
- devtools
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100