git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: push branch descriptions

From
PUPyeron, Jason J CTR (US) <jason.j.pyeron.ctr@mail.mil>
Date
Nov 14, 2012, 17:21 UTC
Message-ID
<871B6C10EBEFE342A772D1159D13208537AABCCA@umechphj.easf.csd.disa.mil>
In-Reply-To
<CAB9Jk9BN6vTnpPa8rv1Yumn2Os=XU=tEn3=j2QJJK1GpajY=VQ@mail.gmail.com>
Show 17 quoted lines
> -----Original Message-----
> From: Angelo Borsotti
> Sent: Wednesday, November 14, 2012 9:51 AM
> 
> Hi Junio,
> 
> > It would conceptually be a lot cleaner to treat updating of remote
> > Ibranch description as a separate "repository management" class of
> > Ioperation, similar to setting the repository description stored in
> > I$GIT_DIR/description.
> 
> I agree, it should be a distinct operation. I was thinking that when
> you have a remote bare repository, the normal way of adding contents
> to it is to push to it, and thus also adding a description should be
> done with some sort of pushing. Creating branches is also normally
> done with a push (think how difficult it is to create a branch in a
> bare repository when the HEAD is not set ...).
Only if the push were to create the branch...
Show 28 quoted lines
> On 14 November 2012 14:57, Junio C Hamano <gitster@pobox.com> wrote:
> > Angelo Borsotti <angelo.borsotti@gmail.com> writes:
> >
> >> currently, there is no means to push a branch description to a
> remote
> >> repository. It is possible to create a branch, but not to set its
> >> description.
> >
> > Correct.  You have to go to the remote repository and run "git
> > branch --edit-description" there; there is currently no way to do
> > this remotely, which may be an issue, but...
> >
> >> Would not be more correct to push also branch descriptions when
> >> branches are pushed?
> >
> > ... I do not think "git push" is the best place to do so, given the
> > inherently local nature of branches and branch descriptions.
> >
> > Imagine the project creates a branch "magic" to enhance its system
> > with magic words.  The description for the "magic" branch in the
> > project may say "support magic words" or something.
> >
> > You and your friend are tasked to add a handful of magic words,
> > e.g. "xyzzy", "frotz" and "nitfol".  You may start your work like so
> > on your "magic-xyzzy" branch:
> >
> >     $ git clone git://example.com/zork.git/
> >     $ git checkout -b magic-xyzzy -t origin/magic
And here the branch description should copy from origin/magic.
Show 6 quoted lines
> >
> > And you say something like "add xyzzy magic" in its branch
> > description.
> >
> >     $ git branch --edit-description magic-xyzzy
> >
And now it is edited
Show 7 quoted lines
> > After finishing your work, you may push it
> >
> >     $ git push origin magic-xyzzy:magic
> >
> > Should the description of the subtask "add xyzzy magic" overwrite
> > the purpose of the project wide "magic" branch "support magic words"?
> > Most likely not.
Never overwrite anything.
Show 31 quoted lines
> >
> > The local nature of the description becomes even more clear if you
> > imagine the case where the push at the last stage gets rejected due
> > to non-fast-forward error (in other words, your friend has already
> > pushed her support of the "frotz" magic to the "magic" branch.
> >
> > In fact, you would normally not directly push your magic-xyzzy
> > branch to the magic branch, but you would do something like this
> > once you are done:
> >
> >     $ git checkout -b magic -t origin/magic
> >     $ git pull origin ;# to update with her work
> >     $ git merge magic-xyzzy
> >     $ git push origin magic
> >
> > And the last "merge" is where the description for your magic-xyzzy
> > is used to fill the commit log template for you to explain your
> > merge (that is, you are merging a branch whose description is "add
> > xyzzy magic").  There is no reason to propagate the description of
> > your magic-xyzzy topic to the description of shared magic branch
> > when you push, as this merge commit already records what the branch
> > that was merged was about.
> >
> > So you could modify "git push" to set the branch description when
> > you push to create a branch remotely, but in general, "git push"
> > should not be updating the branch description with the description
> > of your local branch.  This comes as a consequence of the fact that
> > the purpose of the branch in the remote central repository is, more
> > often than not, different from the purpose of the corresponding
> > branch in your repository.
> >
But pulling such into a new branch should copy the description (unless explicitly set)
> > It would conceptually be a lot cleaner to treat updating of remote
> > branch description as a separate "repository management" class of
> > operation, similar to setting the repository description stored in
> > $GIT_DIR/description.
Previous: Angelo BorsottiNext: Junio C Hamano
Message 6 of 7 in “push branch descriptions”
  1. Angelo BorsottiNov 14, 2012
  2. Ramkumar RamachandraNov 14, 2012
  3. Michael J GruberNov 14, 2012
  4. Junio C HamanoNov 14, 2012
  5. Angelo BorsottiNov 14, 2012
  6. Pyeron, Jason J CTR (US)Nov 14, 2012
  7. Junio C HamanoNov 14, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.