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

Re: A tour of git: the basics (and notes on some unfriendly messages)

From
Steffen Prohaska <prohaska@zib.de>
Date
Sep 30, 2007, 08:15 UTC
Message-ID
<E8851B12-AAA5-4B4D-9F28-C5AB5AEF0E57@zib.de>
In-Reply-To
<7vlkapjeir.fsf@gitster.siamese.dyndns.org>
On Sep 30, 2007, at 12:25 AM, Junio C Hamano wrote:
Show 9 quoted lines
> Steffen Prohaska <prohaska@zib.de> writes:
>
>> - git push: prints updates of remote heads. A message about
>>   failing to update a remote head may get lost.
>
> Please do not remove the report of successful update, as people
> often say "git push" or "git push $there" without explicitly
> saying which refs to push.  When pushing out to publish, I say
> "git push ko" (to mean k.org) and I _want_ my positive feedback.
Yes but it's pretty technical.
A much simpler output could be easier to scan by a human
updating 'refs/heads/master' .. fast forward .. ok.
updating 'refs/heads/pu' .. forced non-fast forward .. ok.
updating 'refs/heads/next' ..
ERROR: 'refs/heads/next' not updating to non-fast forward
exit(1) here.

If we exit after the very first problem it can't get lost. After fixing the issue you can just 'git push' again.

Show 11 quoted lines
>> - git merge: the fact that a merge is a fast forward merge gets
>>   printed at the very top, followed by (often a lot of) diffstat.
>>   I know diffstat can help to judge if the merge did what you
>>   expected. But even more important is the fact that the merge
>>   was just a fast forward, which may get buried under lots of output.
>
> I do not think fast-forwardness is particularly interesting.  If
> you find fast-forwardness interesting, I suspect you would even
> want to know what _your_ change that were not in the other side
> of the merge, which is something that we do not even report
> right now.

I use it to advance a branch to a temporary integration branch. At that point I expect that the merge is a fast forward. Here's what I do.

    git checkout -b for/master master
    git merge branch-with-good-topics
    git branch -f scratch
    git push compileservers # pushes scratch for automatic builds

Now I wait for compiles to finish. Typically I continue not before the next morning. If everything's ok I do.

    git checkout master
    git merge for/master
    git push

The last merge must be a fast forward. This is the only fact I'm interested in. I could do 'git reset' or 'git branch -f' but then I'd loose the check if it's a fast forward.

I don't merge directly to master to avoid any accidentally push. I can also easily revert by just deleting 'for/master'.

Maybe there's a better workflow?
Show 8 quoted lines
>> Maybe git should become more quiet, as other unix tools are, and
>> per default only report problems. Technical details and progress
>> could be requested explicitly by '--verbose' or similar.
>
> I'd agree with this sentiment in principle, and many of the
> things you propose to remove above fall into the "unnecessary
> clutter" category.  But some of the existing output fall into
> the "necessary info" category --- diffstart after merge

I agree. Could we print the note about fast forward _after_ the diffstat? Maybe there are more useful oneline information that could be output there.

> and report of successful remote ref updates are such things, so we
> should be careful not to go overboard.
But the output could be less technical and more human readable.

Also diffstat's output and "git push" are different. diffstats change with the content of your repo. "git push" just succeeds or fails. If is succeeds it updates remote refs according to your configuration. There is no new information in the output beyond success or failure [which is not quite true if you depend on git push finding matching refs automatically -- I don't]. I don't think the sha1's printed are needed by anyone. And if someone needs them, he could call push with '--verbose'.

I asked about a '--dry-run' switch to "git push" some time ago, which would only report what "git push" would do without actually changing anything on the remote side. I'd use this to check what I expect to do. Just in case I messed up my configuration. At the time "git push" is actually pushing it's too late to fix a broken configuration. I know '--dry-run' it's not trivial to implement and I'll likely have no time to look into it.

	Steffen
Previous: Junio C HamanoNext: Junio C Hamano
Message 19 of 26 in “A tour of git: the basics (and notes on some unfriendly messages)”
  1. Carl WorthSep 28, 2007
  2. Shawn O. PearceSep 29, 2007
  3. Johannes SchindelinSep 29, 2007
  4. Steffen ProhaskaSep 29, 2007
  5. Johannes SchindelinSep 29, 2007
  6. Steffen ProhaskaSep 29, 2007
  7. WinGit: included /bin/start in the installerSteffen Prohaska, Sep 29, 2007
  8. WinGit: include html pages from official git.git's html branchSteffen Prohaska, Sep 29, 2007
  9. Johannes SchindelinSep 29, 2007
  10. Junio C HamanoSep 29, 2007
  11. Johannes SchindelinSep 29, 2007
  12. Steffen ProhaskaSep 30, 2007
  13. Pierre HabouzitSep 29, 2007
  14. Wincent ColaiutaSep 30, 2007
  15. Pierre HabouzitSep 30, 2007
  16. Wincent ColaiutaSep 30, 2007
  17. Steffen ProhaskaSep 29, 2007
  18. Junio C HamanoSep 29, 2007
  19. Steffen ProhaskaSep 30, 2007
  20. Junio C HamanoSep 30, 2007
  21. Johannes SchindelinSep 30, 2007
  22. Steffen ProhaskaSep 30, 2007
  23. Junio C HamanoSep 29, 2007
  24. Carl WorthSep 30, 2007
  25. Carl WorthSep 30, 2007
  26. Nguyen Thai Ngoc DuySep 29, 2007

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.