{"title":"Cód tiomanta","version":"5.2","locale":"ga","docname":"internals/contributing/committing-code","url":"/ga/5.2/internals/contributing/committing-code/","canonical":"https://djangodocs.dev/ga/5.2/internals/contributing/committing-code/","summary":"Tá an chuid seo dírithe ar na cumaisc agus d'aon duine ar bith a bhfuil suim acu a fháil amach conas a thiomnaíonn cód i Django.","html":"<h1>Cód tiomanta<a class=\"heading-anchor\" href=\"#committing-code\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>Tá an chuid seo dírithe ar na cumaisc agus d'aon duine ar bith a bhfuil suim acu a fháil amach conas a thiomnaíonn cód i Django. Más ball pobail tú atá ag iarraidh cód a chur le Django, féach ar:doc: writing-code/working-with-git ina ionad.</p>\n<section id=\"handling-pull-requests\">\n<span id=\"id1\"></span><h2>Iarrataí tarraingthe a<a class=\"heading-anchor\" href=\"#handling-pull-requests\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Ós rud é go bhfuil Django á óstáil ar GitHub, cuirtear paistí ar fáil i bhfoirm iarratais tarraingthe.</p>\n<p>Agus iarratas tarraingthe á dhéanamh agat, déan cinnte go gcomhlíonann gach tiomantas aonair na treoirlínte tiomanta Táthar ag súil go soláthróidh ranníocóirí na hiarratais tarraingthe is fearr Go praiticiúil féadfaidh cumaisc - a mbeidh níos eolaí ar na treoirlínte tiomanta - cinneadh a dhéanamh tiomantas a thabhairt suas go dtí an caighdeán iad féin.</p>\n<p>B'fhéidir gur mhaith leat gníomhartha Jenkins nó GitHub a thástáil ar an iarratas tarraingthe le duine de na tógálaithe iarratais tarraingthe nach ritheann go huathoibríoch, mar shampla Oracle nó Selenium. Féach an <a href=\"#id1\"><span class=\"problematic\" id=\"id2\">`</span></a>leathanach wiki CI <a href=\"#id3\"><span class=\"problematic\" id=\"id4\">`</span></a>_ le haghaidh treoracha.</p>\n<p>Má aimsíonn tú tú féin ag seiceáil iarratais tarraingthe go háitiúil níos minice, beidh an t-alias git seo cabhrach:</p>\n<div class=\"code-block\" data-language=\"ini\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Ini</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Ini code\"><code><span class=\"k\">[alias]</span>\n    <span class=\"na\">pr</span> <span class=\"o\">=</span> <span class=\"s\">!sh -c \\&quot;git fetch upstream pull/${1}/head:pr/${1} &amp;&amp; git checkout pr/${1}\\&quot;</span>\n</code></pre></div>\n<p>Cuir é le do <code class=\"docutils literal notranslate\">~/.gitconfig</code>, agus socraigh <code class=\"docutils literal notranslate\">upstream</code> mar <code class=\"docutils literal notranslate\">django/django</code>. Ansin is féidir leat <code class=\"docutils literal notranslate\">git pr ####</code> a rith chun an t-iarratas tarraingthe comhfhreagrach a sheiceáil.</p>\n<p>Ag an bpointe seo, is féidir leat oibriú ar an gcód. Úsáid <code class=\"docutils literal notranslate\">git rebase -i</code> agus <code class=\"docutils literal notranslate\">git commit --amend</code> chun a chinntiú go bhfuil an leibhéal cáilíochta ag súil leis ag na gealltanais. Nuair a bheidh tú réidh:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-0-unix-label\">Linux / macOS</p><div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span><span class=\"c1\"># Pull in the latest changes from main.</span>\n<span class=\"gp\">$ </span>git checkout main\n<span class=\"gp\">$ </span>git pull upstream main\n<span class=\"gp\">$ </span><span class=\"c1\"># Rebase the pull request on main.</span>\n<span class=\"gp\">$ </span>git checkout pr/####\n<span class=\"gp\">$ </span>git rebase main\n<span class=\"gp\">$ </span>git checkout main\n<span class=\"gp\">$ </span><span class=\"c1\"># Merge the work as &quot;fast-forward&quot; to main to avoid a merge commit.</span>\n<span class=\"gp\">$ </span><span class=\"c1\"># (in practice, you can omit &quot;--ff-only&quot; since you just rebased)</span>\n<span class=\"gp\">$ </span>git merge --ff-only pr/XXXX\n<span class=\"gp\">$ </span><span class=\"c1\"># If you&#39;re not sure if you did things correctly, check that only the</span>\n<span class=\"gp\">$ </span><span class=\"c1\"># changes you expect will be pushed to upstream.</span>\n<span class=\"gp\">$ </span>git push --dry-run upstream main\n<span class=\"gp\">$ </span><span class=\"c1\"># Push!</span>\n<span class=\"gp\">$ </span>git push upstream main\n<span class=\"gp\">$ </span><span class=\"c1\"># Delete the pull request branch.</span>\n<span class=\"gp\">$ </span>git branch -d pr/xxxx\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-0-windows-label\">Windows</p><div class=\"code-block\" data-language=\"doscon\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Windows</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Windows shell\"><code><span class=\"gp\">...\\&gt;</span> <span class=\"c1\">REM Pull in the latest changes from main.</span>\n<span class=\"gp\">...\\&gt;</span> git checkout main\n<span class=\"gp\">...\\&gt;</span> git pull upstream main\n<span class=\"gp\">...\\&gt;</span> <span class=\"c1\">REM Rebase the pull request on main.</span>\n<span class=\"gp\">...\\&gt;</span> git checkout pr/####\n<span class=\"gp\">...\\&gt;</span> git rebase main\n<span class=\"gp\">...\\&gt;</span> git checkout main\n<span class=\"gp\">...\\&gt;</span> <span class=\"c1\">REM Merge the work as &quot;fast-forward&quot; to main to avoid a merge commit.</span>\n<span class=\"gp\">...\\&gt;</span> <span class=\"c1\">REM (in practice, you can omit &quot;--ff-only&quot; since you just rebased)</span>\n<span class=\"gp\">...\\&gt;</span> git merge --ff-only pr/XXXX\n<span class=\"gp\">...\\&gt;</span> <span class=\"c1\">REM If you&#39;re not sure if you did things correctly, check that only the</span>\n<span class=\"gp\">...\\&gt;</span> <span class=\"c1\">REM changes you expect will be pushed to upstream.</span>\n<span class=\"gp\">...\\&gt;</span> git push --dry-run upstream main\n<span class=\"gp\">...\\&gt;</span> <span class=\"c1\">REM Push!</span>\n<span class=\"gp\">...\\&gt;</span> git push upstream main\n<span class=\"gp\">...\\&gt;</span> <span class=\"c1\">REM Delete the pull request branch.</span>\n<span class=\"gp\">...\\&gt;</span> git branch -d pr/xxxx\n</code></pre></div></div></div>\n<p>Fórsa brú go dtí an brainse tar éis athbhunú ar an bpríomhlíonra ach roimh chumasc agus brú go dtí an sruth. Ligeann sé seo do na hashes geallta ar an bpríomhlíonra agus an brainse a mheaitseáil a dhúnann an t-iarratas tarraingt go huathoibríoch.</p>\n<p>Mura gá iarraidh tarraingthe a chumasc mar ghealltanais iolracha, is féidir leat cnaipe “Squash agus cumaisc” GitHub a úsáid ar an suíomh Gréasáin. Cuir an teachtaireacht &lt;committing-guidelines&gt;tiomanta in eagar de réir mar is gá chun comhlíonadh la:ref: <a href=\"#id1\"><span class=\"problematic\" id=\"id2\">`</span></a>na treoirlínte <a href=\"#id3\"><span class=\"problematic\" id=\"id4\">`</span></a>agus bain an uimhir iarratais tarraingthe a chuirtear isteach go huathoibríoch le chéad líne na teachtaireachta.</p>\n<p>Agus stair thiomanta iarratais tarraingthe á athscríobh agat, is é an aidhm stair thiomanta Django a dhéanamh chomh inúsáidte agus is féidir:</p>\n<ul class=\"simple\">\n<li><p>Má tá gealltanais anar-anall i bpaiste, ansin iad sin a athscríobh i gceann amháin. Mar shampla, má chuireann tiomantas cód éigin leis agus má shocraíonn an dara tiomantas saincheisteanna stíleacha a tugadh isteach sa chéad thiomantas, ba chóir na gealltanais sin a scriosadh sula ndéantar iad a chumasc.</p></li>\n<li><p>Athruithe ar leithligh ar ghealltanais éagsúla trí ghrúpáil loighciúil: má dhéanann tú glantachán stíle ag an am céanna agus a dhéanann tú athruithe eile ar chomhad, beidh sé níos fusa athbhreithniú a dhéanamh ar an stair trí na hathruithe a roinnt ina dhá ghealltanas éagsúla.</p></li>\n<li><p>Bí cúramach le cumaisc brainsí suas srutha sna hiarratais tarraingthe.</p></li>\n<li><p>Ba chóir go rith na tástálacha agus ba chóir doiciméid a thógáil tar éis gach Níor chóir do na tástálacha ná na doiciméid rabhaidh a eisiúint.</p></li>\n<li><p>Is fearr paistí triobhála agus beaga de ghnáth a dhéanamh i dtiomantas amháin. Féadfar obair mheánmhéide go mór a roinnt ina iliomad gealltanais má tá ciall aige.</p></li>\n</ul>\n<p>Buaileann praiticiúlacht íonacht, mar sin tá sé faoi gach cumaisc cinneadh a dhéanamh cé mhéad staire atá le déanamh le haghaidh iarratas tarraingthe. Is iad na príomhphointí ná an pobal a mhealladh, obair a dhéanamh, agus stair tiomanta inúsáidte a bheith agat.</p>\n</section>\n<section id=\"committing-guidelines\">\n<span id=\"id2\"></span><h2>Treoirlínte a<a class=\"heading-anchor\" href=\"#committing-guidelines\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Ina theannta sin, lean na treoirlínte seo a leanas agus tú ag déanamh cód do stór Git Django:</p>\n<ul>\n<li><p>Ná athraigh stair foilsithe brainsí <code class=\"docutils literal notranslate\">django/django</code> trí bhrú fórsa. Más gá duit go hiomlán (ar chúiseanna slándála mar shampla), plé an cás leis an bhfoireann ar dtús.</p></li>\n<li><p>For any medium-to-big changes, where &quot;medium-to-big&quot; is according to\nyour judgment, please bring things up on the <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Forum</a> before making\nthe change.</p>\n<p>If you bring something up and nobody responds, please don't take that\nto mean your idea is great and should be implemented immediately because\nnobody contested it. Everyone doesn't always have a lot of time to read\ndiscussions immediately, so you may have to wait a couple of days before\ngetting a response.</p>\n</li>\n<li><p>Scríobh teachtaireachtaí tiomanta mionsonraithe san am atá caite, ní am reatha.</p>\n<ul class=\"simple\">\n<li><p>Go maith: “Fhabht Unicode seasta i RSS API.”</p></li>\n<li><p>Droch: “Socraíonn fabht Unicode i RSS API.”</p></li>\n<li><p>Droch: “Socrú fabht Unicode i RSS API.”</p></li>\n</ul>\n<p>Ba chóir go mbeadh an teachtaireacht tiomanta i línte de 72 chars ar a mhéad. Ba chóir go mbeadh líne ábhair ann, scartha le líne bán agus ansin míreanna de 72 líne char. Tá na teorainneacha bog. Maidir leis an líne ábhair, is fearr níos giorra. I gcorp na teachtaireachta tiomanta is fearr níos mó mionsonraí ná níos lú:</p>\n<div class=\"code-block\" data-language=\"none\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">None</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"None code\"><code>Fixed #18307 -- Added git workflow guidelines.\n\nRefactored the Django&#39;s documentation to remove mentions of SVN\nspecific tasks. Added guidelines of how to use Git, GitHub, and\nhow to use pull request together with Trac instead.\n</code></pre></div>\n<p>Creidmheas do na ranníocóirí sa teachtaireacht tiomanta: “Go raibh maith agat A as an tuarascáil agus B le haghaidh athbhreithniú.” Úsáid <a class=\"reference external\" href=\"https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors\">Co-Authored-By</a> git de réir mar is cuí.</p>\n</li>\n<li><p>Maidir le tiomantas do bhrainse, réimsigh an teachtaireacht tiomanta le hainm na brainse. Mar shampla: “[1.4.x] Seasta #xxxxx -- Tacaíocht bhreise le haghaidh léamh intinne.”</p></li>\n<li><p>Tiomann teorainn don athrú is gráinneach a dhéanann ciall. Ciallaíonn sé seo, bain úsáid as gealltanais bheaga go minic seachas tiomantas móra is annamh. Mar shampla, má éilíonn athrú beag ar leabharlann Y a chur i bhfeidhm gné X, déan an t-athrú a dhéanamh ar leabharlann Y ar dtús, ansin déan gné X i dtiomantas ar leithligh. Téann sé seo* bealach fad* chun cabhrú le gach duine d'athruithe a leanúint.</p></li>\n<li><p>Socruithe fabht ar leithligh ó athruithe gné. B'fhéidir go gcaithfear fabhtshocruithe a chur ar ais chuig an mbrainse chobhsaí, de réir: ref: <a href=\"#id1\"><span class=\"problematic\" id=\"id2\">`</span></a>supportted-versions-policy <a href=\"#id3\"><span class=\"problematic\" id=\"id4\">`</span></a>.</p></li>\n<li><p>Má dhúnann do thiomantas ticéad sa <a class=\"reference external\" href=\"https://code.djangoproject.com/\">rianaitheoir ticéad</a> Django, cuir tús le do theachtaireacht tiomanta leis an téacs “Seasta #xxxxx “, áit is é “xxxxx” uimhir an ticéad a shocraíonn do thiomantas. Sampla: “Seasta #123 -- Gné whizbang curtha leis.”. Tá Trac curtha againn ionas go ndúnfaidh aon teachtaireacht tiomanta san fhormáid sin an ticéad tagartha go huathoibríoch agus go gcuirfidh trácht air leis an teachtaireacht iomlán tiomanta.</p>\n<p>Maidir le daoine fiosracha, táimid ag baint úsáide as <a href=\"#id1\"><span class=\"problematic\" id=\"id2\">`</span></a>breiseán Trac <a href=\"#id3\"><span class=\"problematic\" id=\"id4\">`</span></a>_ chuige seo.</p>\n</li>\n</ul>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Note</p>\n<p>Tabhair faoi deara nach bhfuil aon rud ar eolas ag comhtháthú Trac faoi iarratais tarraingthe. Mar sin má dhéanann tú iarratas tarraingthe a dhúnadh leis an abairt “dúnann #400&quot; i do theachtaireacht tiomanta, dúnfaidh GitHub an t-iarratas tarraingthe, ach ní dhúnfaidh an breiseán Trac an ticéad uimhrithe céanna i Trac.</p>\n</aside>\n<ul>\n<li><p>Má thagraíonn do thiomantas ticéad sa <a class=\"reference external\" href=\"https://code.djangoproject.com/\">rianaitheoir ticéad</a> Django ach ní dhúnnaí* an ticéad, cuir an abairt “Refs #xxxxx “san áireamh, áit ar “xxxxx” uimhir an ticéid a thagann do thiomantas. Cuirfidh sé seo trácht ar an ticéad cuí go huathoibríoch.</p></li>\n<li><p>Scríobh teachtaireachtaí tiomanta do chúlphortanna ag baint úsáide as an bpatrún seo:</p>\n<div class=\"code-block\" data-language=\"none\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">None</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"None code\"><code>[&lt;Django version&gt;] Fixed &lt;ticket&gt; -- &lt;description&gt;\n\nBackport of &lt;revision&gt; from &lt;branch&gt;.\n</code></pre></div>\n<p>Mar shampla:</p>\n<div class=\"code-block\" data-language=\"none\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">None</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"None code\"><code>[1.3.x] Fixed #17028 -- Changed diveintopython.org -&gt; diveintopython.net.\n\nBackport of 80c0cbf1c97047daed2c5b41b296bbc56fe1d7e3 from main.\n</code></pre></div>\n<p>Tá <a href=\"#id3\"><span class=\"problematic\" id=\"id4\">`script ar an wiki`_</span></a> chun é seo a uathoibri&lt; <a class=\"reference external\" href=\"https://code.djangoproject.com/wiki/MergerTips#AutomatingBackports\">https://code.djangoproject.com/wiki/MergerTips#AutomatingBackports</a>&gt; ú.</p>\n<p>Má shocraíonn an tiomantas aischéimniú, cuir é seo san áireamh sa teachtaireacht tiomanta:</p>\n<div class=\"code-block\" data-language=\"none\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">None</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"None code\"><code>Regression in 6ecccad711b52f9273b1acb07a57d3f806e93928.\n</code></pre></div>\n<p>(bain úsáid as an hash tiomanta inar tugadh isteach an aischéimniú).</p>\n</li>\n</ul>\n</section>\n<section id=\"reverting-commits\">\n<h2>Tiomantas a thabhairt ar ais<a class=\"heading-anchor\" href=\"#reverting-commits\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Níl aon duine foirfe; déanfar botúin.</p>\n<p>Ach déan iarracht an-chrua a chinntiú nach dtarlóidh botúin. Díreach toisc go bhfuil beartas aisghabhála againn ní mhaolaítear do fhreagracht chun díriú a dhéanamh ar an gcaighdeán is airde is féidir. I ndáiríre: déan do chuid oibre a sheiceáil faoi dhó, nó déan í a sheiceáil trí chumasc eile** roimhe** déanann tú é sa chéad áit!</p>\n<p>Nuair a aimsítear tiomantas mícheart, lean na treoirlínte seo le do thoil:</p>\n<ul class=\"simple\">\n<li><p>Más féidir, cuir ar an údar bunaidh a thiomantas féin a chur ar ais.</p></li>\n<li><p>Ná cuir athruithe údair eile ar ais gan cead ón údar bunaidh.</p></li>\n<li><p>Úsáid git revert - déanfaidh sé seo tiomantas ar ais, ach beidh an tiomantas bunaidh fós mar chuid de stair an tiomanta.</p></li>\n<li><p>If the original author can't be reached (within a reasonable amount\nof time -- a day or so) and the problem is severe -- crashing bug,\nmajor test failures, etc. -- then ask for objections on the <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Forum</a>\nthen revert if there are none.</p></li>\n<li><p>Má tá an fhadhb beag (gné a thiomann tar éis reoite gné, abair), fan amach í.</p></li>\n<li><p>If there's a disagreement between the merger and the reverter-to-be then try\nto work it out on the <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Forum</a> . If an agreement can't be reached then\nit should be put to a vote.</p></li>\n<li><p>Má thug an tiomantas leochaileacht slándála dearbhaithe, nochtaithe isteach ansin féadfar an tiomantas a chur ar ais láithreach gan cead ó aon duine.</p></li>\n<li><p>Féadfaidh an cothabhálaí brainse scaoilte gealltanais a chur ar ais don bhrainse scaoilte gan cead má bhriseann an tiomantas an brainse scaoilte.</p></li>\n<li><p>Má bhrúiteann tú brainse ábhar ar dhearmad chuig django/django`, scrios é. Mar shampla, má rinne tú: git push upstream feature_antigravity`, déan brú droim: <code class=\"docutils literal notranslate\">git push upstream:feature_antigravity</code>.</p></li>\n</ul>\n</section>","rootId":"committing-code","toc":[{"title":"Iarrataí tarraingthe a","anchor":"handling-pull-requests","children":[]},{"title":"Treoirlínte a","anchor":"committing-guidelines","children":[]},{"title":"Tiomantas a thabhairt ar ais","anchor":"reverting-commits","children":[]}],"breadcrumbs":[{"docname":"internals/index","title":"Inmheánacha Django","url":"/ga/5.2/internals/"},{"docname":"internals/contributing/index","title":"Ag cur le Django","url":"/ga/5.2/internals/contributing/"},{"docname":"internals/contributing/writing-code/index","title":"Cód rannpháirteach","url":"/ga/5.2/internals/contributing/writing-code/"}],"prev":{"docname":"internals/contributing/accessibility","title":"Accessibility","url":"/ga/5.2/internals/contributing/accessibility/"},"next":{"docname":"internals/contributing/writing-documentation","title":"Scríobh cáipéis","url":"/ga/5.2/internals/contributing/writing-documentation/"},"formats":{"html":"/ga/5.2/internals/contributing/committing-code/","markdown":"/ga/5.2/internals/contributing/committing-code.md","json":"/ga/5.2/internals/contributing/committing-code.json"},"source":"https://github.com/django/django/blob/stable/5.2.x/docs/internals/contributing/committing-code.txt","official":"https://docs.djangoproject.com/ga/5.2/internals/contributing/committing-code/","inVersions":["6.1","6.0","5.2"],"inLocales":["en","sv","zh-hans","ga","fr","ja","id","it","pt-br","ko","es","el","pl"]}