python / python/devguide

Documenting pushdefault config option

Aperta
#257 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

topic-git type-feature
Lingua principale
Python
Stelle
2.1k
Fork
1k
Merge medio
2g 12h
PR unite (30g)
12

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Esamina le sezioni submitting e pushing changes collegate nel devguide, insieme all’esempio di pushdefault in .git/config. Confronta i tre workflow documentati e determina quale metodo dovrebbe raccomandare la guida, quindi aggiorna la documentazione pertinente per rendere chiari questa scelta e il relativo setup.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
git
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.