python / python/devguide

Documenting pushdefault config option

Offen
#257 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

topic-git type-feature
Vorherrschende Sprache
Python
Sterne
2.1k
Forks
1k
Ø Merge
2 T. 12 Std.
Gemergte PRs (30 T.)
12

Beschreibung

There seem to be 3 variations of the git push command:

  1. Use git push origin branchname and always specify the remote and the branch
  2. Use git push -u origin branchname on the first push to set origin as the default and then just use git push
  3. Set the pushdefault to origin in .git/config and just use git push

The first method is the one suggested in the devguide
(e.g. in the submitting section); the second is also documented in the pushing changes section; the third is apparently somewhat recent and not yet documented.

The pushdefault is configured by adding to .git/config:

[remote]
    pushdefault = origin

Where origin refers to the user's fork of cpython. AFAICT almost all the pushes should go to origin.

Each method has pros and cons:

First method:

  • pros: explicit is better than implicit
  • cons: longer to type, harder to remember, could get the arg names/order wrong

Second method:

  • pros: still explicit but shorter to type for the following pushes
  • cons: same as above but only applies to the first push on each branch

Third method:

  • pros: easier to remember, shorter to type, works like hg push
  • cons: less explicit

The question is: which one should we adopt as the recommended method?

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Überprüfe die verlinkten Abschnitte submitting und pushing changes im devguide sowie das Beispiel für pushdefault in .git/config. Vergleiche die drei dokumentierten Workflows und bestimme, welche Methode der Leitfaden empfehlen sollte, und aktualisiere anschließend die relevante Dokumentation, um diese Entscheidung und ihre Einrichtung klar zu machen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
git
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.