Skip to contentSkip to conversation

What's in git.git (stable)

PATCH In review Junio C Hamano 38 participants 419 messages Dec 13, 2006 – Aug 11, 2016 2 messages not in the archive Documentation Page 1 of 2

lore
Share & tools
lore
#0 lore raw

We have a handful fixes on 'maint'; I will be cutting v1.4.4.3 by the end of the week.

On the 'master' front, this round has many topics (most of which have been cooking in the 'next' branch) merged since the last announcement.

- Johannes Schindelin's built-in shortlog is in.

- Johannes Schindelin's built-in 'RCS merge replacement' is in. Hopefully this would make merge-recursive more portable and faster.

- Shawn Pearce and Johannes Schindelin spotted and fixed a few corner cases in merge-recursive.

- Updates to gitk from Paul Mackerras to fix longstanding menu issues on Mac OS X.

- Eric Wong fixed use of rerere in many places.

- Eric also has quite a few fixes to git-svn.

- Nico updated 'git-add' to really mean 'add contents', not 'add to the set of tracked paths'. Also updated was the documentation for 'git commit' to make it easier to teach new people after a long discussion.

- Lars Hjemli taught 'git-branch' to rename branches.

- Andy Parkins taught 'git-branch' to be colorful.

- Robin Rosenberg improved cvsexportcommit for unusual pathnames.

- 'git push $URL :refs/tags/that' (notice the colon) can be used to delete 'that' tag from the remote repository; this needs the latest git on both ends.

- branch."master".{remote,merge} configuration items are set up by 'git-clone', thanks to Andy Parkins.

- 'git-commit' gives 'diff --summary' output to remind mode changes and added/deleted files.

- 'git-diff --numstat' matches 'git-apply --numstat' when talking about binary changes.

- 'git-merge' is now a first class UI, not just a mere driver for strategies.

I am hoping that we can start a stabilization cycle for v1.5.0 based on what we have in 'master'. The theme is "usability and teachability".

Things that need to be done to complete what have been merged to 'master' are:

- 'git-rm' needs to be fixed up as Linus outlined; remove working tree file and index entry but have a sanity check to make sure the working tree file match the index and HEAD.

- 'git-branch' may need to be taught about renaming the matching per-branch configuration at the same time.

- 'git-merge-file' needs to be documented and linked from git.txt.

- 'git-clone' probably should be updated to use wild-card in remote.origin.fetch, instead of listing all the branches it found when the clone was made.

- tutorials and other Porcelain documentation pages need to be updated to match the updated 'git-add' and 'git-rm' (to be updated), and their description should be made much less about implementation; they should talk in terms of end-user workflows. I will send a draft for 'git diff' out later, but somebody needs a full sweep on Porcelain-ish documentation.

- 'git diff --index' patch should be reverted (already done in 'next'), although we may have to come up with a better wording for --cached.

----------------------------------------------------------------
* The 'maint' branch has these fixes since v1.4.4.2.

Alex Riesen (1):
Clarify fetch error for missing objects.

Brian Gernhardt (1):
Move Fink and Ports check to after config file

Chris Wright (1):
no need to install manpages as executable

Eric Wong (2):
git-svn: exit with status 1 for test failures
git-svn: correctly display fatal() error messages

Jim Meyering (1):
Don't use memcpy when source and dest. buffers may overlap

Martin Langhoff (1):
cvsserver: Avoid miscounting bytes in Perl v5.8.x

Shawn O. Pearce (1):
Make sure the empty tree exists when needed in merge-recursive.

* The 'master' branch has these since the last announcement.

Alex Riesen (3):
git-blame: fix rev parameter handling. Make perl/ build procedure ActiveState friendly. Clarify fetch error for missing objects.

Andreas Ericsson (2):
ls-files: Give hints when errors happen.
git-diff: Introduce --index and deprecate --cached.

Andy Parkins (6):
Use .git/config for storing "origin" shortcut repository Document git-repo-config --bool/--int options.
De-emphasise the symbolic link documentation.
Explicitly add the default "git pull" behaviour to .git/config on clone Colourise git-branch output
Allow subcommand.color and color.subcommand color configuration

Brian Gernhardt (1):
Move Fink and Ports check to after config file

Chris Wright (1):
no need to install manpages as executable

David Miller (1):
Pass -M to diff in request-pull

Eric Wong (21):
git-svn: use ~/.subversion config files when using SVN:: libraries
git-svn: enable delta transfers during fetches when using SVN:: libs
git-svn: update tests for recent changes
git-svn: error out when the SVN connection fails during a fetch
git-svn: fix output reporting from the delta fetcher
git-svn: color support for the log command
git-svn: documentation updates
git-svn: fix multi-init
git-svn: avoid fetching files twice in the same revision
git-svn: avoid network timeouts for long-running fetches
git-svn: extra error check to ensure we open a file correctly
git-svn: use do_switch for --follow-parent if the SVN library supports it
rerere: add clear, diff, and status commands
rerere: record (or avoid misrecording) resolved, skipped or aborted rebase/am
git-svn: enable logging of information not supported by git
git-svn: allow dcommit to take an alternate head
git-svn: correctly display fatal() error messages
git-svn: correctly handle packed-refs in refs/remotes/
git-svn: exit with status 1 for test failures
git-svn: correctly display fatal() error messages
git-svn: correctly handle "(no author)" when using an authors file

Han-Wen Nienhuys (1):
ident.c: Trim hint printed when gecos is empty.

J. Bruce Fields (4):
cvs-migration: improved section titles, better push/commit explanation
Documentation: reorganize cvs-migration.txt
Documentation: update git-clone man page with new behavior
Documentation: simpler shared repository creation

Jakub Narebski (4):
gitweb: Fix Atom feed <logo>: it is $logo, not $logo_url
git-clone: Rename --use-immingled-remote option to --no-separate-remote Document git-diff whitespace flags -b and -w
gitweb: Allow PNG, GIF, JPEG images to be displayed in "blob" view

Jeff King (1):
shortlog: fix segfault on empty authorname

Jim Meyering (2):
Set permissions of each new file before "cvs add"ing it. Don't use memcpy when source and dest. buffers may overlap

Johannes Schindelin (18):
Build in shortlog
shortlog: do not crash on parsing "[PATCH"
shortlog: read mailmap from ./.mailmap again
shortlog: handle email addresses case-insensitively
shortlog: fix "-n"
shortlog: use pager
sha1_object_info(): be consistent with read_sha1_file()
xdiff: add xdl_merge()
xdl_merge(): fix an off-by-one bug
xdl_merge(): fix thinko
git-mv: search more precisely for source directory in index diff -b: ignore whitespace at end of line
xdl_merge(): fix and simplify conflict handling cvs-migration document: make the need for "push" more obvious Add builtin merge-file, a minimal replacement for RCS merge
merge-file: support -p and -q; fix compile warnings
Get rid of the dependency on RCS' merge program
merge-recursive: add/add really is modify/modify with an empty base

Josef Weidendorfer (1):
Add branch.*.merge warning and documentation update

Junio C Hamano (45):
Store peeled refs in packed-refs file.
remove merge-recursive-old
git-merge: make it usable as the first class UI
merge: allow merging into a yet-to-be-born branch.
Store peeled refs in packed-refs (take 2).
git-fetch: reuse ls-remote result.
git-fetch: fix dumb protocol transport to fetch from pack-pruned ref
git-fetch: allow glob pattern in refspec
Allow git push to delete remote ref.
git-shortlog: fix common repository prefix abbreviation.
git-shortlog: make common repository prefix configurable with .mailmap
git-commit: show --summary after successful commit.
git-fetch: allow forcing glob pattern in refspec
fetch-pack: do not barf when duplicate re patterns are given
git-merge: tighten error checking.
git-merge: do not leak rev-parse output used for checking internally.
cvsimport: style fixup.
git blame -C: fix output format tweaks when crossing file boundary.
tutorial: talk about user.name early and don't start with commit -a
git-merge: fix confusion between tag and branch
xmerge: make return value from xdl_merge() more usable.
merge-recursive: use xdl_merge().
receive-pack: do not insist on fast-forward outside refs/heads/
unpack-trees: make sure "df_conflict_entry.name" is NUL terminated.
read-tree: further loosen "working file will be lost" check. Loosen "working file will be lost" check in Porcelain-ish
read-tree: document --exclude-per-directory
git-reset to remove "$GIT_DIR/MERGE_MSG"
git-merge: squelch needless error message.
git-merge: fix "fix confusion between tag and branch" for real Fix perl/ build.
git-rerere: add 'gc' command.
Documentation/git-commit: rewrite to make it more end-user friendly.
git-commit: allow --only to lose what was staged earlier.
shortlog: remove "[PATCH]" prefix from shortlog output
shortlog: fix segfault on empty authorname
diff --numstat: show binary with '-' to match "apply --numstat" add test case for recursive merge
git-push: document removal of remote ref with :<dst> pathspec git merge: reword failure message.
spurious .sp in manpages
git-push: accept tag <tag> as advertised.
send-pack: tighten checks for remote names
branch --color: change default color selection.
config documentation: group color items together.

Lars Hjemli (3):
git-branch: add options and tests for branch renaming
rename_ref: use lstat(2) when testing for symlink
git-branch: let caller specify logmsg

Martin Langhoff (1):
cvsserver: Avoid miscounting bytes in Perl v5.8.x

Michael Loeffler (1):
git-fetch: ignore dereferenced tags in expand_refs_wildcard

Nicolas Pitre (4):
builtin git-shortlog is broken
pack-objects: remove redundent status information
make 'git add' a first class user friendly interface to the index change the unpack limit treshold to a saner value

Paul Mackerras (1):
gitk: Fix enabling/disabling of menu items on Mac OS X

René Scharfe (1):
shortlog: remove range check

Robin Rosenberg (1):
Make cvsexportcommit work with filenames with spaces and non-ascii characters.

Sean Estabrooks (1):
Update documentation to remove incorrect GIT_DIFF_OPTS example.

Shawn O. Pearce (17):
Teach git-completion.bash how to complete git-merge.
Hide plumbing/transport commands from bash completion. Teach bash how to complete options for git-name-rev.
Add current branch in PS1 support to git-completion.bash. Teach bash how to complete git-format-patch.
Teach bash how to complete git-cherry-pick.
Teach bash how to complete git-rebase.
Teach bash about git log/show/whatchanged options.
Support bash completion of refs/remote.
Teach bash about git-repo-config.
Support --strategy=x completion in addition to --strategy x. Cache the list of merge strategies and available commands during load. Teach bash about git-am/git-apply and their whitespace options. Teach bash how to complete long options for git-commit. Fix broken bash completion of local refs.
Make sure the empty tree exists when needed in merge-recursive. Remove uncontested renamed files during merge.

Uwe Zeisberger (1):
Fix documentation copy&paste typo

#1 lore raw
Quoted 2 lines · Junio C Hamano

Things that need to be done to complete what have been merged to 'master' are:

What about discussed but not implemented moving restriction on non-head refs from git-checkout (forbidding to checkout tags, remotes, and arbitrary commits like HEAD~n) to git-commit (allowing commiting only to heads refs)? Probably non-heads refs should be saved in HEAD as explicit sha1 of a commit; this way we wont run into situation where HEAD changed under us (because it was for example to remote branch, and we fetched since).

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#115 lore raw

Git 1.0 Synopis (Draft v2)

[This is still a draft, but I think I incorporated the suggestons from the last attempt.]

Source Code Management with Git

Git, sometimes called "global information tracker", is a "directory content manager". Git has been designed to handle absolutely massive projects with speed and efficiency, and the release of the 2.6.12 and (soon) the 2.6.13 version of the Linux kernel would indicate that it does this task well.

Git falls into the category of distributed source code management tools, similar to Arch or Darcs (or, in the commercial world, BitKeeper). Every Git working directory is a full-fledged repository with full revision tracking capabilities, not dependent on network access to a central server.

Git uses the SHA1 hash algorithm to provide a content-addressable pseudo filesystem, complete with its own version of fsck.
o Speed of use, both for the project maintainer, and the end-users, is a key development principle.
o The history is stored as a directed acyclic graph, making long-lived branches and repeated merging simple.
o A collection of related projects are building on the core Git project, either to provide an easier to use interface on top (StGit, Cogito, qgit, gitk, gitweb), or to take some of the underlying concepts and reimplement them directly into another system (Arch 2.0, Darcs-git).
o Two, interchangeable, on-disk formats are used:
o An efficient, packed format that saves spaced and network bandwidth.
o An unpacked format, optimized for fast writes and incremental work.

To get a copy of Git:
Daily snapshots are available at:
http://www.codemonkey.org.uk/projects/git-snapshots/git/
(Thanks to Dave Jones)

Source tarballs and RPMs at:
http://www.kernel.org/pub/software/scm/git/

Deb packages at:
<insert url here>

Or via Git itself:
git clone http://www.kernel.org/pub/scm/git/git.git/
git clone rsync://rsync.kernel.org/pub/scm/git/git.git/ (rsync is generally faster for an initial pull)

Git distributions contain a tutorial in the Documentation subdirectory. Additionally, the Kernel-Hacker's Git Tutorial at
http://linux.yyz.us/git-howto.html may be useful. (Thanks to Jeff Garzik for that document)

Git development takes place on the Git mailing list. To subscribe, send an email with just "subscribe git" in the body to [email protected]. Mailing list archives are available at http://marc.theaimsgroup.com/?l=git

Git results from the inspiration and frustration of Linus Torvalds, and the enthusiastic help of over 300 participants on the development mailing list.[1] It is maintained by Junio C Hamano <[email protected]>.

1 - Generated with the following, in a maildir folder:

        find . -type f | xargs grep -h "^From:" | perl -ne \
        'tr#A-Z#a-z#; m#<(.*)># && print $1,"\n";' | sort -u | wc -l

(This summary written by Ryan Anderson <[email protected]>. Please bug him with any corrections or complaints.)

Signature · 2 lines
Ryan Anderson
  sometimes Pug Majere
#116 lore raw

Git 1.0 Synopis (Draft v3

Source Code Management with Git

"git" can mean anything, depending on your mood.

- random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of "get" may or may not be relevant.
- stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
- "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
- "goddamn idiotic truckload of sh*t": when it breaks

Git is a "directory content manager". Git has been designed to handle absolutely massive projects with speed and efficiency, and the release of the 2.6.12 and (soon) the 2.6.13 version of the Linux kernel would indicate that it does this task well.

Git falls into the category of distributed source code management tools, similar to Arch or Darcs (or, in the commercial world, BitKeeper). Every Git working directory is a full-fledged repository with full revision tracking capabilities, not dependent on network access to a central server.

Git provides a content-addressable pseudo filesystem, complete with its own version of fsck.

o Speed of use, both for the project maintainer, and the end-users, is a key development principle.

o The history is stored as a directed acyclic graph, making long-lived branches and repeated merging simple.

o The core Git project considers itself to provide "plumbing" for other projects, as well as to serve to arbitrate for compatibility between them. The project built on top of the core Git are referred to as "porcelain". StGit, Cogito, qgit, gitk and gitweb are all building upon the core Git tools, and providing an easy to use interface to various pieces of functionality.

o Some other projects have taken the concepts from the core Git project, and are either porting an existing toolset to use the Git tools, or reimplementing the concepts internally, to benefit from the performance improvements. This includes both Arch 2.0, and Darcs-git.

o Two, interchangeable, on-disk formats are used:
o An efficient, packed format that saves space and network bandwidth.
o An unpacked format, optimized for fast writes and incremental work.

To get a copy of Git:
Daily snapshots are available at:
http://www.codemonkey.org.uk/projects/git-snapshots/git/
(Thanks to Dave Jones)

Source tarballs and RPMs at:
http://www.kernel.org/pub/software/scm/git/

Deb packages at:
<insert url here>

Or via Git itself:
git clone http://www.kernel.org/pub/scm/git/git.git/ <local directory> git clone rsync://rsync.kernel.org/pub/scm/git/git.git/ <local directory>

(rsync is generally faster for an initial clone, you can switch later by editing .git/branches/origin and changing the url)

To get the 'Porcelain' tools mentioned above:
SCM Interface layers:
cogito - http://www.kernel.org/pub/software/scm/cogito/
StGIT - http://www.procode.org/stgit/

History Visualization:
gitk - http://ozlabs.org/~paulus/gitk/
gitweb - http://www.kernel.org/pub/software/scm/gitweb/
qgit - http://sourceforge.net/projects/qgit

Git distributions contain a tutorial in the Documentation subdirectory. Additionally, the Kernel-Hacker's Git Tutorial at
http://linux.yyz.us/git-howto.html may be useful. (Thanks to Jeff Garzik for that document)

Git development takes place on the Git mailing list. To subscribe, send an email with just "subscribe git" in the body to [email protected]. Mailing list archives are available at http://marc.theaimsgroup.com/?l=git

(This summary written by Ryan Anderson <[email protected]>. Please bug him with any corrections or complaints.)

#140 lore raw

Re: Git 1.0 Synopis (Draft v2)

In reply to Ryan Anderson
Quoted 1 line · Ryan Anderson

Source Code Management with Git

Thanks for doing this. Generally looks excellent.

Quoted 3 lines

o Two, interchangeable, on-disk formats are used:
o An efficient, packed format that saves spaced and network bandwidth.

??? "spaced" ???

Quoted 4 lines

Or via Git itself:
git clone http://www.kernel.org/pub/scm/git/git.git/
git clone rsync://rsync.kernel.org/pub/scm/git/git.git/ (rsync is generally faster for an initial pull)

These need a target directory name to create, like this:

git clone rsync://rsync.kernel.org/pub/scm/git/git.git/ $new_dir git clone http://www.kernel.org/pub/scm/git/git.git/ $new_dir

Quoted 3 lines

Git results from the inspiration and frustration of Linus Torvalds, and the enthusiastic help of over 300 participants on the development mailing list.[1] It is maintained by Junio C Hamano <[email protected]>.

Please drop the e-mail address here; you mention nobody else's.

Well, dropping "the current maintainer" information altogether might be even better; the above to a casual reader sounds like Linus was frustrated and I wrote it for him, which is definitely not what we would like to say. I suspect it still has more code by Linus than anybody else (I stopped counting some time ago).

#141 lore raw

Re: Git 1.0 Synopis (Draft v2)

Quoted 11 lines · Junio C Hamano
Quoted 3 lines

Git results from the inspiration and frustration of Linus Torvalds, and the enthusiastic help of over 300 participants on the development mailing list.[1] It is maintained by Junio C Hamano <[email protected]>.

Please drop the e-mail address here; you mention nobody else's.

Well, dropping "the current maintainer" information altogether might be even better; the above to a casual reader sounds like Linus was frustrated and I wrote it for him, which is definitely not what we would like to say. I suspect it still has more code by Linus than anybody else (I stopped counting some time ago).

Ok. I was thinking I could add "current" into that description. Or, something like, "Linus has since returned his focus to the kernel, and passed maintainership to ...".

Signature · 2 lines
Ryan Anderson
  sometimes Pug Majere
#117 lore raw

Re: Git 1.0 Synopis (Draft v3

In reply to Ryan Anderson
Quoted 1 line · Ryan Anderson

Source Code Management with Git

....

The article should include a HOWTO part alos. So people can see how to edit a file, pull from a remote repository etc.
Since you have introduced core and porcelains it would be most logical to use one of the porcelains in these examples, maybe accompanied by the raw git commands being executed.

Sam

#118 lore raw

Re: Git 1.0 Synopis (Draft v3

Quoted 5 lines · Sam Ravnborg
Quoted 1 line · Ryan Anderson

Source Code Management with Git

....

The article should include a HOWTO part alos.

I'd vote for a separate file.

Quoted 2 lines

So people can see how to
edit a file, pull from a remote repository etc.

Exactly.

Quoted 3 lines

Since you have introduced core and porcelains it would be most logical to use one of the porcelains in these examples, maybe accompanied by the raw git commands being executed.

Better leave the Porcelain-HOWTO to individual Porcelain. Perhaps the Plumbing-HOWTO should include a section on interfacing to Porcelain (or it should be yet another file).

Signature · 4 lines
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513
#119 lore raw

Re: Git 1.0 Synopis (Draft v3

In reply to Ryan Anderson
Quoted 1 line · Ryan Anderson

Source Code Management with Git

More bugging...

- Either stay with your idea of "Git is the idea, git the implementation" (iff blessed by the Git Powers That Be) and be consistent about it, or just use "git" throughout.

- Attribute the meaning appropiately, say by:

In Linus' own words as the inventor of git:

Quoted 10 lines

"git" can mean anything, depending on your mood.

- random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of "get" may or may not be relevant.
- stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
- "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
- "goddamn idiotic truckload of sh*t": when it breaks

[...]

Quoted 15 lines

To get a copy of Git:
Daily snapshots are available at:
http://www.codemonkey.org.uk/projects/git-snapshots/git/
(Thanks to Dave Jones)

Source tarballs and RPMs at:
http://www.kernel.org/pub/software/scm/git/

Deb packages at:
<insert url here>

Or via Git itself:
git clone http://www.kernel.org/pub/scm/git/git.git/ <local directory> git clone rsync://rsync.kernel.org/pub/scm/git/git.git/ <local directory>

Quoted 7 lines

(rsync is generally faster for an initial clone, you can switch later by editing .git/branches/origin and changing the url)

To get the 'Porcelain' tools mentioned above:
SCM Interface layers:
cogito - http://www.kernel.org/pub/software/scm/cogito/
StGIT - http://www.procode.org/stgit/

At least cogito includes a (slightly old) version of git. Dunno about StGIT. And git and cogito have a gitk inside too. This should be mentioned, i.e., look at the package(s) you are interested and see what else they carry or require and keep in mind that (for now?) getting git as part of one package is /not/ guaranteed to be compatible with another or standard git.

Signature · 4 lines
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513
#120 lore raw

Re: Git 1.0 Synopis (Draft v3

[Yes, I know it is considered odd when you speak to yourself in public...]

Quoted 4 lines · Horst von Brand
Quoted 1 line · Ryan Anderson

Source Code Management with Git

More bugging...

And then some.

Quoted 11 lines
Quoted 4 lines

To get the 'Porcelain' tools mentioned above:
SCM Interface layers:
cogito - http://www.kernel.org/pub/software/scm/cogito/
StGIT - http://www.procode.org/stgit/

At least cogito includes a (slightly old) version of git. Dunno about StGIT. And git and cogito have a gitk inside too. This should be mentioned, i.e., look at the package(s) you are interested and see what else they carry or require and keep in mind that (for now?) getting git as part of one package is /not/ guaranteed to be compatible with another or standard git.

Also note that StGIT is /not/ a SCM (as cogito is), it is a tool to shuffle patches that uses git as a backend/target.

Signature · 4 lines
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513
#121 lore raw

Git 1.0 Synopis (Draft v4)

In reply to Horst von Brand
Quoted 4 lines · Horst von Brand
Quoted 1 line · Ryan Anderson

Source Code Management with Git

More bugging...

Ok, I think I've got all this addressed (plus the other email).

It just took me a lot longer to get to it than I planned.

Junio, do you want to pull this into the git tree? (I'll reply with a patch)

==========

Source Code Management with git

In Linus's own words as the creator of git:
"git" can mean anything, depending on your mood.

- random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of "get" may or may not be relevant.
- stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
- "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
- "goddamn idiotic truckload of sh*t": when it breaks

git is a "directory content manager". git has been designed to handle absolutely massive projects with speed and efficiency, and the release of the 2.6.12 and (soon) the 2.6.13 version of the Linux kernel would indicate that it does this task well.

git falls into the category of distributed source code management tools, similar to Arch or Darcs (or, in the commercial world, BitKeeper). Every git working directory is a full-fledged repository with full revision tracking capabilities, not dependent on network access to a central server.

git provides a content-addressable pseudo filesystem, complete with its own version of fsck.

o Speed of use, both for the project maintainer, and the end-users, is a key development principle.

o The history is stored as a directed acyclic graph, making long-lived branches and repeated merging simple.

o The core git project considers itself to provide "plumbing" for other projects, as well as to serve to arbitrate for compatibility between them. The project built on top of the core git are referred to as "porcelain". Stgit, Cogito, qgit, gitk and gitweb are all building upon the core git tools, and providing an easy to use interface to various pieces of functionality.

o Some other projects have taken the concepts from the core git project, and are either porting an existing toolset to use the git tools, or reimplementing the concepts internally, to benefit from the performance improvements. This includes both Arch 2.0, and Darcs-git.

o Two, interchangeable, on-disk formats are used:
o An efficient, packed format that saves space and network bandwidth.
o An unpacked format, optimized for fast writes and incremental work.

To get a copy of git:
Daily snapshots are available at:
http://www.codemonkey.org.uk/projects/git-snapshots/git/
(Thanks to Dave Jones)

Source tarballs and RPMs at:
http://www.kernel.org/pub/software/scm/git/

Debian packages should be availabe in unstable (sid) as "git-core"

Or via git itself:
git clone http://www.kernel.org/pub/scm/git/git.git/ <local directory> git clone rsync://rsync.kernel.org/pub/scm/git/git.git/ <local directory>

(rsync is generally faster for an initial clone, you can switch later by editing .git/branches/origin and changing the url)

To get the 'Porcelain' tools mentioned above:
SCM Interface layers:
cogito - http://www.kernel.org/pub/software/scm/cogito/

Patch Management (similar to Quilt):
StGIT - http://www.procode.org/stgit/

History Visualization:
gitk - http://ozlabs.org/~paulus/gitk/ (Included in the standard git
distribution)
gitweb - http://www.kernel.org/pub/software/scm/gitweb/
qgit - http://sourceforge.net/projects/qgit

git distributions contain a tutorial in the Documentation subdirectory. Additionally, the Kernel-Hacker's git Tutorial at
http://linux.yyz.us/git-howto.html may be useful. (Thanks to Jeff Garzik for that document)

git development takes place on the git mailing list. To subscribe, send an email with just "subscribe git" in the body to [email protected]. Mailing list archives are available at http://marc.theaimsgroup.com/?l=git

(This summary written by Ryan Anderson <[email protected]>. Please bug him with any corrections or complaints.)

Signature · 2 lines
Ryan Anderson
  sometimes Pug Majere
#122 lore raw

Re: Git 1.0 Synopis (Draft v4)

Add a SYNOPSIS/release summary to the tree.

SYNOPSIS new file +93 -0
new file mode 100644
@@ -0,0 +1,93 @@
+Source Code Management with git
+
+In Linus's own words as the creator of git:
+"git" can mean anything, depending on your mood.
+
+ - random three-letter combination that is pronounceable, and not
+   actually used by any common UNIX command.  The fact that it is a
+   mispronunciation of "get" may or may not be relevant.
+ - stupid. contemptible and despicable. simple. Take your pick from the
+   dictionary of slang.
+ - "global information tracker": you're in a good mood, and it actually
+   works for you. Angels sing, and a light suddenly fills the room. 
+ - "goddamn idiotic truckload of sh*t": when it breaks
+
+git is a "directory content manager".  git has been designed to handle
+absolutely massive projects with speed and efficiency, and the release of the
+2.6.12 and (soon) the 2.6.13 version of the Linux kernel would indicate that it
+does this task well.
+
+git falls into the category of distributed source code management tools,
+similar to Arch or Darcs (or, in the commercial world, BitKeeper).  Every git
+working directory is a full-fledged repository with full revision tracking
+capabilities, not dependent on network access to a central server.
+
+git provides a content-addressable pseudo filesystem, complete with its own
+version of fsck.
+
+  o Speed of use, both for the project maintainer, and the end-users, is
+    a key development principle.
+
+  o The history is stored as a directed acyclic graph, making long-lived
+    branches and repeated merging simple.
+
+  o The core git project considers itself to provide "plumbing" for other
+     projects, as well as to serve to arbitrate for compatibility between them.
+     The project built on top of the core git are referred to as "porcelain".
+     Stgit, Cogito, qgit, gitk and gitweb are all building upon the core git
+     tools, and providing an easy to use interface to various pieces of
+     functionality.
+
+  o Some other projects have taken the concepts from the core git project, and
+    are either porting an existing toolset to use the git tools, or
+    reimplementing the concepts internally, to benefit from the performance
+     improvements.  This includes both Arch 2.0, and Darcs-git.
+  
+  o Two, interchangeable, on-disk formats are used:
+    o An efficient, packed format that saves space and network
+      bandwidth.
+    o An unpacked format, optimized for fast writes and incremental
+      work.
+
+To get a copy of git:
+	Daily snapshots are available at:
+	http://www.codemonkey.org.uk/projects/git-snapshots/git/
+	(Thanks to Dave Jones)
+
+	Source tarballs and RPMs at:
+	http://www.kernel.org/pub/software/scm/git/
+
+	Debian packages should be availabe in unstable (sid) as "git-core"
+
+	Or via git itself:
+	git clone http://www.kernel.org/pub/scm/git/git.git/ <local directory>
+	git clone rsync://rsync.kernel.org/pub/scm/git/git.git/ <local directory>
+
+	(rsync is generally faster for an initial clone, you can switch later
+	by editing .git/branches/origin and changing the url)
+
+To get the 'Porcelain' tools mentioned above:
+	SCM Interface layers:
+	cogito - http://www.kernel.org/pub/software/scm/cogito/
+
+	Patch Management (similar to Quilt):
+	StGIT - http://www.procode.org/stgit/
+
+	History Visualization:
+	gitk - http://ozlabs.org/~paulus/gitk/ (Included in the standard git
+		distribution)
+	gitweb - http://www.kernel.org/pub/software/scm/gitweb/
+	qgit - http://sourceforge.net/projects/qgit
+
+
+git distributions contain a tutorial in the Documentation subdirectory.
+Additionally, the Kernel-Hacker's git Tutorial at
+http://linux.yyz.us/git-howto.html may be useful.  (Thanks to Jeff Garzik for
+that document)
+
+git development takes place on the git mailing list.  To subscribe, send an
+email with just "subscribe git" in the body to [email protected].
+Mailing list archives are available at http://marc.theaimsgroup.com/?l=git
+
+(This summary written by Ryan Anderson <[email protected]>.  Please bug him
+with any corrections or complaints.)
Signature · 2 lines
Ryan Anderson
  sometimes Pug Majere
#123 lore raw

Re: Git 1.0 Synopis (Draft v4)

In reply to Ryan Anderson
Quoted 1 line · Ryan Anderson

Junio, do you want to pull this into the git tree?

Yes, but I have been wondering where it should go. Should it go under Documentation/ and made into html via asciidoc along with other tools?

#124 lore raw

Re: Git 1.0 Synopis (Draft v4)

Quoted 7 lines · Junio C Hamano
Quoted 1 line · Ryan Anderson

Junio, do you want to pull this into the git tree?

Yes, but I have been wondering where it should go. Should it go under Documentation/ and made into html via asciidoc along with other tools?

I was somewhat thinking it should go in the main directory, and be a useful introduction to the project for people.... but it's not really aimed at that very well, now that I think about it.

To be fair, it's not really aimed well at being documentation for people that already have git, either. I've been writing it with the idea of "something to send to LWN when 1.0 happens so they can post it mostly verbatim."

I guess this means, "I dunno, either place works for me."

Signature · 2 lines
Ryan Anderson
  sometimes Pug Majere
#125 lore raw

Re: Git 1.0 Synopis (Draft v4)

Quoted 1 line · Ryan Anderson

I guess this means, "I dunno, either place works for me."

I was hoping it means to "Oh, come to think of it, maybe I should send this to [email protected]" ;-).

I agree with you that this may be a lot more suitable for people _before_ they get the git sources, which is to say it may make more sense not to include in core-git tarball but is made into a patch to Pasky's introduction website.

#126 lore raw

Re: Git 1.0 Synopis (Draft v4)

Quoted 6 lines · Junio C Hamano
Quoted 1 line · Ryan Anderson

I guess this means, "I dunno, either place works for me."

I was hoping it means to "Oh, come to think of it, maybe I should send this to [email protected]" ;-).

I was waiting until you said, "Ok, 1.00 tomorrow morning"

Quoted 4 lines

I agree with you that this may be a lot more suitable for people _before_ they get the git sources, which is to say it may make more sense not to include in core-git tarball but is made into a patch to Pasky's introduction website.

Good point.

It's already there (now that I found the site.)

Signature · 2 lines
Ryan Anderson
  sometimes Pug Majere
#127 lore raw

Re: Git 1.0 Synopis (Draft v4)

Quoted 1 line · Ryan Anderson

I was waiting until you said, "Ok, 1.00 tomorrow morning"

Makes sense. There would be some weeks until that happens I am afraid.

#128 lore raw

Re: Git 1.0 Synopis (Draft v4)

Quoted 6 lines · Junio C Hamano
Quoted 1 line · Ryan Anderson

I was waiting until you said, "Ok, 1.00 tomorrow morning"

Makes sense. There would be some weeks until that happens I am afraid.

It might be worth putting the list of things left to do before 1.0 in the tree (since they clearly covary), and it would be useful to know what you're thinking of as preventing the release at any particular stage.

-Daniel
*This .sig left intentionally blank*

#129 lore raw

Re: Git 1.0 Synopis (Draft v4)

Quoted 3 lines · Daniel Barkalow

It might be worth putting the list of things left to do before 1.0 in the tree (since they clearly covary), and it would be useful to know what you're thinking of as preventing the release at any particular stage.

Yeah, yeah. Call me lazy.

Excerpts from my "last mile to 1.0", my Itchlist, and pieces from random other messages since then.

- Documentation. [I really need help here --- among ~7000 lines there, I've written around 2500 lines, David Greaves another 2500, and Linus 1400. And it is not very easy to proofread what you wrote yourself.]

- Are all the core commands described in Documentation/ directory?

- Many files under Documentation/ directory have become stale. I've tried to do one pass of full sweep recently [and another since I wrote the original "last mile" message], but I'd like somebody else to make another pass to make sure that the usage strings in programs, what the programs do, and what Documentation says they do match. Also, the spelling and grammar fixes, which I am very bad at and have not done any attempt, needs to be done.

Volunteers?

- Are all the files in Documentation/ reachable from git(7) or otherwise made into a standalone document using asciidoc by the Makefile? I haven't looked into documentation generation myself (I use only the text files as they are); help to update the Makefile by somebody handy with asciidoc suite is greatly appreciated here.

Volunteers?

- We may want to describe more Best Current Practices, along the lines of "Working with Others" section in the tutorial. Please write on your faviorite topic and send patches in ;-)) [ryan started collecting Documentation/howto which would greatly help in this area].

- Glossary documentation Johannes Schindelin is working on.

I think coming up with the concensus of terms would come fairly quickly on the list. Updating docs to match the concensus may take some time. Help is greatly appreciated.

- Maybe doing another pass at tutorial. Could somebody run (or preferably, find a friend who has never touched git and have her run) the tutorial examples from the beginning to the end, and find rooms of improvements? Does the order of materials presented make sense? Do we talk about things assuming that the user knows something else that we have not talked about? Have we introduced better way of doing the same thing since the tutorial was written?

I've done that once with the text that is currently in the head of the master branch, but that is getting rather stale, and also I did that myself so I am sure I've sidestepped pitfalls without even realizing.

The above does not have to be all there in 0.99.5, but I consider that lack of any of the above to block 1.0.

- Commit walker downloading from packed repository is finally complete. Thanks, Daniel!

- Teach fetch-pack reference renaming.

On the push side, send-pack now knows updating arbitrary remote references from local references. We need something similar for fetching [since then I outlined the design of the new shorthand file format and semantics but have not got around to actually do it. Maybe on my next GIT day...]. This is scheduled for 0.99.5.

- commit template filler discussed with Pasky some time ago, with perhaps pre-commit and post-commit hooks. Somehow the discussion died out but that does not mean _I_ forgot about it.

- Binary packaging. Should _I_ worry about "/usr/bin/git" stay there myself --- I think not. But I _do_ want to help Debian packaging folks if that path is causing problems in their effort to push git-core into the official Debian archive.

As Linus mentioned earlier, this seems to be a Debian specific problem, and will not block 1.0 --- if Debian heavyweights do not want to stay compatible with the rest of the world, so be it.

- I have not heard from Darwin or BSD people for some time. Is your portfile up to date? Do you have updates you want me to include? Have we introduced non-Linux non-GNU incompatibilities lately that you want to see fixed and/or worked around?

Again, I consider binary packaging issue independent from our release schedule; it is a distribution local issue, so this would not block 1.0 in any way. But I _am_ willing to help them.

- Oh, another itch I did not list in the previous message. Is anybody interested in doing an Emacs VC back-end for GIT?

- git prune and git fsck-cache; think about their interactions with an object database that borrows from another. This includes the case where .git/objects itself is symlinked to somewhere else (i.e. running "git prune" that somewhere else without consulting this repository would lose objects), and alternates pointing at somewhere else (i.e. ditto).

My personal feeling is that we should just warn users about doing .git/objects symlinking and/or alternates pointing --- do not do it unless you have an off-line arrangement with the owner of the repository you are borrowing from. Even if that would become our official position to take, it needs to be documented clearly before we declare this issue to have been "dealt with".

I am sure I am forgetting something, but the above would be a good start.

#130 lore raw

Re: Git 1.0 Synopis (Draft v4)

Junio C Hamano <[email protected]> wrote:

[...]

Quoted 2 lines

- Oh, another itch I did not list in the previous message. Is anybody interested in doing an Emacs VC back-end for GIT?

And teach make(1) about checking out files from git... or just create a co(1) command for git.

Signature · 4 lines
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513
#131 lore raw

Re: Git 1.0 Synopis (Draft v4)

Hi,

Quoted 2 lines · Horst von Brand

And teach make(1) about checking out files from git... or just create a co(1) command for git.

How about "git-checkout-script", optionally with the "-f" flag to ignore changes since the last checkout/checkin?

Ciao,
Dscho

#132 lore raw

Re: Git 1.0 Synopis (Draft v4)

In reply to Horst von Brand
Quoted 2 lines · Horst von Brand

And teach make(1) about checking out files from git... or just create a co(1) command for git.

Ummm... why?

make's SCCS support depends on the presence of a SCCS/s.<name> file for each <name>. We don't have that. Teaching make about git would be equivalent to teaching it about parsing the index file.

Technically, that would require a stable libgit.so or so. In reality, however, I don't know when I last had a tree which wasn't fully populated, but it's been a while, and it's something that can be readily fixed by "git-checkout-cache -a".

Signature · 5 lines
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  [email protected]
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
One possible reason that things aren't going according to plan
is that there never was a plan in the first place.
#133 lore raw

Re: Git 1.0 Synopis (Draft v4)

In reply to Junio C Hamano
Quoted 8 lines · Junio C Hamano
Quoted 3 lines · Daniel Barkalow

It might be worth putting the list of things left to do before 1.0 in the tree (since they clearly covary), and it would be useful to know what you're thinking of as preventing the release at any particular stage.

Yeah, yeah. Call me lazy.

Quoted 7 lines

Excerpts from my "last mile to 1.0", my Itchlist, and pieces from random other messages since then.

- Documentation. [I really need help here --- among ~7000 lines there, I've written around 2500 lines, David Greaves another 2500, and Linus 1400. And it is not very easy to proofread what you wrote yourself.]

I'm not sure how done this can actually get before some sort of feature freeze; the best ways to do things keeps changing as more convenient ways are added. Once the new stuff is diverted to post-1.0, I'd be interested in going through it.

Quoted 6 lines

- git prune and git fsck-cache; think about their interactions with an object database that borrows from another. This includes the case where .git/objects itself is symlinked to somewhere else (i.e. running "git prune" that somewhere else without consulting this repository would lose objects), and alternates pointing at somewhere else (i.e. ditto).

It should be fine, but only if .git/refs is symlinked to the matching place; this gives you the same repository with multiple working trees. Having refs/ and objects/ directories that aren't always together would be much less safe.

-Daniel
*This .sig left intentionally blank*

#134 lore raw

Re: Git 1.0 Synopis (Draft v4)

In reply to Junio C Hamano

Hi,

Quoted 1 line · Junio C Hamano

- Glossary documentation Johannes Schindelin is working on.

Yeah, yeah. Call _me_ lazy :-) I'll try to come up with a discussable item today.

Quoted 6 lines

- git prune and git fsck-cache; think about their interactions with an object database that borrows from another. This includes the case where .git/objects itself is symlinked to somewhere else (i.e. running "git prune" that somewhere else without consulting this repository would lose objects), and alternates pointing at somewhere else (i.e. ditto).

I don´t see how git could help in the case you are pruning a repository which another repository points to. After all, the first repository doesn´t know about being used by the second.

Quoted 2 lines

I am sure I am forgetting something, but the above would be a good start.

Maybe your $GIT_DIR/remotes idea? Along with a "--store <remotename>" flag to git-pull-script?

Ciao,
Dscho

#135 lore raw

Re: Git 1.0 Synopis (Draft v4)

Hi,

Is there any guide or advise for deploy git server ?

How do I set repository permissions correctly?

cauchy

#137 lore raw

Re: Git 1.0 Synopis (Draft v4)

In reply to Junio C Hamano

Hi,

Quoted 8 lines · Junio C Hamano

- Are all the files in Documentation/ reachable from git(7) or otherwise made into a standalone document using asciidoc by the Makefile? I haven't looked into documentation generation myself (I use only the text files as they are); help to update the Makefile by somebody handy with asciidoc suite is greatly appreciated here.

Volunteers?

The attached script reveals:

git-unpack-objects.txt is not reachable from git.txt git-cvsimport-script.txt is not reachable from git.txt git-send-email-script.txt is not reachable from git.txt git-rename-script.txt is not reachable from git.txt tutorial.txt is not reachable from git.txt git-show-index.txt is not reachable from git.txt cvs-migration.txt is not reachable from git.txt diffcore.txt is not reachable from git.txt git-ls-remote-script.txt is not reachable from git.txt git-apply.txt is not reachable from git.txt git-diff-stages.txt is not reachable from git.txt pack-protocol.txt is not reachable from git.txt

Ciao,
Dscho

#138 lore raw

Re: Git 1.0 Synopis (Draft v4)

Quoted 15 lines · Johannes Schindelin

Hi,

Quoted 8 lines · Junio C Hamano

- Are all the files in Documentation/ reachable from git(7) or otherwise made into a standalone document using asciidoc by the Makefile? I haven't looked into documentation generation myself (I use only the text files as they are); help to update the Makefile by somebody handy with asciidoc suite is greatly appreciated here.

Volunteers?

The attached script reveals:

Quoted 12 lines

git-unpack-objects.txt is not reachable from git.txt git-cvsimport-script.txt is not reachable from git.txt git-send-email-script.txt is not reachable from git.txt git-rename-script.txt is not reachable from git.txt tutorial.txt is not reachable from git.txt git-show-index.txt is not reachable from git.txt cvs-migration.txt is not reachable from git.txt diffcore.txt is not reachable from git.txt git-ls-remote-script.txt is not reachable from git.txt git-apply.txt is not reachable from git.txt git-diff-stages.txt is not reachable from git.txt pack-protocol.txt is not reachable from git.txt

The ones that don't start with git probably don't belong in the same set; perhaps there should be a "technical" (or something similar but shorter) subdirectory for developer documentation instead of user documentation? (And tutorial and cvs-migration can move to howto)

-Daniel
*This .sig left intentionally blank*

#142 lore raw

[RFH] An early draft of v1.5.0 release notes

This is still rough, but I think we have a pretty good idea what will and what won't be in v1.5.0 by now, and end-of-year is a good slow time to summarize what we have done.

One thing I am wondering is if delta from v1.4.4.3 is good enough for the intended audience of this release notes. I am reasonably sure that the name v1.5.0 will attract more people than usual and there will be many people upgrading directly from ancient versions such as v1.1.6 or v1.2.0, and there are a handful "one-way-street upgrades" and quite a few user visible changes that already have happened before v1.4.4. Namely:

- Pack-compatible loose object headers, introduced between v1.4.1 and v1.4.2; repository cannot be read with ancient version of git anymore -- this is a one-way street but core.legacyheaders is still not enabled by default);

- delta-base-offset pack encoding, introduced between v1.4.2 and v1.4.3; this is also a one-way street.

- 'git -p' to paginate anything -- many commands do pagination by default on a tty. Introduced between v1.4.1 and v1.4.2; this may surprise old timer users.

- 'git archive' superseded 'git tar' in v1.4.3;

- 'git pack-refs' appeared in v1.4.4;

- 'git cvsserver' was new invention in v1.3.0;

- 'git repo-config', 'git grep', 'git rebase' and 'gitk' were seriously enhanced during v1.4.0 timeperiod.

- 'gitweb' became part of git.git during v1.4.0 timeperiod and seriously modified since then.

- reflog is v1.4.0 invention.

In the following, I am assuming that jc/utf8 and jc/fsck-reflog topics currently in 'next' will be part of v1.5.0.

-- >8 --

Updates in v1.5.0 since v1.4.4 series
-------------------------------------

* Index manipulation

- git-add is to add contents to the index (aka "staging area" for the next commit), whether the file the contents happen to be is an existing one or a newly created one.

- git-add without any argument does not add everything anymore. Say "git add ." if you want to.

- git-add tries to be more friendly to users by offering an interactive mode.

- git-commit <path> used to refuse to commit if <path> was different between HEAD and the index (i.e. update-index was used on it earlier). This check was removed.

- git-rm is much saner and safer. It is used to remove paths from both the index file and the working tree, and makes sure you are not losing any local modification before doing so.

- git-reset <tree> <paths>... can be used to revert index entries for selected paths.

- git-update-index is much less visible.

* Repository layout

- The data for origin repository is stored in the configuration file $GIT_DIR/config, not in $GIT_DIR/remotes/, for newly created clones (the latter is still supported).

- git-clone always uses what is known as "separate remote" layout for a newly created repository with a working tree; i.e. tracking branches in $GIT_DIR/refs/remotes/origin/ are used to track branches from the origin. New branches that appear on the origin side after a clone is made are also tracked automatically.

- git-clone used to be buggy and copied refs outside refs/heads and refs/tags; it doesn't anymore.

- git-branch and git-show-branch know remote tracking branches.

- git-push can now be used to delete a remote branch or a tag.

* Reflog

- Reflog records the history of where the tip of each branch was at each moment. This facility is enabled by default for repositories with working trees, and can be accessed with the "branch@{time}" and "branch@{Nth}" notation.

- "git show-branch" learned showing the reflog data with the new --reflog option.

- The commits referred to by reflog entries are now protected against pruning. The new command "git reflog expire" can be used to truncate older reflog entries and entries that refer to commits that have been pruned away previously.

Existing repositories that have been using reflog may get complaints from fsck-objects; please run "git reflog expire --all" first to remove reflog entries that refer to commits that are no longer in the repository before attempting to repack it.

- git-branch knows how to rename branches and moves existing reflog data from the old branch to the new one.

* Packed refs

- Repositories with hundreds of tags have been paying large overhead, both in storage and in runtime. A new command, git-pack-refs, can be used to "pack" them in more efficient representation.

- Clones and fetches over dumb transports are now aware of packed refs and can download from repositories that use them.

* Configuration

- configuration related to colorize setting are consolidated under color.* namespace (older diff.color.*, status.color.* are still supported).

* Less external dependency

- We have been depended on "merge" program from RCS suite for the file-level 3-way merge, but now we lost this dependency.

- The original implementation of git-merge-recursive which was in Python has been removed; we have C implementation of it now.

- git-shortlog is not in Perl anymore, and more importantly it does not have to be piped output from git-log. It can traverse the commit ancestry itself.

* I18n

- We have always encouraged the commit message to be encoded in UTF-8, but the users are allowed to use legacy encoding as appropriate for their projects (which will never change). A non UTF-8 commit encoding however _must_ be explicitly set with i18n.commitencoding in the repository configuration; otherwise git-commit-tree will complain if the log message does not look like a valid UTF-8 string.

- A commit object recorded in non UTF-8 encoding records the encoding i18n.commitencoding specified in the originating repository in a new "encoding" header. This information is used by git-log and friends to reencode the message to UTF-8 when displaying.

* User support

- Quite a lot of documentation updates.

- Bash completion scripts have been updated heavily.

- Better error messages for often used Porcelainish commands.

----------------------------------------------------------------
(shortlog since v1.4.4.3 here)

#143 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

Quoted 3 lines · Junio C Hamano

This is still rough, but I think we have a pretty good idea what will and what won't be in v1.5.0 by now, and end-of-year is a good slow time to summarize what we have done.

This is certainly a good idea. And your summary was pretty good too, I enjoyed the read. This group has certainly accomplished quite a bit lately!

Just a few comments:

Quoted 7 lines

- Pack-compatible loose object headers, introduced between v1.4.1 and v1.4.2; repository cannot be read with ancient version of git anymore -- this is a one-way street but core.legacyheaders is still not enabled by default);

- delta-base-offset pack encoding, introduced between v1.4.2 and v1.4.3; this is also a one-way street.

Perhaps you can clarify that using these means the repository cannot be used with an earlier version of Git? You may also want to highlight why these features are good, answering the question "Why should I enable them if it breaks backwards compatibility?".

Isn't the new packed-refs format also a one-way street? If you use them for tags on a web server and the client is using a very old http commit walker, what happens?

Quoted 2 lines

- git-clone used to be buggy and copied refs outside refs/heads and refs/tags; it doesn't anymore.

I mentioned to you on #git this morning that I don't think this is noteworthy for this release.

You missed talking about the mess of pack files created by git-push now, especially with pushes over 100 objects. ;-)

Quoted 1 line

- git-push can now be used to delete a remote branch or a tag.

You should mention this requires server side support too. I read that and assumed I could just upgrade my client and push to delete
- which isn't the case, and I know its not... but I still read it that way.

Quoted 2 lines

- "git show-branch" learned showing the reflog data with the new --reflog option.

I had hoped we could get 'git reflog show' into 1.5.0 but the current discussion with Johannes seems like that's unlikely.

Quoted 2 lines

- We have been depended on "merge" program from RCS suite for the file-level 3-way merge, but now we lost this dependency.

Perhaps just reword as:

We no longer require the "merge" program from the RCS suite. All 3-way file-level merges are now done internally.

Quoted 3 lines

- git-shortlog is not in Perl anymore, and more importantly it does not have to be piped output from git-log. It can traverse the commit ancestry itself.

The "traverse the commit ancestry itself" part is not very readable for the average user. How about instead:

git-shortlog is no longer a Perl script. git-shortlog also no longer requires output piped from git-log; it can accept revision parameters directly on the command line.

Signature · 1 line
Shawn.
#144 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

In reply to Junio C Hamano
Quoted 3 lines · Junio C Hamano

This is still rough, but I think we have a pretty good idea what will and what won't be in v1.5.0 by now, and end-of-year is a good slow time to summarize what we have done.

Could somebody please summarize how to "upgrade" a repository to the new layout? This has got my head spinning... and I'm /not/ cloning the various repos I've got here just to take advantage of the changes.

Thanks!

Signature · 4 lines
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                    Fono: +56 32 2654431
Universidad Tecnica Federico Santa Maria             +56 32 2654239
Casilla 110-V, Valparaiso, Chile               Fax:  +56 32 2797513
#147 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

In reply to Junio C Hamano
Quoted 3 lines · Junio C Hamano

This is still rough, but I think we have a pretty good idea what will and what won't be in v1.5.0 by now, and end-of-year is a good slow time to summarize what we have done.

Very nice idea! Perhaps those release notes can find it's way into either v1.5.0 commit, or v1.5.0 tag comment?

Just a few comments:

Quoted 5 lines

- git-add without any argument does not add everything anymore. Say "git add ." if you want to.

- git-add tries to be more friendly to users by offering an interactive mode.

Perhaps information that git-add can be used to add ignored files with -f option should be added? Or is it not important enough?

Quoted 10 lines

- The commits referred to by reflog entries are now protected against pruning. The new command "git reflog expire" can be used to truncate older reflog entries and entries that refer to commits that have been pruned away previously.

Existing repositories that have been using reflog may get complaints from fsck-objects; please run "git reflog expire --all" first to remove reflog entries that refer to commits that are no longer in the repository before attempting to repack it.

That's a bit bad, as it forces to lose some info... but that info was not that useful anyway.

Quoted 5 lines

- A commit object recorded in non UTF-8 encoding records the encoding i18n.commitencoding specified in the originating repository in a new "encoding" header. This information is used by git-log and friends to reencode the message to UTF-8 when displaying.

I don't quite like it. Why if someone uses different encoding that utf-8 because his terminal is not set to utf-8? Having suddenly what looks like garbage on output, while input was in local encoding (and specified in i18n.commitencoding) is a bit suprising...

Quoted 2 lines

----------------------------------------------------------------
(shortlog since v1.4.4.3 here)

I'd rather have description a la "what's cooking" here...

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#148 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

Quoted 2 lines · Jakub Narebski

That's a bit bad, as it forces to lose some info... but that info was not that useful anyway.

I am tired of listening to this useless FUD of yours. You lost the information when you pruned away the underlying objects; you are not losing information when you expire the reflog entries that became useless long time ago.

Quoted 4 lines

I don't quite like it. Why if someone uses different encoding that utf-8 because his terminal is not set to utf-8? Having suddenly what looks like garbage on output, while input was in local encoding (and specified in i18n.commitencoding) is a bit suprising...

If Luben wants UTF-8 in his project, but somebody he pulled from was mistakenly used latin-1, then the commit pulled record latin-1 while Luben has i18n.commitencoding in his repository set to UTF-8. Output will be done in UTF-8 for Luben. For the originator of that latin-1 commit, i18n.commitencoding says latin-1 (and that was the only reason he managed to create such a commit) and git show of that commit would not involve recoding.

At least that is the idea. Have you spotted a bug, perhaps?

Quoted 3 lines
Quoted 1 line

(shortlog since v1.4.4.3 here)

I'd rather have description a la "what's cooking" here...

Send the summary to the list and I'll append it to the release notes.

#149 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

Quoted 14 lines · Junio C Hamano
Quoted 13 lines · Jakub Narebski
Quoted 11 lines · Junio C Hamano

 - The commits referred to by reflog entries are now protected against pruning.  The new command "git reflog expire" can be used to truncate older reflog entries and entries that refer to commits that have been pruned away previously.

   Existing repositories that have been using reflog may get complaints from fsck-objects; please run "git reflog expire --all" first to remove reflog entries that refer to commits that are no longer in the repository before attempting to repack it.

Quoted 7 lines
Quoted 2 lines

That's a bit bad, as it forces to lose some info... but that info was not that useful anyway.

I am tired of listening to this useless FUD of yours. You lost the information when you pruned away the underlying objects; you are not losing information when you expire the reflog entries that became useless long time ago.

Sorry, this is a bit of my inner packrat ;-) showing thru.

I'd rather use "git reflog expire --pruned" to remove reflog entries which refer to commits which are no longer in the repository; I don't know, perhaps "git reflog expire --all" does that: but there is no Documentation/git-reflog.txt (and I'm not running 'next' nor 'master' but 1.4.4.3). So most probably it is just the case of adding an alias to reflog expire option.

Quoted 20 lines
Quoted 10 lines
Quoted 5 lines

- A commit object recorded in non UTF-8 encoding records the encoding i18n.commitencoding specified in the originating repository in a new "encoding" header. This information is used by git-log and friends to reencode the message to UTF-8 when displaying.

I don't quite like it. Why if someone uses different encoding that utf-8 because his terminal is not set to utf-8? Having suddenly what looks like garbage on output, while input was in local encoding (and specified in i18n.commitencoding) is a bit suprising...

If Luben wants UTF-8 in his project, but somebody he pulled from was mistakenly used latin-1, then the commit pulled record latin-1 while Luben has i18n.commitencoding in his repository set to UTF-8. Output will be done in UTF-8 for Luben. For the originator of that latin-1 commit, i18n.commitencoding says latin-1 (and that was the only reason he managed to create such a commit) and git show of that commit would not involve recoding.

Quoted 1 line

At least that is the idea. Have you spotted a bug, perhaps?

Perhaps that is the idea, but that idea is not described in above new feature announcement. "... to reencode the message to UTF-8 when displaying, if needed." would cover it, but perhaps better would be to cover this in more detail: "reencode message to UTF-8 if i18n.commitencoding is not set to something other than UTF-8", or "reencode ... to i18n.commitencoding ... if needed".

BTW. what happens for NO_ICONV? Just curious...

Signature · 2 lines
Jakub Narebski
Poland
#150 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

Jakub Narebski <[email protected]> wrote:

[...]

Quoted 6 lines

Perhaps that is the idea, but that idea is not described in above new feature announcement. "... to reencode the message to UTF-8 when displaying, if needed." would cover it, but perhaps better would be to cover this in more detail: "reencode message to UTF-8 if i18n.commitencoding is not set to something other than UTF-8", or "reencode ... to i18n.commitencoding ... if needed".

And what happens to the people who can't/won't display UTF-8? This is a both a project wide configuration (how does stuff get saved) + a user/local configuration (how to display stuff).

Signature · 4 lines
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                    Fono: +56 32 2654431
Universidad Tecnica Federico Santa Maria             +56 32 2654239
Casilla 110-V, Valparaiso, Chile               Fax:  +56 32 2797513
#157 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

In reply to Junio C Hamano

Hi,

Quoted 7 lines · Junio C Hamano
Quoted 4 lines · Jakub Narebski

I don't quite like it. Why if someone uses different encoding that utf-8 because his terminal is not set to utf-8? Having suddenly what looks like garbage on output, while input was in local encoding (and specified in i18n.commitencoding) is a bit suprising...

Quoted 7 lines

If Luben wants UTF-8 in his project, but somebody he pulled from was mistakenly used latin-1, then the commit pulled record latin-1 while Luben has i18n.commitencoding in his repository set to UTF-8. Output will be done in UTF-8 for Luben. For the originator of that latin-1 commit, i18n.commitencoding says latin-1 (and that was the only reason he managed to create such a commit) and git show of that commit would not involve recoding.

I think that this is a misunderstanding. Maybe the config variable is misnamed. As is clearly visible from the commit messages, this whole stuff is meant to reencode to whatever encoding the caller of git-log likes, not just UTF-8. And it defaults to UTF-8, overridable by i18n.commitEncoding.

BTW I think that latin-1 is not a valid encoding name (at least in my setup it isn't), so we should rather talk about iso-8859-1.

Ciao,
Dscho

#158 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

Quoted 2 lines · Johannes Schindelin

BTW I think that latin-1 is not a valid encoding name (at least in my setup it isn't), so we should rather talk about iso-8859-1.

"iconv --list" include l1 and latin1 as aliases to the proper name of encoding, i.e. iso-8859-1; but not latin-2.

Signature · 2 lines
Jakub Narebski
Poland
#159 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

In reply to Jakub Narebski
Quoted 7 lines · Jakub Narebski

Just a few comments:

Quoted 2 lines

- git-add without any argument does not add everything anymore. Say "git add ." if you want to.

Perhaps information that git-add can be used to add ignored files with -f option should be added? Or is it not important enough?

Thanks. Will change the above bullet to this:

- git-add without any argument does not add everything anymore. Use 'git-add .' instead. Also you can add otherwise ignored files with an -f option.

#145 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

In reply to Horst H. von Brand
Quoted 8 lines · Horst H. von Brand
Quoted 3 lines · Junio C Hamano

This is still rough, but I think we have a pretty good idea what will and what won't be in v1.5.0 by now, and end-of-year is a good slow time to summarize what we have done.

Could somebody please summarize how to "upgrade" a repository to the new layout? This has got my head spinning... and I'm /not/ cloning the various repos I've got here just to take advantage of the changes.

The old layout was to map remote branch $B to local tracking branch .git/refs/heads/$B, unless $B == 'master' in which case it was mapped to .git/refs/heads/origin (and I think we discarded 'origin' at remote).

Each remote branch $B is tracked with .git/refs/remote/origin/$B in the new layout.

And you will get something like this in your .git/config:

[remote "origin"]
url = git://git.kernel.org/pub/scm/.../torvalds/linux-2.6.git/
fetch = refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master

The first section defines what the token 'origin' means when you say "git pull origin" or "git fetch origin". remote.origin.url defines the URL to fetch/pull from, and remote.origin.fetch supplies the refspecs you omitted from the command line (fetch everything from refs/heads/ hierarchy of remote and store them in my refs/remotes/origin/ hierarchy).

The second section defines what happens when you say "git pull" or "git fetch" while on your "master" branch. It tells that you meant to say "git pull origin" or "git fetch origin" when you omitted the URL argument from the command line. And because you are also omitting the refspecs, remote.origin.fetch kicks in and slurps all the branches from the remote side and stores them in your refs/remotes/origin/ hierarchy. When the command was "git pull", it also says the merge that follows the fetch is to merge the 'master' branch at the remote side (which happens to be copied to your remotes/origin/master only because you have remote.origin.fetch) into your current branch (which is "master", because this section is about what happens while you are on your "master" branch).

So for an existing repository that does not use the separate remotes layout, you can easily convert that by hand if you wanted to by:

- Move tracking branches from refs/heads/* to
refs/remotes/origin/*,

- create the config section like the above in .git/config, and

- remove .git/remotes/origin when you are done.

#146 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

[Cc: [email protected], Junio C Hamano <[email protected]>,
"Horst H. von Brand" <[email protected]>]

Quoted 7 lines · Junio C Hamano
Quoted 5 lines · Horst H. von Brand
Quoted 3 lines · Junio C Hamano

This is still rough, but I think we have a pretty good idea what will and what won't be in v1.5.0 by now, and end-of-year is a good slow time to summarize what we have done.

Quoted 8 lines
Quoted 3 lines

Could somebody please summarize how to "upgrade" a repository to the new layout? This has got my head spinning... and I'm /not/ cloning the various repos I've got here just to take advantage of the changes.

The old layout was to map remote branch $B to local tracking branch .git/refs/heads/$B, unless $B == 'master' in which case it was mapped to .git/refs/heads/origin (and I think we discarded 'origin' at remote).

How to discard 'origin' in the new wildcard / globbing remote config? IIRC there was proposal to use '-' or '!' to exclude branch from fetching, but no code...

[...]

Quoted 1 line

- create the config section like the above in .git/config, and

You can use contrib/remotes2config.sh script...

Quoted 1 line

- remove .git/remotes/origin when you are done.

...which saves remotes/ under remotes.old/

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#151 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

In reply to Horst H. von Brand
Quoted 11 lines · Horst H. von Brand

Jakub Narebski <[email protected]> wrote:

[...]

Quoted 6 lines

Perhaps that is the idea, but that idea is not described in above new feature announcement. "... to reencode the message to UTF-8 when displaying, if needed." would cover it, but perhaps better would be to cover this in more detail: "reencode message to UTF-8 if i18n.commitencoding is not set to something other than UTF-8", or "reencode ... to i18n.commitencoding ... if needed".

Quoted 3 lines

And what happens to the people who can't/won't display UTF-8? This is a both a project wide configuration (how does stuff get saved) + a user/local configuration (how to display stuff).

Presumably you would do something like:

git log | tcs -f utf -t latin1 | less

The point being that the input to tcs will be uniformly UTF-8 even the committers used Latin-1 and UTF-8, either carelessly or deliberately [*1*].

Maybe i18n.displayencoding set to latin1 is what you are after? I think it might make sense...

In any case, as Jakub and others pointed out, the description was not nice nor clear. How about this as an update?

* I18n

- We have always encouraged the commit message to be encoded in UTF-8, but the users are allowed to use legacy encoding as appropriate for their projects. This will continue to be the case. However, a non UTF-8 commit encoding _must_ be explicitly set with i18n.commitencoding in the repository where a commit is made; otherwise git-commit-tree will complain if the log message does not look like a valid UTF-8 string.

[Side note: in v1.5.0 preview, it only warns about this
situation; I have a feeling that it might be better to promote this to an error and refuse to commit until the user sets i18n.commitencoding to the name of the legacy encoding used for the project -- this will be a one-time inconvenience but will be much better in the long run.]

- The value of i18n.commitencoding in the originating repository is recorded in the commit object on the "encoding" header, if it is not UTF-8. git-log and friends notice this, and reencodes the message to the encoding specified with i18n.commitencoding when displaying, if they are different.

[Footnote]

*1* For encoding as simple as Latin I do not think it is an issue, but we do not want to encode everything to UTF-8 at commit time, because non-reversible conversion can lose information. I do not want to rule out a situation where a particular commit log entry needs to be in an encoding different from the project norm, which hopefully is UTF-8, because it needs to describe something in a character that cannot be reversibly converted to UTF-8 (maybe the project is about iconv enhancement, the commit fixes something related to irreversible conversion and the log message wants to give an example).

#152 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

Quoted 8 lines · Junio C Hamano

"Horst H. von Brand" <[email protected]> writes:
...

Quoted 3 lines

And what happens to the people who can't/won't display UTF-8? This is a both a project wide configuration (how does stuff get saved) + a user/local configuration (how to display stuff).

...
Maybe i18n.displayencoding set to latin1 is what you are after? I think it might make sense...

I've done this and will be pushing the result out in 'next' shortly, with a new test. I find the result mostly sensible.

#153 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

Quoted 7 lines · Junio C Hamano
Quoted 5 lines · Junio C Hamano

"Horst H. von Brand" <[email protected]> writes:
...

Quoted 3 lines

And what happens to the people who can't/won't display UTF-8? This is a both a project wide configuration (how does stuff get saved) + a user/local configuration (how to display stuff).

Quoted 6 lines
Quoted 3 lines

...
Maybe i18n.displayencoding set to latin1 is what you are after? I think it might make sense...

I've done this and will be pushing the result out in 'next' shortly, with a new test. I find the result mostly sensible.

Shouldn't the LANG environment variable be used for this purpose instead?

Nicolas

#154 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

Quoted 13 lines · Nicolas Pitre
Quoted 11 lines · Junio C Hamano
Quoted 8 lines · Junio C Hamano

"Horst H. von Brand" <[email protected]> writes:
...

Quoted 3 lines

And what happens to the people who can't/won't display UTF-8? This is a both a project wide configuration (how does stuff get saved) + a user/local configuration (how to display stuff).

...
Maybe i18n.displayencoding set to latin1 is what you are after? I think it might make sense...

Quoted 5 lines
Quoted 2 lines

I've done this and will be pushing the result out in 'next' shortly, with a new test. I find the result mostly sensible.

Shouldn't the LANG environment variable be used for this purpose instead?

You mean LC_CTYPE, no?

Signature · 1 line
David Kågedal
#155 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

In reply to Jakub Narebski
Quoted 4 lines · Jakub Narebski

... I don't
know, perhaps "git reflog expire --all" does that: but there is no Documentation/git-reflog.txt (and I'm not running 'next' nor 'master' but 1.4.4.3)...

If that is the case, may I ask you to at least please make it a habit to read what are relevant to the topic under discussion before jumping in? The list traffic is already high enough that I am spending a lot of time just to skim all the messages posted here -- I think that time is better spent on development and improvements.

#156 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

In reply to Jakub Narebski
Quoted 14 lines · Jakub Narebski
Quoted 13 lines · Junio C Hamano
Quoted 12 lines · Jakub Narebski
Quoted 11 lines · Junio C Hamano

 - The commits referred to by reflog entries are now protected against pruning.  The new command "git reflog expire" can be used to truncate older reflog entries and entries that refer to commits that have been pruned away previously.

   Existing repositories that have been using reflog may get complaints from fsck-objects; please run "git reflog expire --all" first to remove reflog entries that refer to commits that are no longer in the repository before attempting to repack it.

[...]

Quoted 6 lines

I'd rather use "git reflog expire --pruned" to remove reflog entries which refer to commits which are no longer in the repository; I don't know, perhaps "git reflog expire --all" does that: but there is no Documentation/git-reflog.txt (and I'm not running 'next' nor 'master' but 1.4.4.3). So most probably it is just the case of adding an alias to reflog expire option.

Thanks for adding Documentation/git-reflog.txt. Nevertheless it didn't add the information that "git reflog expire" removes reflog entries that refer to commits that are no longer in the repository (see attached patch).

I'm not sure if such technical information should be in git-reflog(1), but does only second, current sha1 in reflog line matters for prune? And does expiring rewrite reflog (previous sha1, making always previous sha1 (first sha1 in reflog line) always to refer some commit in earlier reflog line, or before first reflog line), or only delete lines?

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Quoted 1 line

From c39e864dec5fc5542e9dd14235a48fa2bb77ed6a Mon Sep 17 00:00:00 2001

From: Jakub Narebski <[email protected]>
Date: Thu, 28 Dec 2006 01:30:05 +0100
Subject: [PATCH] Add information in git-reflog(1) that "expire" removes pruned entries

Add information to Documentation/git-reflog.txt that "expire" subcommand also removes entries which refer to commits that are no longer in repository.

---
 Documentation/git-reflog.txt |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
Documentation/git-reflog.txt +3 -2
index 55a24d3..04ea51a 100644
@@ -22,11 +22,12 @@ updated.  This command is to manage the information recorded in it.
 The subcommand "expire" is used to prune older reflog entries.
 Entries older than `expire` time, or entries older than
 `expire-unreachable` time and are not reachable from the current
-tip, are removed from the reflog.  This is typically not used
+tip, are removed from the reflog.  Entries which refer to
+commits that are no longer in the repository are pruned
+regardless of their age.  This command is typically not used
 directly by the end users -- instead, see gitlink:git-gc[1].
 
 
-
 OPTIONS
 -------
 
Signature · 1 line
1.4.4.3
#160 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

In reply to Junio C Hamano
Quoted 3 lines · Junio C Hamano

ancient versions such as v1.1.6 or v1.2.0, and there are a handful "one-way-street upgrades" and quite a few user visible changes that already have happened before v1.4.4. Namely:

Addendum:

git-svn related changes:

- git-svn now requires the Perl SVN:: libraries, the command-line backend was too slow and limited.

- the 'commit' command has been renamed to 'set-tree', and 'dcommit' is the recommended replacement for day-to-day work.

Signature · 1 line
Eric Wong
#161 lore raw

Re: [RFH] An early draft of v1.5.0 release notes

Quoted 3 lines · Eric Wong

Addendum:

git-svn related changes:

Thanks.

#162 lore raw

An early draft of v1.5.0 release notes (2nd ed)

In reply to Junio C Hamano

This incorporates comments from the list (thanks). Maybe I should park this in 'todo' branch so that people can review the updates more easily.

-- >8 --

Major changes that are not news
-------------------------------

There were a handful big changes that happened before this major release.

This section is for people who are upgrading from ancient versions. Some of them are one-way street upgrades -- once you use the feature your repository cannot be used with ancient git.

- There is a new configuration variable core.legacyheaders that changes the format of loose objects to more efficient to pack and send out of the repository over git native protocol. However, this format cannot be read by git older than v1.4.2; people fetching from your repository using older clients over dumb transports (e.g. http) will also be affected. This is not enabled by default.

- Another configuration repack.usedeltabaseoffset further allows packfile to be created in more space efficient format, which cannot be read by git older than v1.4.3. This is not enabled by default.

- 'git pack-refs' appeared in v1.4.4; this command allows tags to be accessed much more efficiently than the traditional 'one-file-per-tag' format. Older git-native client can fetch from a repository that packed its tags, but older dumb transports cannot. This is done by an explicit user action, either by use of "git pack-refs --prune" command or by use of "git gc" command.

- 'git -p' to paginate anything -- many commands do pagination by default on a tty. Introduced between v1.4.1 and v1.4.2; this may surprise old timer users.

- 'git archive' superseded 'git tar' in v1.4.3;

- 'git cvsserver' was new invention in v1.3.0;

- 'git repo-config', 'git grep', 'git rebase' and 'gitk' were seriously enhanced during v1.4.0 timeperiod.

- 'gitweb' became part of git.git during v1.4.0 timeperiod and seriously modified since then.

- reflog is an v1.4.0 invention.

Updates in v1.5.0 since v1.4.4 series
-------------------------------------

* Index manipulation

- git-add is to add contents to the index (aka "staging area" for the next commit), whether the file the contents happen to be is an existing one or a newly created one.

- git-add without any argument does not add everything anymore. Use 'git-add .' instead. Also you can add otherwise ignored files with an -f option.

- git-add tries to be more friendly to users by offering an interactive mode.

- git-commit <path> used to refuse to commit if <path> was different between HEAD and the index (i.e. update-index was used on it earlier). This check was removed.

- git-rm is much saner and safer. It is used to remove paths from both the index file and the working tree, and makes sure you are not losing any local modification before doing so.

- git-reset <tree> <paths>... can be used to revert index entries for selected paths.

- git-update-index is much less visible.

* Repository layout and objects transfer

- The data for origin repository is stored in the configuration file $GIT_DIR/config, not in $GIT_DIR/remotes/, for newly created clones (the latter is still supported).

- git-clone always uses what is known as "separate remote" layout for a newly created repository with a working tree; i.e. tracking branches in $GIT_DIR/refs/remotes/origin/ are used to track branches from the origin. New branches that appear on the origin side after a clone is made are also tracked automatically.

- git-branch and git-show-branch know remote tracking branches.

- git-push can now be used to delete a remote branch or a tag. This requires the updated git on the remote side.

- git-push more agressively keeps the transferred objects packed. Earlier we recommended to monitor amount of loose objects and repack regularly, but you should repack when you accumulated too many small packs this way as well. Updated git-count-objects helps you with this.

* Reflog

- Reflog records the history of where the tip of each branch was at each moment. This facility is enabled by default for repositories with working trees, and can be accessed with the "branch@{time}" and "branch@{Nth}" notation.

- "git show-branch" learned showing the reflog data with the new --reflog option.

- The commits referred to by reflog entries are now protected against pruning. The new command "git reflog expire" can be used to truncate older reflog entries and entries that refer to commits that have been pruned away previously with older versions of git.

Existing repositories that have been using reflog may get complaints from fsck-objects; please run "git reflog expire --all" first to remove reflog entries that refer to commits that are no longer in the repository before attempting to repack it.

- git-branch knows how to rename branches and moves existing reflog data from the old branch to the new one.

* Packed refs

- Repositories with hundreds of tags have been paying large overhead, both in storage and in runtime. A new command, git-pack-refs, can be used to "pack" them in more efficient representation.

- Clones and fetches over dumb transports are now aware of packed refs and can download from repositories that use them.

* Configuration

- configuration related to colorize setting are consolidated under color.* namespace (older diff.color.*, status.color.* are still supported).

* Less external dependency

- We no longer require the "merge" program from the RCS suite. All 3-way file-level merges are now done internally.

- The original implementation of git-merge-recursive which was in Python has been removed; we have C implementation of it now.

- git-shortlog is no longer a Perl script. It no longer requires output piped from git-log; it can accept revision parameters directly on the command line.

* I18n

- We have always encouraged the commit message to be encoded in UTF-8, but the users are allowed to use legacy encoding as appropriate for their projects. This will continue to be the case. However, a non UTF-8 commit encoding _must_ be explicitly set with i18n.commitencoding in the repository where a commit is made; otherwise git-commit-tree will complain if the log message does not look like a valid UTF-8 string.

- The value of i18n.commitencoding in the originating repository is recorded in the commit object on the "encoding" header, if it is not UTF-8. git-log and friends notice this, and reencodes the message to the log output encoding when displaying, if they are different. The log output encoding is determined by "git log --encoding=<encoding>", i18n.logoutputencoding configuration, or i18n.commitencoding configuration, in the decreasing order of preference, and defaults to UTF-8.

* User support

- Quite a lot of documentation updates.

- Bash completion scripts have been updated heavily.

- Better error messages for often used Porcelainish commands.

#163 lore raw

Re: An early draft of v1.5.0 release notes (2nd ed)

Quoted 5 lines · Junio C Hamano

-- >8 --

Major changes that are not news
-------------------------------

If these major changes aren't news, what are they? Chopped liver? I'm highly confused by the section header.

Signature · 1 line
Shawn.
#164 lore raw

Re: An early draft of v1.5.0 release notes (2nd ed)

Quoted 8 lines · Shawn Pearce
Quoted 5 lines · Junio C Hamano

-- >8 --

Major changes that are not news
-------------------------------

If these major changes aren't news, what are they?

Exactly as described in the part you did not quote:

There were a handful big changes that happened before this major release.

This section is for people who are upgrading from ancient versions.

In other words, they are only to help people who were not paying enough attention to earlier releases.

#165 lore raw

Re: An early draft of v1.5.0 release notes (2nd ed)

Quoted 13 lines · Junio C Hamano
Quoted 8 lines · Shawn Pearce
Quoted 5 lines · Junio C Hamano

-- >8 --

Major changes that are not news
-------------------------------

If these major changes aren't news, what are they?

Exactly as described in the part you did not quote:

Quoted 8 lines

There were a handful big changes that happened before this major release.

This section is for people who are upgrading from ancient versions.

In other words, they are only to help people who were not paying enough attention to earlier releases.

OK, yet again I don't quite quote enough. Or read enough. ;-)

But maybe you can title the section

Major changes since 1.2.x

? Or whatever version preceeded when we started to add that stuff?

The section is really for those who are upgrading from ancient versions, but the title of the section implies (at least to me) that these changes aren't something important.

Just my (nearly worthless against the Euro) two US pennies...

Signature · 1 line
Shawn.
#166 lore raw

Re: An early draft of v1.5.0 release notes (2nd ed)

Quoted 3 lines · Shawn Pearce

The section is really for those who are upgrading from ancient versions, but the title of the section implies (at least to me) that these changes aren't something important.

True. How about "Something important you should already know but just in case" ;-)?

#167 lore raw

Re: An early draft of v1.5.0 release notes (2nd ed)

Quoted 8 lines · Junio C Hamano
Quoted 3 lines · Shawn Pearce

The section is really for those who are upgrading from ancient versions, but the title of the section implies (at least to me) that these changes aren't something important.

True. How about "Something important you should already know but just in case" ;-)?

Sure, that's more fun then my proposed text and does summarize the section better. Plus it reminds Git users that maybe they should track our releases a little bit more often than only on "major" version number increments. :-)

Signature · 1 line
Shawn.
#168 lore raw

Re: An early draft of v1.5.0 release notes (2nd ed)

Quoted 7 lines · Shawn Pearce
Quoted 6 lines · Junio C Hamano
Quoted 3 lines · Shawn Pearce

The section is really for those who are upgrading from ancient versions, but the title of the section implies (at least to me) that these changes aren't something important.

Quoted 7 lines
Quoted 2 lines

True. How about "Something important you should already know but just in case" ;-)?

Sure, that's more fun then my proposed text and does summarize the section better. Plus it reminds Git users that maybe they should track our releases a little bit more often than only on "major" version number increments. :-)

That was a tongue-in-cheek comment.

I consider git is still young and I have the right to gripe at the list if something that has been cooking in 'next' without anybody complaining causes a real breakage immediately after it gets pushed out to 'master'. But for the rest of the world, git has already matured enough that there is much less need to be on the bleeding edge for the lack of something crucial in the last released version.

And let's face it. Nobody has enough time to keep track of the changes to all tools he uses, it is not unusual to skip a handful of minor versions, and it is a norm to get surprised after an upgrade of any tool because there was a major change in a couple of releases back that he skipped. I do not have the right to complain if the end users do not follow every minor release or every issue of "What's in git.git" messages. Not anymore.

So I'd like the introductory section to have more positive spin. I tried rewording it and pushed it out to 'todo' branch.

#169 lore raw

Re: An early draft of v1.5.0 release notes (3rd ed)

In reply to Junio C Hamano

Instead of sending the full text, I'll send out the diff against the one I sent out on the 27th last month.

Highlights:

* Introductory notes have been reworded heavily;

* I intend to merge bare repository support and detached HEAD before v1.5.0, so a section each for them has been added;

* Sliding mmap and shallow clone are also mentioned.

The full text is available as v1.5.0.txt in 'todo' branch.

--

 v1.5.0.txt |  180 +++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 149 insertions(+), 31 deletions(-)
v1.5.0.txt +149 -31
index 671c14b..9bbe825 100644
@@ -1,37 +1,54 @@
-Major changes that are not news
--------------------------------
+GIT v1.5.0 Release Notes
+========================
 
-There were a handful big changes that happened before this major
-release.
+Old news
+--------
 
 This section is for people who are upgrading from ancient
-versions.  Some of them are one-way street upgrades -- once you
-use the feature your repository cannot be used with ancient git.
-
- - There is a new configuration variable core.legacyheaders that
-   changes the format of loose objects to more efficient to pack
-   and send out of the repository over git native protocol.
-   However, this format cannot be read by git older than v1.4.2;
-   people fetching from your repository using older clients over
-   dumb transports (e.g. http) will also be affected.  This is
-   not enabled by default.
-
- - Another configuration repack.usedeltabaseoffset further
-   allows packfile to be created in more space efficient format,
-   which cannot be read  by git older than v1.4.3.  This is not
-   enabled by default.
+versions of git.  Although all of the changes in this section
+happened before the current v1.4.4 release, they are summarized
+here in the v1.5.0 release notes for people who skipped earlier
+versions.
+
+In general, you should not have to worry about incompatibility,
+and there is no need to perform "repository conversion" if you
+are updating to v1.5.0.  However, some of the changes are
+one-way street upgrades; once you use them your repository
+can no longer be used with ancient git.
+
+ - There is a configuration variable core.legacyheaders that
+   changes the format of loose objects so that they are more
+   efficient to pack and to send out of the repository over git
+   native protocol, since v1.4.2.  However, loose objects
+   written in the new format cannot be read by git older than
+   that version; people fetching from your repository using
+   older clients over dumb transports (e.g. http) using older
+   versions of git will also be affected.
+
+ - Since v1.4.3, configuration repack.usedeltabaseoffset allows
+   packfile to be created in more space efficient format, which
+   cannot be read by git older than that version.
+
+The above two are not enabled by default and you explicitly have
+to ask for them, because these two features make repositories
+unreadable by older versions of git, and in v1.5.0 we still do
+not enable them by default for the same reason.  We will change
+this default probably 1 year after 1.4.2's release, when it is
+reasonable to expect everybody to have new enough version of
+git.
 
  - 'git pack-refs' appeared in v1.4.4; this command allows tags
    to be accessed much more efficiently than the traditional
-   'one-file-per-tag' format.  Older git-native client can fetch
-   from a repository that packed its tags, but older dumb
-   transports cannot.  This is done by an explicit user action,
-   either by use of "git pack-refs --prune" command or by use of
-   "git gc" command.
+   'one-file-per-tag' format.  Older git-native clients can
+   still fetch from a repository that packed and pruned refs
+   (the server side needs to run the up-to-date version of git),
+   but older dumb transports cannot.  Packing of refs is done by
+   an explicit user action, either by use of "git pack-refs
+   --prune" command or by use of "git gc" command.
 
  - 'git -p' to paginate anything -- many commands do pagination
    by default on a tty.  Introduced between v1.4.1 and v1.4.2;
-   this may surprise old timer users.
+   this may surprise old timers.
 
  - 'git archive' superseded 'git tar' in v1.4.3;
 
@@ -43,7 +60,10 @@ use the feature your repository cannot be used with ancient git.
  - 'gitweb' became part of git.git during v1.4.0 timeperiod and
    seriously modified since then.
 
- - reflog is an v1.4.0 invention.
+ - reflog is an v1.4.0 invention.  This allows you to name a
+   revision that a branch used to be at (e.g. "git diff
+   master@{yesterday} master" allows you to see changes since
+   yesterday's tip of the branch).
 
 
 Updates in v1.5.0 since v1.4.4 series
@@ -80,7 +100,9 @@ Updates in v1.5.0 since v1.4.4 series
 
  - The data for origin repository is stored in the configuration
    file $GIT_DIR/config, not in $GIT_DIR/remotes/, for newly
-   created clones (the latter is still supported).
+   created clones.  The latter is still supported and there is
+   no need to convert your existing repository if you are
+   already comfortable with your workflow with the layout.
 
  - git-clone always uses what is known as "separate remote"
    layout for a newly created repository with a working tree;
@@ -100,6 +122,26 @@ Updates in v1.5.0 since v1.4.4 series
    accumulated too many small packs this way as well.  Updated
    git-count-objects helps you with this.
 
+ - A new command, git-remote, can help you manage your remote
+   tracking branch definitions.
+
+
+* Bare repositories
+
+ - Certain commands change their behaviour in a bare repository
+   (i.e. a repository without associated working tree).  We use
+   a fairly conservative heuristic (if $GIT_DIR is ".git", or
+   ends with "/.git", the repository is not bare) to decide if a
+   repository is bare, but "core.bare" configuration variable
+   can be used to override the heuristic when it misidentifies
+   your repository.
+
+ - git-fetch used to complain updating the current branch but
+   this is now allowed for a bare repository.
+
+ - NEEDSWORK: We should disable Porcelain-ish commands that
+   require a working tree in a bare repository.
+
 
 * Reflog
 
@@ -118,15 +160,42 @@ Updates in v1.5.0 since v1.4.4 series
    versions of git.
 
    Existing repositories that have been using reflog may get
-   complaints from fsck-objects; please run "git reflog expire
-   --all" first to remove reflog entries that refer to commits
-   that are no longer in the repository before attempting to
-   repack it.
+   complaints from fsck-objects and may not be able to run
+   git-repack; please run "git reflog expire --all" first to
+   remove reflog entries that refer to commits that are no
+   longer in the repository when that happens.
 
  - git-branch knows how to rename branches and moves existing
    reflog data from the old branch to the new one.
 
 
+* Detached HEAD
+
+ - You can give non-branch to "git checkout" now.  This will
+   dissociate your HEAD from any of your branches.  A typical
+   use of this feature is to "look around".  E.g.
+
+	$ git checkout v2.6.16
+	... compile, test, etc.
+	$ git checkout v2.6.17
+	... compile, test, etc.
+
+ - After detaching your HEAD, you can go back to an existing
+   branch with usual "git checkout $branch".  Also you can
+   start a new branch using "git checkout -b $newbranch".
+
+ - You can even pull from other repositories, make merges and
+   commits while your HEAD is detached.  Also you can use "git
+   reset" to jump to arbitrary commit.
+
+   Going back to undetached state by "git checkout $branch" can
+   lose the current stat you arrived in these ways, and "git
+   checkout" refuses when the detached HEAD is not pointed by
+   any existing ref (an existing branch, a remote tracking
+   branch or a tag).  This safety can be overriden with "git
+   checout -f".
+
+
 * Packed refs
 
  - Repositories with hundreds of tags have been paying large
@@ -181,6 +250,24 @@ Updates in v1.5.0 since v1.4.4 series
    configuration, in the decreasing order of preference, and
    defaults to UTF-8. 
 
+ - Tools for e-mailed patch application now default to -u
+   behaviour; i.e. it always re-codes from the e-mailed encoding
+   to the encoding specified with i18n.commitencoding.  This
+   unfortunately forces projects that have happily using a
+   legacy encoding without setting i18n.commitencoding, but
+   taken with other improvement, please excuse us for this very
+   minor one-time inconvenience.
+
+
+* Foreign SCM interfaces
+
+  - git-svn now requires the Perl SVN:: libraries, the
+    command-line backend was too slow and limited.
+
+  - the 'commit' subcommand of git-svn has been renamed to
+    'set-tree', and 'dcommit' is the recommended replacement for
+    day-to-day work.
+
 
 * User support
 
@@ -191,4 +278,35 @@ Updates in v1.5.0 since v1.4.4 series
  - Better error messages for often used Porcelainish commands.
 
 
+* Sliding mmap
+
+ - We used to assume that we can mmap the whole packfile while
+   in use, but with a large project this consumes huge virtual
+   memory space and truly huge ones would not fit in the
+   userland address space on 32-bit platforms.  We now mmap huge
+   packfile in pieces to avoid this problem.
+
+
+* Shallow clones
+
+ - There is a partial support for 'shallow' repositories that
+   keeps only recent history now.  A 'shallow clone' is created
+   by specifying how deep that truncated history should be.
+
+   Currently a shallow repository has number of limitations:
+
+   - Cloning and fetching _from_ a shallow clone are not
+     supported (nor tested -- so they might work by accident but
+     they are not expected to).
+
+   - Pushing from nor into a shallow clone are not expected to
+     work.
+
+   - Merging inside a shallow repository would work as long as a
+     merge base is found in the recent history, but otherwise it
+     will be like merging unrelated histories and may result in
+     huge conflicts.
 
+   but this would be more than adequate for people who want to
+   look at near the tip of a big project with a deep history and
+   send patches in e-mail format.
#189 lore raw

PATCH 1/1 pretty-formats: add 'format:<string>'

In reply to Han-Wen Nienhuys

With this patch,

$ git show -s \
	--pretty=format:'  Ze komit %h woss%n  dunn buy ze great %an'

shows something like

Ze komit 04c5c88 woss
dunn buy ze great Junio C Hamano

The supported placeholders are:

'%H': commit hash
'%h': abbreviated commit hash
'%T': tree hash
'%t': abbreviated tree hash
'%P': parent hashes
'%p': abbreviated parent hashes
'%an': author name
'%ae': author email
'%ad': author date
'%aD': author date, RFC2822 style
'%ar': author date, relative
'%at': author date, UNIX timestamp
'%cn': committer name
'%ce': committer email
'%cd': committer date
'%cD': committer date, RFC2822 style
'%cr': committer date, relative
'%ct': committer date, UNIX timestamp
'%e': encoding
'%s': subject
'%b': body
'%Cred': switch color to red
'%Cgreen': switch color to green
'%Cblue': switch color to blue
'%Creset': reset color
'%n': newline

---

On Fri, 24 Nov 2006, Han-Wen Nienhuys wrote:

> The recently posted patch documenting is an improvement, but why > not add an option so you can do
>
> --format 'committer %c\nauthor %a\n'
>
> this catches all combinations, and is easier for scripting.

So, I overcame my laziness after 91 days...

Of course, this is not as efficient as it could be: it _will_ get _all_ variables from the commit, even if not needed. However, I don't think that it matters in reality.

BTW I have not found any implementation of xstrndup(), so I let it be static.

 Documentation/pretty-formats.txt |   44 +++++++++
 commit.c                         |  195 ++++++++++++++++++++++++++++++++++++++
 commit.h                         |    1 +
 log-tree.c                       |    2 +-
 4 files changed, 241 insertions(+), 1 deletions(-)
Documentation/pretty-formats.txt +44 -0
index fb0b0b9..2fe6c31 100644
@@ -77,9 +77,53 @@ displayed in full, regardless of whether --abbrev or
 true parent commits, without taking grafts nor history
 simplification into account.
 
+	* 'format:'
++
+The 'format:' format allows you to specify which information
+you want to show. It works a little bit like printf format,
+with the notable exception that you get a newline with '%n'
+instead of '\n'.
+
+E.g, 'format:"The author of %h was %an, %ar%nThe title was >>%s<<"'
+would show something like this:
+
+The author of fe6e0ee was Junio C Hamano, 23 hours ago
+The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<
+
+The placeholders are:
+
+- '%H': commit hash
+- '%h': abbreviated commit hash
+- '%T': tree hash
+- '%t': abbreviated tree hash
+- '%P': parent hashes
+- '%p': abbreviated parent hashes
+- '%an': author name
+- '%ae': author email
+- '%ad': author date
+- '%aD': author date, RFC2822 style
+- '%ar': author date, relative
+- '%at': author date, UNIX timestamp
+- '%cn': committer name
+- '%ce': committer email
+- '%cd': committer date
+- '%cD': committer date, RFC2822 style
+- '%cr': committer date, relative
+- '%ct': committer date, UNIX timestamp
+- '%e': encoding
+- '%s': subject
+- '%b': body
+- '%Cred': switch color to red
+- '%Cgreen': switch color to green
+- '%Cblue': switch color to blue
+- '%Creset': reset color
+- '%n': newline
+
+
 --encoding[=<encoding>]::
 	The commit objects record the encoding used for the log message
 	in their encoding header; this option can be used to tell the
 	command to re-code the commit log message in the encoding
 	preferred by the user.  For non plumbing commands this
 	defaults to UTF-8.
+
commit.c +195 -0

227 lines not on this page · raw message

commit.h +1 -0
index c737444..83507a0 100644
@@ -47,6 +47,7 @@ enum cmit_fmt {
 	CMIT_FMT_FULLER,
 	CMIT_FMT_ONELINE,
 	CMIT_FMT_EMAIL,
+	CMIT_FMT_USERFORMAT,
 
 	CMIT_FMT_UNSPECIFIED,
 };
log-tree.c +1 -1
index ac86194..6ce239d 100644
@@ -211,7 +211,7 @@ void show_log(struct rev_info *opt, const char *sep)
 				 sha1, sha1);
 			opt->diffopt.stat_sep = buffer;
 		}
-	} else {
+	} else if (opt->commit_format != CMIT_FMT_USERFORMAT) {
 		fputs(diff_get_color(opt->diffopt.color_diff, DIFF_COMMIT),
 		      stdout);
 		if (opt->commit_format != CMIT_FMT_ONELINE)
Signature · 1 line
1.5.0.1.620.gac8f
#190 lore raw

Re: [PATCH for "next"] pretty-formats: add 'format:<string>'

Johannes Schindelin escreveu:

Quoted 11 lines

With this patch,

$ git show -s \
	--pretty=format:'  Ze komit %h woss%n  dunn buy ze great %an'

shows something like

Ze komit 04c5c88 woss
dunn buy ze great Junio C Hamano

The supported placeholders are:

nitpick:

\n

for newline would be nice. Similar for backslash, formfeed, alarm, etc.

Signature · 1 line
 Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen
#191 lore raw

Re: [PATCH for "next"] pretty-formats: add 'format:<string>'

Hi,

Quoted 5 lines · Han-Wen Nienhuys

nitpick:

\n

for newline would be nice. Similar for backslash, formfeed, alarm, etc.

Yes, I thought about that. But it would change behaviour (even if I don't think it would do serious damage; the only user of interpolate.[ch] I saw is git-daemon, and that does not need \n, I guess).

Besides, "%n" is

- more consistent,
- date(1) does it the same way, and
- you can put BS, FF, AL, etc. into the format string before passing it as an option to git; git does not have to help you there.

Ciao,
Dscho

#192 lore raw

Re: [PATCH for "next"] pretty-formats: add 'format:<string>'

fredag 23 februari 2007 02:07 skrev Johannes Schindelin:

Quoted 6 lines

Hi,

Quoted 2 lines · Han-Wen Nienhuys

nitpick:

Quoted 7 lines
Quoted 3 lines

\n

for newline would be nice. Similar for backslash, formfeed, alarm, etc.

Yes, I thought about that. But it would change behaviour (even if I don't think it would do serious damage; the only user of interpolate.[ch] I saw is git-daemon, and that does not need \n, I guess).

Other tools that come to mind, rpm and clearcase use \n vfor newline in the format argument, which is good because I can guess that even without looking at the documentation. %n I'd guess would be for a number of some kind, e..g. the ordinal number of the commit listed (in subset and order of the listed commits)

Quoted 3 lines

Besides, "%n" is

- more consistent,

with...?

Quoted 1 line

- date(1) does it the same way, and

Ok, I learnt something. Never fi

Quoted 2 lines

- you can put BS, FF, AL, etc. into the format string before passing it as an option to git; git does not have to help you there.

They are hard to type in shells and even harder in gui's.

-- robin

#193 lore raw

Re: [PATCH for "next"] pretty-formats: add 'format:<string>'

Hi,

Quoted 16 lines · Robin Rosenberg

fredag 23 februari 2007 02:07 skrev Johannes Schindelin:

Quoted 7 lines · Han-Wen Nienhuys
Quoted 5 lines

nitpick:

\n

Quoted 7 lines
Quoted 2 lines

for newline would be nice. Similar for backslash, formfeed, alarm, etc.

Yes, I thought about that. But it would change behaviour (even if I don't think it would do serious damage; the only user of interpolate.[ch] I saw is git-daemon, and that does not need \n, I guess).

Quoted 5 lines

Other tools that come to mind, rpm and clearcase use \n vfor newline in the format argument, which is good because I can guess that even without looking at the documentation. %n I'd guess would be for a number of some kind, e..g. the ordinal number of the commit listed (in subset and order of the listed commits)

Okay. Patch?

Quoted 5 lines
Quoted 3 lines

Besides, "%n" is

- more consistent,

with...?

... itself? Why should not _one_ escape character be enough?

Quoted 4 lines
Quoted 2 lines

- you can put BS, FF, AL, etc. into the format string before passing it as an option to git; git does not have to help you there.

They are hard to type in shells and even harder in gui's.

You would not do that all that often, but rather write a script. Even the config format allows for inclusion of special characters, so aliases should be fine.

Ciao,
Dscho

#194 lore raw

Re: [PATCH for "next"] pretty-formats: add 'format:<string>'

In reply to Johannes Schindelin
Quoted 9 lines · Johannes Schindelin

With this patch,

$ git show -s \
	--pretty=format:'  Ze komit %h woss%n  dunn buy ze great %an'

shows something like

Ze komit 04c5c88 woss
dunn buy ze great Junio C Hamano

Does it say "This commit is by a fool whose name is blah"?

Quoted 5 lines

The supported placeholders are:

'%H': commit hash
...

	'%b': body

Hmmm. Would we want to make them somehow interoperable with git-for-each-ref format atoms?

Also, it _might_ be worthwhile to do something like "%+4b" which means "indent each line of this field with 4 spaces", for a multi-line field like "%b".

Quoted 4 lines

'%Cred': switch color to red
'%Cgreen': switch color to green
'%Cblue': switch color to blue
'%Creset': reset color

Hmmm. I strongly suspect that we would want to reuse code to grok colors and attributes in color.c.

Quoted 3 lines
	>   --format 'committer %c\nauthor %a\n'
	>   
	> this catches all combinations, and is easier for scripting.

I do not have strong preference between "\n" and "%n".

Quoted 1 line

So, I overcame my laziness after 91 days...

Thanks.

#195 lore raw

Re: [PATCH for "next"] pretty-formats: add 'format:<string>'

Hi,

Quoted 7 lines · Junio C Hamano
Quoted 5 lines · Johannes Schindelin

With this patch,

$ git show -s \
	--pretty=format:'  Ze komit %h woss%n  dunn buy ze great %an'
Quoted 6 lines
Quoted 4 lines

shows something like

Ze komit 04c5c88 woss
dunn buy ze great Junio C Hamano

Does it say "This commit is by a fool whose name is blah"?

Vy, it iss korrekt Churmen Inklish [Translation: Why, it is correct German "English"]... ;-)

Quoted 8 lines
Quoted 5 lines

The supported placeholders are:

'%H': commit hash
...

	'%b': body

Hmmm. Would we want to make them somehow interoperable with git-for-each-ref format atoms?

But those placeholders are so long! Not even GNU date supports such long placeholders... And I could not reuse interpolate.[ch] as is for that.

Quoted 3 lines

Also, it _might_ be worthwhile to do something like "%+4b" which means "indent each line of this field with 4 spaces", for a multi-line field like "%b".

Same goes here: interpolate.[ch] does not (yet) allow for that.

Quoted 7 lines
Quoted 4 lines

'%Cred': switch color to red
'%Cgreen': switch color to green
'%Cblue': switch color to blue
'%Creset': reset color

Hmmm. I strongly suspect that we would want to reuse code to grok colors and attributes in color.c.

And again...

Quoted 5 lines
Quoted 3 lines
	>   --format 'committer %c\nauthor %a\n'
	>   
	> this catches all combinations, and is easier for scripting.

I do not have strong preference between "\n" and "%n".

This would be easy, methink, to teach to interpolate().

Maybe I can overcome my laziness, and extend interpolate() so that it can actually call callbacks with callback data...

Alternatively, I could imitate for-each-ref, and roll my own interpolate()? :-)

Ciao,
Dscho

#196 lore raw

Re: [PATCH for "next"] pretty-formats: add 'format:<string>'

Quoted 11 lines · Johannes Schindelin
Quoted 8 lines
Quoted 5 lines

The supported placeholders are:

'%H': commit hash
...

	'%b': body

Hmmm. Would we want to make them somehow interoperable with git-for-each-ref format atoms?

But those placeholders are so long! Not even GNU date supports such long placeholders... And I could not reuse interpolate.[ch] as is for that.

What I was hinting at was to fix (or extend) for-each-ref to accept these short-and-sweet placeholders.

Quoted 5 lines
Quoted 3 lines

Also, it _might_ be worthwhile to do something like "%+4b" which means "indent each line of this field with 4 spaces", for a multi-line field like "%b".

Same goes here: interpolate.[ch] does not (yet) allow for that.

Nah, if you feel it is too much work, I trust your judgement (I do not recall details of how interpolate.c does its thing). I do not think it's worth it.

#197 lore raw

Re: [PATCH for "next"] pretty-formats: add 'format:<string>'

Hi,

Quoted 11 lines · Junio C Hamano
Quoted 9 lines · Johannes Schindelin
Quoted 8 lines
Quoted 5 lines

The supported placeholders are:

'%H': commit hash
...

	'%b': body

Hmmm. Would we want to make them somehow interoperable with git-for-each-ref format atoms?

Quoted 6 lines
Quoted 3 lines

But those placeholders are so long! Not even GNU date supports such long placeholders... And I could not reuse interpolate.[ch] as is for that.

What I was hinting at was to fix (or extend) for-each-ref to accept these short-and-sweet placeholders.

Ah, the other way round...

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

Also, it _might_ be worthwhile to do something like "%+4b" which means "indent each line of this field with 4 spaces", for a multi-line field like "%b".

Same goes here: interpolate.[ch] does not (yet) allow for that.

Nah, if you feel it is too much work, I trust your judgement (I do not recall details of how interpolate.c does its thing). I do not think it's worth it.

Sure, it _would_ be nice to let interpolate call back, instead of having to fill a table with static strings (xstrdup()ing them, no less).

However, I want to go play Snooker tonight, so this is up-for-grabs.

Ciao,
Dscho

#17 lore raw

Re: [PATCH] Enable reflogs by default in any repository with a working directory.

In reply to Johannes Schindelin
Quoted 4 lines · Johannes Schindelin

Hi,

On Thu, 14 Dec 2006, Shawn O. Pearce wrote:

Quoted 10 lines

environment.c static void setup_git_env(void) · line 60

Quoted 7 lines
environment.c +6 -0
+int is_bare_git_dir (const char *dir)
+{
+	if (!strcmp(dir, DEFAULT_GIT_DIR_ENVIRONMENT))
+		return 0;
+	const char *s = strrchr(dir, '/');
+	return !s || strcmp(s + 1, DEFAULT_GIT_DIR_ENVIRONMENT);
 }

This function does not really determine if the repo is bare. I have no better name for it, though.

guess_if_bare_git_dir ?

I struggled to name that thing because it can't really tell, its just guessing... but it is going to be right most of the time. Of course I'm sure there's some Git user somewhere who will confuse it.

#212 lore raw

Re: multi-project repos

In reply to Johannes Schindelin
Quoted 6 lines · Johannes Schindelin

_If_ you use git-fetch directly you virtually always want to store the result. I was tempted quite often to submit a patch which adds a command line switch --no-warn, which is passed to git-fetch by git-pull, and without which git-fetch complains if the branch-to-be-fetched is not stored right away (and refuses to go along).

Quoted 6 lines

_Also_, git-pull not storing the fetched branches at least temporarily often annoyed me: the pull did not work, and the SHA1 was so far away I could not even scroll to it. The result: I had to pull (and fetch!) the whole darned objects again. Again, I was tempted quite often to submit a patch which makes git-pull fetch the branches into refs/fetch-temp/* and only throw them away when the merge succeeded.

I think the earlier write-up by Linus on magic HEADs would help documenting FETCH_HEAD better.

#28 lore raw
In reply to Nicolas Pitre
Quoted 4 lines · Nicolas Pitre
Quoted 2 lines

That changes what the command does to existing repositories, which is somewhat impolite.

You must be kidding, aren't you?

I am dead serious. I do not have _any_ issue on existing repositories with a working tree, but I care deeply about public distribution points. See my other message.

#21 lore raw

Re: [PATCH] Enable reflogs by default in any repository with a working directory.

In reply to Shawn Pearce
Quoted 8 lines · Shawn Pearce
Quoted 3 lines · J. Bruce Fields

Stupid question--I assume a mention in the reflog doesn't count as a real reference to an object, so they won't save you in the case when you pruned recently?

Not a stupid question. Your assumption is correct, its not a real reference, so prune will remove things that the log mentions but that refs don't currently mention.

OK, thanks. So we just need to make sure that's documented someplace.

#280 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 8 lines · Carl Worth

First, the pull may just fast-forward in which case there's no message at all. And we've been through that topic enough recently that we all know that no important information is lost by not doing any separate recording in that case.

So you can't turn around and argue that the remote URL information is suddenly important when it just so happens that it's not a fast forward.

When it's a fast forward, the puller hasn't had to make any judgment calls, so there's no editorial history to record. When it's not, but the puller chooses to retain the result on a persistent branch, that _is_ an editorial decision (even if the result of the auto-merge is clean); I like having that in the history.

Quoted 11 lines
Quoted 2 lines

And in a truly distributed situation, "pull" is strictly more powerful than a separate "fetch" + separate "merge".

I don't buy it. In my usage, I have several different remote repositories I'm interested in tracking, each with any number of branches. What I really want is an easy command that fetches all of those branches, (even new ones that I've never heard about---but never any of their "tracking branches" that wouldn't be of interest to me). And I want to do that once, to get the online-access-required part over with and get all the data into my local repository where I can start working with it.

What do you want all of those branches for? They haven't been published to you (that's a human interaction that doesn't go through git), so for all you know they're just upstream experiments, and doing things with them is probably shooting yourself in the foot.

I do agree that a robust form of "for b in .git/remotes/*; do git fetch basename $b; done" would be a nice bit of porcelain. The entries in .git/remotes would probably need to grow a "Fetch-options:" field so that you could choose whether or not to follow tags, etc. Patch to follow.

Cheers,

#3 lore raw
In reply to Junio C Hamano
Quoted 3 lines · Junio C Hamano

I am hoping that we can start a stabilization cycle for v1.5.0 based on what we have in 'master'. The theme is "usability and teachability".

This is what I have in my "niggles" list. These are surface level things that I think are easy to fix. A large part of the scariness is (I think) git's unfriendly output. Too many messages require understanding of git internals.

The major barrier to implementing these sorts of changes is, I think, worries about users of the output of these commands in scripts. I say: screw them, porcelain is there for the breaking :-)

* git-fetch has to be in working root. If I can do git-push from anywhere in my tree, why can't I do git-fetch?
* git-reset has to be in working root. If you typically sit in, say "src/", it's annoying to have to change directory to do a reset.
* git-commit doesn't (generally) have output - after a commit, it's difficult to know if anything happened. Get users used to the idea of hashes to identify commits by telling them which one they just made. Tell them if they made a branch as well, which branch they are now on.
* git-init-db says "defaulting to local storage area", as if that is meant to be a helpful message
* git-revert should be called git-invert. It doesn't remove a change from history, it simply applies another commit that does the opposite of whatever commit you are "revert"ing. That's an inversion.
* git-merge output is horrible - this affects git-pull, git-rebase, and git-cherry-pick. Issuing "fatal" errors and then carrying on is very confusing. Errors in merges appear multiple times. The files upon which which there is a conflict are spread throughout the output. Most of the output is not relevant to an average user.
* git-apply output is horrible. It says a few things about whitespace on
stdin then just finishes. When it succeeds. When it fails, it just says
failed, it doesn't say why a particular hunk failed.
* git-branch is not verbose enough when creating a new branch, for a new user a little reassurance that what they meant to happen has happened would be nice.
* git-commit without "-a" and without an "update-index" says "nothing to commit", which isn't an adequate message to help a user who hasn't realised they need to update the index
* git-rebase --skip requires that the offending file be clean with git-checkout HEAD file
before the skip will work. Why? The fact of the skip is enough knowledge for rebase to know that I don't care if the merge is lost
* git-rebase/git-cherry-pick/git-reset/etc should all tell the user that they need to run git-prune to tidy up after themselves.
* git-add has no output, whether it works or not
* git-cat-file is badly named. git-cat-object would be slightly better.
* git-fetch output is confusing:
remote: Generating pack...
remote: Done counting 189146 objects.
remote: Result has 186566 objects.
remote: Deltifying 186566 objects.
remote: 100% (186566/186566) done
Unpacking 186566 objects
24% (44792/186566) done
Some questions from the point of view of a newbie: what is a pack? what is an object? Why is the remote counting them? Which remote am I reading from? What am I fetching? What is "Deltifying"? How much data do I have to download (number of objects doesn't tell me). How long has this taken? How long is left to go?
* Similar things can be said about git-clone
* Similar things can be said about git-push
* git-show-branch output is cryptic.
* In general the principle for messages should be the same as for presentations:
- say what you're going to do
- do it
- say what you did
So for example, "git-branch newbranch existingbranch" would say
Branching at "existingbranch", hash XXXXXXXXXXXXXXXXXX
- created branch "newbranch"
- your working branch is "existingbranch"
Rather than the nothing that it currently outputs.
* It would be really nice to be able to do an arbitrary checkout, rather than having to make a branch for it. Then I could do

    git-checkout remotes/origin/master && make

(obviously committing with a non-branch HEAD would be prevented)
* git-verify-tag would be nicer as a switch to git-tag

Andy

Signature · 1 line
Dr Andrew Parkins, M Eng (Hons), AMIEE
#317 lore raw

Re: Cleaning up git user-interface warts

In reply to Alexandre Julliard
Quoted 11 lines · Alexandre Julliard
Quoted 10 lines · Jakub Narebski
Quoted 8 lines · Alexandre Julliard
Quoted 2 lines · Junio C Hamano

I would rather say "use 'git branch' to make sure if you are ready to merge". Who teaches not to use "git pull"?

We do that for Wine. The problem is that we recommend using git-rebase to make it easier for occasional developers to keep a clean history, and rebase and pull interfere badly.

Quoted 5 lines
Quoted 2 lines

What about proposed (and I think not accepted) merge strategy "rebase" (formerly called "subordinate" or something like that)?

That sounds very interesting. Has it ever been implemented, or only discussed?

There was some implementation with warts

http://thread.gmane.org/gmane.comp.version-control.git/30068
Message-Id: <[email protected]>

which didn't got corrected and resent.

Signature · 1 line
Jakub Narebski
#36 lore raw
In reply to Jakub Narebski
Quoted 3 lines · Jakub Narebski

It would be nice to have some generic place in git config to specify default options to git commands (at least for interactive shell). It cannot be done using aliases. Perhaps defaults.<command> config variable?

I would say the alias facility has to be fixed then.

In bash you can alias "ls" to "ls -l" and it just works.

#343 lore raw

Re: Cleaning up git user-interface warts

In reply to Petr Baudis
Quoted 7 lines · Petr Baudis
Quoted 4 lines · Junio C Hamano

You have to admit both pull and fetch have been contaminated with loaded meanings from different backgrounds. I was talking about killing the source of confusion in the longer term by removing fetch/pull/push, so we are still on the same page.

How was/is fetch contaminated?

I think "fetch" is sane. Its only problem is a missing symetrical counterpart verb, like "get" and "put".

#23 lore raw
In reply to Shawn Pearce
Quoted 7 lines · Shawn Pearce
Quoted 2 lines · Junio C Hamano

That changes what the command does to existing repositories, which is somewhat impolite.

Yes, but users are forgetting to enable them. They will work in a new repository having that feature, move to an older one and not have it, but expect it to be there.

I concur entirely.

Quoted 9 lines
Quoted 3 lines

I am not opposed too much to an updated version of the tool that sets the configuration on by default for newly created repositories, though.

I almost did that in my patch - but decided against it for the reason I just noted above.

Does anyone on the mailing list really have an objection to having reflogs on by default?

I certainly don't.

#281 lore raw

Re: Cleaning up git user-interface warts

In reply to Michael K. Edwards
Quoted 4 lines · Michael K. Edwards

What do you want all of those branches for? They haven't been published to you (that's a human interaction that doesn't go through git), so for all you know they're just upstream experiments, and doing things with them is probably shooting yourself in the foot.

The same "what do you want them all for" question could be asked of git-clone which also fetches all available branches. I really just want to be able to easily watch what's going on in multiple repositories.

I want to be able to just say "git update" (or whatever) and then be able to list and browse and explore the stuff locally.

Yes, there's still outside communication that's necessary, but with the ability to easily track all the remote branches that communication can be even less formal if I can easily browse and explore things locally. For example, I might not even know the name of the branch:

Me: Have you pushed a branch for your new work on the frob-widget?
Friend: Yes

And then I can "get fetch" and see "cool-new-frob" come in without having to be told that name. Or I could have even just fetched without the specific communication if I was already expecting it for some reason.

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFXKym6JDdNq8qSWgRAm2lAJwKjxDgphT1oKmuD+k6QdH9MOMIqgCcDA2r IoW5DeJll2eyIjAUjrp73HE=
=QNa1
-----END PGP SIGNATURE-----

#80 lore raw
In reply to Horst H. von Brand

Hi,

Quoted 5 lines · Horst H. von Brand
Quoted 1 line · Johannes Schindelin

On Thu, 14 Dec 2006, Andy Parkins wrote:

[...]

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

"newbie" doesn't mean "idiot". Everybody wants to understand what is going on.

I heartly disagree. I saw so many faces _begging_ me to just say _what_ to do, not _why_, and quickly, please.

So? This is meant to be a /tool/. Not wanting to know how it works doesn't make one an idiot, it is just economy.

My thoughts exactly.

And I did not want to force understanding onto the users. Heck, I even know people who use git and do not know about the index! They don't need to, either.

Ciao,
Dscho

#392 lore raw

Re: Cleaning up git user-interface warts

In reply to Nicolas Pitre
Quoted 11 lines · Nicolas Pitre

If the fetch+merge behavior (which I think should really be refered as pull+merge) is still desirable, then it should be called git-update and be no more than a single shell script line such as

        git_pull && git_merge"

This is really what most people expect from such a command name based on obvious historical reasons.  The lack of any branch argument to git-pull and git-merge could be defined as using the first defined remote branch by default.  But having git-pull performing merges is IMHO overloading the word and goes against most people's expectations.

By the way, is anyone doing _remote_ octopus pull (true pull, not with . as repository)?

We can always have --merge arguments to git-pull, and --fetch argument to git-merge.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#107 lore raw

Re: [PATCH] git-pull: refuse default merge without branch.*.merge

In reply to Junio C Hamano
Quoted 6 lines · Junio C Hamano

Everybody hated the pull behaviour of merging the first branch listed on remotes/* file (or remote.*.fetch config) into the current branch. This finally corrects that UI wart by forbidding "git pull" without an explicit branch name on the command line or branch.$current.merge for the current branch.

Yay!

May I suggest also just merging the built-in 3-way merge, and just calling the resulting version 1.5.0?

With all the "git add" and documentation cleanups, and these kinds of fundamental changes in behaviour (not that anybody will hopefully _notice_, and if they do they'll hopefully just be grateful, but it's still conceptually a big step), I think it's definitely worth a new version number.

Maybe even "2.0", although since we're still backwards compatible in all ways that really matter, a major number might be too big a step.

#400 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 6 lines · Carl Worth
Quoted 4 lines · Junio C Hamano

For another example, having a commit command to commit everything by default is disastrous for people who allow their workflows to often be interrupted.

Quoted 10 lines

Workflow-interruption is an important thing to support, but separating update-index and commit really doesn't address it nearly as much as I would like. The lack of really good workflow-interruption support has been one of my longest-running annoyances with git, (perhaps because I have a problem with trying to do too many things at once). Git can create and change branches fast enough that it really should be able to help me better with this. The only missing piece is being able to stash the dirty stuff on the current branch, to be able to come back to it later. I've talked a bit about what I would like in this area before, and I really just need to code it up.

There is git-stash/git-unstash floating somewhere in the archive.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#351 lore raw

Re: Cleaning up git user-interface warts

In reply to Nicolas Pitre

Nicolas Pitre wrote:

[ axed a lot of stuff that I didn't fully grok ]

Quoted 6 lines

This becomes formalized as:

	git_pull [<URL>] [<local_name>]

If <URL> includes a branch name then <local_name> is a single branch name. If <URL> doesn't include any branch name then <local_name> becomes a local branch group name containing all branches in the remote repository.

I would change that so "local_name" is always a branch group name, but branch group names can be used as refs. That is,

git pull startrek.com/kirk.git:master kirk

would always create the branch-head .git/refs/remote/kirk/master which for short can be referenced as just "kirk" (barring clashes ofc), so long as it only has one branch tracked.

Signature · 2 lines
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se
#405 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 5 lines · Junio C Hamano

Yes. The current "merge" started its life as Linus's porcelain (we did not have fetch and pull infrastructure back then) but quickly has become just a helper for pull to produce a merge commit. If anybody thinks its UI is good as a general end-user level command, there is a need for "head examination".

If you mean "git merge" it sure needs to be brought forward. It can't be clearer than:

git-merge the_other_branch

or

git-merge git://repo.com/time_machine.git

to instantaneously understand what is going on.

#310 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 9 lines · Linus Torvalds
Quoted 3 lines · Andy Parkins

On the one hand you're arguing that git syntax is easy to learn, and on the other that no one will be able to learn a new syntax just as easily.

I'm saying that people who are new to git will _have_ to learn new concepts ANYWAY.

I don't think the naming is the hard part.

It isn't - the unexpectedness of what happens is.

I've started by teaching how to do stuff locally, then "pushing" it out to others (me). All the while being able to point out how this is either all local, or sends stuff (without any local modifications) to others.

Come up to 'pull' and ere you have to point out that not only will you get the remote changes but they are also merged into your repository. On the wrong branch?

Too bad.

The problem with git-pull behaving illogically drove me to look at cogito (an aside, perhaps cg-throw should be the corrollary to cg-fetch?) instead. Alas it has problems with a cogito branch not being something you can mentally map back to a git branch.

Quoted 2 lines

But I bet people don't teach it that way. They _start_ by teaching "pull". Right?

Nope.

Anand

#8 lore raw
In reply to Andy Parkins
Quoted 11 lines · Andy Parkins

How's this then:

$ git commit
$ git commit
$ git commit
$ git reset HEAD^^^

"AGGGHHHHHH! I meant HEAD^^"

At this point I start running "git-prune -n | grep commit" and some liberal use of git-show to try and find the hash of the object so I can do

At this point I usually try to politely suggest that users do:

  git repo-config --global core.logAllRefUpdates true

and in the future do something like:

Quoted 6 lines
$ git commit         # {4}
$ git commit         # {3}
$ git commit         # {2}
$ git reset HEAD^^^  # {1}

"AGGGHHHHHH! I meant HEAD^^"

  $ git reset HEAD@{4}

should give you what

  $ git reset HEAD^^

would have given had you not added the extra ^. :-)

#48 lore raw

Re: [PATCH] make commit message a little more consistent and conforting

In reply to Nicolas Pitre
Quoted 7 lines · Nicolas Pitre

So in short I do think there should be something shown after a successful commit, and including the commit sha1 doesn't hurt.
...
And it is true that diffstat can be quite large. I wouldn't mind the diffstat to be added to the commit message summary in the text editor though. And displaying it when -v is used makes also a lot of sense. But not by default please.

I agree with everything you said in your message, including that commit object name might help as a learning aid.

We could give something like this, though, if we wanted to:

	$ git commit
        4 files changed, 17 insertions(+), 10 deletions(-)
        mode change 100755 => 100644 test.sh
#204 lore raw

Re: Cleaning up git user-interface warts

In reply to Horst H. von Brand
Quoted 2 lines · Horst H. von Brand

If you make pushing into an empty repository work also, you fix the case of "create an empty repo for somebody, let them fill it up remotely later".

This seems to work just fine now. I do it all of the time.

#327 lore raw

Re: Cleaning up git user-interface warts

In reply to Marko Macek
Quoted 9 lines · Marko Macek

For people switching from CVS and SVN it would be much better if the index was hidden behind the scenes by using different defaults:

git-commit -a
git-status -a
git-diff HEAD

BTW, currently there's a minor bug: git-diff HEAD doesn't work before you make the first commit. Perhaps this should be special cased.

That's only a _bug_ in your implementation of the synonym for "svn diff" which blindly used "git diff HEAD".

"git diff HEAD" is not a synonym for "svn diff" when HEAD does not exist yet, because you are asking "please give me a diff between the tree in the HEAD commit and my working tree files through the index". So if you are doing "git-svnish-diff" Porcelain script, it should notice that HEAD does not exist yet and take an appropriate action. We do something similar in git-status; the porcelain notices and acts differently when HEAD is not there yet.

This "there is no HEAD yet" is not related to the index, but I am skeptical about trying to hide the index from the end user.

You can make some things map more naturally to systems like SVN and CVS than other things. For example, Nico's proposal to always use remote tracking branches and defaulting to use refs/remotes/ would be a way to match UI of pull/push to another existing system and that would work well (I am not agreeing to the change to make 'pull' not to do the merge which would break existing users -- I am just saying that the result would be self consistent). But things that have difference at the concept level, I suspect no clever mapping to hide the differences would work well.

The index is quite central to the way git works at the concept level, and I think it is doing disservice to the end user to try hiding it forever from them and failing to do so, rather than being honest and teaching them the concept upfront.

But me thinking so does not necessarily mean you are forbidden from trying. Your efforts may result in a system where the index is totally invisible and the end user never has to know about it.

#225 lore raw

Re: multi-project repos (was Re: Cleaning up git user-interface warts)

In reply to Shawn Pearce
Quoted 2 lines · Shawn Pearce
Quoted 1 line · Linus Torvalds

- "ORIG_HEAD" is very useful indeed, and it's the head _before_ a merge

...

Quoted 4 lines

Although if you have reflog enabled on your current branch there is a 1 character shorter syntax:

	gitk HEAD@{1}..

Yes, this was my exact thought when reading what Linus wrote. ORIG_HEAD might be fine and all, but it pales in functionality compared to what reflog provides.

I would very much like to see reflog getting first-class citizen support in git:

1. Be on by default

2. Get documented in all the right places, (much better than adding documentation for ORIG_HEAD in my opinion)

3. Tighter integration with branch manipulations. Do we already delete reflog when deleting a branch? We don't have a branch rename operation, but if we get one, renaming the reflog should go hand-in-hand, etc.

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFXeeB6JDdNq8qSWgRAnk0AJsFhwhOA0xXBFvpa2kT4fR43NUhPACdGnKG opL4mKlpCjpcJHQC+Eq568E=
=+gMu
-----END PGP SIGNATURE-----

#173 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 2 lines · Carl Worth

Anyway, now I've just gone and blown all my secret plans for changing git in ways to make it less intimidating for new users.

I just cannot do otherwise than cheer this with applause.

Even if I have a clear preference for GIT's _technology_, I still think that the HG user interface is more convivial. I even been thinking about writing something like an hg-like frontend to GIT from time to time just so that GIT could then be better compared to (and actually just used like) HG.

I still think that the GIT user interface sucks in many ways. The confusion between pull, fetch and push is still my favorite, along with the locale vs remote branch issue. Maybe we'll better handle the branch issue eventually, but it would be so much intuitive to split branch merging out of git-pull, and make git-pull be the same as git-fetch (maybe deprecating git-fetch in the process) so push and pull are really _only_ opposite of each other.

If the fetch+merge behavior (which I think should really be refered as pull+merge) is still desirable, then it should be called git-update and be no more than a single shell script line such as

	git_pull && git_merge"

This is really what most people expect from such a command name based on obvious historical reasons. The lack of any branch argument to git-pull and git-merge could be defined as using the first defined remote branch by default. But having git-pull performing merges is IMHO overloading the word and goes against most people's expectations.

#357 lore raw

Re: Cleaning up git user-interface warts

In reply to Nicolas Pitre
Quoted 11 lines · Nicolas Pitre
Quoted 9 lines · Junio C Hamano
Quoted 6 lines · Nicolas Pitre

But again I think it is important that the URL to use must be a per branch attribute i.e. attached to "default/master" and not just "default". This way someone could add all branches of interest into the "default" group even if they're from different repositories, and a simple get without any argument would get them all.

Quoted 8 lines
Quoted 5 lines

I think the "one group per one remote repository" model is a lot easier to explain. At least when I read your first "branch group" proposal that was I thought was going on and I found it quite sensible (and it maps more or less straightforwardly to the way existing .git/refs/remotes is set up by default).

I think one group per remote repo is how things should be by default too. But we should not limit it to that if possible.

Without the limitation, we risk name collisions when getting all branches from the remote repository (that is, including any new branches we previously didn't know about).

Signature · 1 line
Karl Hasselström, [email protected]
#262 lore raw

Re: Cleaning up git user-interface warts

In reply to Han-Wen Nienhuys
Quoted 11 lines · Han-Wen Nienhuys

FWIW, I regularly mess up with the differences between fetching, pulling and merging. In particular, having to do a two step process to get remote changes in,

git pull url-to-server master:master
..error message about not being a fast-forward..

git pull --update-head-ok url-to-server master:master
..still an error message about update not being a fast-forward..

(sigh)

Sigh indeed.

Why don't you do the simple and obvious

git pull url master

or "git pull url" if you already know the master is the branch you are interested in.

The more advanced form of using tracking branches are there and documentation talks about them for completeness but that does not mean you have to use it.

#344 lore raw

Re: Cleaning up git user-interface warts

In reply to Nicolas Pitre
Quoted 3 lines · Nicolas Pitre

I think "fetch" is sane. Its only problem is a missing symetrical counterpart verb, like "get" and "put".

If you're a dog owner, the obvious counterpart for "fetch" is "throw" ;)

I think "get" and "put" would be bad, just because of confusion with "sccs get" (ie it has that "get this file" connotations).

Maybe "fetch" and "push" aren't totally diametrically opposite, but really, I don't think they are that hard to understand either. We do have the BK legacy of "pull" implying a merge, and that's fairly fundamental.

It's also true that in a lot of usage schenarios, what people actually _use_ is "pull" and "push", and no, they aren't mirror images (since push will _not_ do the merge), but at the same time, from a _usage_ standpoint they really _are_ each others opposites.

You "pull" to get other peoples data into your branch (and once you've internalized local branches and the merge thing, you know what this means), and you "push" to push your changes out. It really _is_ the usage schenario, and using "opposite" words really _does_ make sense.

It's true that _technically_ "fetch" is the opposite of "push", but at the same time, that really is about technology, not about usage models. You normally wouldn't do a "git fetch + git push" pair. You _can_ do so, but it's not the natural way to work - unless you're just doing a mirror service.

#307 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 6 lines · Linus Torvalds

The form I use is actually a lot simpler (conceptually) than the "short" form.

When you do

git pull <reponame> <branchname>

Yes, that's what the user almost always wants. The UI problem here is that the conceptually simpler form is syntactically longer, (which means users aren't likely to find it).

So if we can just get <reponame> and <branchname> to default correctly, (based on the current branch name, and clone/fetch/pull history), then the conceptually simple form ends up syntactically simple as "git pull".

And I definitely don't have any problem with that. I'd love to be able to teach that kind of simple thing to new users.

Quoted 3 lines

driver tree, and because I'm always on that branch, what I do is

git pull origin modesetting

...

Quoted 2 lines

Well, as mentioned, I think even for non-developers, doing pulls with explicit branchnames is actually perfectly sane.

The behavior is sane, but having to always type the branch name specifically because it never changes... that's a user-interface bug.

This is a good example of the kind of thing I wanted to hit when starting this thread. I don't think there are any big conceptual changes needed in git to make it easier for new users. But there are little things that are problems that really should be fixed. Wouldn't it be great to have the following exchange:

User: How do I track on-going development in a branch?
Master: Use "git pull"

Rather than:

User: How do I track on-going development in a branch? Master Use "git pull origin <name-of-branch-you-are-already-on>"

?

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFXJlM6JDdNq8qSWgRAs6kAJwMUMlTsXDXtvGSwcmW1JhYIH6IrACdHr/S 9ufauZHpiUhk3f+Rt0DEeeo=
=WfsU
-----END PGP SIGNATURE-----

#46 lore raw

Re: [PATCH] make commit message a little more consistent and conforting

In reply to Andreas Ericsson
Quoted 6 lines · Andreas Ericsson
Quoted 5 lines · Shawn Pearce
Quoted 3 lines · Nicolas Pitre

It is nicer to let the user know when a commit succeeded all the time, not only the first time. Also the commit sha1 is much more useful than the tree sha1 in this case.

Quoted 7 lines
Quoted 5 lines

I agree the commit sha1 is more useful than the tree sha1, but I'm not really sure its useful to show the commit sha1 post commit. If you want to show something the diffstat like what git merge does is better.

diffstats can be huge though. I'd rather have those only with -v option.

But they are on by default for pull/merge, and disabled by -n.

They are on to tell you what you just got during the pull/merge. If we want commit to confirm it did something successfully, I think having it confirm what it committed by way of diffstat makes a lot of sense.

Unfortunately -n is taken to mean --no-verify by git-commit, so we probably cannot repurpose it to mean --no-summary, like it is for merge/pull.

#407 lore raw

Re: Cleaning up git user-interface warts

In reply to Jakub Narebski
Quoted 19 lines · Jakub Narebski
Quoted 17 lines · Nicolas Pitre
Quoted 5 lines · Junio C Hamano

Yes. The current "merge" started its life as Linus's porcelain (we did not have fetch and pull infrastructure back then) but quickly has become just a helper for pull to produce a merge commit. If anybody thinks its UI is good as a general end-user level command, there is a need for "head examination".

If you mean "git merge" it sure needs to be brought forward. It can't be clearer than:

git-merge the_other_branch

or

git-merge git://repo.com/time_machine.git

Quoted 7 lines
Quoted 1 line

to instantaneously understand what is going on.

You mean

git merge git://repo.com/time_machine.git#branch

don't you (perhaps with 'master' as default branch)?

perhaps with remote 'HEAD' as default branch?

#417 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 7 lines · Carl Worth

So, the fact that conflict resolution still requires the use of update-index would just be the next thing to fix. A name for a replacement to use there could be "git resolve <paths>", (since the old git-resolve is now officially deprecated). That's a name that matches what hg uses in this situation, (another option is "resolved" which is what stg uses, but I think verbs for commands work better in general).

Yes, "resolve" sounds better than "resolved". The latter is arguably more correct, since you're telling git that you have already resolved the file and not asking it to resolve it for you, but I still prefer "resolve".

Quoted 8 lines

And then, the next phase of my evil plan would be to introduce a -i option for git-commit making it commit the state in the index. Then git-commit with no options could work like "git-commit -a" does now, (with the additional protection of not committing any unmerged files---that is the new "git resolve" would be required before "git commit" would work after a conflict). Users who really, really like the current behavior of git-commit could use the new alias support to pass the new -i option in order to maintain compatible behavior.

Seems very sane. Default to simple behavior, and provide a switch to get more complicated behavior.

Quoted 2 lines

Then, the last thing I'd really like to fix is to allow a usage of "git merge <branch>" instead of the awkward "git pull . <branch>".

This should reduce newbie confusion a lot.

Signature · 1 line
Karl Hasselström, [email protected]
#185 lore raw

Re: Cleaning up git user-interface warts

In reply to Han-Wen Nienhuys

Han-Wen Nienhuys <[email protected]> writes:

You claim it is _an interface_ issue but it is not.

Quoted 5 lines

With GIT, this is what happens

[hanwen@haring y]$ git pull ../x
fatal: Needed a single revision Pulling into a black hole?

You asked it to fetch from the neighbour repository and merge it into your current branch which does not exist (I presume that you omitted to describe what you did in directory y/ and I am assuming you did "mkdir y && cd y && git initdb" and nothing else). You are pulling into a black hole.

Quoted 3 lines

[hanwen@haring y]$ git fetch ../x
...
[hanwen@haring y]$ git checkout

You fetched without telling it in which tracking branch to store what you fetched, and as a result your HEAD is not updated, so your current branch still does not exist. A failure from checking out nothingness is not an interface issue; expectation for it to work is a concept level issue.

Quoted 2 lines

[hanwen@haring y]$ git branch master
fatal: Needed a single revision

You are not at any commit yet and you try to create a branch?

Of course, the "right" (in some sense of the word) thing is to do "git clone x y" in the parent directory, without creating y upfront.

If you have an empty y to begin with, then you can do this:

	$ git fetch ../x :origin
        $ git reset --hard origin

which would mirror a part of what "git clone" would have done for you. It copies from the other repository, stores the tip in your tracking branch called "origin", and make your HEAD to be the same as origin. After these two commands, you would have two branches, origin and master, and you will be on master.

You can name 'origin' any way you want. You might want to name it 'x' to make it clear (to yourself) that it is used to track what will happen in the neighboring repository 'x'. Also, you would most likely be fetching and merging from the same ../x from now on, so it might be handy to set up the remotes for it:

	$ cat >.git/remotes/x <<EOF
        URL: ../x
        Pull: master:origin
	EOF

Then subsequent work of yours would be done on 'master' branch (you have only two branches, and origin is a tracking branch so you will never make commits on it, which means the above is a logical consequence), and from time to time you would sync with whoever is working in ../x

	$ git pull x

Here, 'x' is just a shorthand which looks up the URL: and Pull: line through .git/remotes/x. If your .git/remotes/ file was named origin (not x), you could even have written:

	$ git pull

because pull defaults to 'origin' (without any other configuration).

Quoted 4 lines
Quoted 2 lines

Let's face it, you could just alias "merge" to "pull", and it wouldn't really change ANYTHING.

I don't want ANYTHING to really change, I just want a sane interface to it.

I agree that you do not want to change anything. You just needed a bit of handholding, because you deviated from the cookbook usage, to correct your course.

#218 lore raw

Re: multi-project repos (was Re: Cleaning up git user-interface warts)

In reply to Johannes Schindelin
Quoted 6 lines · Johannes Schindelin
Quoted 2 lines · Linus Torvalds

For example, if you used one of the old-fashioned commit walkers, maybe we got the initial commit, but we may not have gotten the whole _chain_. See?

Huh? I am quite certain that FETCH_HEAD is not updated in that case. If it is, that's a bug.

It may be updated and then things may break _afterwards_. git-prune will happily blow anything referenced by FETCH_HEAD, it's not considered by the fsck-objects reachability analysis.

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
#354 lore raw

Re: Cleaning up git user-interface warts

In reply to Andy Parkins
Quoted 7 lines · Andy Parkins
Quoted 1 line · Nicolas Pitre

OK..... let's pretend this is my follow-up to your "If I were redoing

Personally, I agree with almost everything in this email. Except the implementation of point 3.

Quoted 8 lines
Quoted 1 line

3) remote branch handling should become more straight forward.

I was completely confused by this origin/master/clone stuff when I started with git. In hindsight, now I understand git a bit more, this is what I would have liked:

* Don't use the name "origin" twice. In fact, don't use it at all. In a
distributed system there is no such thing as a true origin.

I agree, sort of. Not because"origin" is ambigous as a name. But rather because there is a magic translation from "master" to "origin", and I think this is wrong to do that.

As mentioned elsewhere (and let's start using "get" instead of "pull" as suggested by Johannes), a "get" should probably always create a branch group even if it contains only one branch. This way the remote branch called "master" will still be called "master" locally, under the branch group used to represent the remote repository. And if a local name is not provided then let's just call it "default". This way, amongst the remote references, there would be a "default/master" that would be used when nothing else is provided by the user. So...

git get repo.com/time_machine.git

would create a local branch named "remotes/default/master" if the remote repo has only a master branch.

Then, a simple:

git merge

could be the same as

git merge default

which would be equivalent to

git merge default/master

Afterwards, because the "default" remote already exists, then:

git get

would be the same as

git get default

to get changes for all branches in the "default" remote branches, of which "master" might be the only one in the simple case.

But again I think it is important that the URL to use must be a per branch attribute i.e. attached to "default/master" and not just "default". This way someone could add all branches of interest into the "default" group even if they're from different repositories, and a simple get without any argument would get them all.

#308 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 5 lines · Carl Worth
Quoted 3 lines · Linus Torvalds

The form I use is actually a lot simpler (conceptually) than the "short" form.

Quoted 7 lines
Quoted 3 lines

When you do

git pull <reponame> <branchname>

Yes, that's what the user almost always wants. The UI problem here is that the conceptually simpler form is syntactically longer, (which means users aren't likely to find it).

Yeah.

And this is something I absolutely agree with. Our default branches for "pull" are horrible. You can "fix" it, but you can only fix it by adding _explicit_ branches to your .git/config file by hand, so I don't think that's actually a real fix at all. We should just fix the default (where even a "I don't know what branch you want" _error_ would be preferable over the current situation).

Along with the "git checkout <tag>" thing, I think these two things are definitely worth just fixing.

Quoted 2 lines

The behavior is sane, but having to always type the branch name specifically because it never changes... that's a user-interface bug.

Yeah. Each branch should

(a) have a "default source" initialized on the initial "clone"

(b) have a way to set the source afterwards

(c) error out if you do just a "git pull" or "git pull remotename" if there is no default branch for the current local branch for that remote.

We actually have (b) in a weak form right now ("weak" because it requires you to manually edit the config file: we've got the mechanism, but not a nice UI for it), but (a) and (c) are just broken.

And yeah, we should allow pulling into a branch that hasn't been initialized.

#338 lore raw

Re: Cleaning up git user-interface warts

In reply to Petr Baudis
Quoted 8 lines · Petr Baudis
Quoted 5 lines · Josef Weidendorfer

Often, I find myself doing "git branch" just to make sure that I am on "master", so that a following pull does not do a bogus merge.

Can we please disable this behavior, e.g. by allowing a fake first Pull line like "Pull: (not-for-merge)" to prohibit any merge?

Wait, if you don't want pull to merge, why do you pull and not fetch?

I am not really opposed to pull doing a merge. It only should work in a useful way: ie. only do the merge of updated origin branch when current branch is master (given "Pull: master:origin").

I want "git pull" being harmless if I find myself accidently on a branch != master. I always can do "git checkout master; git pull . origin" afterwards.

For this to work, I currently need to specify a "branch.<name>.merge" config for _every_ branch I have, as otherwise I get this bogus pull merge behavior. This is not needed if there was a way to configure no merge at all as default pull behavior.

I just noted that allowing such a config option would be kind of a working compromise for all the people which want
pull to be the opposite of push.

#91 lore raw
In reply to Junio C Hamano
Quoted 7 lines · Junio C Hamano
Quoted 5 lines · Jakub Narebski
Quoted 3 lines · Shawn Pearce
Quoted 1 line · Andy Parkins

* git-show-branch output is cryptic.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Agreed. I still don't know how to read its output. So I just don't use it. Ever. :-)

And the way it uses it's options is even more cryptic, and differs from other similar commands.

(Jakub, please do not drop people from cc: list; you were asked more than once).

The problem is that I'm not subscribed to git mailing list; I usually read it via GMane news<->mail interface, at
nntp://news.gmane.org/gmane.comp.version-control.git
First, in this interface I have only the last author and not the full
Cc: list. Second, when I reply _both_ via email (adding authors if necessary) and to news, people receiving my reply don't have (I guess) [email protected] in Cc: list, so sometimes the discussion drops off the list. Third, if I add git mailing list address when replying via mail, vger server blocks email from gmane stating

Technical details of permanent failure:
PERM_FAILURE: SMTP Error (state 9): 501 5.1.3 Path data: Had characters unsuitable for an rfc821-string

When email is sent _directly_ to me (i.e. I'm on Cc: list) I try to preserve Cc: list.

Quoted 7 lines

Ok, so what's the action you guys are proposing?

(1) show-branch input is cryptic and it does not do anything useful. Drop it.

(2) show-branch input is cryptic and I do not understand what it is trying to do. Document it better.

[...]

I'm just used to the way revisions are specified to other history
viewers: git-log (via git-rev-list), gitk, qgit. git-show-branch is a bit odd man out here. "git-show-branch ref1 ref2 ref3" is (without --more=n) like

  git rev-list ref1 ref2 ref3 --not $(git merge-base ref1 ref2 ref3)

Which is handy for git-show-branch, but odd. Perhaps we should add --xor option to git rev list for the above, i.e.

  git rev-list A...B        == 
    == git rev-list A B --not $(git merge-base A B)
  git rev-list --xor A B C  ==
    == git rev-list A B C --not $(git merge-base A B C)   
Quoted 4 lines

Personally, I find its input branch globbing very handy, and often wish that 'git branch' had a '--list' option that lists branches that match the glob pattern given on the command line, not just listing everything when no parameter is given.

It is odd (git branch not having --list with globbing) also because 'git tag' has globbing support.

Signature · 1 line
Jakub Narebski
#251 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 6 lines · Junio C Hamano
Quoted 3 lines · Michael K. Edwards

Presumably "git branch -D" should inspect everything under .git/remotes to see whether one or more Pull: lines need to be deleted along with the branch.

Quoted 6 lines

I am not sure what you mean. .git/remotes files do not describe any relationship between local branches (and that is where one of the problem raised in recent thread -- pull does not notice on which branch you are on and change its behaviour depending on it), so I do not think there is anything gained for "git branch -D" by going through them.

.git/remotes/foo does contain Pull: lines which indicate the local branch onto which to _fetch_ remote changes. It's the subsequent _merge_ that doesn't notice which branch you have checked out.

Cheers,

#272 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 10 lines · Linus Torvalds

I'm saying that even if you _never_ end up using "git fetch" ever again (because in practice you always want to do a "fetch + merge == pull"), people who teach others the concepts and usage of git should probably start by talking about "git fetch".

Then, when the user says (and he obviously will say this) "but I don't want to just fetch the other persons work into some local branch, I want to actually get it into _my_ branch", you say "Ahhah!" and talk about how "pull" is a shorthand for first fetching and then merging the result into the current branch.

Actually I believe it would make things even clearer if "merge" was taught at that point. Only when the user is comfortable with the separate notions of fetching and merging might the pull shorthand possibly be mentioned.

#176 lore raw

Re: Cleaning up git user-interface warts

In reply to Jakub Narebski
Quoted 2 lines · Jakub Narebski

The git interface refactoring should be I think the cause for git 2.0.0 release...

Good idea indeed.

#228 lore raw

Re: multi-project repos

In reply to Marko Macek
Quoted 11 lines · Marko Macek

Shawn Pearce wrote:
...

Quoted 7 lines

I have:

	git repo-config --global core.logAllRefUpdates true

especially since Junio fixed it to only create logs for heads and not tags. That way its on by default for me. But I think it should be on by default in the next version of Git.

Why is it not useful for tags for having logs?

When I make a tag that says "this is the v1.2.0 release", it is expected it won't change in the future, ever. I _can_ make mistake and tag a wrong commit under v1.2.0 name, in which case I may have to replace it with another corrected tag, but recoding that mistake does not really add value. So most of the time ref-log for a tag would contain only one entry per file, its creation, but that creation time is already recorded in the tag object itself anyway.

At times, it may be useful to have some floating tag that point at the "latest", or "today's", but that use is a minority. For these minority cases, you can manually create an empty file under .git/logs/ directory to record their updates.

The configuration mechanism only kicks in when there is no such existing file to prime the process, and not creating ref-log for tags by default is the sensible thing to do.

Quoted 3 lines

I also have a question:

Does git-fsck-objects/prune check the ref logs?

They deliberately ignore ref-log for the same reason lost-found does not drop found refs under .git/refs hierarchy.

This only matters if you somehow rewind an existing branch in order to lose part of its history, using "reset --hard HEAD~n" or "rebase". If the updates to your branch tips always build on top of the previous (either by commiting on top of the current, merging on top of the current, or fast-forwarding), and if you never rewind the branch, the commits recorded in the ref-log for the branch are always ancestors of the tip of the branch, so checking ref-log does not give you anything other than slowing the operation down.

However, if you rewind the tip of a branch, the story changes. Until the next "prune", objects reachable from the ref-log of the branch but not reachable from the tip of the branch are still available in your object store and in a pinch you can recover them, but after a "prune" they will be lost forever if they do not have any other references. So it might seem that they should be protected from pruning.

But if you did so, you can never remove cruft from your object store once you make a mistake. You can clean up your history by a reset and/or a rebase, and cleaning up to _lose_ part of the history was the reason you rewound the branch in the first place.

In other words, running 'prune' is a conscious act of saying "I know I am not in the middle of something; I thought over what I've done recently, salvaged necessary bits from what I discarded earlier, and there is nothing that need to be salvaged later anymore -- I have refs to what I need. Now go clean up the cruft from my object store".

#105 lore raw

PATCH 1/1 git-clone: use wildcard specification for tracking branches

In reply to Junio C Hamano

This stops enumerating the set of branches found on the remote side when a clone was made in the configuration file. Instead, a single entry that maps each remote branch to the local tracking branch for the remote under the same name is created.

Doing it this way not only shortens the configuration file, but automatically adjusts to a new branch added on the remote side after the clone is made.

Unfortunately this cannot be done for the traditional layout, where we always need to special case the 'master' to 'origin' mapping within the local branch namespace. But that is Ok; it will be going away before v1.5.0.

We could also lose the "primary branch" mapping at the beginning, but that has to wait until we implement the "forbid 'git pull' when we do not have branch.$current.merge for the current branch" policy we earlier discussed. That should also be in v1.5.0

---

Quoted 6 lines · Junio C Hamano

Things that need to be done to complete what have been merged to 'master' are:
...
- 'git-clone' probably should be updated to use wild-card in remote.origin.fetch, instead of listing all the branches it found when the clone was made.

 git-clone.sh |   47 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 30 insertions(+), 17 deletions(-)
git-clone.sh +30 -17
index 1f5d07a..422499a 100755
@@ -366,41 +366,54 @@ then
 		)
 	)
 
-	# Write out remotes/$origin file, and update our "$head_points_at".
+	# Write out remote.$origin config, and update our "$head_points_at".
 	case "$head_points_at" in
 	?*)
-		mkdir -p "$GIT_DIR/remotes" &&
+		# Local default branch
 		git-symbolic-ref HEAD "refs/heads/$head_points_at" &&
+
+		# Tracking branch for the primary branch at the remote.
 		case "$use_separate_remote" in
 		t)	origin_track="$remote_top/$head_points_at"
 			git-update-ref HEAD "$head_sha1" ;;
 		*)	origin_track="$remote_top/$origin"
 			git-update-ref "refs/heads/$origin" "$head_sha1" ;;
 		esac &&
+
+		# Upstream URL and the primary branch tracking
 		git-repo-config remote."$origin".url "$repo" &&
 		git-repo-config remote."$origin".fetch \
 			"refs/heads/$head_points_at:$origin_track" &&
-		(cd "$GIT_DIR/$remote_top" && find . -type f -print) |
-		while read dotslref
-		do
-			name=`expr "$dotslref" : './\(.*\)'`
-			if test "z$head_points_at" = "z$name"
-			then
-				continue
-			fi
-			if test "$use_separate_remote" = '' &&
-			   test "z$origin" = "z$name"
-			then
-				continue
-			fi
-			git-repo-config remote."$origin".fetch "refs/heads/${name}:$remote_top/${name}" '^$'
-		done &&
+
+		# Set up the mappings to track the remaining branches.
+		case "$use_separate_remote" in
+		t)
+			git-repo-config remote."$origin".fetch \
+				"refs/heads/*:$remote_top/*" '^$'
+			;;
+		*)
+			(cd "$GIT_DIR/$remote_top" && find . -type f -print) |
+			while read dotslref
+			do
+				name=`expr "$dotslref" : './\(.*\)'`
+				if test "z$head_points_at" = "z$name" ||
+					test "z$origin" = "z$name"
+				then
+					continue
+				fi
+				git-repo-config remote."$origin".fetch \
+				"refs/heads/${name}:$remote_top/${name}" '^$'
+			done
+			;;
+		esac &&
+
 		case "$use_separate_remote" in
 		t)
 			rm -f "refs/remotes/$origin/HEAD"
 			git-symbolic-ref "refs/remotes/$origin/HEAD" \
 				"refs/remotes/$origin/$head_points_at"
 		esac &&
+
 		git-repo-config branch."$head_points_at".remote "$origin" &&
 		git-repo-config branch."$head_points_at".merge "refs/heads/$head_points_at"
 	esac
#62 lore raw
In reply to Junio C Hamano
Quoted 2 lines

The 'can of worms' is that switching to an existing branch could fail with conflicts.

One fix for this would be the idea I've proposed to have a new flag for "git checkout" to 'stash' the dirty state in the current branch before switching.

Then, there wouldn't be a problem to implement "commit -b <anybranch>" on top of the stashing checkout.

I think the only real problem with the idea of having dirty changes stashed in a branch is that git already allows dirty changes to be carried while switching to a branch, (with or without -m). And doing both of those at once would lead to an ugly new conflict situation, (where _neither_ of the conflicted states exist as exposed tree objects). Even if there were no conflict, it would mingle two different sets of local modifications, and that could be unkind as it might be hard for the user to separate them if they didn't want them mingled.

If someone were to pursue this idea, I think it would be reasonable to just make that case an error, "Cannot carry local modifications when checking out a branch with stashed modifications." That message could even suggest the user use the stash option to leave the local modifications behind when doing the checkout.

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFgyel6JDdNq8qSWgRAkhSAJ9jrm+xHJKHNYpP/RgLXOprANCjXgCfQd5/ 7Kk3k/XhRBTBxyRTTI31lTQ=
=Wpg2
-----END PGP SIGNATURE-----

#198 lore raw

Re: Cleaning up git user-interface warts

In reply to Han-Wen Nienhuys
Quoted 11 lines · Han-Wen Nienhuys

Jakub Narebski escreveu:

Quoted 5 lines
Quoted 2 lines

- --pretty option with wholly uninformative options full, medium,
short, raw. It's not even documented what each option does.

And 'oneline' and undocumented 'email'. True, git lacks documentation (and this one of main complaints in git survey).

The recently posted patch documenting is an improvement, but why not add an option so you can do

Quoted 6 lines

--format 'committer %c\nauthor %a\n'

this catches all combinations, and is easier for scripting.

Right now, I have some scripts that have to munge log output with regular expressions to strip out the "author:" prefixes.

If we ever implemented this, I'd rather to separate what is now of format parsing in git-for-each-ref (although I'd like to make it more like rpm's --query-format argument, with %-n{header}, %[array] etc.) into separate module, and reuse it for git-log and friends --pretty/--format handling.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#12 lore raw
In reply to Nicolas Pitre
Quoted 8 lines · Nicolas Pitre

I'd say screw that. The solution should really be this patch:

environment.c +0 -0
index 84d870c..98275b2 100644

environment.c int use_legacy_headers = 1; · line 21

Quoted 8 lines
environment.c +1 -1
@@ -15,7 +15,7 @@ int use_legacy_headers = 1;
 int trust_executable_bit = 1;
 int assume_unchanged;
 int prefer_symlink_refs;
-int log_all_ref_updates;
+int log_all_ref_updates = 1;
 int warn_ambiguous_refs = 1;
 int repository_format_version;
 char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8";

That changes what the command does to existing repositories, which is somewhat impolite.

I am not opposed too much to an updated version of the tool that sets the configuration on by default for newly created repositories, though.

#358 lore raw

Re: Cleaning up git user-interface warts

In reply to Nicolas Pitre
Quoted 17 lines · Nicolas Pitre
Quoted 2 lines · Andy Parkins

* Don't use the name "origin" twice. In fact, don't use it at all. In
a distributed system there is no such thing as a true origin.

I agree, sort of. Not because"origin" is ambigous as a name. But rather because there is a magic translation from "master" to "origin", and I think this is wrong to do that.

As mentioned elsewhere (and let's start using "get" instead of "pull" as suggested by Johannes), a "get" should probably always create a branch group even if it contains only one branch. This way the remote branch called "master" will still be called "master" locally, under the branch group used to represent the remote repository. And if a local name is not provided then let's just call it "default". This way, amongst the remote references, there would be a "default/master" that would be used when nothing else is provided by the user. So...

Quoted 4 lines

git get repo.com/time_machine.git

would create a local branch named "remotes/default/master" if the remote repo has only a master branch.

Why not call it remotes/repo.com/time_machine.git/master and have a DEFAULT_ORIGIN that is a symref to it in the same way as HEAD is a symref to a local branch

Signature · 1 line
Alan Chandler
#178 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 7 lines · Junio C Hamano
Quoted 5 lines · Nicolas Pitre
Quoted 2 lines · Jakub Narebski

The git interface refactoring should be I think the cause for git 2.0.0 release...

Quoted 8 lines
Quoted 1 line

Good idea indeed.

We need to avoid user confusion, so making a command that used to do one thing to suddenly do something completely different is a no-no. However, I do not think it needs to wait for 2.0.0. We can start with a separate namespace (or even a separate "Improved git UI project") and introduce the "improved UI set" in 1.5.0 timeframe.

Dunno. I feel this is a bit overboard. Actually the naming problem is rather localized to one command, namely git-pull. In my opinion going with yet another namespace which would rather add to the confusion not clear it.

The best way to avoid user confusion is to remove the source of the confusion not let it live. In other words I think we should _fix_ git-pull instead of replacing it. People are already confused about it so simply fixing this command will have a net confusion reduction. Yet we're not talking about "suddenly doing something completely different" either. If git-pull doesn't merge automatically anymore it is easy to tell people to use git-merge after a pull.

"You pull the remote changes with 'git-pull upstream,, then you can merge them in your current branch with 'git-merge upstream'."

Isn't it much simpler to understand (and to teach) that way?

Also I don't think using git-upload and git-download is much better. This adds yet more commands that do almost the same as existing ones but with a different name which is yet not necessarily fully adequate. I for example would think that "download" is more like git-clone than git-fetch or git-pull.

Let's face it: HG got it right with pull and push and newbies have much less difficulty grokking it. We screwed it by not using the most intuitive semantic of a pull and locking the word "pull" away is not the better solution given all considerations. Why just not admit it and avoid being different than HG just for the sake of it?

#11 lore raw
In reply to Shawn Pearce
Quoted 5 lines · Shawn Pearce

But the problem raised is that there are many types of repositories, and not all should always have reflogs enabled, and its hard to tell which one should and which shouldn't by default, and its even worse to force it into a user's ~/.gitconfig as then repositories which should not have reflogs are getting them anyway.

Thank you for reminding me the reasons why.

However I'd argue that the lack of reflog data is much much worse than needlessly having it.

It is therefore much saner to disable it in the config and remove the unwanted reflog files than being sorry because it wasn't enabled when you would have needed it.

Quoted 4 lines

* Normal working repository (wants reflogs);
* Bare private (backup) repository (wants reflogs);
* Bare shared repository (probably doesn't want reflogs);
* Import generated repository (probably doesn't want reflogs);

And what would be the actual problem if reflog was enabled (i.e. was not explicitly disabled if enabled by default) in those last two cases?

Quoted 3 lines

Find a way to make git-init-db know the difference magically and you'll probably see a patch emerge quickly afterwards. But right now I don't think anyone really has a great solution to the problem.

I'd say screw that. The solution should really be this patch:

environment.c +1 -1
index 84d870c..98275b2 100644
@@ -15,7 +15,7 @@ int use_legacy_headers = 1;
 int trust_executable_bit = 1;
 int assume_unchanged;
 int prefer_symlink_refs;
-int log_all_ref_updates;
+int log_all_ref_updates = 1;
 int warn_ambiguous_refs = 1;
 int repository_format_version;
 char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8";
Quoted 3 lines

I know Junio wrote something on this not too long ago (and it was a good writeup too) but I can never find threads in gmane's archives, so I'm just going to leave that to someone else...

Well I must have missed it.

But unless there is real harm to have reflog enabled even when you don't need it I really think the default should be set to enabled.

#33 lore raw
In reply to Andy Parkins
Quoted 6 lines · Andy Parkins
Quoted 4 lines · Junio C Hamano

Correct but a bad example that does not demonstrate the real power of reflog. Andy's AGGGHHHHHH can be recovered with a simple:

Quoted 6 lines
Quoted 1 line
     $ git reset ORIG_HEAD

HAHA! I knew reading this mailing list would pay off.

It amazes me that there is always an answer. It's almost becoming a pantomime - I say "well git can't do this", and you say "oh yes it can".

And it is mentioned in git-reset(1), although:

* it would be nice to have example with ORIG_HEAD about how to recover from bad (wrong) git reset in EXAMPLES section.

* it would be nice to mention that the first example can
be now done with simply "edit; git commit -a --amend" instead of "git reset --soft HEAD^; edit; git commit -a -c ORIG_HEAD" (which can fail for merges).

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#81 lore raw
In reply to Johannes Schindelin
Quoted 3 lines · Johannes Schindelin

If I have the choice between a "doing something" bar and a Windows Explorer "14 seconds left" bar showing the same message for two minutes, I'd rather have a Mars bar ;-)

Gahhhhhhhhh! Oh how I hate that window.

On this we can wholeheartedly agree. Unfortunately it's not just windows; most applications that have a progress bar go like this:

0%, ..., 0%,..., 0%,.., 1 , 2, 3, 4, 5, 6, 33%, ..., 33%, ..., 33%, 35, 36, 85%, ..., 85%, ..., 85%, ..., 99%, 100%, ..., 100%, ... (yes, I'm completely finished, but still working), ... 100%.

I reckon, unless the window with a progress bar in it has an ETA, then the progress should be an ETA itself. If it's not going to monotonically increase, then the "percentage" is meaningless.

Andy

Signature · 1 line
Dr Andy Parkins, M Eng (hons), MIEE
#330 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 12 lines · Junio C Hamano
Quoted 9 lines · Marko Macek
Quoted 5 lines
Quoted 2 lines

BTW, currently there's a minor bug: git-diff HEAD doesn't work before you make the first commit. Perhaps this should be special cased.

That's only a _bug_ in your implementation of the synonym for "svn diff" which blindly used "git diff HEAD".

My "implementation" is taken from git-diff man page. It seems obvious that the situation before the first commit is just a special case if we consider git-diff to be Porcelain (which I do).

Quoted 6 lines

Yes, "git diff" is a Porcelain. No question about it.

I do not consider the current behaviour of "git diff HEAD" that complains instead of giving runs of "foo is a new file and no diff is available for it" a bug; you asked for diff from some commit but the commit you gave was bogus (does not exist yet).

git diff --root HEAD, perhaps?

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#288 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 13 lines · Linus Torvalds
Quoted 3 lines · Shawn Pearce

I've taught the same fetch first, then merge strategy. Nobody I know in meat-space pulls from a remote URL and merges in one shot;

Actually, with different people involved it's _much_ better to do it in one shot.

Why? Because doing a separate "fetch to local space" + "merge from local space" actually loses the information on what you are merging.

Quoted 7 lines

It's a lot more useful to have a merge message like

Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6

than one like

Merge branch 'for-linus'

That is an implementation detail that should be easily overcome once the notion of tracking branch with URL attribute is implemented. Then it will be really easy to notice whether the branch argument is a local branch or a tracking branch with remote reference.

#370 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano

Junio C Hamano escreveu:

Quoted 9 lines

I still think in the long run you would be better off giving separate names to Porcelains because I am sure you are going to find the next command to "fix", you cannot suddenly change the

"ig pull", you can dismiss all the broken git-x Porcelain-ish by saying "Oh, git-x user-level commands had inconsistent semantics and broken UI so do not use them anymore -- they are still there only to help old timers transition. The user level commands are now called ig-x and ig stands for improved git".

I think it would be good if there were different commands for porcelains. Not because fixing the current commands is too much work, but rather because it would clarify the structure of git. GIT is a 3-layer approach:

- index+workdir+refs over
- a DAG of commits over
- a file based SHA1 database

at first sight it is difficult to tell for each command on which layer it operates. It would help understanding GIT a lot if each layer got it's own command, eg.

git - sha1 content db
gic - sequences of commits
giu - UI

(Of course, these names are completely silly, but you get the idea)

Quoted 4 lines

I think get/put is much better than suddenly changing what pull means and is shorter to type than x-load; I am Ok with them. Although I think these words are tainted by SCCS, I do not think anybody cares.

they're also tainted by darcs, but that's a minor problem, I suppose.

#410 lore raw

Re: Cleaning up git user-interface warts

In reply to Jakub Narebski
Quoted 19 lines · Jakub Narebski
Quoted 17 lines · Nicolas Pitre
Quoted 5 lines · Junio C Hamano

Yes. The current "merge" started its life as Linus's porcelain (we did not have fetch and pull infrastructure back then) but quickly has become just a helper for pull to produce a merge commit. If anybody thinks its UI is good as a general end-user level command, there is a need for "head examination".

If you mean "git merge" it sure needs to be brought forward. It can't be clearer than:

git-merge the_other_branch

or

git-merge git://repo.com/time_machine.git

Quoted 7 lines
Quoted 1 line

to instantaneously understand what is going on.

You mean

git merge git://repo.com/time_machine.git#branch

don't you (perhaps with 'master' as default branch)?

Something like that. I wantee to enphasize on the "merge" command that should deal with, hey, merges.

I don't know if # is a good choice for branch indicator though.

#184 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds

Linus Torvalds escreveu:

Quoted 10 lines
Quoted 7 lines
Quoted 3 lines

- git itself has now done it that way for the last 18 months, and the
fact is, the people _complaining_ are a small subset of the people who actually use git on a daily basis and don't complain.

that's not a good argument; the set of git users is a small subset of those that looked at git, and dismissed it because they couldn't wrap their heads around it.

And I've said this again, and I'll say it once more: that has basically _nothing_ to do with whether you spell "pull" as "pull" or "merge".

Quoted 7 lines

The reason people have trouble wrapping their heads around git is because they have been braindamaged by CVS and SVN, and just don't understand the fairly fundamental new concepts and workflow.

I claim that those "annoying little issues" are totally made up by people
who had trouble wrapping their minds about git, and then make up reasons
that have nothing to do with reality for why that might be so.

Let me put this more personally: I continue to be bitten by stupid naming issues, and the myriad of little mostly non-orthogonal commands.
My head is doing just fine otherwise, and has no problems wrapping it around the core of GIT. I've also used Darcs for almost a year. Darcs, which is much less overwhelming.

This is not about CVS or SVN, so don't put them up as a strawman.
If you want to argue that my brain is warped, use other distributed VCs as an example.

The following

mkdir x y
cd x
hg init
echo hoi > bla
hg add
hg commit -m 'yes, I am also too stupid to refuse explicit empty
commit messages'
cd ../y
hg init
hg pull ../x

pretty much works the same in Darcs, bzr and mercurial.

With GIT, this is what happens

[hanwen@haring y]$ git pull ../x
fatal: Needed a single revision
Pulling into a black hole?

[hanwen@haring y]$ git fetch ../x
warning: no common commits
remote: Generating pack...
Done counting 3 objects.
Deltifying 3 objects.
100% (3/3) done
Total 3, wremote: ritten 3 (delta 0), reused 0 (delta 0) Unpacking 3 objects
100% (3/3) done

[hanwen@haring y]$ git checkout
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions
fatal: Not a valid object name HEAD

[hanwen@haring y]$ git branch master
fatal: Needed a single revision

at this point, I resort to adding a bogus commit and/or editing .git/HEAD by hand. I'm sure there is a saner way of doing it, but I still haven't found out what it is.

This might not be typical GIT use, but it does show the typical GIT user experience, at least mine.

If you want to have another example of how not to design a user-interface, try the above on Monotone.

Quoted 9 lines

That's totally different from then arguing about stupid naming issues.

Peopel seem to believe that changign a few names or doing other totally _minimal_ UI changes would somehow magically make things understandable. I claim that isn't so at all. The fact is, git is different from CVS and SVN, and git _has_ to be different from CVS and SVN. It has to be different because the whole model of CVS and SVN is simpyl fundamentally BROKEN.

Quoted 2 lines

It's worth trying to get those on board by fixing the annoying little issues that have popped up in this thread.

Let's face it, you could just alias "merge" to "pull", and it wouldn't really change ANYTHING.

I don't want ANYTHING to really change, I just want a sane interface to it.

Signature · 1 line
 Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen
#92 lore raw
In reply to Jakub Narebski
Quoted 8 lines · Jakub Narebski

I'm just used to the way revisions are specified to other history
viewers: git-log (via git-rev-list), gitk, qgit. git-show-branch is a bit odd man out here. "git-show-branch ref1 ref2 ref3" is (without --more=n) like

  git rev-list ref1 ref2 ref3 --not $(git merge-base ref1 ref2 ref3)

Which is handy for git-show-branch, but odd.

I hate to sound harsh, but...

Then you do not understand show-branch at all. Not having to say the "--not merge-base" part is NOT about being handy, but is the central part of what show-branch does. The command is about showing the commits that are on only some of the branches but not on others.

Other commands you listed above are all based on rev-list logic of painting commits in two colors (either UNINTERESTING or ~UNINTERESTING) and being able to combine the set using "A..B", "^A B", and "A B --not C" notations all make sense. All combinations work as set operation -- start from union of commits reachable from positive (i.e. not prefixed with ^) refs, and subtract set of commits reachable from any negative ref.

What show-branch does cannot be expressed with that two-color logic; it needs to use N colors for N input refs. After digging from the tips deep enough, you would find the common merge-base and after that point it is not interesting to show anything anymore, and that is how it stops output.

#324 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 11 lines · Linus Torvalds
Quoted 4 lines · Nicolas Pitre

But the fact is that HG (which has a growing crowd of happy campers, maybe even larger than the BK crowd now) did work with and got used to a sensible definition of what a "pull" is.

Guys, before you start thinking this way, the fact is, there's a lot of happy git users.

Quoted 8 lines

So the reason for using "git pull" is

- bk did it that way, and like it or not, bk was the first usable distributed system. hg is totally uninteresting.

- git itself has now done it that way for the last 18 months, and the fact is, the people _complaining_ are a small subset of the people who actually use git on a daily basis and don't complain.

Those arguments are somewhat flawed. If we stick to "BK did it that way and it was first", then following that logic we would also carry a lot of CVS baggage because "CVS did it that way, and it was the most successful of its kind". Still, we decided not to follow CVS nor BK in many ways already.

As for the fraction of people complaining being a small fraction of current GIT users: that is easily explainable by the fact that most people who would have grown the complainers group are simply not GIT users anymore since they were turned away by GIT's current user interface issues. The only complainers remaining are those who see value in the GIT technology but who would like to bring more intuitiveness to the GIT interface instead of going for the alternative technology. And those kind of people are always few.

Quoted 4 lines

So don't fall for the classic "second system syndrome". The classic reason for getting the second system wrong is because you focus on the issues people complain about, and not on the issues that work well (because the issues that work fine are obviously not getting a lot of attention).

The counter part of that is the possibility to fall for the "ivory tower syndrome" where seasoned GIT users feel they are well satisfied with what is currently available and unwilling to consider changes that would reduce the barrier to entry for new users... simply because they are so used to the way things work that they can't see why others have problems with it.

Quoted 2 lines

If you think "pull" is confusing, I can guarantee you that _changing_ the name is a hell of a lot more confusing.

Agreed. This is why the current discussion led to a proposition that allows for "pull" to remain as is but to have a "get" version that would be the alternate (saner) version.

Quoted 9 lines

In fact, I think a lot of the
confusion comes from cogito, not from git - the fact that cogito used different names and different syntax was a mistake, I think.

And that '#' for branch naming in particular was (and is) total braindamage. The native git branch naming convention is just fundamentally much better, and allows you to very naturally fetch multiple branches at once, in a way that cogito's syntax does not.

Quoted 4 lines

So when I see suggestions of using that brain-damaged cogito syntax as an "improvement", I know for a fact that somebody hasn't thought things through, and only thinks it's a better syntax beause of totally bogus reasons.

Do you have comments on my proposed syntax (that would be implemented with a git-get command) which I think doesn't really look like cogito?

Quoted 5 lines

I do agree that we probably could/should re-use the "git merge" name. The current "git merge" is an esoteric internal routine, and I doubt a lot of people use it as-is. I don't think it would be a mistake to make "git merge" basically be an alias for "git pull", for example, and I doubt many people would really even notice.

Agreed.

Quoted 2 lines

But the fact is, git isn't really that hard to work out, and the commands aren't that complicated.

I agree with you in general, except for the "pull" behavior which is really really odd. Maybe it made sense in the BK context, maybe it is fine _once_ you get used to it, but otherwise it is really overloaded.

Quoted 2 lines

But trying to rename "pull" (or the "git" name itself) is just going to cause more confusion than you fix.

Agreed again.

#240 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 6 lines · Linus Torvalds
Quoted 4 lines · Linus Torvalds

(And the real reason for that is simple: "git pull" simply wants to have something to _start_ with. It's not hugely fundamental, it's just how it was written).

Quoted 7 lines

Here's a very lightly tested patch that allows you to use "git pull" to populate an empty repository.

I'm not at all sure this is necessarily the nicest way to do it, but it's fairly straightforward.

Junio, what do you think?

Yeah, I talked about making "merge" treat missing HEAD as a special case of fast forward, but I like yours better. It is a lot cleaner and to the point.

#77 lore raw
In reply to Johannes Schindelin
Quoted 5 lines · Johannes Schindelin
Quoted 3 lines

* git-revert should be called git-invert. It doesn't remove a change from history, it simply applies another commit that does the opposite of whatever commit you are "revert"ing. That's an inversion.

No. An inversion is the _opposite_. Not an undo.

That's what I'm saying, we are applying the opposite of the given commit - that commit is being inverted and applied again. It most certainly isn't an undo, because the original commit still exists. It's not a reversion because "reversion" is to regress to a previous time or state. In that sense git-revert is not doing what it says on the tin. A revert would be to remove all the revisions from now until the specified commit - i.e. what git-reset now does.

(Note: I don't think git-reset should be renamed, as it's possible to use git-reset to move a branch forward as well as backward).

Quoted 3 lines

Besides, The fact that revert _adds_ to history is a nice way to document that you reverted that change. And you can even explain in the commit message, why you did it.

I'm not disputing that the /operation/ is useful, I'm arguing that it is incorrectly named.

Quoted 1 line

IMHO it is better for a newbie to see that _something_ is happening. A

I'm not arguing that we should show nothing; I'm arguing that the something we do show should be more clear than what is now shown. The choice is therefore "show something confusing" or "show something clear".

Quoted 1 line

newbie cannot, and does not want to, understand exactly what is going on.

"newbie" doesn't mean "idiot". Everybody wants to understand what is going on.

Quoted 4 lines

So, think of it as our response to Windows' non-progress-bar: when you start up Windows, there is a progress-bar, except that it does not show progress, but a Knight Rider like movement, only indicating that it does something.

Given the choice between nothing and a non-progress "doing something" bar, I would of course pick the "doing something" bar. However, given the choice between a "doing something" bar and a progress bar, I'd rather have the progress bar.

Andy

Signature · 1 line
Dr Andy Parkins, M Eng (hons), MIEE
#401 lore raw

Re: Cleaning up git user-interface warts

In reply to Jakub Narebski
Quoted 18 lines · Jakub Narebski
Quoted 6 lines · Carl Worth
Quoted 4 lines · Junio C Hamano

For another example, having a commit command to commit everything by default is disastrous for people who allow their workflows to often be interrupted.

Quoted 10 lines

Workflow-interruption is an important thing to support, but separating update-index and commit really doesn't address it nearly as much as I would like. The lack of really good workflow-interruption support has been one of my longest-running annoyances with git, (perhaps because I have a problem with trying to do too many things at once). Git can create and change branches fast enough that it really should be able to help me better with this. The only missing piece is being able to stash the dirty stuff on the current branch, to be able to come back to it later. I've talked a bit about what I would like in this area before, and I really just need to code it up.

Quoted 1 line

There is git-stash/git-unstash floating somewhere in the archive.

I find that a "git commit -a -m parked; git checkout -b ..." works well to stash my current stuff off. Then I just amend the commit when I come back to that branch.

The problem I just ran into today was "git checkout" doesn't double check the file stat data against the index before switching branches. If the file is unchanged between the two branches there's no error. So I switched branches with dirty files that I forgot to park on the old branch.

#384 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano

On Tuesday 14 November 2006 22:36, Junio C Hamano wrote:
...

Quoted 10 lines

And I agree with Pasky that fixing UI is hard unless you are willing to get rid of historical warts. Syntax of the command line arguments the current set of Porcelain-ish takes are sometimes just horrible. It may not be a bad idea to start building the fixed UI from scratch, using different prefix than "git" (say "gu" that stands for "git UI" or "gh" that stands for "git for humans").

Of course, it could even be "cg" ;-).

I have been away on business last week and have been following this thread from the archives. There is a comment I want to make about split of Porcelain and Plumbing namespaces that is not particularly an answer to this particular post, but it does seem an appropriate place to insert it.

I think there were three (historic) mistakes in the development of git
- to split git and cogito so that some of the commands started git and some
cg (aided and abetted by putting them in separate repositories).
- to try and make the distinction between plumbing and porcelein a line in
the sand (after all this is exactly why git and cg separated) when in practice it isn't that straight forward
- for cogito to (initially) not support the internal branches, but in fact
deal with them via cloned repositories

On the other hand, it was a good move to bring gitk and gitweb into the core repository.

These were not technical mistakes, but social ones.

Much of the discussion on UI warts doesn't exist in the cogito world (not that I use it at all anymore, despite its more user friendly interface - just because I didn't want to learn two parallel sets of commands and I prefered git's branch model so stuck with the slightly less friendly git command set) but if you look at any of the SCM comparison discussions that happen now, they are always comparing the core git with the other SCM, not git plus all its porcelains.

So I think it would be a mistake (which hopefully does seem to be the concensus reached in the list) to try and introduce new namespaces to the command set.

Signature · 1 line
Alan Chandler
#271 lore raw

Re: Cleaning up git user-interface warts

In reply to Michael K. Edwards
Quoted 6 lines · Michael K. Edwards
Quoted 3 lines

But I bet people don't teach it that way. They _start_ by teaching "pull". Right?

"git fetch" is certainly the right thing for the platform integration role

I'm saying that even if you _never_ end up using "git fetch" ever again (because in practice you always want to do a "fetch + merge == pull"), people who teach others the concepts and usage of git should probably start by talking about "git fetch".

Then, when the user says (and he obviously will say this) "but I don't want to just fetch the other persons work into some local branch, I want to actually get it into _my_ branch", you say "Ahhah!" and talk about how "pull" is a shorthand for first fetching and then merging the result into the current branch.

See? Once you explain "fetch" to somebody, I can pretty much guarantee that they'll explain "pull" to themselves without you having to even work at it. And then they'll probably happily use "pull" ever after, and never worry about fetch, but now they'll understand the _concepts_.

It's only if you start the other way around that "pull" vs "fetch" vs "push" become confusing. If you _start_ by explaining branches (and you might use "gitk --all" on a small project as a visualization tool), suddenly the concepts aren't all that complicated.

Sure, then you have to remember two words ("pull" vs "fetch"), but I'm pretty sure that the thing that makes people confused is not the words themselves, but their lack of understanding of the concepts behind them.

#214 lore raw

Re: multi-project repos (was Re: Cleaning up git user-interface warts)

In reply to Johannes Schindelin
Quoted 2 lines · Johannes Schindelin

- a terrible UI.

Why? We _do_ have the temporary branch. It's called FETCH_HEAD.

Quoted 3 lines

_Also_, git-pull not storing the fetched branches at least temporarily often annoyed me: the pull did not work, and the SHA1 was so far away I could not even scroll to it.

Again, why didn't you use FETCH_HEAD?

If the user doesn't give us a head to write to, we clearly MUST NOT write to any long-term branch. That would be a _horrible_ mistake.

So all your complaints seem totally misplaced. The UI is both usable and practical, and your complaint that git pull doesn't store the fetched branches is just NOT TRUE.

And your "solution" is obviously totally unusable. git ABSOLUTELY MUST NOT overwrite any existing branches unless explicitly told to do so by the user.

So I really don't see your point.

A lot of the complaints seem to not be about the interfaces, but about people not _understanding_ and knowing what the interfaces do. If you were confused about something (like not realizing that FETCH_HEAD is there and very much usable), how about sending in a patch to make FETCH_HEAD use clearer in whatever docs you looked at and didn't find it mentioned in.

Now, there is no question that some of the interfaces can get a bit "interesting" to use. For example, if you really don't want to re-fetch for some reason, FETCH_HEAD actually does contain enough information that you should be able to just re-do a failed merge, for example, including the message generation. But at that point it really _does_ get a bit complicated, and you end up doing something like

	git merge "$(git fmt-merge-msg < .git/FETCH_HEAD)" HEAD FETCH_HEAD

which should _work_, but I'm not going to claim that it's all that easy to understand.

(That said, read that one-liner a few times, and suddenly it doesn't seem _that_ complicated any more, now does it? You can probably even guess what it's really going to do, even if you don't know git all that well. It's not unreadable line noise, is it?)

Of course, if I had a merge that failed (the most common reason being that I had some uncommitted patch in a file that wanted to be updated by the merge), I'd never actually do the above one-liner. I'd just re-do the pull. But if networking was _really_ slow, and I _really_ cared, maybe I'd do the above.

(And no, I didn't actually test the above one-liner. Maybe it doesn't work for some reason. Somebody should check, just for fun).

#220 lore raw

Re: multi-project repos (was Re: Cleaning up git user-interface warts)

In reply to Linus Torvalds
Quoted 3 lines · Linus Torvalds

So in many ways, HEAD, FETCH_HEAD, MERGE_HEAD and ORIG_HEAD are more fundamental than any long-term branch has ever been, and maybe they should be taught first as such.

Older in git's history as it developed is not a good match for more fundamental in the concepts that git makes available today.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Again, why didn't you use FETCH_HEAD?

Because I am a Jar-HEAD?

Well, we clearly should document them better. Anybody?

I for one am totally unsatisfied with this approach.

Here's an operations I'd like to be able to do:

Given a (URL, branch) pair I'd like I'd like to be able to investigate that code, (say with the fancy new "read-only branch" concept we've been talking about).

What are my options for this operation? What might a new user's reaction to them be?

a) git fetch URL branch
git checkout FETCH_HEAD

This is really ugly. A name like "FETCH_HEAD" is something a user should really never have to type. It's hideously hard to type and has no natural discoverability. Yuck, yuck, yuck.

b) vi .git/remotes/something
git fetch something
git checkout branch

Also yuck. I hope it's obvious that having to edit a configuration for this simple operation is a non-starter.

c) git fetch URL branch:local-branch
git checkout local-branch

We're getting close to the desired functionality now, but the UI makes users cringe? "What's that : for?" Why do I need another name?" etc. Linus, you yourself said this is a form that users should generally avoid.

d) git fetch URL branch:branch
git checkout branch

One step closer. But there's still that goofy extra ':' and a doubled name in the first command. "Why is that there? Git sure is weird...".

What I think this operation should look like is:

git fetch URL branch
git checkout branch

And the fetch should just complain if there's a name clash. Or better, the fetch should tuck the fetched branch into its own URL-specific namespace and then the checkout command can kindly prompt if there is any ambiguity:

Which "branch" do you want?
local/branch
remote-url/branch

or whatever.

See? That's what reasonable UI should look like.

Please feel free to keep using vestiges like FETCH_HEAD as much as you like, but please don't recommend documenting them better as a solution for UI warts in git. (If you would only look at these warts closer, you'd see they have some lovely locks of hair on them.)

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFXQt16JDdNq8qSWgRAjDyAKCNKGkGuNXao4putztMxv3Y74BrJgCgjLxv LbWeV/v0bq7c/GAVlUToaUQ=
=65rH
-----END PGP SIGNATURE-----

#265 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 8 lines · Junio C Hamano
Quoted 6 lines · Han-Wen Nienhuys

Junio C Hamano escreveu:

Quoted 5 lines

...
Sigh indeed.

Why don't you do the simple and obvious

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

git pull url master

It is not all evident from the git-pull man-page that this is the obvious and most common usage.

In the git user poll a few months ago, many people recommended "everyday git" as a good cheat sheet, and indeed it does not talk anything about ...

Sorry, I must have been very grumpy mood when I wrote the message (cf. Pasky's utterance on #git a few days ago). What I wrote was a bit incoherent, so here is an attempt to clarify.

I should point out that the colon separated refspec pairs you can give to "pull" was designed with considerable thought; it is not a convenience hack that we give them to "pull" that "fetches and merges". Linus's and Michael's other messages in this thread may seem to be saying that using tracking branches is not a kosher way to use git, but I do not think that is a correct interpretation of their messages.

The workflow that does not use any tracking branches is the simplest and truly distributed way as Linus says. The command recommended in "everyday git" document:

git pull $url $branchname

is the most natural way to express it, and simplest variant that you do not have to say anything "colon" in it.

However that does not mean it is a bad practice to use tracking branches. Sometimes it is handy to be able to refer to what you fetched from the remote the last time, possibly which is what you merged into your branch if that last fetch was done via "git pull", so that you can later examine its history without your own development. For that purpose, you need to store what you fetched in your local refs/ namespace, and that is what tracking branches are.

The workflow that fetches to tracking branches and then merges within local repository as two separate steps loses the true origin information ("Merge branch 'foo'" vs "Merge branch 'foo' of git://git.bar.xz/foo.git"). That's the reason why not just "git fetch" but also "git pull" take the colon separated refspec pairs to direct git to update the tracking branches when "pull" happenes. The longhands are cumbersome to type all the time, and we have shorthand, both to store URL: and Pull: lines in remotes/ hierarchy, and also $branchname alone is a shorthand for saying "${branchname}:", meaning "do not use a tracking branch to store this".

So you have options to use or not to use tracking branches. After cloning we happen to default to track all remote branches with corresponding local tracking branches, but that is only because may people on the list wanted to make life easier to CVS migrants where following mostly static set of branches is the norm ("set" is the static part: I do not mean the branches stay still) and we wanted to make it easier for them.

#412 lore raw

Re: Cleaning up git user-interface warts

In reply to Petr Baudis
Quoted 6 lines · Petr Baudis

  (i) Clearly divided porcelain/plumbing interface, so that you can really isolate the two UI-wise; endless confusion reigns there now. Is git-update-index porcelain or plumbing? _You_ call git-merge a proper porcelain? From my perspective, git-update-ref is as plumbing as it gets, but it's classified as porcelain. Etc, etc. This would be by far the most important advantage.

The problem is that one man's plumbing is another man porcelain.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#352 lore raw

Re: Cleaning up git user-interface warts

In reply to Andreas Ericsson
Quoted 14 lines · Andreas Ericsson

Nicolas Pitre wrote:

[ axed a lot of stuff that I didn't fully grok ]

Quoted 9 lines

This becomes formalized as:

     git_pull [<URL>] [<local_name>]

If <URL> includes a branch name then <local_name> is a single branch name. If <URL> doesn't include any branch name then <local_name> becomes a local branch group name containing all branches in the remote repository.

Quoted 4 lines

I would change that so "local_name" is always a branch group name, but branch group names can be used as refs. That is,

git pull startrek.com/kirk.git:master kirk

I'd rather use Cogito (not gitweb) notation startrek.com/kirk.git#master This way we can change the name of local branch
startrek.com/kirk.git#master:kirk

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#342 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 4 lines · Junio C Hamano

You have to admit both pull and fetch have been contaminated with loaded meanings from different backgrounds. I was talking about killing the source of confusion in the longer term by removing fetch/pull/push, so we are still on the same page.

How was/is fetch contaminated?

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
#221 lore raw

Re: multi-project repos (was Re: Cleaning up git user-interface warts)

In reply to Linus Torvalds
Quoted 2 lines · Linus Torvalds
	git merge "$(git fmt-merge-msg < .git/FETCH_HEAD)" HEAD FETCH_HEAD

Btw, I'd like to claim that this is a _great_ user interface.

Yeah, it's different from other SCM's. I don't think you'd really want to script a merge like this in CVS, especially not using standard UNIX pipelines etc. But it's an example of how a lot of git operations - even the "high level ones" are pretty scriptable, using very basic and very simple standard UNIX shell scripting.

So even though I'd not actually _do_ the above one-liner, I think it's a great example of how git really works, and how scriptable it can be, without a lot of huge problems.

So considering that "FETCH_HEAD" works pretty much everywhere, and that you can also use the totally non-scripting approach of doing "standard" SCM things like

git diff ..FETCH_HEAD

or

gitk HEAD...FETCH_HEAD

to look at what got fetched (and in the latter case look at both the current HEAD _and_ FETCH_HEAD, and what was in one but not the other), I really think it's unfair to say that "git fetch" does not have a nice UI.

It's just that "git fetch" can be used two totally different ways:

- "git fetch" to get something temporary: use FETCH_HEAD, and do _not_ specify a destination branch

- "git fetch" as a way to update the branches you already have, by either using explicit branch specifiers (which would be unusual, but works), or by just having the branch relationships listed in your .git/remotes/ file or .git/config file.

both are actually very natural things to do.

What is probably _not_ that natural is to do the explicit branch specifier, ie

git fetch somerepo remotebranch:localbranch

which obviously works, but you wouldn't want to actually do this very often. Either you do something once (and use FETCH_HEAD, which is actually nicer than a real branch in some respects: it also tells you were you fetched _from_, and it can contain data on merging from _multiple_ branches), or you set up a "real translation" in your configuration files.

So I would say that the natural thing to do is:

- "git pull somerepo"

This will _also_ fetch all the branches you've said you want to track, of course.

- "git fetch somerepo somebranch"

Look at FETCH_HEAD, and be happy

- "git fetch somerepo"

This is kind of strange, but it can be useful if you are basically just mirroring another repo, and want to fetch all the branches you've said you want to track, but don't actually want to check them out.

while the "complicated" scenario like the following is something you should generally _avoid_, because it's just confusing and complex:

- "git fetch somerepo branch1:mybranch1 branch2:mybranch2"

This works, and I'm sure it's useful, and I've even used it (usually with just one branch, though), but let's face it - it's too damn complicated to be anything you want to do _normally_.

So git is definitely powerful, but I think some people have looked at the _complicated_ cases more than the simple cases (ie maybe people have looked too much at that last case, not realizing that there really isn't much reason to use it - and FETCH_HEAD is one big reason why you seldom need the complicated format).

#49 lore raw

Re: [PATCH] make commit message a little more consistent and conforting

In reply to Junio C Hamano
Quoted 10 lines · Junio C Hamano
Quoted 7 lines · Nicolas Pitre

So in short I do think there should be something shown after a successful commit, and including the commit sha1 doesn't hurt.
...
And it is true that diffstat can be quite large. I wouldn't mind the diffstat to be added to the commit message summary in the text editor though. And displaying it when -v is used makes also a lot of sense. But not by default please.

Quoted 8 lines

I agree with everything you said in your message, including that commit object name might help as a learning aid.

We could give something like this, though, if we wanted to:

	$ git commit
        4 files changed, 17 insertions(+), 10 deletions(-)
        mode change 100755 => 100644 test.sh

Actually that would really be nice to have all the time for the diff --summary output whenever --stat is not provided. Or maybe a --shortstat option.

What about this (on top of my previous patch):

---

Documentation/diff-options.txt +5 -0
index 9cdd171..f12082e 100644
@@ -21,6 +21,11 @@
 	deleted lines in decimal notation and pathname without
 	abbreviation, to make it more machine friendly.
 
+--shortstat::
+	Output only the last line of the --stat format containing total
+	number of modified files, as well as number of added and deleted
+	lines.
+
 --summary::
 	Output a condensed summary of extended header information
 	such as creations, renames and mode changes.
diff.c +37 -1
index 0b284b3..d754280 100644
@@ -809,6 +809,35 @@ static void show_stats(struct diffstat_t* data, struct diff_options *options)
 	       set, total_files, adds, dels, reset);
 }
 
+static void show_shortstats(struct diffstat_t* data)
+{
+	int i, adds = 0, dels = 0, total_files = data->nr;
+
+	if (data->nr == 0)
+		return;
+
+	for (i = 0; i < data->nr; i++) {
+		if (!data->files[i]->is_binary &&
+		    !data->files[i]->is_unmerged) {
+			int added = data->files[i]->added;
+			int deleted= data->files[i]->deleted;
+			if (!data->files[i]->is_renamed &&
+			    (added + deleted == 0)) {
+				total_files--;
+			} else {
+				adds += added;
+				dels += deleted;
+			}
+		}
+		free(data->files[i]->name);
+		free(data->files[i]);
+	}
+	free(data->files);
+
+	printf(" %d files changed, %d insertions(+), %d deletions(-)\n",
+	       total_files, adds, dels);
+}
+
 static void show_numstat(struct diffstat_t* data, struct diff_options *options)
 {
 	int i;
@@ -1767,6 +1796,7 @@ int diff_setup_done(struct diff_options *options)
 		options->output_format &= ~(DIFF_FORMAT_RAW |
 					    DIFF_FORMAT_NUMSTAT |
 					    DIFF_FORMAT_DIFFSTAT |
+					    DIFF_FORMAT_SHORTSTAT |
 					    DIFF_FORMAT_SUMMARY |
 					    DIFF_FORMAT_PATCH);
 
@@ -1777,6 +1807,7 @@ int diff_setup_done(struct diff_options *options)
 	if (options->output_format & (DIFF_FORMAT_PATCH |
 				      DIFF_FORMAT_NUMSTAT |
 				      DIFF_FORMAT_DIFFSTAT |
+				      DIFF_FORMAT_SHORTSTAT |
 				      DIFF_FORMAT_SUMMARY |
 				      DIFF_FORMAT_CHECKDIFF))
 		options->recursive = 1;
@@ -1868,6 +1899,9 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
 	else if (!strcmp(arg, "--numstat")) {
 		options->output_format |= DIFF_FORMAT_NUMSTAT;
 	}
+	else if (!strcmp(arg, "--shortstat")) {
+		options->output_format |= DIFF_FORMAT_SHORTSTAT;
+	}
 	else if (!strncmp(arg, "--stat", 6)) {
 		char *end;
 		int width = options->stat_width;
@@ -2642,7 +2676,7 @@ void diff_flush(struct diff_options *options)
 		separator++;
 	}
 
-	if (output_format & (DIFF_FORMAT_DIFFSTAT|DIFF_FORMAT_NUMSTAT)) {
+	if (output_format & (DIFF_FORMAT_DIFFSTAT|DIFF_FORMAT_SHORTSTAT|DIFF_FORMAT_NUMSTAT)) {
 		struct diffstat_t diffstat;
 
 		memset(&diffstat, 0, sizeof(struct diffstat_t));
@@ -2656,6 +2690,8 @@ void diff_flush(struct diff_options *options)
 			show_numstat(&diffstat, options);
 		if (output_format & DIFF_FORMAT_DIFFSTAT)
 			show_stats(&diffstat, options);
+		else if (output_format & DIFF_FORMAT_SHORTSTAT)
+			show_shortstats(&diffstat);
 		separator++;
 	}
 
diff.h +1 -0
index 101b2b5..eff4455 100644
@@ -29,6 +29,7 @@ typedef void (*diff_format_fn_t)(struct diff_queue_struct *q,
 #define DIFF_FORMAT_NUMSTAT	0x0004
 #define DIFF_FORMAT_SUMMARY	0x0008
 #define DIFF_FORMAT_PATCH	0x0010
+#define DIFF_FORMAT_SHORTSTAT	0x0020
 
 /* These override all above */
 #define DIFF_FORMAT_NAME	0x0100
git-commit.sh +1 -1
index 395bcd2..b9e49ea 100755
@@ -629,7 +629,7 @@ then
 	if test -z "$quiet"
 	then
 		echo "Created${initial_commit:+ initial} commit $commit"
-		git-diff-tree --summary --root --no-commit-id HEAD
+		git-diff-tree --shortstat --summary --root --no-commit-id HEAD
 	fi
 fi
#305 lore raw

Re: Cleaning up git user-interface warts

In reply to Theodore Tso
Quoted 26 lines · Theodore Tso
Quoted 1 line · Linus Torvalds

And yes, this is why you should NOT try to use the same naming as "hg", for example. Last I saw, hg still didn't even have local branches, To mercurial, repository == branch, and that's it. It was what I came from too, and I used to argue for using git that way too. I've since seen the error of my ways, and git is simply BETTER.

Actually, that's not true. Mercurial has local branches, just as git does. Some people choose not to *use* this particular feature, and use the BK style repository == branch, but that's mainly because it's conceptually easy for them, and a number of BK refugees are very happily using Hg.

It's probably because of the BK refugee population that after you do an hg pull, it will warn you that you need to do an "hg update" in order to merge the working directory up to the latest version that was just pulled --- and this change was made precisely because Hg supports local branches, and merging with the current branch isn't always the right thing, unlike with BK.

Quoted 1 line

And the concept of local branches is exactly _why_ you have to have separate "fetch" and "pull", but why you do _not_ need a separate "merge" (because "pull ." does it for you).

It's just that the semantics are different, and many developers have to use multiple DSCM's, depending on what project they happen to be developing on. So the reality is that there are people who have to use bzr, git, and hg, all at the same time. And while eventually newbies will figure out and remember that "git pull ." == "merge", the naming is simply confusing, that's all. (What does "pull" have to do with "merge"? It's not at all obvious.)

Quoted 2 lines

For somoene who uses git full-time, and to the exclusion of all other systems, I'm sure it's not a problem at all.

It seems we should, cheaply, be able to avoid a large part of the confusion by

* Mentioning git-fetch before git-pull in all documentation newborn gitizens are likely to come across. Most git-users aren't Linus, and for every successful project the maintainers are outnumbered 100 to 1 by the contributors. Those projects successful *because* maintainers are heavily outnumbered so we should make it easier for contributors by teaching them the right things from the start and possibly have a separate man-page for maintainer (git-{maintainer,developer} man-pages, anyone?).
* Creating "git update" which might possibly be an internal alias to "git pull", except that it should read .git/remotes/* by default unless a specific remotes-file is specified.
* Renaming git-merge to git-merge-driver
* Implementing a git-merge that actually does what its name implies, possibly by making it an internal alias to pull, but with these differences:
- It always merges into your current branch.
- It understands "git merge branch" as well as "git merge . branch".

This is just the very low-hanging fruit. If we take these steps and let things cool down a bit, it would probably be proper to take a fresh look at this in a couple of months.

Signature · 2 lines
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se
#239 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 4 lines · Linus Torvalds

(And the real reason for that is simple: "git pull" simply wants to have something to _start_ with. It's not hugely fundamental, it's just how it was written).

Here's a very lightly tested patch that allows you to use "git pull" to populate an empty repository.

I'm not at all sure this is necessarily the nicest way to do it, but it's fairly straightforward.

Junio, what do you think?

Linus

---

git-pull.sh +13 -2
index ed04e7d..7e5cee2 100755
@@ -44,10 +44,10 @@ do
 	shift
 done
 
-orig_head=$(git-rev-parse --verify HEAD) || die "Pulling into a black hole?"
+orig_head=$(git-rev-parse --verify HEAD 2> /dev/null)
 git-fetch --update-head-ok --reflog-action=pull "$@" || exit 1
 
-curr_head=$(git-rev-parse --verify HEAD)
+curr_head=$(git-rev-parse --verify HEAD 2> /dev/null)
 if test "$curr_head" != "$orig_head"
 then
 	# The fetch involved updating the current branch.
@@ -80,6 +80,11 @@ case "$merge_head" in
 	exit 0
 	;;
 ?*' '?*)
+	if test -z "$orig_head"
+	then
+		echo >&2 "Cannot merge multiple branches into empty head"
+		exit 1
+	fi
 	var=`git-repo-config --get pull.octopus`
 	if test -n "$var"
 	then
@@ -95,6 +100,12 @@ case "$merge_head" in
 	;;
 esac
 
+if test -z "$orig_head"
+then
+	git-update-ref -m "initial pull" HEAD $merge_head "" || exit 1
+	exit
+fi
+
 case "$strategy_args" in
 '')
#94 lore raw
In reply to Johannes Schindelin
Quoted 7 lines · Johannes Schindelin
Quoted 5 lines · Jakub Narebski
Quoted 2 lines · Junio C Hamano

(Jakub, please do not drop people from cc: list; you were asked more than once).

Quoted 6 lines
Quoted 1 line

The problem is that I'm not subscribed to git mailing list;

So subscribe. I am sure I lost quite some of your responses to my emails, _just_ because you happen to kill me from the Cc: list.

IOW if you expect answers, _please_ adher to net standards.

FWIW, I also read the list traffic through gmane news gateway.

I am subscribed and my mail filter drops the mails from the list into a dedicated mailbox, but that is purely for my own backup and I usually do not look at it otherwise.

#60 lore raw
In reply to Junio C Hamano
Quoted 3 lines · Junio C Hamano
Quoted 1 line

There truly is something wrong with me.

I did not mean it that way. I only took it as a sign that maybe

Don't worry; I've got thicker skin than that. I was simply amazed at my lack of comprehension ability. :-)

Quoted 7 lines
Quoted 2 lines

I'm not sure about your "commit -b"; is it wise to have /another/ way of making a branch? I mean - I'm clearly confused enough, have a heart :-)

I said "commit -b <newbranch>" and deliberately avoided saying "commit -b <anybranch>", because I did not want to open another can of worms while we are discussing so many good things already, and my head can hold only a handful topics at once.

Absolutely. I'd agree that only <newbranch> is worth even considering.

Quoted 3 lines

* While working on it, I find an obvious bug that I would not want to fix on the branch (the topic branch I am currently on is not about fixing that bug).

I find myself swayed by this. This is indeed something that happens to me a lot. In certain circumstances I've been defeated by git because I couldn't switch to the other branch to make that quick commit because my local changes conflicted with that other branch. The solution I use is to commit the bug fix in the wrong branch, finish my current on-topic commit then rebase/reset/etc to put everything where it should be.

Quoted 3 lines

I do agree that it adds one more way to do the same thing and would make the documentation noisier, potentially adding more to the confusion. So let's not go there.

Yep. Although you've persuaded me with the above example, I think this is the correct path. It's not wise to add every bell and whistle just because we can. As long as there is /a/ way to achieve every task, that's good enough, we don't need every way to achieve every task. We might even argue that git's flexibility is what makes it harder to learn. It's similar to UNIX in that respect - hard to learn, easy to use.

Andy

Signature · 1 line
Dr Andy Parkins, M Eng (hons), MIEE
#219 lore raw

Re: multi-project repos (was Re: Cleaning up git user-interface warts)

In reply to Petr Baudis

Hi,

Quoted 11 lines · Petr Baudis
Quoted 6 lines · Johannes Schindelin
Quoted 2 lines · Linus Torvalds

For example, if you used one of the old-fashioned commit walkers, maybe we got the initial commit, but we may not have gotten the whole _chain_. See?

Huh? I am quite certain that FETCH_HEAD is not updated in that case. If it is, that's a bug.

It may be updated and then things may break _afterwards_. git-prune will happily blow anything referenced by FETCH_HEAD, it's not considered by the fsck-objects reachability analysis.

This actually underlines my point: FETCH_HEAD is no _real_ branch, not even a temporary one. If it was, git-prune would not lose the related objects.

Ciao,
Dscho

#386 lore raw

Re: Cleaning up git user-interface warts

In reply to Petr Baudis

Petr Baudis escreveu:

Quoted 3 lines

(vi) Coding issues. This is probably very subjective, but a blocker for me. I have no issues about C here, but about the shell part of Git. Well, how to say it... It's just fundamentally incompatible with me. I

(on a tangent)

I concur, but probably in a different way.

some 10 years ago I vowed never to write perl code again, and some 5 years ago, I made the same pledge for shell scripts, because I spent inordinate amounts of time debugging them.

When I see the GIT shell scripts, my hands start to itch to make a nice object oriented Python wrapper for it.

#366 lore raw

Re: Cleaning up git user-interface warts

In reply to Nicolas Pitre
Quoted 3 lines · Nicolas Pitre

What is the point of hiding tracking branches? Why just not making them easier to use instead? There are currently so many ways to specify remote branches that even I get confused.

Ok, I think in essence we are saying the same thing except I went overboard by suggsting to extend sha1_name to also look at .git/remotes/$name which is not necessary, because we already have the .git/refs/remotes/%s/HEAD magic there. Consider the suggestion of "upstream#next" syntax retracted, please.

Quoted 1 line

1) make "git init" an alias for "git init-db".

Or even better, have "gh init".

Quoted 1 line

2) "pull" and "push" should be symmetrical operations

I think that makes a lot of sense to have "gh pull" and "gh push" as symmetric operations, and make "gh merge" do the fast-forward and 3-way merge magic done in the current "git pull". These three words would have a lot saner meaning.

Quoted 5 lines

3) remote branch handling should become more straight forward.

OK! Now that we've solved the pull issue and that everybody agrees with me (how can't you all agree with me anyway) let's have a look at remote branches.

I would probably prefer making the default namespace under .git/refs/remotes/remote-name for the tracking branches this proposal creates, but other than that I agree with the general direction this proposal is taking us, including branch groups. We have .git/refs/remotes/%s/HEAD magic so I do not think we even need to treat one branch repository any specially as you suggsted.

The reason I am suggsting "gh" instead of "git" is primarily to deal with stale documentation people would find googling. I can easily see people get confused by reading "pull = fetch + merge" from either mailing list archive or Git cheat sheet various projects seem to have developed.

It does not mean we need to redo _all_ UI. I think most of the archaeology commands have sane UI so during the transition period (git 1.99) we can have "git log" and "gh log" which are one and the same program, and perhaps git 2.0 can be shipped with clear distinction between plumbing (i.e. git-update-index and friends) and porcelain (e.g. "gh pull" that only fetches but with the user friendliness you outlined here), with backward compatibility wart to help old timers (e.g. "git pull" that still does "git fetch" followed by "git merge").

#113 lore raw
In reply to Junio C Hamano
Quoted 28 lines
Quoted 28 lines

I am hoping that we can start a stabilization cycle for v1.5.0 based on what we have in 'master'. The theme is "usability and teachability".

Things that need to be done to complete what have been merged to 'master' are:

- 'git-rm' needs to be fixed up as Linus outlined; remove working tree file and index entry but have a sanity check to make sure the working tree file match the index and HEAD.

- 'git-branch' may need to be taught about renaming the matching per-branch configuration at the same time.

- 'git-merge-file' needs to be documented and linked from git.txt.

- 'git-clone' probably should be updated to use wild-card in remote.origin.fetch, instead of listing all the branches it found when the clone was made.

- tutorials and other Porcelain documentation pages need to be updated to match the updated 'git-add' and 'git-rm' (to be updated), and their description should be made much less about implementation; they should talk in terms of end-user workflows. I will send a draft for 'git diff' out later, but somebody needs a full sweep on Porcelain-ish documentation.

Quoted 3 lines
Quoted 3 lines

- 'git diff --index' patch should be reverted (already done in 'next'), although we may have to come up with a better wording for --cached.

I'm done with 2 out of the above six ("diff --index", and "clone") and a bit of the "documentation" item so far, and will go to bed now. Any takers for the remaining tasks while I'll be sleeping ;-)?

#206 lore raw

Re: Cleaning up git user-interface warts

In reply to Han-Wen Nienhuys
Quoted 4 lines · Han-Wen Nienhuys

This is not about CVS or SVN, so don't put them up as a strawman. If you want to argue that my brain is warped, use other distributed VCs as an example.

Your example has nothing at all to do with "pull" vs "fetch", though.

Your example is about something totally _different_, namely that under git, "git init-db" is _only_ for creating a _new_ project.

Quoted 12 lines

The following

mkdir x y
cd x
hg init
echo hoi > bla
hg add
hg commit -m 'yes, I am also too stupid to refuse explicit empty commit messages' cd ../y
hg init
hg pull ../x

Quoted 5 lines

pretty much works the same in Darcs, bzr and mercurial.

With GIT, this is what happens

[hanwen@haring y]$ git pull ../x

Bzzt. This is where you went wrong, and you blamed "pull".

The way you do this in git is to NOT do "git init". Instead, you replace all the

	mkdir y
	cd ../y
	hg init
	hg pull ../x

with a simple

git clone x y

and YOU ARE DONE.

Now, we could certainly _make_ "git pull" work on an empty git project, but that has _nothing_ to do with what people have been talking about.

In fact, the fact that "git fetch" kind of works is not exactly accidental (because "git fetch" _is_ meant to add new local branches too), but all the problems you have with it are due to the SAME issue. You started without any branch at all, because you started with an empty git repo, and you're simply not _supposed_ to do that.

So current rule (and this is not new, it's always been true): the ONLY time you use "git init-db" is when you are going to start a totally new project. Never _ever_ otherwise. If you want to track another project, use "git clone".

Quoted 2 lines

This might not be typical GIT use, but it does show the typical GIT user experience, at least mine.

It's not that it isn't typical, it's that you are using the wrong model. Maybe it's not well documented, I can easily give you that, but ALL your problems come from that fundamental starting point: you shouldn't have used "git init-db" in the first place.

Somebody want to document it?

Alternatively, we certainly _could_ make "git pull" just accept an empty git repo, and make it basically create the current branch.

(And we probably should improve the error messahe)

Quoted 1 line

I don't want ANYTHING to really change, I just want a sane interface to it.

The sane interface _exists_. It's called "git clone".

#32 lore raw
In reply to Junio C Hamano
Quoted 5 lines · Junio C Hamano

Correct but a bad example that does not demonstrate the real power of reflog. Andy's AGGGHHHHHH can be recovered with a simple:

	$ git reset ORIG_HEAD

HAHA! I knew reading this mailing list would pay off.

It amazes me that there is always an answer. It's almost becoming a pantomime - I say "well git can't do this", and you say "oh yes it can".

Andy

Signature · 1 line
Dr Andrew Parkins, M Eng (Hons), AMIEE
#244 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 3 lines · Linus Torvalds

So the way you'd normally set up a single repo that contains multiple other existing repositories is to basically start with one ("git clone") and then add the other branches and "git fetch" them.

For that we'd also need a way for clone to be able to fetch just a single branch, and not all of them as well.

There is some clone vs. fetch asymmetry here that has annoyed me for a while, and that I don't think has been mentioned in this thread yet. Namely:

clone: can only be executed once, fetches all branches, "remembers"
URLs for later simplified use

fetch: can be executed many times, fetches only named branches,
doesn't remember anything for later

I've often been in the situation where I cloned a long time ago, but I'd like to be able to fetch everything that I would get if I were to start a fresh clone.

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFXKpf6JDdNq8qSWgRAp4VAJ9O7f4PPkLjxrV5HlExEWLplANeSwCfZTLk RL2xlSElw88APwlQ2lvJBVw=
=8PX8
-----END PGP SIGNATURE-----

#101 lore raw
In reply to Andy Parkins
Quoted 4 lines · Andy Parkins

I think the problem in most cases is that git outputs _too much_. Also, I'm not imagining that "git-add ." would list every file that it added - who is that going to help? It should say "added X files to index" or similar. You surely can't be arguing that that slows down your expert workflow?

git-commit-tree's "committing initial tree" and git-init-db's "defaulting to local storage area" are both probably too verbose and should just get removed.

The progress meters in git-pack-objects that you see during clone, repack, fetch and push at least keep the user amused. I do read the output of repack every so often, but in general I don't care about the output of clone, fetch or push - all I care about is that my objects got to the remote system and were accepted, or not. Which means that at least for me the output could be reduced down to just the bandwidth transfer meter, for really slow links.

But I'm not sure that git-add should output anything. Last I checked the 'mv' command in Linux doesn't say "Move 5 files" when I move 5 files into a directory. Likewise I don't think that knowing that 6781 files were added is useful, what if it should have really been 6782 files? I'm unlikely to know, care, or realize it.

Your niggle list (is that what you called it) has been useful fodder for discussion. I'm glad you took the time to write it up, and to argue it so well on the list. There's a number of items on it that I'd like to see happen too; enough that I may code some of them if nobody beats me to it.

#321 lore raw

Re: Cleaning up git user-interface warts

In reply to Theodore Tso

The car analogy is excellently clear.

Quoted 3 lines

they need more than the "stupid simple" git usage, but if they don't need the extreme power of git, Hg is simpler for people to learn how to use.

As a 80%-hg/20%-git user, I'm curious what features of git you had in mind, so I know where to look as I wander up the git learning curve.

My experience with the git user interface, for what it's worth, is that I never quite get the conceptual model crystal clear enough in my head. So it won't stay for long enough for me to progress up the learning curve and retain the gains. I move up a bit, but the gain soon evaporates and I backslide, and then just hack my way through it.

I found hg's conceptual model very easy to learn, almost as if I don't have to remember anything. Maybe that simplicity comes at a price, whence my question at the start about the extreme-power features of git.

-Sanjoy

`Never underestimate the evil of which men of power are capable.'

#389 lore raw

Re: Cleaning up git user-interface warts

In reply to Petr Baudis

Petr Baudis <[email protected]> writes:

You already said this kind of details are subjective so I'd omit the usual "I would think" and answer them without worrying about a big style flamewar. People, please be civil ;-).

Quoted 1 line

What about [ instead of test?

[ ] is not more readable.

Quoted 6 lines

if foo; then

instead of

if foo
then

Having "then" on the beginning of line is much more readable.

Quoted 8 lines

Am I the only one who hates

case "$log_given" in
tt*)

        die "Only one of -c/-C/-F can be used." ;;
*tm*|*mt*)
        die "Option -m cannot be combined with -c/-C/-F." ;;

esac

This is much more readable without "case". "abandon the old rule that told us to avoid if when case would do" applies. Although it is about multiple possibility switch (so a case can be made that "case" is appropriate here), we should reduce the use of "case" to cases like the outermost big "case" you find in git-merge-one-file-script.

Quoted 3 lines

It would be really great if Git would have something alike the Cogito's optparse infrastructure. I'm not sure if you can implement it in Bourne sh with reasonable performance, though...

getopt(1) is fine, unless somebody screams that it is not available on his platform.

#183 lore raw

Re: Cleaning up git user-interface warts

In reply to Han-Wen Nienhuys
Quoted 9 lines · Han-Wen Nienhuys

Linus Torvalds escreveu:

Quoted 3 lines

- git itself has now done it that way for the last 18 months, and the
fact is, the people _complaining_ are a small subset of the people who actually use git on a daily basis and don't complain.

that's not a good argument; the set of git users is a small subset of those that looked at git, and dismissed it because they couldn't wrap their heads around it.

And I've said this again, and I'll say it once more: that has basically _nothing_ to do with whether you spell "pull" as "pull" or "merge".

The reason people have trouble wrapping their heads around git is because they have been braindamaged by CVS and SVN, and just don't understand the fairly fundamental new concepts and workflow.

That's totally different from then arguing about stupid naming issues.

Peopel seem to believe that changign a few names or doing other totally _minimal_ UI changes would somehow magically make things understandable. I claim that isn't so at all. The fact is, git is different from CVS and SVN, and git _has_ to be different from CVS and SVN. It has to be different because the whole model of CVS and SVN is simpyl fundamentally BROKEN.

Quoted 2 lines

It's worth trying to get those on board by fixing the annoying little issues that have popped up in this thread.

I claim that those "annoying little issues" are totally made up by people who had trouble wrapping their minds about git, and then make up reasons that have nothing to do with reality for why that might be so.

Let's face it, you could just alias "merge" to "pull", and it wouldn't really change ANYTHING. You'd still have to learn the new model.

#84 lore raw
In reply to Andy Parkins
Quoted 8 lines · Andy Parkins

I wonder if the number of objects is a reasonable measure of progress. Let's say we're transferring 100,000 objects. Let's also say that the average size of objects is 100 bytes. Let's finally say that the object sizes are evenly distributed throughout the 100,000 objects. This would mean that the first 1,000 objects are just as representative as the last 1,000 objects; or any other randomly chosen 1,000 objects. In which case, the size of the first thousand objects would be approximately one hundredth the size of the total transfer. Volia: an estimate of the total size of the transfer.

Ah, but much like those stock scam emails, "prior performance does not predict future results"... The size of objects in the pack tends to be small up front (commits/trees) and larger in the back (blobs). The size distribution probably also gets more erratic near the back as the blob sizes may not follow a nice distribution.

E.g. I have a repository with a blob that is 23 MiB. But I also have some 5 MiB blobs, and then a very large number of relatively small blobs. That 23 MiB blob really gums up any estimate.

But as you state, its easy to refine it over time, and the closer we get to the end the more likely it is to be correct. Unless its that 23 MiB blob. As it takes up about 85% of that repository's pack.

#292 lore raw

Re: Cleaning up git user-interface warts

In reply to Michael K. Edwards
Quoted 25 lines · Michael K. Edwards
Quoted 8 lines · Linus Torvalds

Actually, with different people involved it's _much_ better to do it in one shot.

Why? Because doing a separate "fetch to local space" + "merge from local space" actually loses the information on what you are merging.

It's a lot more useful to have a merge message like

Quoted 8 lines

Merge branch 'for-linus' of
git://one.firstfloor.org/home/andi/git/linux-2.6

than one like

Merge branch 'for-linus'

which is what you get if you fetched it first.

Full ACK from a platform integrator's perspective. Local merge is great for trial runs but the history in a persistent branch should be as self-contained and self-explanatory as possible. It shouldn't depend on what I name local tracking branches, which are just a convenience so that I can still do trial runs when my connectivity is broken.

[...]

Quoted 6 lines

Coming from me, this is all rather theoretical, as I haven't been using this particular tool for the purpose long enough to have an independent opinion. But for what it's worth, the workflow Linus describes isn't just for the guy at the top of the pyramid.

I think it's unfortunate that git was originally written by Linus, since he so obviously is "the guy at the top of the pyramid" in many more senses than just "Linus said this and that patch was OK to commit", since git was designed to work like king Arthur's round table; "Linus is in the same circle as me, so ofcourse we help each other out".

All suggestions I've been reading about tracking branches, separate-remotes and whatnot have their merit. If any of it gets implemented, I'd still like to be able to do one-shot pulls from remote repos *without* creating specific tracking branches for it. It's extremely useful to fetch other peoples topic-branches into my own "master" (or topic-branch) when I trust their changes to be good. Please consider that when you're hacking away on whatever changes to do.

Signature · 2 lines
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se
#59 lore raw
In reply to Andy Parkins
Quoted 7 lines · Andy Parkins
Quoted 3 lines · Junio C Hamano

This is interesting. You said "commit -b", were pointed out that you were talking about "checkout -b", and just after saying "yup, that is right, I was", you again say "commit -b".

There truly is something wrong with me.

I did not mean it that way. I only took it as a sign that maybe "first create and switch to a branch and then work and commit there, in separate steps", which is how git encourages things to be done, does not match people's mental model so well.

Quoted 2 lines

I'm not sure about your "commit -b"; is it wise to have /another/ way of making a branch? I mean - I'm clearly confused enough, have a heart :-)

I said "commit -b <newbranch>" and deliberately avoided saying "commit -b <anybranch>", because I did not want to open another can of worms while we are discussing so many good things already, and my head can hold only a handful topics at once.

But people on the list (and #git channel) sometimes wished an easy way to help the following workflow.

* I am in the middle of working on a new feature. As a good git user, I am on a topic branch dedicated for that purpose.

* While working on it, I find an obvious bug that I would not want to fix on the branch (the topic branch I am currently on is not about fixing that bug).

* But I fix it in the working tree anyway, because otherwise I would forget. It happens to be in an isolated file that my current topic does not need to modify (say, I was looking at a function in that file that my new feature needs to call and I wanted to study its calling convention. And I found a typo in the comment near the function).

* The fix does not belong to the current topic, but can go to the 'master' branch straight. It's a fix in the comment that cannot possibly break things, and I can/will test it later anyway.

* So with the existing set of tools, I would go there, commit and then come back:

	$ git checkout [-m] master
        $ git commit -m 'fix typo in that-file' that-file
        $ git checkout [-m] topic

But it might be faster to say:

   	$ git commit -b master -m 'fix typo in that-file' that-file

to make a commit on the other branch and come back immediately afterwards.

* In the same situation, when the 'master' is closed for some administrative reason (e.g. "deep freeze before a release and strict bugfixes and nothing else are allowed"), I would create a new 'typofix' branch and do the same. I can rebase it later on 'master' when it reopens.

	$ git commit -b typofix -m 'fix typo in that-file' that-file

... much later when master reopens ...
$ git rebase --onto master topic typofix

It's just a possible typesaver, but I am likely not using it myself (my fingers are already trained to do the three command sequence dance).

I do agree that it adds one more way to do the same thing and would make the documentation noisier, potentially adding more to the confusion. So let's not go there.

#398 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 5 lines · Carl Worth
Quoted 1 line · Petr Baudis

Hmm, did they (not) consider Cogito? They wouldn't have those issues.

I didn't ask.

Quoted 16 lines

Frankly, I don't see a lot of value in the git/cogito split right now.
...
It's great that git is written in a script-friendly way so that new interfaces can be built on top of it. And I think the benefits of new user interfaces are clear when they work in fundamentally different ways, (say, being operated through a GUI). But where git and cogito are both command-line utilities and have the same basic functionality,
...
There are some things that cogito does that git does not that I would like to have in git.
...
I don't see any defining difference that justifies cogito's existence ("hide the index" maybe? let's just hide it a tiny bit more in git). And I would like to help work to get the remaining good stuff that has been proven in cogito---to get it pushed down into git itself.

I am of two minds here.

I do not think the Porcelain-ish UI that is shipped with git should be taken with the same degree of "authority" as git Plumbing. The plumbing needed to have something that worked for one particular workflow (namely, workflow of the people in the integrator role of kernel-style project) and that is where the current set of Porcelain-ish originates. Linus works primarily as an integrator so the toolsets he did tend to be more pleasant to use for integrators and less so for contributors. I started as a contributor and added some commands like format-patch and rebase that Linus never would have felt the need for. I think single isolated developers, contributors and CVS style shared repository usage could be a lot improved because neither of us were concentrating in their workflows. This needs somebody motivated enough to improve things in that area. For example, StGIT with its 'float' command is a great improvement over what rebase does for people in the contributor role.

By now, perhaps git may be good enough for the kernel folks, even for those not in the integrator role, but I have no doubt that they have many dislikes to the way some commands work. They and X.org folks are using git primarily because Linus and Keith forced them to ;-), and being interoperable is more important than having to tolerate sucky UI here and there. Everybody knows that git Porcelain-ish sucks, and making it more usable is a worthy goal.

But making it more usable for whom is a big question.

Quite frankly, I do not think there can be _the_ single UI that would satisfy different types of workflows for some of the commands. The commands related to software archaeology, in which my main interest and strength lie, would easily be usable across workflows, but commands to build commits locally and propagate them to and from other repositories would be affected by the workflow.

For example, fetching and merging from many places without necessarily having corresponding tracking branches is a great thing for people in the integrator role. On the other hand, for people doing CVS-style centralized repository interaction, it is often more useful to have tracking branches. You could support both but it has been painful.

For another example, having a commit command to commit everything by default is disastrous for people who allow their workflows to often be interrupted. When I respond to a message from the list with an example patch, my repository is often in the middle of doing something completely unrelated, and I edit and make diff to send the message out and I do not necessarily revert that change afterwards immediately. For more organized people it may not be a problem so you either support both types of workflows or do a specialized toolset.

It is not just command line syntax and the defaults, but concepts as well. People in the integrator role often need to deal with merges and you would need to be aware of the role of the index and need to be able to manipulate the index, a lot more often than people in the contributor role. To satisify both kinds of workflows, you would either have switches, or do a specialized toolset, like Cogito, that tries to hide the index.

A Porcelain that does a very similar thing in slightly different way is obviously a waste, but otherwise I do not think it is a problem to have different Porcelains. StGIT does not compete with the "sucky" Porcelain-ish shipped with git but makes the user's life a lot more pleasant by complementing what the sucky one does not do well. It is not very useful while I am playing the integrator role, but when I am doing my own thing it is a great addition to my toolchest.

I am from the camp that does _not_ want to hide the index, so obviously I do not see any value in its effort to hide the index. But other aspects of it, most notably being friendly to simpler workflows, is a very good thing.

#210 lore raw

Re: multi-project repos (was Re: Cleaning up git user-interface warts)

In reply to Han-Wen Nienhuys
Quoted 4 lines · Han-Wen Nienhuys

You're misunderstanding me: the multi-repo is at git.sv.gnu.org is the remote one. The example I gave was about locally creating a single project repo from a remote multiproject repo.

Ahh.

Ok, try the patch I just sent out, and see if it works for you. It _should_ allow you to do exactly that

mkdir new-repo
cd new-repo
git init-db
git pull <remote> <onehead>

and now your "master" branch should be initialized to "onehead".

Oh, except I just realized that I forgot to do a "git checkout" in my patch, so you'd need to add that (or do it by hand, but you really shouldn't need to, since the checkout is implied by the "pull").

The downside with this is that it does NOT populate your "remotes" information (like "git clone" would have done), so either we'd need to teach "git pull" to do that too, or you just have to do it by hand (so that you then can do the shorthand "git pull" to update in the future).

Quoted 3 lines

On a tangent: why is there no reverse-clone? I have no shell access to the machine, so when I created the remote repo, I had to push, and ended up putting 1.2 Gb data on the server.

Yeah, you're supposed to "init-db" and "push". Right now, that tends to unpack everything (which is bad), although that is hopefully getting fixed (ie the receiving end shouldn't unpack any more if it is recent. Junio?)

Quoted 3 lines

<looks at manpage>

is this send-pack?

"git push" uses send-pack internally, you shouldn't ever need to use it yourself.

Quoted 3 lines

From UI perspective it would be nice if this could also be done with clone,

git clone . ssh+git://....

The creation of a new archive tends to need special rights (with _real_ ssh access and a shell you could do it, but "ssh+git" really means "git protocol over a connection that was opened with ssh, but doesn't necessarily have a real shell at the other end").

So for most protocols, you simply cannot (and shouldn't) do it. Think about services like the one that Pasky has set up, that allow you to set up a new git repo - the setup phase really _has_ to be separate (because you need to set up your keys etc).

So I think the above syntax is actually not a good one, because it cannot work in the general case. It's much better to get used to setting up a repo first, and then pushing into it, and just accepting that it's a two-phase thing.

Also, from a bandwidth standpoint, you can often (although obviously not always) make the setup start with something that is _closer_ to what you want to do. So, for example, you'd often do something like:

(a) ssh to central repository
(b) create the new repository by cloning it _locally_ at the central place from some other repository that is related
(c) then, from your local (non-central) repository, do a "git push --force" to force your changes (which now only needs the _incremental_ thing).

An example of this is again the "forking" thing that he repos at at
http://git.or.cz/ already supports.

Quoted 10 lines
Quoted 2 lines

And that "git pull" semantic actually means that if you want a _bare_ repository, I think "git --bare init-db" + "git --bare fetch" actually

yes, this works. Two remarks:

* it needs

website/master:master

otherwise you still don't have a branch.

Right. In fact, you should probably do

website/master:refs/heads/master

just to make it really explicit.

Quoted 5 lines

* why are objects downloaded twice? If I do

  git --bare fetch git://git.sv.gnu.org/lilypond.git web/master

it downloads stuff, but I don't get a branch.

A "fetch" by default won't actually generate a local branch unless you told it to. It just squirrels the end result into the magic FETCH_HEAD name, so that you can do

	# do the fetch
	git fetch git://git.sv.gnu.org/lilypond.git web/master
	# look at changes
	gitk ..FETCH_HEAD

# If you're happy with them, merge them in git merge "merge new code" HEAD FETCH_HEAD

and you never actually created a real local branch at all.

If you want "git fetch" to fetch _into_ a branch, you need to tell it so, by using the full "src:dest" format. Otherwise it doesn't know what branch to fetch it into.

(And, of course, you can define that branch relationship in your remote configuration, so you don't actually have to say it explicitly every time)

Quoted 5 lines

If I then do

  git --bare fetch git://git.sv.gnu.org/lilypond.git web/master:master

it downloads the same stuff again.

Right. So you can either

(a) do it that way to begin with (because you now told it to put the results in "master", so you never needed to do the second fetch in the first place)

or

(b) after you did the first fetch (into FETCH_HEAD), you could also have just decided to do

git update-ref HEAD FETCH_HEAD ""

(where that "" at the end is really not technically necessary, but it tells "update-ref" that you _only_ want to do this if the old HEAD was empty/undefined. Without it, "git update-ref" will just overwrite HEAD without caring what it contained before, so it can be a dangerous operation!)

See?

#109 lore raw

Re: [PATCH] git-clone: lose the artificial "first" fetch refspec

In reply to Junio C Hamano

Hi,

Quoted 2 lines · Junio C Hamano

With the recent flurry of UI updates, I think it is sane to do that before v1.5.0; opinions?

Answering to all of your recent patches in this direction: I like it.

Originally, I thought that this would require more from me: I often synchronize my git repository (including topic branches) between different machines back and forth, via usb stick, and two different central machines. I use the script I sent in this mail:

http://article.gmane.org/gmane.comp.version-control.git/6956/

However, I just realized that I will not need the script anymore, what with the recent addition of wildcards to remote.<branch>.fetch. Good job!

Ciao,
Dscho

#276 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 9 lines · Linus Torvalds
Quoted 8 lines · Carl Worth

Well, one of the problems is that with current git I can teach, (and I have), that there's a conceptual:

pull = fetch + merge

But then shortly after I have to teach an interface notion:

Quoted 7 lines
Quoted 1 line

merge = pull .

This is why I would suggest teaching the _concept_ of the "merge", and not the actual command.

I don't think you should basically ever use the "git merge" command itself, not in teaching, and not in real life.

I think that's just and accident of git-merge having such a bad syntax, (requiring a merge message, not using -m for that, requiring two heads instead of defaulting to current, etc.). So the result is accepting another bad syntax "pull ." for an operation that really is merge.

Quoted 2 lines

Once you've explained the _concept_ of merging, you then introduce the command to actually _execute_ the merge: it's "git pull".

I think we'll be doing better when there is a stronger correlation between the concepts of the operations and the command names for carrying them out.

Plus, when I'm teaching "fetch everything first, then manipulate it locally", (which is what I teach, since that's the only way I use git), then the "." looks really out of place when I teach the 'merge' command. I end up saying, "Oh, that's there because you could do the fetch and merge all in one step if you really wanted, but I never do that.".

And that's because I _do_ teach fetch first, as you've suggested.

Quoted 3 lines

changes from both branches. So it's a _conceptual_ issue, and that's why I said I think you should just totally gloss over the whole issue of "git merge" syntax.

That doesn't work. I know I went looking at the git-merge documentation when I started to learn git. "It can't really be this hard, can it?" was my reaction to it. And then only after attending a tutorial did I learn that "pull ." is the way it's really done.

That's nothing more than a user-interface trap for new users, plain and simple.

The real fix is to stop glossing over git-merge and just give it a usable syntax.

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFW5ow6JDdNq8qSWgRAsnQAKCYgRHru7xAHn+O7RQFVa3IlXQRHACfbhwX NnbDgzDzLXUcD90YWOzimj4=
=ySLy
-----END PGP SIGNATURE-----

#24 lore raw
In reply to Shawn Pearce
Quoted 6 lines · Shawn Pearce

About the only trouble that can cause is a failed push when git-receive-pack needs to generate the reflog entry but cannot get the user's committer data because their gecos information doesn't exist.

In that case, it would be best if it let the commit go through using only the username. Reflogs are fixable afterwards, so there's no real harm done.

Signature · 2 lines
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se
#299 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 9 lines · Junio C Hamano

I am wondering if that could be "git merge <committish>..." instead. I do not care too much about the ... part (i.e. an Octopus), but I often find myself doing:

git checkout next
git merge "Merge early part of branch 'foo'" HEAD foo~3

when earlier part of "foo" topic are worthy to be in 'next' but not the later ones.

Indeed !

#57 lore raw
In reply to Andy Parkins
Quoted 11 lines · Andy Parkins
Quoted 7 lines
Quoted 2 lines

Tell them if they
made a branch as well, which branch they are now on.

I think you are talking about "checkout -b" not commit here; this might be a borderline (branch creation is less often done and it might warrant assuring feedback), but I think it still falls into the "doing exactly what it was told to do" category.

You're right, I was. The reason I think feedback is useful is because of the two ways of making a new branch:

Quoted 8 lines

- git-branch XYZ
This makes a new branch but DOESN'T leave me on XYZ
- git-commit -b XYZ
This makes a new branch and switches to XYZ

I can't tell you the number of times I get this wrong. It's not because I don't know if I stop to think, it's because I'm thinking about the project, not the VCS.

This is interesting. You said "commit -b", were pointed out that you were talking about "checkout -b", and just after saying "yup, that is right, I was", you again say "commit -b".

Maybe the users often need this sequence (I personally don't, but others might):

	$ git checkout ;# or the previous day ended with a clean state
	$ edit edit hack
        $ git checkout -b XYZ ;# the changes are about different stuff
        $ git commit ;# commit the changes there
        $ git checkout master ;# or whatever branch you usually are on

and "git commit -b <newbranch>" might be a handy shortcut for the last three commands. I dunno.

And if we had such a variant of commit, then it is doing something unusual, so I would not oppose (actually I would probably favor) if the transcript went something like this:

	$ git commit -b XYZ -m "implement 'foo' subcommand" -a
	committed changes to newly created branch XYZ, back on 'master'.
	$ git show-branch master XYZ
        * [master] finishing touches to 'hello world'
         ! [XYZ] implement foo subcommand
        --
         + [XYZ] implement foo subcommand
        -- [master] finishing touches to 'hello world'
	$ exit

Earlier I said that the command should be silent if it did exactly what it was told to do with some 'unless'es.

* If the command fails, we should report (no question).

* If the command succeeds the usual way, staying silent is preferable, at least to me.

* If the command can have more than one mode of successful outcome, stating success in which way is not a useless verbosity. E.g. 'git merge' should probably tell you if it did a usual three-way or a fast-forward (if the difference matters). Especially reporting an unusual case a bit more verbosely than usual is a good thing.

#226 lore raw

Re: multi-project repos (was Re: Cleaning up git user-interface warts)

In reply to Carl Worth
Quoted 8 lines · Carl Worth

Yes, this was my exact thought when reading what Linus wrote. ORIG_HEAD might be fine and all, but it pales in functionality compared to what reflog provides.

I would very much like to see reflog getting first-class citizen support in git:

1. Be on by default

I have:

	git repo-config --global core.logAllRefUpdates true

especially since Junio fixed it to only create logs for heads and not tags. That way its on by default for me. But I think it should be on by default in the next version of Git.

Quoted 2 lines

2. Get documented in all the right places, (much better than adding documentation for ORIG_HEAD in my opinion)

Agreed. I'm not likely to do it anytime soon however, so I'm hoping someone else will do it... :-)

Quoted 4 lines

3. Tighter integration with branch manipulations. Do we already delete reflog when deleting a branch? We don't have a branch rename operation, but if we get one, renaming the reflog should go hand-in-hand, etc.

Yes, we delete the log when we delete the branch, and we prune back the empty directories too just like we do on the branch side, so that new branches can be correctly created.

There was a recent discussion about that from Junio if I recall. Several people that I work with have asked that branch rename support be added to Git, and that if you rename the branch the reflog follows. Because in their mind they are simply changing the name of the branch, any old history of that branch should stick around.

I tried to think of an option to "git branch" to do the rename but kept thinking that:

git rename-branch old new

is the better syntax... even though that's command number 133 or something like that...

We should stick a "null" event into the reflog during a branch rename. Make both the old and new SHA1 the current SHA1 but drop a message in saying "renamed branch old -> new" (for example).

#99 lore raw
In reply to Andy Parkins
Quoted 3 lines · Andy Parkins

This is what I have in my "niggles" list.  These are surface level things that I think are easy to fix.  A large part of the scariness is (I think) git's unfriendly output.  Too many messages require understanding of git internals.

Nice list, although I'd rather add extra output only if command is used with -v/--verbose (or -V/--verbose) option; if not, then add -q/--quiet (or -s/--silent) option to be used in scripts. I'm partial to --verbose solution, as advanced users are not interested in any output; they know the commands, and want them to be fast. C.f GNU tar: it outputs something only with -v/--verbose option.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#22 lore raw
In reply to Junio C Hamano
Quoted 5 lines · Junio C Hamano

Maybe a check to say if $GIT_DIR is ".git" or ends with "/.git" then enable it and otherwise honor the configuration variable, without changing the default in the code (with your patch) nor in the default configuration ("enable for new repositories" as I suggested) might be a workable compromise.

See my latest patch. Though that patch also sets the value in the config file, much as core.filemode is also set in the config file, based on the guess determined by init-db at the time it was executed.

#83 lore raw
In reply to Johannes Schindelin
Quoted 5 lines · Johannes Schindelin

And now you know one of the reasons we have no true progress bar.

Another reason is that it would be relatively expensive to calculate, since the total _size_ is not known beforehand (remember, the pack is calculated on the fly).

Hmmm; just thinking out loud now... I used to calculate ETA's for simulations I ran that had similar problems - i.e. you don't know how long it takes until its done (it was with genetic programming function trees, and of course you don't know what operations will be in the next generations tree, so you can't estimate a time). I just showed "something" by doing a standard: how long did n/N take therefore N will take... then I plotted the error in the ETA after the simulation completed. Interestingly it was always a -exp(-x) shape. In other words it got more accurate towards the end (of course); which is exactly the sort of accuracy you would want. At the beginning you just want a broad "this will take a few hours" measure. Towards the end, you want to know "there is 1m50s remaining".

I wonder if the number of objects is a reasonable measure of progress. Let's say we're transferring 100,000 objects. Let's also say that the average size of objects is 100 bytes. Let's finally say that the object sizes are evenly distributed throughout the 100,000 objects. This would mean that the first 1,000 objects are just as representative as the last 1,000 objects; or any other randomly chosen 1,000 objects. In which case, the size of the first thousand objects would be approximately one hundredth the size of the total transfer. Volia: an estimate of the total size of the transfer.

Obviously this estimate would be continuously updated, and would become more accurate as more objects are transferred. The data rate would of course be based on only the previous X objects rather than the total transferred to take account of changing server conditions. From these ETA could be estimated.

Obviously the ETA is unstable, but it's only for giving users an idea of how long is left; not for strict accounting.

Andy

Signature · 1 line
Dr Andy Parkins, M Eng (hons), MIEE
#296 lore raw

Re: Cleaning up git user-interface warts

In reply to Richard CURNOW

Hi,

Quoted 7 lines · Richard CURNOW

In contrast to Linus's case of wanting to record where the remote merge came from, I expressly don't want to record that - I want the merge commit to describe conceptually what was being merged with what.

OK, I could use probably use pull with --no-commit, but I've already trained my fingers to type out the merge syntax. They'd be happier with 'git merge -m "Merge feature foo with fixes for bar" bar" though.

For the moment, if you forget --no-commit, you can always do a "git-commit --amend" -- even with merges.

Hth,
Dscho

#85 lore raw
In reply to Shawn Pearce
Quoted 4 lines · Shawn Pearce

not predict future results"... The size of objects in the pack tends to be small up front (commits/trees) and larger in the back (blobs). The size distribution probably also gets more erratic near the back as the blob sizes may not follow a nice distribution.

Oh well; that pretty much settles it then.

Quoted 3 lines

But as you state, its easy to refine it over time, and the closer we get to the end the more likely it is to be correct. Unless its that 23 MiB blob. As it takes up about 85% of that repository's pack.

I had imagined (foolishly), that most objects would be diffs, and would be similarly sized.

Scratch that.

Andy

Signature · 1 line
Dr Andy Parkins, M Eng (hons), MIEE
#291 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 8 lines · Linus Torvalds

Actually, with different people involved it's _much_ better to do it in one shot.

Why? Because doing a separate "fetch to local space" + "merge from local space" actually loses the information on what you are merging.

It's a lot more useful to have a merge message like

Quoted 7 lines

Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6

than one like

Merge branch 'for-linus'

which is what you get if you fetched it first.

Full ACK from a platform integrator's perspective. Local merge is great for trial runs but the history in a persistent branch should be as self-contained and self-explanatory as possible. It shouldn't depend on what I name local tracking branches, which are just a convenience so that I can still do trial runs when my connectivity is broken.

I don't have to manually log the _mechanical_origin_ of a given delta; git does that for me, and mostly just DTRT when the same delta arrives via several paths. When I use git pull from a remote branch (with or without an entry in remotes/heads, which for this purpose is just shorthand), I don't have to manually log what conflicts I have and haven't resolved, either; I must have assimilated whatever I cared about in the remote branch's history up to that point, because as long as there are things in that remote branch that I haven't decided how to handle, I stick to cherry-picking.

Obviously, fetch to local space is great (especially when you spend some of your working hours behind a firewall that blocks outbound TCP 9418). Fetch from local space is also great, when the local space you are fetching from reflects local work (such as a sync point and reconciliation of several upstream sources, which then needs to be ported forward or back to the chosen core version for each platform). Fetch from a local space that is just a tracker for remote work is not great, because it doesn't capture the editorial decision implied by a remote pull: I looked at what the remote branch had to offer as of this date, systematically decided which bits did and didn't belong in the branch to which I was pulling, and pulled.

The record of that pull becomes a first-class object because it's attached to an actual content delta in the target branch. So it propagates into branches that pull from it. Pulling this delta into another branch is different from cherry-picking a feature delta; it implies acceptance of the reconciliation and editorial work associated with the merge in the source branch.

Coming from me, this is all rather theoretical, as I haven't been using this particular tool for the purpose long enough to have an independent opinion. But for what it's worth, the workflow Linus describes isn't just for the guy at the top of the pyramid.

Cheers,

#249 lore raw

Re: Cleaning up git user-interface warts

In reply to Michael K. Edwards

On 11/16/06, Michael K. Edwards <[email protected]> wrote

Quoted 5 lines

The only entry placed in .git/remotes is the
"origin" of the new clone, which is the "master" of the remote repository. That's for the user's convenience, and is about the only thing in the new clone that _isn't_ a copy of something in the remote tree.

Actually, this "origin" entry does contain "Pull:" lines for all of the branches that were cloned, so that "git pull" fetches and merges updates to all of these branches. (If upstream is in the habit of reverting things, you may need "git pull -f"; I just did that on the git repo to handle a failure to fast-forward on the "pu" branch.)

Presumably "git branch -D" should inspect everything under .git/remotes to see whether one or more Pull: lines need to be deleted along with the branch. Currently, it looks like "remotes" entries are created only by "git clone" or by hand. Junio, are there any plans to manage the contents of "remotes" through the tool instead of by hand?

Cheers,

#415 lore raw

Re: Cleaning up git user-interface warts

In reply to Steven Grimm
Quoted 10 lines · Steven Grimm

echo foo >> child1/testfile
perl -pi -e 's/tree/shrub/' child2/testfile
...
git-diff --binary > /tmp/patch
git-reset --hard
git-pull
git-apply /tmp/patch

I might have gotten that slightly wrong, but I think I have the general idea right.

stg pull would help you in such a situation as well, but I see what you mean.

Just like we have an explicit -m option to "checkout" to allow file-level merging of local changes, I think it is reasonable to hav an option that allows file-level merging of local changes when doing a pull that you _know_ will not conflict.

When there will be a conflict between your HEAD and MERGE_HEAD even without your local changes, you somehow need to sort out the resulting mess that come from conflicts due to the branch diversion (i.e. log HEAD...MERGE_HEAD) and conflicts between your local change and what the other branch did. The resulting merge commit obviously needs to record resolutions only to the former and should not even record anything you did locally, conflicted or not. Which is a pain for the end user and giving them a way to revert to the state before this three-and-half way merge started also needs to be there.

Unfortunately the only way to know if there will be a file-level conflict is to try one, and stashing away the current state just in case it conflicted is a performance penalty, so this probably should stay as an option just like "-m" to the "checkout".

But the basic mechanism to do this three-and-half way merge is simple and I have no objection if somebody wanted to add such an option to "git pull".

#347 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano

I would kind of like to see "git poll" -- visit all remote branches, fetching objects and tags into the local repository, so that I can inspect changes off-line and merge, cherry-pick, etc. to my heart's content. That would fit the platform integrator's workflow nicely -- "git poll" into a tracking tree, do some merges there (such as backporting a subsystem to a "stable" base kernel), then merge this backport branch to each platform working copy and cherry-pick other changes as necessary.

Cheers,

#378 lore raw

Re: Cleaning up git user-interface warts

In reply to Robin Rosenberg
Quoted 6 lines · Robin Rosenberg

torsdag 16 november 2006 04:21 skrev Petr Baudis:

Quoted 3 lines

Another point is, if using _just_ _git_ requires you to learn "all those git commands too" from git-commit-tree up (yes it does! if you want your authorship information to be correct), something is wrong.

When/why do I need git-commit-tree? Isn't git-commit enough?

As I said, when you need to find out how to setup your authorship information. It's documented as deep as on the git-commit-tree level. BTW, the documentation is another important part of the plumbing/porcelain separation, it's not only about the list of commands but also that porcelain documentation should be reasonably self-contained and not require users to peek at plumbing docs in order to find out many stuff. It's also a consideration I take when maintaining Cogito documentation.

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
#385 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 4 lines · Junio C Hamano

Commenting on the messages in this thread:

- "resolve / resolved" are both confusing, when you are talking about "mark-resolved" operation.

Well that's what "resolved" is saying. But speaking of which, it took me _weeks_ of regular (though not extensive) usage to train my fingers to write "stg resolved" and not "stg resolve".

Quoted 3 lines

- "pull/push/fetch" have undesired confusion depending on where people learned the term. I'd perhaps vote for replacing fetch with download and push with upload.

It's too long. :-(

I think if some people have a real problem with something it's "pull", not push or fetch. Without "pull" name, there's no confusion about merging or not merging; and without it, there's also no confusion about "push" and the fetch/push duality. I'm not saying that this is enough an argument to ditch pull from Git at this point.

Quoted 5 lines

- I think it would be sensible to make remote tracking branches less visible. For example:

git diff origin

Quoted 7 lines

where origin is the shorthand for your upstream (e.g. you have .git/remotes/origin that records the URL and the branch you are tracking) should be easier to understand than

git diff remotes/origin/HEAD

The latter is an implementation detail.

Hmm, wait. I didn't start using refs/remotes/ yet for obvious reasons, but wasn't it generally agreed when implementing them that what you wrote above would work? (That a ref not found in refs/{heads,tags}/ is looked up in remotes and if it's a directory, /HEAD is appended.) So it doesn't for some reason?

Quoted 9 lines

I could imagine we might even want to allow

git diff origin#next

to name the branch of the remote repository. The notion of "where the tips of remote repository's branches are" is probably be updated by "git download" (in other words, the above "git diff" does not automatically initiate network transfer).

Yes, that little syntax extension would be cute to have.

Quoted 1 line

Of course, it could even be "cg" ;-).

So, here is an arbitrary list of random reasons why cg commands are not part of git yet:

(i) Naming issues. Example: "pull" vs. "update".

(ii) Namespace issues. Big selling point of Cogito is that it's _simple_. A very important part of that is that your command set is limited, so that even someone who wants to fully grok Cogito is not overwhelmed and has just few commands in front of him. I think we're doing pretty good here, and I very carefully weight adding another command to the set (I'm actually pondering removing some now). The similar applies to actual commands' usage, though certainly not so heavily; and there are few warts here.

But overally, I think this point is pretty much unsolvable and this is where I actually think the main "incompatibleness" of Cogito and Git with its free mix of high- and mid- and low- level commands lies. I don't think the thread provided any solution to this either.

(ii) Behaviour issues. Example: Cogito tries to deal with uncommitted local changes in your repository when doing stuff. It didn't shine at it before recent improvements (post-v0.18), but it tried to preserve your local uncommitted changes during various operations (merging, fast-forwarding, switching branches, seeking, ...). I think historically Git's stance to this was negative (it'd rather block the operation), I'm not sure what the current situation is, though.

(iii) Output format issues. Example: "status" in Git and Cogito has a completely different format in both. I'm a die-hard fan of Cogito's format but there're surely die-hard fans of Git's.

(iv) Control issues. I'm reluctant to give up a final word on how the UI looks like, mostly for the reason of enforcing (ii) and proper documentation. But this is not a blocker point.

(v) Library issues. Cogito has a pretty neat shell library which it prices; but that could be carried around. Also, Cogito requires /bin/bash, but mostly for performance reasons (using builtins instead of forking for external commands at some points); Git has the advantage of simply putting that part in C, which is though something I should've been doing more frequently too.

(vi) Coding issues. This is probably very subjective, but a blocker for me. I have no issues about C here, but about the shell part of Git. Well, how to say it... It's just fundamentally incompatible with me. I *could* do things in/with it, but it's certainly something I wouldn't _enjoy_ doing _at all_, on a deep level. I think the current shell code is really hard to read, the ancient constructs are frequently strange at best, etc. It's surely fine code at functional level and there'll be people who hate _my_ style of coding and my shell code which isn't perfect either, but it's just how it is with me.

Now, it would be absolutely awesome if we could start to bridge at least some of these points, shuffle some functionality around and overally reduce the code duplication, increase features count and improve general level of world happiness.

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
#360 lore raw

Re: Cleaning up git user-interface warts

In reply to Jakub Narebski
Quoted 5 lines · Jakub Narebski
Quoted 2 lines

* Don't use the name "origin" twice. In fact, don't use it at all. In
a distributed system there is no such thing as a true origin.

The remote 'origin' is true origin of the repository: it is repository we cloned this repository from.

But that is not necessarily /the/ original, and "origin" is the absolute reference in maths. It doesn't bother me that much I suppose, it's just that as far as unambiguous names go, I'm not wild about it - it's got too many "central repository" connotations, which is of course anathema to git.

Andy

Signature · 1 line
Dr Andy Parkins, M Eng (hons), MIEE
#66 lore raw
In reply to Horst H. von Brand
Quoted 7 lines · Horst H. von Brand
Quoted 1 line

Perhaps under "[user] expert" control.

Nope. You'd be surprised what kind of people consider themselves "experts"... I'd prefer adding -v/--verbose flags to all commands (if nothing else, for symmetry's sake), have a '[default] --verbose' controlling this across the board (perhaps also '[default "command"] --verbose'), with '[default]' setting default switches.

Nice idea... but configuration variables have to have name. So it would be

  $ git repo-config defaults.command --verbose

resulting in

[defaults]

        command = --verbose
Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#207 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds

Linus Torvalds escreveu:

Quoted 4 lines

So current rule (and this is not new, it's always been true): the ONLY time you use "git init-db" is when you are going to start a totally new project. Never _ever_ otherwise. If you want to track another project, use "git clone".

Actually, only a 2 weeks ago, you suggested that I share the website and main source code for my project in a single repository for reasons of organization.

In this setup I find it logical to do

git init-db
git pull ..url.. website/master

to wind up with just the 5mb website, instead of the complete 70mb of packed source code with all of its branches and tags.

Quoted 9 lines

It's not that it isn't typical, it's that you are using the wrong model. Maybe it's not well documented, I can easily give you that, but ALL your problems come from that fundamental starting point: you shouldn't have used "git init-db" in the first place.

Somebody want to document it?

Alternatively, we certainly _could_ make "git pull" just accept an empty git repo, and make it basically create the current branch.

Yes, I would like that.

#297 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 2 lines · On Wed, 15 Nov 2006 14:52:32 -0800 Carl Worth <[email protected]> wrote:

The real fix is to stop glossing over git-merge and just give it a usable syntax.

Agreed 100% There's just no good reason to hide the user level
merge command inside of pull.

#274 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 9 lines · Linus Torvalds
Quoted 5 lines · Nicolas Pitre

Actually I believe it would make things even clearer if "merge" was taught at that point. Only when the user is comfortable with the separate notions of fetching and merging might the pull shorthand possibly be mentioned.

I agree. I just expect that "merge" is such a simple concept that it doesn't really need a whole lot of explaining.

Well, one of the problems is that with current git I can teach, (and I have), that there's a conceptual:

pull = fetch + merge

But then shortly after I have to teach an interface notion:

merge = pull .

So there's this goofy circular notion that people end up with mentally. If we fix it so that a local merge really is performed with "git merge <branch>" instead of "git pull . <branch>" then teaching pull=fetch+merge really is a lot easier.

In the meantime, pull would still be useless to me, I think. But maybe that's just the "default branch to merge" selection being broken. If that were fixed, maybe I would start using pull.

Quoted 3 lines

(a) explain what "branches" mean in git (and in that situation, "fetch" is very natural - I think fetching itself is probably easier to explain than "branches" are).

There's a piece missing here, namely the mapping between remote and local branch names and any notion of "tracking branches". I think a sane story for that is still being invented, (or if it exists now, I haven't seen it yet).

Quoted 4 lines

(c) once "fetching branches" and "merging" have been explained, "pull" is really pretty damn trivial, and in fact, if you then explain that it's just easier to do "git pull . branchname" than to use "git merge", I think people may just even agree with you.

Well, they get pretty darn confused at this point, in my experience.

Quoted 7 lines

Once you understand local branches, fetching and merging, it's actually _easier_ to explain why we merge even local branches with "git pull .":
you just tell them that this way you can use the same command regardless of whether you're merging something local or something remote. Again, if it's explained that way, I bet a lot of people react with "ahh, that's clever", and _like_ the fact that they only really need to learn _one_ command, instead of learning two.

No. It's really, really broken to use "pull ." for local merging. Not a feature at all. We just got done establishing that pull is a shorthand for doing fetch+merge, so reusing it when there is _no_ fetch at all is insane.

You just established quite clearly hat git has a huge advantge over all other systems by having a model that everything is fetched in and then worked with locally. I agree that this is a major selling-point of git, and I'm also baffled that systems like bzr and hg try so hard to push every branch into a separate repository.

But I think that git's "work with everything locally" story is undercut a bit by regular usage being to use a transfer-inducing command like "pull" for a totally local merge.

Anyway, I think we all agree that we'd really rather have "git merge <branch>" be usable for local merges, so let's get that in place and users can pick whichever they like.

Quoted 4 lines

But the real issue here is to explain local branches. I will happily admit that local branches are very VERY different from just about any other SCM, but I also claim that git is just much BETTER than other SCM's in this respect.

Totally agree.

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFW4Hq6JDdNq8qSWgRAr3OAJkBDKpe8W61HdQmpCep+6ZeWjqdZgCfa1qV tyjjFBxE92fDZALmf4kz83c=
=UOh4
-----END PGP SIGNATURE-----

#391 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 7 lines · Junio C Hamano
Quoted 4 lines · Petr Baudis

(v) Library issues...
Git has the advantage of
simply putting that part in C, which is though something I should've been doing more frequently too.

Quoted 10 lines

It should be stressed that git-core plumbing written in C is not just for git Porcelain-ish, and it will continue to be shared service. We would add core support for what Porcelains need and we would try hard to keep them generic enough so that other Porcelains can use them. Keeping the core and Porcelain-ish in the same project has made it easier to keep them in sync and to find and add missing features that would benefit Porcelains (not limited to git Porcelain-ish). But that should not be mistaken as plumbing somehow belongs more to git Porcelain-ish than to Cogito or others.

Of course, I didn't mean to say that. I should do more often things
like adding --stdin to the fetchers. From one part, I'm used to work with a fixed set of system tools and extending Git with the functionality I want means changing my thinking mode and "jumping out of the system" a bit. The other part is that I cannot use the improvements in Cogito right away (at least not in the main branch) but I have to wait for the next Git release; but this is mostly just an excuse. :-)

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
#27 lore raw
In reply to Junio C Hamano
Quoted 13 lines · Junio C Hamano
Quoted 11 lines · Nicolas Pitre

I'd say screw that. The solution should really be this patch:

environment.c +0 -1
index 84d870c..98275b2 100644
@@ -15,7 +15,7 @@ int use_legacy_headers = 1;
 int trust_executable_bit = 1;
 int assume_unchanged;
 int prefer_symlink_refs;
-int log_all_ref_updates;
Quoted 8 lines

environment.c int use_legacy_headers = 1; · line 21

Quoted 5 lines
environment.c +1 -0
+int log_all_ref_updates = 1;
 int warn_ambiguous_refs = 1;
 int repository_format_version;
 char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8";

That changes what the command does to existing repositories, which is somewhat impolite.

You must be kidding, aren't you?

Just in case you really are serious, let's pretend that being impolite for something that has the potential of saving people's arses is certainly worth it, much more that the little inconvenience of having log files mysteriously appear and make no harm otherwise.

Quoted 3 lines

I am not opposed too much to an updated version of the tool that sets the configuration on by default for newly created repositories, though.

Hmmm....

Well it is just that I strongly believe users with existing repos have no really valid reason to not have this feature enabled. But making it on in a default config file at repo creation time is better than nothing.

#284 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 5 lines · Carl Worth

What I have been doing up to this point is a little script I wrote that does git-ls-remote on the repository I want to track and writes a .git/remotes file to bring in all their branches. So if I want to see what behdad is up to, I first refresh his .git/remotes file with my:

Quoted 7 lines

cairo-git-setup-remotes behdad
then:
git fetch behdad

And I end up with a bunch of branch names with "behdad-" prefixes that I can explore or blow away if I'm no longer interested, (could have used a "behdad/" prefix as well).

I would suggest refs/remotes/behdad.

Quoted 7 lines

So, yes, I'll definitely look into improving this. I think the details will involve:

1. Making clone do the --use-separate-remotes behavior by default

2. Taking advantage of that consistently for all branches instead of a special master:origin mapping in clone

This already should be the case if you use separate-remote. I haven't run "clone --separate-remote" myself for a long time, but the design was certainly to make it behave that way. Specifically, map everything in refs/heads/ at remote to refs/remotes/$origin/ with corresponding names, one-to-one.

I do not see much reason to change the mapping of master:origin which is done for the traditional layout. The traditional layout is not suitable for your workflow anyway, and that is why you prefer separate-remote layout for your project, and I fully agree it would suit you better.

Quoted 9 lines

3. Enhancing git-fetch (or other) to modify .git/remotes, (or was there a desire for some other branch-specific section in the config file?)

4. Making git-fetch handle the disappearance of a remote branch gracefully

5. Adding something like git-fetch --all to allow it to pick up all new branches

These three are easily done for separate-remote layout but at that point you would not want --all but more powerful --mirror (or --update if you want to use that word), which goes the whole nine yards of noticing disappearance of remote branch, making matching deletion of local tracking branch, updating .git/remotes, etc. I've muttered something similar in a nearby thread; see below.

Quoted 11 lines

6. Adding a "git update" that does a fetch for all appropriately marked remotes.

On this last point, maybe we do something like:

update=no|yes|all

in .git/remotes. Then git-clone would set this up with update=all for origin so git-update would do a "fetch --all" on the origin repository. Then step 3 above would have to provide for setting this update option as appropriate.

I would prefer this to be kept in contrib/; it feels like it is filling rather very narrow need.

Quoted 1 line

Anyway, something along those lines perhaps. Any feedback?

I muttered something less elaborate in the nearby thread.

	Message-ID: <[email protected]>
	Message-ID: <[email protected]>

The part that deals with manual configuration (the last point in the first message, and the second in message its entirety) is something your workflow would not need nor want to worry about, but I think it is necessary for different ref namespace layouts and different workflows. I think the automatable part (the first two points in the "sensible thing to do" list in the first message) is very relevant to what you talked about in your message.

#54 lore raw

Re: [PATCH] make commit message a little more consistent and conforting

In reply to Shawn Pearce
Quoted 10 lines · Shawn Pearce

I do the same (diff a lot before commit) and thus find commit outputting anything at all to be noisy and irritating. Frankly the new

  git-diff-tree --summary --root --no-commit-id HEAD

that Junio put on the end is already irritating.

But it was added to help users verify that commit did what they thought it would (see 61f5cb7f).

The credit should go Pasky's way. Add/delete/mode are rarer events and reminding them is sensible.

We do not show the 'summary' when we are concluding a merge that conflicted. Otherwise you will be seeing other people's huge changes that was just brought in.

#336 lore raw

Re: Cleaning up git user-interface warts

In reply to Jakub Narebski
Quoted 12 lines · you
Quoted 9 lines · Linus Torvalds

But the fact is, git isn't really that hard to work out, and the commands aren't that complicated. There's no reason to rename them. We do have other problems:

 - default branch selection for merging is broken (it should definitely take the current branch into account). When I do "git pull" with no branch specification, and I happen to be on a branch that is associated with something else than "master" in the remote, I shouldn't merge with master.

Quoted 3 lines

This problem is _slightly_ migitated by branch.<name>.merge config variable. Slightly because you have to specify branch to merge, instead of forbidding merge if you are not on specific branch (and you don't override it).

We should change this.

The problem is that whatever is the first Pull line in remotes config gets merged by default into current branch, which most often is not the right thing to do.

Often, I find myself doing "git branch" just to make sure that I am on "master", so that a following pull does not do a bogus merge.

Can we please disable this behavior, e.g. by allowing a fake first Pull line like "Pull: (not-for-merge)" to prohibit any merge?

This even could be written by default in git-clone somewhere in the future, and we suddenly get the behavior of pull being symmetric to push - at least by default. And still, it is fully compatible to existing repositories.

To make pull do the right thing, we _have_ to configure branch.<name>.merge whenever we create a new branch (which matters for git-clone, too).

Josef

Quoted 6 lines
Quoted 4 lines

 - I agree that having to create temporary branches to just look at a tag that you don't want to actually develop on is just unnecessarily bothersome.

Agreed.

#394 lore raw

Re: Cleaning up git user-interface warts

In reply to Nicolas Pitre
Quoted 11 lines · Nicolas Pitre
Quoted 2 lines · Jakub Narebski

We can always have --merge arguments to git-pull, and --fetch argument to git-merge.

That would be a complete abomination if you want my opinion.

Please let git-pull actually pull stuff from a remote place, and git-merge actually merge stuff only. Let's keep simple concepts mapped to simple commands please. Nothing prevents _you_ from scripting more involved operations with a single command of your liking afterwards.

Do we want to abandon completely "single-branch" workflow, where you don't use tracking branch, only merge directly into your working branch? That is the cause to (unused by most) future git-merge (replacement for git-pull .) --fetch=<remote>[#<branch>] option.

I'm not that sure about --merge option, but it could be useful, at least to have current automatic "Merge branch '<branch>' of <URL>" commit message.

Signature · 1 line
Jakub Narebski
#37 lore raw
In reply to Nicolas Pitre

Hi,

Quoted 9 lines · Nicolas Pitre
Quoted 3 lines · Jakub Narebski

It would be nice to have some generic place in git config to specify default options to git commands (at least for interactive shell). It cannot be done using aliases. Perhaps defaults.<command> config variable?

I would say the alias facility has to be fixed then.

In bash you can alias "ls" to "ls -l" and it just works.

So, why not use bash aliases?

Frankly, what git aliases try to achieve is a little bit different from bash aliases. Bash knows exactly when a command is interactive, and has a clear advantage there. Git _cannot_ know.

Ciao,
Dscho

#110 lore raw

PATCH 1/1 git-clone: lose the traditional 'no-separate-remote' layout

In reply to Junio C Hamano

Finally.

The separate-remote layout is so much more organized than traditional and easier to work with especially when you need to deal with remote repositories with multiple branches and/or you need to deal with more than one remote repositories, and using traditional layout for new repositories simply does not make much sense.

Internally we still have code for 1:1 mappings to create a bare clone; that is a good thing and will not go away.

---

Quoted 3 lines · Junio C Hamano

Next step will be to remove the traditional layout altogether. With the recent flurry of UI updates, I think it is sane to do that before v1.5.0; opinions?

And this drops it; modulo bugs, I think this is about it for v1.5.0 around this area.

 Documentation/git-clone.txt |   15 +----------
 git-clone.sh                |   58 +++++++++----------------------------------
 2 files changed, 13 insertions(+), 60 deletions(-)
Documentation/git-clone.txt +1 -14
index bfddb21..874934a 100644
@@ -11,8 +11,7 @@ SYNOPSIS
 [verse]
 'git-clone' [--template=<template_directory>] [-l [-s]] [-q] [-n] [--bare]
 	  [-o <name>] [-u <upload-pack>] [--reference <repository>]
-	  [--use-separate-remote | --no-separate-remote] <repository>
-	  [<directory>]
+	  <repository> [<directory>]
 
 DESCRIPTION
 -----------
@@ -99,18 +98,6 @@ OPTIONS
 	if unset the templates are taken from the installation
 	defined default, typically `/usr/share/git-core/templates`.
 
---use-separate-remote::
-	Save remotes heads under `$GIT_DIR/refs/remotes/origin/` instead
-	of `$GIT_DIR/refs/heads/`.  Only the local master branch is
-	saved in the latter. This is the default.
-
---no-separate-remote::
-	Save remotes heads in the same namespace as the local
-	heads, `$GIT_DIR/refs/heads/'.  In regular repositories,
-	this is a legacy setup git-clone created by default in
-	older Git versions, and will be removed before the next
-	major release.
-
 <repository>::
 	The (possibly remote) repository to clone from.  It can
 	be any URL git-fetch supports.
git-clone.sh +12 -46

88 lines not on this page · raw message

#283 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 3 lines · Junio C Hamano

I have no objection to this if it is done in a controlled way that does not make life more difficult for people who work with multiple remote repositories.

That's fine with me. Maybe I didn't explain this well before, but my desire is exactly for this to work with multiple repositories.

Specifically, what we have in cairo is a "central" shared tree that many people push to. But we only have two branches there, (one for bug-fixes only for our stable releases, and one for ongoing development of new features, and that only of stuff that's well cooked).

So that tree looks and acts an awful lot like our cvs tree back in the past. It's often very linear and often fairly boring to look at in gitk.

Meanwhile, all the really interesting stuff happens in personal repositories where people have their own branches for stuff that is still getting cooked. This is what's a lot more fun to watch, and there's a lot more distributed back-and-forth that goes on here as people collaborate on things. And it's all this kind of collaboration that cvs never helped with at all, but git has been great.

So, what I want is both "git update" for the central tree. I said we only have two branches, but that's really only two that are active---the "stable" branch is actually a new branch after every major release. It was 1.0 for a while, is 1.2 now, and will be 1.4 later. So I want "git update" to automatically pick those new branches up as they get created.

Meanwhile, I also want to use "git update" to track everything that people are working on in the more wild personal trees. So, yes, I do want "git update" to be able to track lots of remote repositories in a sane way.

What I have been doing up to this point is a little script I wrote that does git-ls-remote on the repository I want to track and writes a .git/remotes file to bring in all their branches. So if I want to see what behdad is up to, I first refresh his .git/remotes file with my:

cairo-git-setup-remotes behdad
then:
git fetch behdad

And I end up with a bunch of branch names with "behdad-" prefixes that I can explore or blow away if I'm no longer interested, (could have used a "behdad/" prefix as well).

The first problem we ran into when doing that months ago was that I don't want any tracking branches to come across this way. Or else I end up with behdad-origin, he then gets cworth-behdad-origin, ad nauseum. So we filtered "origin" out, but it will be nice to revisit this if there's a sane distinction in git now to separate tracking branches from heads.

Quoted 5 lines

And I think "git fetch" is the tool for what you want if enhanced properly; see Linus's message that explaind that we already have that support in "manually configurable" form but initializing and maintaining the configuration is currently all manual and can be improved.

Yes, git-fetch is lovely, and it's the need for manual configuration that's a problem, (and the mixing up of heads and remote tracking branches that has been in git historically).

So, yes, I'll definitely look into improving this. I think the details will involve:

1. Making clone do the --use-separate-remotes behavior by default

2. Taking advantage of that consistently for all branches instead of a special master:origin mapping in clone

3. Enhancing git-fetch (or other) to modify .git/remotes, (or was there a desire for some other branch-specific section in the config file?)

4. Making git-fetch handle the disappearance of a remote branch gracefully

5. Adding something like git-fetch --all to allow it to pick up all new branches

6. Adding a "git update" that does a fetch for all appropriately marked remotes.

On this last point, maybe we do something like:

update=no|yes|all

in .git/remotes. Then git-clone would set this up with update=all for origin so git-update would do a "fetch --all" on the origin repository. Then step 3 above would have to provide for setting this update option as appropriate.

Anyway, something along those lines perhaps. Any feedback?

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFXX5s6JDdNq8qSWgRAthtAJ0bv4WzROtvHAoiSU/+31GCd3phIACfRl8Q ik+AXAJsvleOqB5uzmcDAp4=
=H6gp
-----END PGP SIGNATURE-----

#361 lore raw

Re: Cleaning up git user-interface warts

In reply to Andy Parkins
Quoted 5 lines · Andy Parkins

But that is not necessarily /the/ original, and "origin" is the absolute reference in maths. It doesn't bother me that much I suppose, it's just that as far as unambiguous names go, I'm not wild about it - it's got too many "central repository" connotations, which is of course anathema to git.

To me, "origin" just means "where <whatever we're talking about> originated". If you think of it that way, it's perfectly obvious that each repository can have its own origin.

Signature · 1 line
Karl Hasselström, [email protected]
#199 lore raw

Re: Cleaning up git user-interface warts

In reply to Han-Wen Nienhuys

Hi,

Quoted 6 lines · Han-Wen Nienhuys

The recently posted patch documenting is an improvement, but why not add an option so you can do

--format 'committer %c\nauthor %a\n'

this catches all combinations, and is easier for scripting.

Yes, it would be easier for scripting, and it would probably be relatively easy, what with the addition of interpolate.[ch] to git. However, it is work, and I am lazy.

What information would you like, anyway? IOW can you provide me with a list like this:

%c committer
%a author
%d committer_date
...

Ciao,
Dscho

#273 lore raw

Re: Cleaning up git user-interface warts

In reply to Nicolas Pitre
Quoted 5 lines · Nicolas Pitre

Actually I believe it would make things even clearer if "merge" was taught at that point. Only when the user is comfortable with the separate notions of fetching and merging might the pull shorthand possibly be mentioned.

I agree. I just expect that "merge" is such a simple concept that it doesn't really need a whole lot of explaining.

People kind of expect merging to be hard, but I think it's because CVS et al have tought people that merging is _painful_. I don't think it's a very complicated concept per se, especially if you have explained branches with gitk already.

But yes, the order should be:

(a) explain what "branches" mean in git (and in that situation, "fetch" is very natural - I think fetching itself is probably easier to explain than "branches" are).
(b) once you've explained branches, the notion of "merge" comes next, and I _think_ that is very obvious. This is where UI issues come in, because "git merge" is really a totally internal program with a pretty horrid UI, but I think we could fix the syntax, and even with the current syntax you can really just gloss it over, because nobody is really going to care.
(c) once "fetching branches" and "merging" have been explained, "pull" is really pretty damn trivial, and in fact, if you then explain that it's just easier to do "git pull . branchname" than to use "git merge", I think people may just even agree with you.

I think I saw that particular discussion on #git: somebody didn't expect "git pull . branch" to be the way to merge. And again, I think it's not _really_ because "pull" is hard to understand, it's because people haven't been walked through the thing in this way.

Once you understand local branches, fetching and merging, it's actually _easier_ to explain why we merge even local branches with "git pull .":
you just tell them that this way you can use the same command regardless of whether you're merging something local or something remote. Again, if it's explained that way, I bet a lot of people react with "ahh, that's clever", and _like_ the fact that they only really need to learn _one_ command, instead of learning two.

See? Explain it that way: "pull" really is simple. By using "pull", you don't have to learn about "merge" syntax. You -can- use "merge" as a separate program if you want to, but the syntax isn't very nice, exactly because you're not really expected to.

But the real issue here is to explain local branches. I will happily admit that local branches are very VERY different from just about any other SCM, but I also claim that git is just much BETTER than other SCM's in this respect.

And yes, this is why you should NOT try to use the same naming as "hg", for example. Last I saw, hg still didn't even have local branches, To mercurial, repository == branch, and that's it. It was what I came from too, and I used to argue for using git that way too. I've since seen the error of my ways, and git is simply BETTER.

And the concept of local branches is exactly _why_ you have to have separate "fetch" and "pull", but why you do _not_ need a separate "merge" (because "pull ." does it for you).

If you don't understand local branches, you'll never understand git usage. And once you _do_ understand local branches, "fetch" vs "pull" actually is rather simple.

#236 lore raw

Re: multi-project repos

In reply to Linus Torvalds
Quoted 3 lines · Linus Torvalds

Yeah, you're supposed to "init-db" and "push". Right now, that tends to unpack everything (which is bad), although that is hopefully getting fixed (ie the receiving end shouldn't unpack any more if it is recent. Junio?)

Correct.

Quoted 3 lines

See?

Linus

Saw.

#223 lore raw

Re: multi-project repos (was Re: Cleaning up git user-interface warts)

In reply to Linus Torvalds
Quoted 4 lines · Linus Torvalds

A "fetch" by default won't actually generate a local branch unless you told it to. It just squirrels the end result into the magic FETCH_HEAD name [...]

Btw, the magic heads are probably not all that well documented. They do come up in the man-pages, but I don't think there is any central place talking about them. We have:

- "HEAD" itself, which is obviously the default pointer for a lot of operations, and that specifies the current branch (ie it should currently always be a symref, although we've talked about relaxing that)

- "ORIG_HEAD" is very useful indeed, and it's the head _before_ a merge (or some other operations, like "git rebase" and "git reset": think of it as a "original head before we did some uncontrolled operation where we otherwise can't use HEAD^ or similar")

I use "gitk ORIG_HEAD.." a lot, and if I don't like something I see when I do it, I end up doing "git reset --hard ORIG_HEAD" to undo a pull I've done. This is important exactly because ORIG_HEAD is _not_ the same as the first parent of a merge, since a merge could have been just a fast-forward.

- "FETCH_HEAD" as mentioned. Normally you'd only use this in scripting, I suspect, but it's potentially useful if you prefer to do a fetch first and then check out it (perhaps cherry-picking stuff instead of merging, for example).

So you could do (for example)

git fetch some-other-repo branch
gitk ..FETCH_HEAD
git cherry-pick <some-particular-commit-you-picked>

- "MERGE_HEAD" is kind of the opposite of "ORIG_HEAD" when you're in the middle of a merge: it's the "other" branch that you're merging.

It's mainly useful for merge resolution, ie

git log -p HEAD...MERGE_HEAD -- some/file/with/conflicts

is a great way to see what happened along both branches (note the _triple_ dot: it's a symmetric difference), to see _why_ the confict happened.

Most of the above are used implicitly in various cases, not just HEAD. The "--merge" flag to git-rev-list (and thus git log and friends) is just shorthand for the above "HEAD...MERGE_HEAD" behaviour (with the addition of also limiting the result to just conflicting files), so

	git log -p --merge

is basically exactly the same as the above (except for _all_ files that have conflicts in them rather than just one hand-specified one).

Anyway, maybe somebody didn't know about these, and finds them useful. Normally, the only one you would _really_ use is "ORIG_HEAD" (which is described in several of the tutorials and examples, so people hopefully already know about it). Most of the others tend to mostly be used implicitly, not by explicitly naming them - although you _can_.

#241 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds

git-pull.sh case "$merge_head" in · line 108

Quoted 10 lines · Linus Torvalds
git-pull.sh +6 -0
@@ -95,6 +100,12 @@ case "$merge_head" in
 	;;
 esac
 
+if test -z "$orig_head"
+then
+	git-update-ref -m "initial pull" HEAD $merge_head "" || exit 1
+	exit
+fi
+

So this is the place that probably wants a "git-checkout" before the exit, otherwise you'd (illogically) have to do it by hand for that particular case.

Of course, we should _not_ do it if the "--bare" flag has been set, so you migth want to tweak the exact logic here.

#26 lore raw
In reply to Junio C Hamano
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · Andreas Ericsson
Quoted 5 lines · Shawn Pearce

About the only trouble that can cause is a failed push when git-receive-pack needs to generate the reflog entry but cannot get the user's committer data because their gecos information doesn't exist.

Quoted 8 lines
Quoted 3 lines

In that case, it would be best if it let the commit go through using only the username. Reflogs are fixable afterwards, so there's no real harm done.

This sounds sensible, regardless of the current discussion on the default 'logallrefupdates' setting.

Volunteers?

Its a good idea. I'll do it later tonight, after dinner.

#95 lore raw
In reply to Junio C Hamano

Hi,

Quoted 9 lines · Junio C Hamano
Quoted 7 lines · Johannes Schindelin
Quoted 5 lines · Jakub Narebski
Quoted 2 lines · Junio C Hamano

(Jakub, please do not drop people from cc: list; you were asked more than once).

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

The problem is that I'm not subscribed to git mailing list;

So subscribe. I am sure I lost quite some of your responses to my emails, _just_ because you happen to kill me from the Cc: list.

IOW if you expect answers, _please_ adher to net standards.

FWIW, I also read the list traffic through gmane news gateway.

So, how do you tackle the problem Jakub evidently has, namely to reply to all the people who your reply refers to?

Ciao,
Dscho

#106 lore raw

PATCH 1/1 git-pull: refuse default merge without branch.*.merge

In reply to Junio C Hamano

Everybody hated the pull behaviour of merging the first branch listed on remotes/* file (or remote.*.fetch config) into the current branch. This finally corrects that UI wart by forbidding "git pull" without an explicit branch name on the command line or branch.$current.merge for the current branch.

The matching change to git-clone was made to prepare the default branch.*.merge entry for the primary branch some time ago.

---

Quoted 5 lines · Junio C Hamano

We could also lose the "primary branch" mapping at the beginning, but that has to wait until we implement the "forbid 'git pull' when we do not have branch.$current.merge for the current branch" policy we earlier discussed. That should also be in v1.5.0

And this does exactly that.

 git-parse-remote.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
git-parse-remote.sh +2 -1
index 6ae534b..7cd79c2 100755
@@ -144,7 +144,8 @@ canon_refs_list_for_fetch () {
 			curr_branch=$(git-symbolic-ref HEAD | \
 			    sed -e 's|^refs/heads/||')
 			merge_branches=$(git-repo-config \
-			    --get-all "branch.${curr_branch}.merge")
+			    --get-all "branch.${curr_branch}.merge") ||
+			merge_branches=.this.would.never.match.any.ref.
 		fi
 		set x $(expand_refs_wildcard "$@")
 		shift
#346 lore raw

Re: Cleaning up git user-interface warts

In reply to Nicolas Pitre
Quoted 8 lines · Nicolas Pitre
Quoted 6 lines · Petr Baudis
Quoted 4 lines · Junio C Hamano

You have to admit both pull and fetch have been contaminated with loaded meanings from different backgrounds. I was talking about killing the source of confusion in the longer term by removing fetch/pull/push, so we are still on the same page.

Quoted 4 lines
Quoted 1 line

How was/is fetch contaminated?

I think "fetch" is sane. Its only problem is a missing symetrical counterpart verb, like "get" and "put".

"throw" ?

But I think "I'll just 'throw' this set of patches at you" is a lot harshers sounding than "I'll just 'push' this set of patches at you".

Anand

#172 lore raw

Cleaning up git user-interface warts

In reply to Andy Whitcroft
Quoted 9 lines · Andy Whitcroft
Quoted 3 lines · Carl Worth

As has been discussed recently, update-index isn't intended as a "porcelain" command so the mention of it in the output of git-commit does lead to some user confusion.

Are we sure this isn't porcelain-ish? We need to use it in merge conflict correction and the like? You can't use git-commit there as a replacement. I'd expect it to be 'git update-index' rather than 'git-update-index' of course.

It was Junio that recently said update-index is plumbing, not porcelain.

So, the fact that conflict resolution still requires the use of update-index would just be the next thing to fix. A name for a replacement to use there could be "git resolve <paths>", (since the old git-resolve is now officially deprecated). That's a name that matches what hg uses in this situation, (another option is "resolved" which is what stg uses, but I think verbs for commands work better in general).

It would be really nice if none of the "common" commands had a hyphen in them, for example.

And then, the next phase of my evil plan would be to introduce a -i option for git-commit making it commit the state in the index. Then git-commit with no options could work like "git-commit -a" does now, (with the additional protection of not committing any unmerged files---that is the new "git resolve" would be required before "git commit" would work after a conflict). Users who really, really like the current behavior of git-commit could use the new alias support to pass the new -i option in order to maintain compatible behavior.

Then, the last thing I'd really like to fix is to allow a usage of "git merge <branch>" instead of the awkward "git pull . <branch>".

With that, most of the user-interface warts that I regularly run into with git would be solved. Oh, except it would also be nice to eliminate the "plumbing" commands in a couple of places:

1) From the "man git" man page

2) From git-<TAB>, (maybe the solution for this is to make "git <TAB>" work and only do tab-completion for the commands blessed enough to appear in "git --help"? Also push the tab completion stuff out as a standard part of packages.

Anyway, now I've just gone and blown all my secret plans for changing git in ways to make it less intimidating for new users.

For reference, the latest potential batch of new users that I'm dealing with is the set of Fedora package maintainers who are looking at replacing CVS for their tree of package-building scripts. They are currently evaluating systems and liking the interface of hg. Here's the top of the current thread:

https://www.redhat.com/archives/fedora-maintainers/2006-November/msg00030.html

Here's the report about "git commit -a" confusion that led to my patch above:

https://www.redhat.com/archives/fedora-maintainers/2006-November/msg00141.html

And here's my reply where I suggest that git UI might still be improved in these areas:

https://www.redhat.com/archives/fedora-maintainers/2006-November/msg00149.html

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFWhd/6JDdNq8qSWgRAvFpAKCHc2nUZhu8q/VaukIOwiNsSfId9gCdGWA2 frKKGnCCLLOUmzRX8HRPfAg=
=iJwu
-----END PGP SIGNATURE-----

#34 lore raw
In reply to Shawn Pearce
Quoted 8 lines · Shawn Pearce
Quoted 7 lines · Andy Parkins

How's this then:

$ git commit
$ git commit
$ git commit
$ git reset HEAD^^^
Quoted 9 lines
Quoted 4 lines

"AGGGHHHHHH! I meant HEAD^^"

At this point I start running "git-prune -n | grep commit" and some liberal use of git-show to try and find the hash of the object so I can do

At this point I usually try to politely suggest that users do:

  git repo-config --global core.logAllRefUpdates true

And this is where I politely say that this option should be true by default for everybody.

I don't recall why it isn't so yet.

#254 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 2 lines · Junio C Hamano
Quoted 2 lines

- clone for getting all branches of a repo, but no command for updating all branches of a repo.

I want this one as well.

Quoted 3 lines

This one I can understand, but how would you propose to "update all branches", in other words what's your design for mapping remote branch names to local branch namespaces?

As long as its consistent with "clone" I'll be happy, (I think as part of a separate topic we need to fix the mappings in clone, see --use-separate-remotes as default and related).

The current case is really annoying where I have to throw use clone into a new repository just to get everything, rather than just being able to fetch everything into the repository I already have.

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFXQQ36JDdNq8qSWgRArDuAKCRW9oNmKBMTDt3zsE4bclQizdkigCfeTyh UDLMMXg1jX4W32JVkzcxo40=
=z/ZX
-----END PGP SIGNATURE-----

#67 lore raw
In reply to Junio C Hamano
Quoted 12 lines
Quoted 3 lines

* git-branch is not verbose enough when creating a new branch, for a new user a little reassurance that what they meant to happen has happened would be nice.

The same comment applies here.

However, perhaps you could make lack of "[user] expert = true" in ~/.gitconfig to trigger more verbose messages that say "yes sir I did what I was told to do".

Not interested in implementing that myself at all, though.

Quoted 8 lines
Quoted 2 lines

Tell them if they
made a branch as well, which branch they are now on.

I think you are talking about "checkout -b" not commit here; this might be a borderline (branch creation is less often done and it might warrant assuring feedback), but I think it still falls into the "doing exactly what it was told to do" category.

Yes. checkout -b works. But only _if_ you have read the manpage. Someone thinking about branching at the current commit would just have

git branch

in mind (so would I). Its not obvious to say

git checkout -b <newbranchname> oldbranch

becouse checkout implies to advance to another version.

-Peter

#45 lore raw

Re: [PATCH] make commit message a little more consistent and conforting

In reply to Shawn Pearce
Quoted 8 lines · Shawn Pearce
Quoted 1 line · Nicolas Pitre

It is nicer to let the user know when a commit succeeded all the time, not only the first time. Also the commit sha1 is much more useful than the tree sha1 in this case.

I agree the commit sha1 is more useful than the tree sha1, but I'm not really sure its useful to show the commit sha1 post commit. If you want to show something the diffstat like what git merge does is better.

diffstats can be huge though. I'd rather have those only with -v option.

Signature · 2 lines
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se
#232 lore raw

Re: multi-project repos

In reply to Junio C Hamano
Quoted 6 lines · Junio C Hamano

True, except if you did:

        $ git pull
        $ git checkout otherbranch
        $ git show HEAD@{1}
Quoted 8 lines

My real point was that I was wondering if it also makes sense for ref-log to record switching branches for the symref itself.

But after sending that message I thought about it a bit more and concluded that it is not an interesting information. It is more code that affects unrelated places even if we were to implement it and without real gain, so let's not log symref itself and keep the current implementation.

I agree completely.

I have no interest in a history of what branches I've recently been on. All I care about is the history of this branch. And I consider HEAD to be nothing but a shortcut that always points to the current branch... so its darn useful for that.

In retrospect CURR may have been a better name for the HEAD symref but its far too late to even consider changing that, so lets not go down that road. :-)

#374 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 13 lines · Carl Worth

I'm not the original poster, but I feel the same way about the line being unclear.

Here's a real-world example from last week.
...
Anyway, when I announced this I also mentioned how easily someone might generate an entire series of reports for a series of commits. The command I gave as an example is:

	for rev in $(git rev-list 1.2.6..HEAD); do
	    cairo-perf-diff $rev
	done
Quoted 6 lines

I think that's a perfectly legitimate one-liner for users to use, and it really shows off the easy-scriptability of git. But certainly, no "new porcelain" author is going to consider rev-list to be porcelain rather than plumbing, right? So as soon as I start teaching people to do useful stuff like this, they might have to reach down into the "scary" git interface.

That is a very fine example, but I do not see why it is a problem. I do not think the goal of Porcelain is to make it totally unnecessary for users to know about the plumbing.

The one-liner is essentially a new Porcelain command that is useful in the cairo developers' workflow, and implementing it with a plumbing command makes perfect sense. The whole point of git plumbing is to be friendly for scripted use. If the user who learns that one-liner from you gets curious why and how that one-liner works, that would be a good gentle introduction to the plumbing, but otherwise the user is not forced to know about it.

Also I do not see a problem if some plumbing commands happen to be also useful by themselves ("[alias] less = -p cat-file -p" comes to mind for example).

Some plumbing commands may be too deep magic and users do not have to directly deal with them every day. Some other plumbing commands are so low-level and needs combination with others to be any useful, and it is cumbersome to type the combination every day. For the latter kind, we have Porcelain commands that implement the frequently used combination and the end users do not have to know about them.

So it is true that by having a rich and usable set of Porcelain, there is less need for the users to know about all the plumbing details, but I consider that is a happy consequence. It does not have to be the goal of having a good Porcelain to hide the whole plumbing.

#301 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 11 lines · Junio C Hamano
Quoted 9 lines · Nicolas Pitre
Quoted 7 lines · Junio C Hamano

I am wondering if that could be "git merge <committish>..." instead. I do not care too much about the ... part (i.e. an Octopus), but I often find myself doing:

git checkout next
git merge "Merge early part of branch 'foo'" HEAD foo~3

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

when earlier part of "foo" topic are worthy to be in 'next' but not the later ones.

Indeed !

Indeed, what?

What you propose would be excellent indeed.

Quoted 11 lines

That means that updated "git merge" (not the current one) would not be able to assume it's parameter is a branch name, and still has to come up with the merge message "Merge <branch>".

Merging only within the local branch namespace already has the problem you need to solve to come up with a nicely formatted "Merge <branch> of <remote repository>" some way. I am not saying that this is unsolvable (you can look at remotes/ files to see what remote tracking branch the branch is about), but something you need to keep in mind when implementing the improved "git merge".

Right. But that is an _implementation_ detail, not a usability issue.

#335 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 9 lines · Linus Torvalds

But the fact is, git isn't really that hard to work out, and the commands aren't that complicated. There's no reason to rename them. We do have other problems:

 - default branch selection for merging is broken (it should definitely take the current branch into account). When I do "git pull" with no branch specification, and I happen to be on a branch that is associated with something else than "master" in the remote, I shouldn't merge with master.

This problem is _slightly_ migitated by branch.<name>.merge config variable. Slightly because you have to specify branch to merge, instead of forbidding merge if you are not on specific branch (and you don't override it).

Quoted 3 lines

 - I agree that having to create temporary branches to just look at a tag that you don't want to actually develop on is just unnecessarily bothersome.

Agreed.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#180 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 21 lines · Junio C Hamano
Quoted 4 lines · Nicolas Pitre

"You pull the remote changes with 'git-pull upstream,, then you can merge them in your current branch with 'git-merge upstream'."

Isn't it much simpler to understand (and to teach) that way?

If it were "you download the remote changes with 'git download upstream' and then merge with 'git merge'", then perhaps, but if you used the word "pull" or "fetch", I do not think so.

I would be all for changing the semantics of "pull" from one thing to another, if the new semantics were (1) what everybody welcomed, (2) what "pull" traditionally meant everywhere else. In that case, we have been misusing it to be confusing to outsiders and I agree it makes a lot of sense to remove the source of confusion. But I do not think CVS nor SVN ever used the term, and I was told that BK was what introduced the term, and the word meant something different from what you are proposing.

Quoted 7 lines

You have to admit both pull and fetch have been contaminated with loaded meanings from different backgrounds. I was talking about killing the source of confusion in the longer term by removing fetch/pull/push, so we are still on the same page.

That's where my "you download from the upstream and merge" comes from.

But the fact is that HG (which has a growing crowd of happy campers, maybe even larger than the BK crowd now) did work with and got used to a sensible definition of what a "pull" is. This means that their definition is becoming rather more relevant with time than what it used to, and because it is a saner definition than what GIT has for the same word which HG users really have no issue with, I think we really should leverage the "common wisdom" and consider aligning ourselves with them in this case rather than trying to go into a totally different direction. We simply won't gain anything trying to teach people "a pull in HG is a download in GIT". If a pull becomes the same thing for both then it's one less oddball in the GIT interface.

#103 lore raw
In reply to Nicolas Pitre
Quoted 9 lines · Nicolas Pitre
Quoted 5 lines · Shawn Pearce

But I'm not sure that git-add should output anything. Last I checked the 'mv' command in Linux doesn't say "Move 5 files" when I move 5 files into a directory. Likewise I don't think that knowing that 6781 files were added is useful, what if it should have really been 6782 files? I'm unlikely to know, care, or realize it.

git-add -v does output added files already.

Ha! Now only get it to accept --verbose as long alternative to -v option, and add -v/--verbose option to other similar commands (git-mv for example).

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#170 lore raw

PATCH 1/1 commit: Steer new users toward "git commit -a" rather than update-index

As has been discussed recently, update-index isn't intended as a "porcelain" command so the mention of it in the output of git-commit does lead to some user confusion.

---
 wt-status.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
wt-status.c +1 -1
index 7dd6857..4edabcd 100644
@@ -126,7 +126,7 @@ static void wt_status_print_changed_cb(s
 	int i;
 	if (q->nr)
 		wt_status_print_header("Changed but not updated",
-				"use git-update-index to mark for commit");
+				"use \"git commit <files>\" to commit or \"git commit -a\" for all");
 	for (i = 0; i < q->nr; i++)
 		wt_status_print_filepair(WT_STATUS_CHANGED, q->queue[i]);
 	if (q->nr)

--
1.4.3.3.gf040

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFWfIJ6JDdNq8qSWgRAk/mAKCBOXGZRC2bwO0Z9LqMP3d1pjOaEwCeNvwI 8H6Kn6LsA111YAhziEB+BUc=
=wQjx
-----END PGP SIGNATURE-----

#181 lore raw

Re: Cleaning up git user-interface warts

In reply to Nicolas Pitre
Quoted 4 lines · Nicolas Pitre

But the fact is that HG (which has a growing crowd of happy campers, maybe even larger than the BK crowd now) did work with and got used to a sensible definition of what a "pull" is.

Guys, before you start thinking this way, the fact is, there's a lot of happy git users.

So the reason for using "git pull" is

- bk did it that way, and like it or not, bk was the first usable distributed system. hg is totally uninteresting.

- git itself has now done it that way for the last 18 months, and the fact is, the people _complaining_ are a small subset of the people who actually use git on a daily basis and don't complain.

So don't fall for the classic "second system syndrome". The classic reason for getting the second system wrong is because you focus on the issues people complain about, and not on the issues that work well (because the issues that work fine are obviously not getting a lot of attention).

If you think "pull" is confusing, I can guarantee you that _changing_ the name is a hell of a lot more confusing. In fact, I think a lot of the confusion comes from cogito, not from git - the fact that cogito used different names and different syntax was a mistake, I think.

And that '#' for branch naming in particular was (and is) total braindamage. The native git branch naming convention is just fundamentally much better, and allows you to very naturally fetch multiple branches at once, in a way that cogito's syntax does not.

So when I see suggestions of using that brain-damaged cogito syntax as an "improvement", I know for a fact that somebody hasn't thought things through, and only thinks it's a better syntax beause of totally bogus reasons.

I do agree that we probably could/should re-use the "git merge" name. The current "git merge" is an esoteric internal routine, and I doubt a lot of people use it as-is. I don't think it would be a mistake to make "git merge" basically be an alias for "git pull", for example, and I doubt many people would really even notice.

But the fact is, git isn't really that hard to work out, and the commands aren't that complicated. There's no reason to rename them. We do have other problems:

- default branch selection for merging is broken (it should definitely take the current branch into account). When I do "git pull" with no branch specification, and I happen to be on a branch that is associated with something else than "master" in the remote, I shouldn't merge with master.

- I agree that having to create temporary branches to just look at a tag that you don't want to actually develop on is just unnecessarily bothersome.

But trying to rename "pull" (or the "git" name itself) is just going to cause more confusion than you fix.

#216 lore raw

Re: multi-project repos (was Re: Cleaning up git user-interface warts)

In reply to Johannes Schindelin
Quoted 4 lines · Johannes Schindelin
Quoted 1 line

Why? We _do_ have the temporary branch. It's called FETCH_HEAD.

It is a terrible UI, because it was not that obvious to me. And I consider myself not a git newbie.

Heh. The "temporary branches" are actually the _original_ branches as far as git is concerned. The long-term branches only came later.

So in many ways, HEAD, FETCH_HEAD, MERGE_HEAD and ORIG_HEAD are more fundamental than any long-term branch has ever been, and maybe they should be taught first as such.

So you're newbie enough that you've only seen those new-fangled "real" branches.

When I was young, we had to walk to school up-hill in three feet of snow every day. And we _liked_ our FETCH_HEAD's.

Quoted 2 lines

Besides, it is not really a temporary branch. If it was, the pull would _not_ download all these objects again, would it?

Well, exactly because they are temporary, we can't actually trust the objects they point to. They have no "real" long-term life, so no, I'm afraid that we always will have to re-fetch the objects, because fetching them is the only way to know that we still have them.

That said, we could certainly _make_ them be honored by things like "git prune" and friends. But yes, they really _are_ temporary branches right now, and part of the meaning of that "temporary" is exactly the fact that git fetch will not trust that you still have the objects.

For example, if you used one of the old-fashioned commit walkers, maybe we got the initial commit, but we may not have gotten the whole _chain_. See?

Temporary branch indeed.

Quoted 3 lines
Quoted 1 line

Again, why didn't you use FETCH_HEAD?

Because I am a Jar-HEAD?

Well, we clearly should document them better. Anybody?

#269 lore raw

Re: Cleaning up git user-interface warts

In reply to Andy Parkins
Quoted 3 lines · Andy Parkins

On the one hand you're arguing that git syntax is easy to learn, and on the other that no one will be able to learn a new syntax just as easily.

I'm saying that people who are new to git will _have_ to learn new concepts ANYWAY.

I don't think the naming is the hard part.

The fact is, git is one of the very few (essentially _only_) SCM's that make it very clear that all real operations are local and that if you want to work with other repositories, you have to "fetch" those into local branches first. The fact that "pull" exists at all is really just shorthand.

If people have trouble explaining this to others, and have trouble grasping "pull", then I will bet that the _real_ issue has nothing at all to do with naming at all, and the real issue is that people are being _taught_ the concepts in the wrong order.

Before you learn "pull", you should learn "fetch". Don't even _mention_ "pull" until the person got what "fetch" means. Because the fact is, "fetch" is really the much more fundamental operation, and once you really understand what "fetch" does, "pull" is obvious.

So I'll argue that the problem isn't naming, the "problem" is really that git has a few fundamnetal concepts that people aren't used to. The most fundamnetal of those is the notion of the local branch-space. EVERY other (broken) SCM has branches as being some kind of totally idiotic separate subdirectories, or doesn't really support branches at all (ie neither BK nor CVS really support "branches" - even if a concept of that name exists in CVS, it has nothing at all in common with the git model of branches).

But once you understand branches, and understand "fetch" (and it really isn't _that_ complicated: fetch really does exactly what the name says, so if you understand local branches, you will understand "fetch"), then it's a much smaller step to explain "pull = fetch + merge".

But I bet people don't teach it that way. They _start_ by teaching "pull". Right?

#4 lore raw
In reply to Andy Parkins
Quoted 4 lines · Andy Parkins

The major barrier to implementing these sorts of changes is, I think, worries about users of the output of these commands in scripts. I say: screw them, porcelain is there for the breaking :-)

I like that ;-).

Thanks for the list. I'll comment only on no brainers. Things I cannot decide to agree or disagree are not mentioned in this message.

Quoted 6 lines

* git-fetch has to be in working root. If I can do git-push from anywhere in my tree, why can't I do git-fetch?
* git-reset has to be in working root. If you typically sit in, say "src/", it's annoying to have to change directory to do a reset.
* git-verify-tag would be nicer as a switch to git-tag

True and true and true; let's make them happen.

Quoted 4 lines

* git-commit doesn't (generally) have output - after a commit, it's difficult to know if anything happened. Get users used to the idea of hashes to identify commits by telling them which one they just made.

I am moderately against making a command verbosely report when it did exactly what it was told to do, _unless_ the command is expected to take longer than other commands in git suite, or it is something the user rarely runs.

Quoted 3 lines

* git-branch is not verbose enough when creating a new branch, for a new user a little reassurance that what they meant to happen has happened would be nice.

The same comment applies here.

However, perhaps you could make lack of "[user] expert = true" in ~/.gitconfig to trigger more verbose messages that say "yes sir I did what I was told to do".

Not interested in implementing that myself at all, though.

Quoted 2 lines

Tell them if they
made a branch as well, which branch they are now on.

I think you are talking about "checkout -b" not commit here; this might be a borderline (branch creation is less often done and it might warrant assuring feedback), but I think it still falls into the "doing exactly what it was told to do" category.

Quoted 2 lines

* git-init-db says "defaulting to local storage area", as if that is meant to be a helpful message

It probably used to be back when the original tutorial Linus wrote was still called tutorial.txt; but I agree that the message is not helpful anymore.

Quoted 6 lines

* git-merge output is horrible - this affects git-pull, git-rebase, and git-cherry-pick. Issuing "fatal" errors and then carrying on is very confusing. Errors in merges appear multiple times. The files upon which which there is a conflict are spread throughout the output. Most of the output is not relevant to an average user.

Yes.

Quoted 4 lines

* git-apply output is horrible. It says a few things about whitespace on stdin then just finishes. When it succeeds. When it fails, it just says failed, it doesn't say why a particular hunk failed.

No. It either says patch is corrupt, or a hunk at this line does not apply. I do not see what more would you would want to ask it to say.

Quoted 3 lines

* git-commit without "-a" and without an "update-index" says "nothing to commit", which isn't an adequate message to help a user who hasn't realised they need to update the index

Perhaps.

"\n(hint: 'git add' to stage your changes, or 'git commit --all')\n" in wt-status.c under "[user] expert = false" mode?

Quoted 4 lines

* git-rebase --skip requires that the offending file be clean with git-checkout HEAD file
before the skip will work. Why? The fact of the skip is enough knowledge for rebase to know that I don't care if the merge is lost

As long as your solution does not accidentally lose local, unrelated changes, changing "git-rebase --skip" to do the needed clean-up itself for the user would be Ok (I think we would want to loosen the requirement for starting in a totally clean working tree in the future).

Quoted 3 lines

* git-rebase/git-cherry-pick/git-reset/etc should all tell the user that they need to run git-prune to tidy up after themselves.

While I agree the users need to be taught about 'prune', I do think immediately after running the above commands is exactly the wrong point to run 'prune'. 'prune' should not be run while you are busily munging the tip of the branch with rebase and reset to come up with something that you can call "oh, I am done with this series for now." Otherwise even lost-found would not be able to help you.

Also, this sequence creates crufts that need to be pruned:

edit hello.c
git add hello.c
edit hello.c
git add hello.c

I do not think we would want to suggest 'git prune' upon every 'git add'.

Quoted 1 line

* git-add has no output, whether it works or not

"git add no-such-file" complains, and I think that is adequate. Now with Nico's 'add means adding contents, not path' change is in, we _might_ want to differentiate adding a path that was untracked before and updating the contents, but I think this again falls into "doing exactly as told" category.

Quoted 2 lines

* git-cat-file is badly named. git-cat-object would be slightly better.

Not a Porcelain.

We might want to add a pair of built-in internal aliases though:

[alias]
cat = cat-file -p
less = -p cat-file -p

or have these as samples in template .git/config file.

Quoted 10 lines

* In general the principle for messages should be the same as for presentations:
- say what you're going to do
- do it
- say what you did
So for example, "git-branch newbranch existingbranch" would say
Branching at "existingbranch", hash XXXXXXXXXXXXXXXXXX
- created branch "newbranch"
- your working branch is "existingbranch"
Rather than the nothing that it currently outputs.

In general the principle ought to be not to say anything if the command does exactly what it was told to do successfully, unless the operation is expected to take longer than other normal commands in the git suite, or something that is rarely used.

Perhaps under "[user] expert" control.

#286 lore raw

Re: Cleaning up git user-interface warts

In reply to Johannes Schindelin
Quoted 7 lines · Johannes Schindelin

I introduced the remote.<nick>.{url,fetch,push} entries into the config with the goal to enhance -fetch to remember the current command line with a setting. I was the only one to find that useful.

BTW I still would argue that it is better to write the remote information into the config, because you have a saner way to manipulate that from scripts than .git/remotes/<nick>.

I'm *fully* in favor of the remote.<nick>.{url,fetch,push} entries in the config file. I've pretty much switched every repository to that format at this point.

In writing git-gui I'm finding it much, much easier to manage things through repo-config than to do any mucking around in the .git/remotes directory. Yes, the remote files have simple format, but I can get everything in one "git repo-config --list" pull it all into a Tcl array and work with it; using .git/remotes means I have to open the file and read each line too. :-(

#337 lore raw

Re: Cleaning up git user-interface warts

In reply to Josef Weidendorfer
Quoted 5 lines · Josef Weidendorfer

Often, I find myself doing "git branch" just to make sure that I am on "master", so that a following pull does not do a bogus merge.

Can we please disable this behavior, e.g. by allowing a fake first Pull line like "Pull: (not-for-merge)" to prohibit any merge?

Wait, if you don't want pull to merge, why do you pull and not fetch?

(Disclaimer: I'm not intimately familiar with git pull/fetch and I didn't read the whole thread yet.)

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
#399 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 3 lines · Junio C Hamano

I do not think the Porcelain-ish UI that is shipped with git should be taken with the same degree of "authority" as git Plumbing.

I think we should fix this. "This is great technology with a crap interface on top" really isn't a good story. I don't actually agree with that---I don't think the git interface is really all that bad, it's just got a few little things that tend to trip up new users in my experience.

And what git does really well, (history exploring, allowing for pipeline on-liners to iterate over revisions in A..B), are things that don't even exist in other tools, nor even in the "alternate" porcelains for git. This stuff is where git's interface is really fantastic, and it would be a shame to write it off.

Quoted 7 lines

I think
single isolated developers, contributors and CVS style shared repository usage could be a lot improved because neither of us were concentrating in their workflows. This needs somebody motivated enough to improve things in that area. For example, StGIT with its 'float' command is a great improvement over what rebase does for people in the contributor role.

Yes, there are some specific workflow-oriented operations that git doesn't handle as well as it could. Things like commit --amend are certainly improvements. One that is still totally broken is "follow all the development in another repository" where clone followed by repeated fetch doesn't do the job as soon as the remote adds or deletes a branch.

Quoted 5 lines

But making it more usable for whom is a big question.

Quite frankly, I do not think there can be _the_ single UI that would satisfy different types of workflows for some of the commands.

I strongly disagree. Or at least, I don't think we've tried hard enough yet that we should give up on this.

I do agree that people in different roles will have different lists of "most used operations" and that some operations won't appear on some users lists at all, (someone who's just "watching" development won't commit or merge, for example---[or so they thing when they start]).

But I really don't think that for any given operation that different roles impose a different desire on the behavior of the operation. We have different people with different background and disagreement on names and silly things like that, but I don't think that's related to the roles in which they are working with the tool.

Quoted 2 lines

For example, fetching and merging from many places without necessarily having corresponding tracking branches is a great

...

I don't think we've ever had this right in git. The new --use-separate-remotes stuff or similar will start to help as it becomes the default. I don't see how this won't benefit everybody.

Quoted 3 lines

For another example, having a commit command to commit everything by default is disastrous for people who allow their workflows to often be interrupted.

Workflow-interruption is an important thing to support, but separating update-index and commit really doesn't address it nearly as much as I would like. The lack of really good workflow-interruption support has been one of my longest-running annoyances with git, (perhaps because I have a problem with trying to do too many things at once). Git can create and change branches fast enough that it really should be able to help me better with this. The only missing piece is being able to stash the dirty stuff on the current branch, to be able to come back to it later. I've talked a bit about what I would like in this area before, and I really just need to code it up.

Quoted 4 lines

It is not just command line syntax and the defaults, but concepts as well. People in the integrator role often need to deal with merges and you would need to be aware of the role of the index and need to be able to manipulate the index, ...

Again, I think it's more that the specific operations bring in concepts, (merge bringing in the index here). As such, someone never doing a merge could easily get by not having to understand the index.

Quoted 8 lines

A Porcelain that does a very similar thing in slightly different way is obviously a waste, but otherwise I do not think it is a problem to have different Porcelains. StGIT does not compete with the "sucky" Porcelain-ish shipped with git but makes the user's life a lot more pleasant by complementing what the sucky one does not do well. It is not very useful while I am playing the integrator role, but when I am doing my own thing it is a great addition to my toolchest.

But even here, there's a bunch of waste in StGit. For example, there are a lot of commands in StGit whose only purpose is to translate back and forth between the StGit and non-StGit views of the world, (init, assimilate, commit, uncommit). Those could all be discarded if the functionality of StGit were brought down into git itself. Then there are a myriad of StGit commands which are basically just the same as their git counterparts.

Now, StGit is a great tool, and I know that it works really well for some people in the role of just maintaining a stack of changes against some upstream, and can use StGit alone and never touch "git" the command-line.

But for someone like me who already uses git regularly, and occasionally just wants to pop back a few commits, amend it, and then push again, StGit is not helpful, (the series of init, assimilate, and uncommits just to get started is prohibitive compared to just working out the awkward steps needed to make a temporary branch and rebase). So I'd love to see just a couple of commands added to "git" to support these kinds of operations more smoothly.

Quoted 4 lines

I am from the camp that does _not_ want to hide the index, so obviously I do not see any value in its effort to hide the index. But other aspects of it, most notably being friendly to simpler workflows, is a very good thing.

I don't think "hide or not-to-hide" is the right way to frame the discussion about the index. I regularly use update-index to stage partial commits, and I find that very useful. And obviously the index is involved in resolving merge conflicts.

But I don't think the user-interface for either of those operations (partial commit, resolve conflicts), is ideal, and the current requirement to use either "update-index <paths>" or "commit -a" after modifying a file for the first time is demonstrably a hangup for a lot of new users. So I really think it's possible to address both of these at once.

Anyone, that's enough generic rambling from me without any specific content. I'll try to keep future messages focused on specific desirable operations that have problematic interfaces in git right now, along with proposals for improving them.

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFW3236JDdNq8qSWgRAvpYAJ4tTW2O9iZmILd4n/lDH4/fy43ODACePKaV EEzi2LDBKRKjLHR4n6tevkM=
=+9ng
-----END PGP SIGNATURE-----

#275 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 9 lines · Carl Worth

Well, one of the problems is that with current git I can teach, (and I have), that there's a conceptual:

pull = fetch + merge

But then shortly after I have to teach an interface notion:

merge = pull .

This is why I would suggest teaching the _concept_ of the "merge", and not the actual command.

I don't think you should basically ever use the "git merge" command itself, not in teaching, and not in real life. So after talking about branches and having taught people to use "git fetch", the next stage is not so much to teach people to use "git merge", but to explain to them the _concept_ of merging.

I really think that's a fairly quick thing, partly exactly _because_ you shouldn't at that point need to worry about syntax or details or anything like that at all. You just tell them that there's a notion of "merging" two branches by joining them together and havign the result have the changes from both branches. So it's a _conceptual_ issue, and that's why I said I think you should just totally gloss over the whole issue of "git merge" syntax.

Once you've explained the _concept_ of merging, you then introduce the command to actually _execute_ the merge: it's "git pull".

See? No circular thinking at all. One is a _concept_ ("join two branches together by including both in the result") and the other is a command ("pull will fetch the remote data if any, and merge it into the current branch").

If you explain it that way, then _obviously_ if you don't need to fetch any remote data, doing "git pull . xyzzy" will merge the local branch "xyzzy" into the current branch.

#52 lore raw

Re: [PATCH] make commit message a little more consistent and conforting

In reply to Shawn Pearce
Quoted 4 lines · Shawn Pearce
Quoted 3 lines · Andreas Ericsson
Quoted 2 lines · Shawn Pearce
Quoted 1 line · Nicolas Pitre

It is nicer to let the user know when a commit succeeded all the time, not only the first time. Also the commit sha1 is much more useful than the tree sha1 in this case.

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines

I agree the commit sha1 is more useful than the tree sha1, but I'm not really sure its useful to show the commit sha1 post commit. If you want to show something the diffstat like what git merge does is better.

diffstats can be huge though. I'd rather have those only with -v option.

But they are on by default for pull/merge, and disabled by -n.

Yes, but it makes sense for merges where you generally pull someone elses work or one of your topic branches because it gives a general feel for the amount of modifications and are a sort of conclusion. Commits are a different thing, because you should know what kind of changes you've just done. If you don't you have other problems. I for one run git diff quite frequently when I'm getting close to a commit to make sure I don't get only the changes I want. I imagine others do too, so getting a diffstat when issuing the actual commit would just be noisy and irritating.

Signature · 2 lines
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se
#387 lore raw

Re: Cleaning up git user-interface warts

In reply to Petr Baudis
Quoted 9 lines · Petr Baudis

(vi) Coding issues. This is probably very subjective, but a blocker for me. I have no issues about C here, but about the shell part of Git. Well, how to say it... It's just fundamentally incompatible with me. I *could* do things in/with it, but it's certainly something I wouldn't _enjoy_ doing _at all_, on a deep level. I think the current shell code is really hard to read, the ancient constructs are frequently strange at best, etc. It's surely fine code at functional level and there'll be people who hate _my_ style of coding and my shell code which isn't perfect either, but it's just how it is with me.

I've been thinking about revamping the style of shell scripts in git-core Porcelain-ish for some time, and I have a feeling that now may be a good time to do so, after one feature release is out and the list is discussing UI improvements.

But before mentioning the specifics, let me mention one tangent. I recently installed an OpenBSD bochs (it was actually a qemu image) without knowing much about the way of the land, and after adjusting myself to necessary glitches (like "make" being called "gmake" there), I saw git properly built and pass its selftest. I was pleasantly surprised when I noticed there was no 'bash' on the system after all that.

I would like to keep it that way.

I'll list things I would want to and not want to change. Comments from the list are very appreciated. You can say things in two ways:

* I guarantee that the _default_ shell on all sane platforms we care about handle this construct correctly, although it was not in the original Bourne. There is no reason to stay away from it these days.

or

* You've stayed away from this construct but now you say you feel it is Ok to use it. Don't. It would break with the shell on my platform (or "it is a bad practice because of such and such reasons").

I do not think many people can say the former with authority unless you have a portability lab (the company I work for used to be like that and it was an interesting experience to learn all about irritating implementation differences). And "POSIX says shell should behave that way" is _not_ what I want to hear about.

But the latter should be a lot easier to say, and would be appreciated because it would help us avoid regressions.

Things I would want to change:

- One indent level is one tab and the tab-width is eight columns. Some of our scripts tend to use less than eight spaces for indentation to avoid line wrapping.

- More use of shell functions are fine. Especially if the
above change makes lines too long, the logic should be refactored.

- It is so 80-ish to follow certain portability and performance wisdom. The following should go:

. Use "case" when you do not have to use "if test".

. Avoid ${parameter##word} and friends and use expr instead
to pick a string apart.

. Avoid "export name=word", write "name=word; export name"
instead.

   . Avoid ${parameter:-word} and friends when ${parameter-word}
     would do.

Things I do not want to change:

- The shell scripts should start with #!/bin/sh, not #!/bin/bash (nor even worse "#!/usr/bin/env sh").

- Shell functions are written as "name () { ... }" without "function" noiseword.

- 'foo && bar || exit' exits with the error code of what failed; no need to say 'exit $?'.

- String equality check for "test" is a single =, not ==.

- Do not use locals.

- Do not use shell arrays.

- In general, if something does not behave the same way in ksh, bash and dash, don't use it (that does not mean these three are special; it just means if something is not even portable across these three, it is a definite no-no).

I do not think I need to list other common-sense shell idioms in the latter category (e.g. 'using "test z$name = zexpected" when we do not know what $name contains' falls into that).

#414 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth

Jumping into this a day late, but:

Quoted 6 lines · Carl Worth

I don't see any defining difference that justifies cogito's existence ("hide the index" maybe? let's just hide it a tiny bit more in git). And I would like to help work to get the remaining good stuff that has been proven in cogito---to get it pushed down into git itself.

Agreed totally on the second point. It would be great if git natively supported everything people use in Cogito.

I find myself using native git commands for the most part, except for one Cogito command: "cg-update". It is vastly more convenient than git-pull in large part because it automatically merges upstream changes with uncommitted working-copy changes. I suppose you could classify this as "hide the index" in some sense.

Maybe I should give an example of what I mean. Suppose I have two child repositories (owned by different developers, say):

cg-clone repo child1
cg-clone repo child2

Now I go into both of them and make different (hopefull non-conflicting) edits to the same file.

echo foo >> child1/testfile
perl -pi -e 's/tree/shrub/' child2/testfile

I push the change from child1 into the integration repo.

cd child1
git-commit -a
git-push

Now I want to incorporate the change into child2, where I'm still doing work. With Cogito, I go to child2 and run:

cg-update

and afterwards, the upstream changes are merged into testfile and "git diff" still shows my local edits. With Git native commands, updating child2 if I'm not ready to commit yet is more like:

git-diff --binary > /tmp/patch
git-reset --hard
git-pull
git-apply /tmp/patch

I might have gotten that slightly wrong, but I think I have the general idea right; in any event, it's not nearly as convenient! The alternative is to commit then pull, but then when I want to look at my local edits, I have to remember to diff my working copy against the correct revision, which gets increasingly annoying if I update more than once.

Like others on this list, I'm also trying to sell an existing user base (in this case, they're using Subversion) on Git. The lack of a built-in equivalent to "svn update" is actually a pretty big UI annoyance for people whose workflow doesn't require git's more sophisticated feature set at a given point in time. Even a sophisticated user doesn't need the full power of the tool 100% of the time, so this isn't just a novice vs. expert thing in my opinion.

Absent Cogito, would the lack of a simple "svn update" equivalent be a deal-killing "throw your hands up in disgust and give up" thing? Maybe not, but it's a daily "ugh, why am I having to type extra commands to do something that only took one command in svn?" thing. So it's nice to have Cogito to paper over that particular wart.

If there is a native git equivalent to cg-update including the working-copy automatic merges, I'll be delighted to stand corrected!

#78 lore raw
In reply to Andy Parkins

Hi,

Quoted 10 lines · Andy Parkins
Quoted 5 lines · Johannes Schindelin
Quoted 3 lines

* git-revert should be called git-invert. It doesn't remove a change from history, it simply applies another commit that does the opposite of whatever commit you are "revert"ing. That's an inversion.

No. An inversion is the _opposite_. Not an undo.

That's what I'm saying, we are applying the opposite of the given commit
- that commit is being inverted and applied again.

Ahh! I get what you are thinking. I was talking about reverting a change from the _content's viewpoint_. I _never_ want to revert history (I am no politician, you know?)

Quoted 5 lines
Quoted 2 lines

newbie cannot, and does not want to, understand exactly what is going on.

"newbie" doesn't mean "idiot". Everybody wants to understand what is going on.

I heartly disagree. I saw so many faces _begging_ me to just say _what_ to do, not _why_, and quickly, please.

Quoted 9 lines
Quoted 4 lines

So, think of it as our response to Windows' non-progress-bar: when you start up Windows, there is a progress-bar, except that it does not show progress, but a Knight Rider like movement, only indicating that it does something.

Given the choice between nothing and a non-progress "doing something" bar, I would of course pick the "doing something" bar. However, given the choice between a "doing something" bar and a progress bar, I'd rather have the progress bar.

If I have the choice between a "doing something" bar and a Windows Explorer "14 seconds left" bar showing the same message for two minutes, I'd rather have a Mars bar ;-)

Ciao,
Dscho

#279 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 7 lines · Linus Torvalds

It's a lot more useful to have a merge message like

Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6

than one like

Merge branch 'for-linus'

There's more information in the first, sure. But I absolutely don't accept that it's necessarily more useful, and definitely not that this is a good argument for using pull with a remote branch instead of fetch followed by merge with a local branch.

First, the pull may just fast-forward in which case there's no message at all. And we've been through that topic enough recently that we all know that no important information is lost by not doing any separate recording in that case.

So you can't turn around and argue that the remote URL information is suddenly important when it just so happens that it's not a fast forward.

Quoted 2 lines

And in a truly distributed situation, "pull" is strictly more powerful than a separate "fetch" + separate "merge".

I don't buy it. In my usage, I have several different remote repositories I'm interested in tracking, each with any number of branches. What I really want is an easy command that fetches all of those branches, (even new ones that I've never heard about---but never any of their "tracking branches" that wouldn't be of interest to me). And I want to do that once, to get the online-access-required part over with and get all the data into my local repository where I can start working with it.

As for the URL from which I'm fetching all this stuff, it's really not interesting to me at all. The URL for "Keith's stuff" keeps changing anyway---I have no interest in recording that. But I do think it's worth recording that the commits came from Keith's repository. I do that right now with a keith/ prefix for his branches. It could also be done by bringing in his .git/description during the fetch and storing it somewhere. But I honestly don't see how storing something like that during would make the system any less distributed in any sense.

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFXJPX6JDdNq8qSWgRAsE3AJwI7r9R8rCAZLfBJEvWTslYunXubwCeP/EG LF+nqDfS5zbUYwk8cNQisAU=
=wISt
-----END PGP SIGNATURE-----

#397 lore raw

Re: Cleaning up git user-interface warts

In reply to Petr Baudis
Quoted 1 line · Petr Baudis

Hmm, did they (not) consider Cogito? They wouldn't have those issues.

I didn't ask.

Frankly, I don't see a lot of value in the git/cogito split right now.

When I first learned git and cogito (January 2006) and switched cairo from cvs to git (the repository storage), I recommended cogito to cairo programmers as a "more cvs-like" way to work with the new repository.

Since then, having worked with git (the command-line program) exclusively for my own work, and having introduced it to dozens of new users, I don't bother recommending cogito anymore. It's just not that hard to learn git itself, so there's not that much value in learning cogito instead.

And this is particularly true since there's quite a large cost to having to learn cogito _in addition to_ git. And I think that's what most people would have to do anyway. For example, cogito doesn't wrap all git commands. So users have to dip down into git for things like git-bisect or else miss out an important functionality.

And for something like the Fedora transition, where I'm working with the people who will be training the community in the new tools, the trainers would have to learn both if they want to support a community using both git and cogito. These trainers are already complaining about the ~140 git commands, so adding 40 more cogito commands as well doesn't make the story better.

It's great that git is written in a script-friendly way so that new interfaces can be built on top of it. And I think the benefits of new user interfaces are clear when they work in fundamentally different ways, (say, being operated through a GUI). But where git and cogito are both command-line utilities and have the same basic functionality, I don't see how its helpful to maintain both tools. (Certainly some of my attitude here is due to the timing of my introduction to git contrasted with the timing of the inception of cogito. I'm sure git improved a lot between those two events.)

There are some things that cogito does that git does not that I would like to have in git. One is having a "commit" command that commits everything by default without an extra command-line option. Another (that I _think_ cogito has) is a way to switch away from a branch with dirty changes to a clean branch, do work there, and come back to the original branch with the dirty stuff still there.

I don't see any defining difference that justifies cogito's existence ("hide the index" maybe? let's just hide it a tiny bit more in git). And I would like to help work to get the remaining good stuff that has been proven in cogito---to get it pushed down into git itself.

-Carl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFWi2N6JDdNq8qSWgRAia8AJ9b7rLA6wOfat7/OCguOyNRhpi+nACeIE3j jYXp17k0tw5LnV6eFRJeocY=
=mRNe
-----END PGP SIGNATURE-----

#13 lore raw
In reply to Junio C Hamano
Quoted 13 lines · Junio C Hamano
Quoted 11 lines · Nicolas Pitre

I'd say screw that. The solution should really be this patch:

environment.c +0 -1
index 84d870c..98275b2 100644
@@ -15,7 +15,7 @@ int use_legacy_headers = 1;
 int trust_executable_bit = 1;
 int assume_unchanged;
 int prefer_symlink_refs;
-int log_all_ref_updates;
Quoted 8 lines

environment.c int use_legacy_headers = 1; · line 21

Quoted 5 lines
environment.c +1 -0
+int log_all_ref_updates = 1;
 int warn_ambiguous_refs = 1;
 int repository_format_version;
 char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8";

That changes what the command does to existing repositories, which is somewhat impolite.

Yes, but users are forgetting to enable them. They will work in a new repository having that feature, move to an older one and not have it, but expect it to be there.

As I recall the primary objection to enabling them by default when I first introduced them was that core.logAllRefUpdates=true meant that refs/tags/<name> were also being logged. This was not a great idea as tags generally did not change once they were created. You fixed that and now it just makes sense to enable it for branch heads all of the time.

Quoted 3 lines

I am not opposed too much to an updated version of the tool that sets the configuration on by default for newly created repositories, though.

I almost did that in my patch - but decided against it for the reason I just noted above.

Does anyone on the mailing list really have an objection to having reflogs on by default?

About the only trouble that can cause is a failed push when git-receive-pack needs to generate the reflog entry but cannot get the user's committer data because their gecos information doesn't exist.

#222 lore raw

Re: multi-project repos (was Re: Cleaning up git user-interface warts)

In reply to Linus Torvalds

Linus Torvalds escreveu:

Quoted 2 lines

A lot of the complaints seem to not be about the interfaces, but about people not _understanding_ and knowing what the interfaces do. If you were

From the point of view of a user, there is not really a difference between the two. As a user, you form a mental model of how things work by looking at the interface. If the interface is bad, the user creates a faulty model in his head, and starts doing things that are perfectly logical in the faulty model, but stupid and silly when you consider the actual internals.

A nice book about this is "The Design of Everyday Things" by Donald Norman.

#331 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 9 lines · Junio C Hamano

The index is quite central to the way git works at the concept level, and I think it is doing disservice to the end user to try hiding it forever from them and failing to do so, rather than being honest and teaching them the concept upfront.

But me thinking so does not necessarily mean you are forbidden from trying. Your efforts may result in a system where the index is totally invisible and the end user never has to know about it.

I agree with what you are saying about the index.

But in git-gui I found myself writing code on Monday which tries to hide the index from the user unless he/she requested that the index be made visible.

The reason is there are some users who I'd like to give git-gui to who I'm not sure I trust to make sure their index is in sync with their working directory before they commit. In some cases I'm lucky that the user even knows what directory their file is stored in. :-( Yes, there really are computer users who are afraid of directories and command lines.

I probably could try to teach them to make sure the final file is included in the index before committing, but I think that for most of them they would find this to be just another couple of mouse clicks they have to perform before every commit, meaning its something that the #$@!*@!*@$# tool should just do for them.

#230 lore raw

Re: multi-project repos

In reply to Junio C Hamano
Quoted 8 lines · Junio C Hamano
Quoted 4 lines · Shawn Pearce

Although if you have reflog enabled on your current branch there is a 1 character shorter syntax:

	gitk HEAD@{1}..

Are you sure about this? I've seen "next@{1}" to look at history of the named branch, but never history of "HEAD".

Yes. :-)

If the ref name is a symref then we resolve the symref all the way down to the real ref before we open and walk the reflog. Therefore this works.

#277 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 8 lines · Carl Worth

Plus, when I'm teaching "fetch everything first, then manipulate it locally", (which is what I teach, since that's the only way I use git), then the "." looks really out of place when I teach the 'merge' command. I end up saying, "Oh, that's there because you could do the fetch and merge all in one step if you really wanted, but I never do that.".

And that's because I _do_ teach fetch first, as you've suggested.

Ditto. In every way.

I've taught the same fetch first, then merge strategy. Nobody I know in meat-space pulls from a remote URL and merges in one shot; they always fetch locally, look at the incoming changes, decide if its worthwhile/ok, *then* merge with "git pull . branch".

The "." looks out of place for everyone...

#70 lore raw
In reply to Nicolas Pitre
Quoted 8 lines · Nicolas Pitre
Quoted 4 lines · Johannes Schindelin

I sent a patch which makes "git show" have that functionality, and frankly, I disagree "less" would be a good name for it. It uses the _pager_, which is not always "less", and besides, what it does is to show that particular blob. So obviously, I think my patch is the best approach.

I think your approach is pretty sensible too.

I think so too for a few reasons.

* cat-file is a very low level plumbing. Giving it -p was a mistake made by somebody lazy long time ago back when we were not all that hot about "user friendliness in Porcelain-ish" (the option -p was not originally even meant to be the user level; it was merely a helper feature for verify-tag).

* If we were to call something 'cat' and make a user-level command, adding the feature to 'show' is a lot more sensible than cat-file; the former takes more than one args already. People expect 'cat' to concatenate the arguments. cat-file doesn't.

* Throwing ls-tree output is the most sensible thing to do at 'cat-file -p <tree-ish>' level, but not at the UI level (Andy compared ls-tree with 'svn list' today). With 'git show', it would be more natural to show ls-tree --name-only by default for tree-ish objects, and control the verbosity level with command line option.

One minor issue we may need to decide is what to do when show is given a tag object. Personally I think the current behaviour of dereferencing it to commit is fine (people who want to see the tag can always do 'git-verify-tag -v').

#348 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 7 lines · Carl Worth
Quoted 5 lines · Nicolas Pitre

Even if I have a clear preference for GIT's _technology_, I still think that the HG user interface is more convivial. I even been thinking about writing something like an hg-like frontend to GIT from time to time just so that GIT could then be better compared to (and actually just used like) HG.

Quoted 8 lines

I've actually been tempted to do the same myself. I really think that the technology is a more important criterion than the UI so the imagined hg-on-git interface would be an attempt to get people to look past the interface differences and look at the technology when deciding.
...

Quoted 1 line

I still think that the GIT user interface sucks in many ways. The

...

I've actually been tempted to do that too, and my earlier "if I were to redo git from scratch" message was the beginning of it to summarize my preference about some of the issues raised in this thread.

Commenting on the messages in this thread:

- "resolve / resolved" are both confusing, when you are talking about "mark-resolved" operation.

- "pull/push/fetch" have undesired confusion depending on where people learned the term. I'd perhaps vote for replacing fetch with download and push with upload.

- I think it would be sensible to make remote tracking branches less visible. For example:

git diff origin

where origin is the shorthand for your upstream (e.g. you have .git/remotes/origin that records the URL and the branch you are tracking) should be easier to understand than

git diff remotes/origin/HEAD

The latter is an implementation detail. I could imagine we might even want to allow

git diff origin#next

to name the branch of the remote repository. The notion of "where the tips of remote repository's branches are" is probably be updated by "git download" (in other words, the above "git diff" does not automatically initiate network transfer).

- "git merge" to merge another branch into the current would make sense. "git pull . remotes/origin/next" is showing too much implementation detail. It should just be:

git merge origin#next

And I agree with Pasky that fixing UI is hard unless you are willing to get rid of historical warts. Syntax of the command line arguments the current set of Porcelain-ish takes are sometimes just horrible. It may not be a bad idea to start building the fixed UI from scratch, using different prefix than "git" (say "gu" that stands for "git UI" or "gh" that stands for "git for humans").

Of course, it could even be "cg" ;-).

#224 lore raw

Re: multi-project repos (was Re: Cleaning up git user-interface warts)

In reply to Linus Torvalds
Quoted 10 lines · Linus Torvalds

- "ORIG_HEAD" is very useful indeed, and it's the head _before_ a merge (or some other operations, like "git rebase" and "git reset": think of it as a "original head before we did some uncontrolled operation where we otherwise can't use HEAD^ or similar")

I use "gitk ORIG_HEAD.." a lot, and if I don't like something I see when I do it, I end up doing "git reset --hard ORIG_HEAD" to undo a pull I've done. This is important exactly because ORIG_HEAD is _not_ the same as the first parent of a merge, since a merge could have been just a fast-forward.

Although if you have reflog enabled on your current branch there is a 1 character shorter syntax:

	gitk HEAD@{1}..

as recent Git understands that to mean the value that HEAD just had, which is also what is in ORIG_HEAD. Except that unlike ORIG_HEAD it can also show even older values (e.g. HEAD@{3}, 3 ops back) and it works very, very well on tracking branches. "What did I just fetch in next?" git log next@{1}..next

#71 lore raw

git-show, was Re: What's in git.git (stable)

In reply to Junio C Hamano

Hi,

Quoted 4 lines · Junio C Hamano

One minor issue we may need to decide is what to do when show is given a tag object. Personally I think the current behaviour of dereferencing it to commit is fine (people who want to see the tag can always do 'git-verify-tag -v').

How about adding the command line option "--tag" to git-show, which makes it only show that tag. I'd also vote for a "--verbose|-v" flag to show the contents of the tag _before_ showing the referenced object.

Ciao,
Dscho

#263 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano

Junio C Hamano escreveu:

Quoted 10 lines
Quoted 10 lines

FWIW, I regularly mess up with the differences between fetching, pulling and merging. In particular, having to do a two step process to get remote changes in,

git pull url-to-server master:master
..error message about not being a fast-forward..

git pull --update-head-ok url-to-server master:master
..still an error message about update not being a fast-forward..

Quoted 7 lines
Quoted 1 line
      (sigh)

Sigh indeed.

Why don't you do the simple and obvious

git pull url master

It is not all evident from the git-pull man-page that this is the obvious and most common usage.

Quoted 2 lines

or "git pull url" if you already know the master is the branch you are interested in.

Because I usually replace verbose commands with shortcuts only when I understand exactly what the shortcut is.

To me it's very unlogical that

master:current-branch

doesn't work, but

master:

does work, and does what I'd expect

master:current-branch

to do. Interestingly, doing

pull ..url.. master:HEAD

also doesn't merge into the current branch, but rather creates a bogus refs/heads/HEAD

I use the remote:local syntax, because I started using GIT in scripted compiles from copied branches of remote repositories. There the explicit remote:local statements are necessary because there is no default branch.

#364 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 2 lines · Junio C Hamano

I think the latter is what clone has done always; take remote's HEAD and use that to initialize local master (there is no

It's this sort of thing that is confusing though - the remote HEAD branch could be anything, and yet that is made to be origin locally as a tracking branch and then master as the writable branch. What if upstream /has/ a master but "next" is its HEAD? You'd then get

next:remotes/origin
master:remotes/master

Then a local master which is actually upstream next! Oh dear.

I may well have misunderstood what you've said above above clone always initialising master from remote's HEAD; if so please disregard what I'm saying.

Quoted 7 lines
Quoted 3 lines

that as soon as git-clone has special capabilities (like --shared, --local and --reference) then you are prevented from doing magic with existing repositories.

That is not entirely true. clone has convenience because people asked. It does not have to mean you are not allowed to give similar convenience to other commands. Patches?

Absolutely, that was why I said clone shouldn't have special abilities. In fact, if you're willing you don't need clone at all; you just need git-init-db and to write the correct remotes file.

Quoted 4 lines
Quoted 2 lines

branches from two other local repositories that have the objects hard linked?

fetch by second local repository with git-local-fetch perhaps.

Is that not plumbing? I thought this was about porcelain.

Quoted 4 lines

A consensus would not write code and it generally does not take technology into account to tell what is realistic and what is not, so the result needs to be take with a grain of salt, though.

Of course, I only suggested it because the same suggestions were popping up multiple times. Anyway; I put it in the GitWiki at
http://git.or.cz/gitwiki/Wishlist

Andy

Signature · 1 line
Dr Andrew Parkins, M Eng (Hons), AMIEE
#304 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 5 lines · Linus Torvalds

And yes, this is why you should NOT try to use the same naming as "hg", for example. Last I saw, hg still didn't even have local branches, To mercurial, repository == branch, and that's it. It was what I came from too, and I used to argue for using git that way too. I've since seen the error of my ways, and git is simply BETTER.

Actually, that's not true. Mercurial has local branches, just as git does. Some people choose not to *use* this particular feature, and use the BK style repository == branch, but that's mainly because it's conceptually easy for them, and a number of BK refugees are very happily using Hg.

It's probably because of the BK refugee population that after you do an hg pull, it will warn you that you need to do an "hg update" in order to merge the working directory up to the latest version that was just pulled --- and this change was made precisely because Hg supports local branches, and merging with the current branch isn't always the right thing, unlike with BK.

Quoted 3 lines

And the concept of local branches is exactly _why_ you have to have separate "fetch" and "pull", but why you do _not_ need a separate "merge" (because "pull ." does it for you).

It's just that the semantics are different, and many developers have to use multiple DSCM's, depending on what project they happen to be developing on. So the reality is that there are people who have to use bzr, git, and hg, all at the same time. And while eventually newbies will figure out and remember that "git pull ." == "merge", the naming is simply confusing, that's all. (What does "pull" have to do with "merge"? It's not at all obvious.)

For somoene who uses git full-time, and to the exclusion of all other systems, I'm sure it's not a problem at all.

#403 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 24 lines · Junio C Hamano
Quoted 5 lines · Carl Worth
Quoted 1 line · Petr Baudis

Hmm, did they (not) consider Cogito? They wouldn't have those issues.

I didn't ask.

Quoted 16 lines

Frankly, I don't see a lot of value in the git/cogito split right now.
...
It's great that git is written in a script-friendly way so that new interfaces can be built on top of it. And I think the benefits of new user interfaces are clear when they work in fundamentally different ways, (say, being operated through a GUI). But where git and cogito are both command-line utilities and have the same basic functionality,
...
There are some things that cogito does that git does not that I would like to have in git.
...
I don't see any defining difference that justifies cogito's existence ("hide the index" maybe? let's just hide it a tiny bit more in git). And I would like to help work to get the remaining good stuff that has been proven in cogito---to get it pushed down into git itself.

Quoted 5 lines

I am of two minds here.

I do not think the Porcelain-ish UI that is shipped with git should be taken with the same degree of "authority" as git Plumbing.

..snip passage about workflows..

Controversy's fun, so...

<Cogito maintainer hat _off_> (But yeah, it still looks silly that I'm saying this.)

From the current perspective, I think it has been a mistake that the
porcelain and plumbing was not kept separate in independent packages, and perhaps even maintained separately (and perhaps not; at least having a single tree with plumbing/ and porcelain/ directories and separate packages in distributions might already help something), so that "git" would be kept as a kind of library and then there would be a separate package providing an interface to it. Or you could select one of several packages. Not only would that make Cogito prevail in the world and bring me a flood of marriage proposals, but look at how would it help the general public:

(i) Clearly divided porcelain/plumbing interface, so that you can
really isolate the two UI-wise; endless confusion reigns there now. Is git-update-index porcelain or plumbing? _You_ call git-merge a proper porcelain? From my perspective, git-update-ref is as plumbing as it gets, but it's classified as porcelain. Etc, etc. This would be by far the most important advantage.

(ii) The plumbing and porcelain would not share the same namespace,
leading to clearer UI. (I'm just inflating (i).)

(iii) The documentation would not be a strange mix of porcelain and
plumbing. (More (i) inflation.)

(iv) (i) is troublesome because I have a feeling that Junio declared
several times that he doesn't care that much about stable API for porcelain compared to the plumbing. But with the current mix it's desirable to use some porcelain even in other porcelains and in scripts.

(v) Git would be properly libified by now. If you wanted to convert
bits of porcelain to C, it would be at least much higher priority.

(vi) You wouldn't need to make the gruesome choice on what is the
canonical workflow the _the_ Git porcelain supports (see the snipped passage). Or you would, but it would have less impact.

(vii) The world would be a happier place.

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
#6 lore raw
In reply to Andy Parkins
Quoted 6 lines · Andy Parkins
$ git commit
Revision XXXXXXXXXXXXXXXXXX successfully added.

I'd actually argue that git-commit is a particular problem because it's too fast. You quit editing your commit message and bang, you're back at the command line. Then you run git-log to make sure it really was committed.

You keep repeating that you want to know the object name of the newly created commit. I would very strongly agree with you that it would be a fatal UI bug of git-commit if that information were vital for the end user after making each commit.

But you never communicate with your own git repository using the SHA-1 object names when talking about commits you made recently (you would have the SHA-1 output from your updated version of 'git commit' command on the screen or in your scrollbuffer for them -- you would need to refer to commits older than what your scrollbuffer has in different way anyway). Git gives branch~<n> notation, and commands like "git log --pretty=short" and friends would show them which you can easily cut&paste. When people talk about object names on the mailing list, they do so by asking "git log" and friends to find them out -- it is pretty much "on demand" type of thing and I do not think continually mentioning SHA-1 object names buys us anything.

In other words, the following transcript would be possible but not realistic:

	$ git commit
        Revision deadbeef0000 created.
        : now what did I do?
        $ git show deadbeef0000
        : oops, that is wrong
        $ git reset --hard deadbeef0000^

So I do not think "git commit" is a valid example. I also agree with Shawn that "git add" that says 6781 files were added is pointless.

Quoted 6 lines
Quoted 3 lines

However, perhaps you could make lack of "[user] expert = true" in ~/.gitconfig to trigger more verbose messages that say "yes sir I did what I was told to do".

I've always thought that programs that needed an expert/beginner split were badly designed.

There probably is a truth in that. Let's not add verbosity unnecessarily.

I agree with you that making some commands with progress indication less chatty would be a good clean-up.

#382 lore raw

Re: Cleaning up git user-interface warts

In reply to Shawn Pearce
Quoted 8 lines · Shawn Pearce
Quoted 1 line · Junio C Hamano

Or even better, have "gh init".

Why gh? Is Git just Mercurial backwards? :)

I'm all in favor of this discussion, and in particular of just breaking the entire UI in 2.0 by using a new frontend command. I'm just not sure that "Mercurial backwards" describes Git well.

I do not have any obsession to any name as long as it is different from "git" to avoid confusion coming from older documents that would be found by googling. gh was just shorthand for "git for humans" (and easy to type with index fingers). I think I listed a few other possibilities in my previous message.

#340 lore raw

Re: Cleaning up git user-interface warts

In reply to Linus Torvalds
Quoted 4 lines · Linus Torvalds

If you think "pull" is confusing, I can guarantee you that _changing_ the name is a hell of a lot more confusing. In fact, I think a lot of the confusion comes from cogito, not from git - the fact that cogito used different names and different syntax was a mistake, I think.

I would agree that having "pull" mean something different in Cogito
than in Git was a bad idea (explanation: historically, for some period of time Cogito had cg-pull which meant the same as cg-fetch or hg pull; later it got renamed to cg-fetch). But I'm also happy that Cogito just does not use the "pull" expression at all currently: "updating" seems to be a clear and unloaded enough concept for new people. Pull is really _very_ confusing, with it meaning something different (but not different enough) in _all_ other systems but BK (which is basically irrelevant nowadays).

That said, I agree with your argument that changing it in Git now
might just result in more confusion. I'm just trying to explain Cogito's choice here, and I believe it does no good nor harm to Core Git if it just uses different name for the concept and avoids the original name at all (except explaining in the docs that updating in Cogito is what pulling is in Git).

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
#25 lore raw
In reply to Andreas Ericsson
Quoted 10 lines · Andreas Ericsson
Quoted 5 lines · Shawn Pearce

About the only trouble that can cause is a failed push when git-receive-pack needs to generate the reflog entry but cannot get the user's committer data because their gecos information doesn't exist.

In that case, it would be best if it let the commit go through using only the username. Reflogs are fixable afterwards, so there's no real harm done.

This sounds sensible, regardless of the current discussion on the default 'logallrefupdates' setting.

Volunteers?

#372 lore raw

Re: Cleaning up git user-interface warts

In reply to Andy Parkins
Quoted 7 lines · Andy Parkins
Quoted 2 lines · Junio C Hamano

I still think in the long run you would be better off giving separate names to Porcelains because I am sure you are going to

The problem I think with that is that the line between plumbing and porcelain is not clear.

This is moot because we (at least tentatively) agreed not to do "gh" or "ig" or whatever, but I do not understand why you feel so.

If we had a separate Porcelain namespace (say "ng" for "new git") you would know "ng-commit" is not a Plumbing and when you are writing a Porcelain script you would stay away from using it in your script.

In the longer term, when the new Porcelain UI Nico and friends are designing matures, and if it makes everybody (including existing users who learned git-* Porcelain-ish during 18-months process) happy, we could gradually deprecate and eventually remove the git-* Porcelain-ish over time, at that point we would have a very clear line between plumbing and porcelain.

But that would not be a flag-day change. During the transition period you cannot mechanically tell if git-foo is a plumbing or a porcelain just like you cannot do so now.

#313 lore raw

Re: Cleaning up git user-interface warts

In reply to Theodore Tso
Quoted 5 lines · Theodore Tso

So with Bitkeeper, with "bk pull" there was never any question about which branch ("line of development") you would be merging into after doing a "bk pull", since there was only one LOD, and given that BK had the rule that a within a LOD only one tip was allowed, a "bk pull" _had_ to do do a merge operation.

I've never used Bk and I really appreciate your comments here.

Quoted 2 lines

If you are operating on your local development branch, the reality is that merging is probably not the right answer in the general case,

I agree, but I wonder why you are pulling/fetching (with or without merge) if you are operating on your local development branch (implying that you are in the middle of something else).

Quoted 8 lines

... And by
telling people, use "git fetch" instead, that's also an implicit admission that merging onto the current branch is often not the Right Thing.

The problem is that "pull" is a very evocative word, especially given the existence "push", and so in the git world we are reduced to telling people, "you really don't want to use pull, trust me".

I would rather say "use 'git branch' to make sure if you are ready to merge". Who teaches not to use "git pull"?

Quoted 4 lines

If people are looking for a simple way out, maybe it would be enough to have an option where if "git pull" is called from an interactive terminal, and the "novice user" option is enabled, "git pull" returns a warning message,

I have to disagree with this. In the simplest CVS-like central repository with single branch setup in which many "novice users" start out with, there is almost no need for "git fetch" nor tracking branch. You pull, resolve conflicts, attempt to push back, perhaps gets "oh, no fast forward somebody pushed first", pull again, then push back. So I am not sure where "you really do not want to use pull. trust me" comes from.

It is a different story for people who _know_ git enough to know what is going on. They may be using multiple branches and interacting with multiple remote branches, and there are times you would want fetch and there are other times you would want pull. But for them, I do think the suggestion would never end with "trust me" -- they would understand what the differences are.

#390 lore raw

Re: Cleaning up git user-interface warts

In reply to Petr Baudis
Quoted 4 lines · Petr Baudis

(v) Library issues...
Git has the advantage of
simply putting that part in C, which is though something I should've been doing more frequently too.

It should be stressed that git-core plumbing written in C is not just for git Porcelain-ish, and it will continue to be shared service. We would add core support for what Porcelains need and we would try hard to keep them generic enough so that other Porcelains can use them. Keeping the core and Porcelain-ish in the same project has made it easier to keep them in sync and to find and add missing features that would benefit Porcelains (not limited to git Porcelain-ish). But that should not be mistaken as plumbing somehow belongs more to git Porcelain-ish than to Cogito or others.

I also think you should take credit for some core improvements you did yourself (e.g "ls-files -t" format was originally added for the sole purpose of helping Cogito, but now others use it, too).

#420 lore raw

Re: [PATCH] commit: Steer new users toward "git commit -a" rather than update-index

In reply to Andy Whitcroft
Quoted 4 lines · Andy Whitcroft

Are we sure this isn't porcelain-ish? We need to use it in merge conflict correction and the like? You can't use git-commit there as a replacement. I'd expect it to be 'git update-index' rather than 'git-update-index' of course.

I think status should be taken as Porcelain-ish so it should notice more about the environment to see why the user has changed but not updated files and recommend the possible action depending on the context.

For that, you would need to enumerate what kind of 'context' there could be with the current set of tools. Here is a strawman.

1. None of the below.
2. A merge was attempted and resulted in a conflict.
3. An am or rebase without --merge was attempted and resulted in a conflict or patch rejection.
4. A "rebase --merge was attempted and resulted in a conflict.

In the normal case, the next user action would be:

1-1. The user wants that change in the next commit, and should
run "git update-index $that_path" to prepare the index for partial commit, or "git commit -a" to commit all the changes made to the working tree so far. Carl's patch helps the user in this case.

1-2. The user realizes that the some of the changes in the
working tree were not desirable, and "git checkout -- $that_path" to revert them before continuing. Before deciding to revert, the user may want to check what the difference is by running "git diff -- $that_path" so suggesting these two might also be helpful.

1-3. The user wants to keep that change a strictly local change
in the working tree (this is often very useful and making "commit -a" the default will not be acceptable unless there is a very compelling reason to do so). This means the suggestion we would make should clearly be _suggestion_.

The earlier wording was bad in that it suggested to use a Plumbing command update-index, but was attempting to convey that it was merely a conditional suggestion by saying "use it TO MARK FOR COMMIT", implying that if the user does not want to mark them for commit, it is Ok not to use update-index.

When a merge is in progress, we would have .git/MERGE_HEAD and that would be the way to tell case 2. In that case, the next user action would be:

2-1. The user resolves conflicts and marks them as resolved,
with update-index (or "git mark-resolved"), to prepare the index for the merge commit. But this is not done for "Changed but not updated" files but "unmerged" files. We should strongly suggest not to do _anything_ to "Changed but not updated" files here.

2-2. The user decides this conflict is too much to handle right
now, and abandones the change by "git reset --hard". This would lose the local changes ("Changed but not updated"), so we should suggest to save the change before doing so.

If you are going to abandone this merge with "reset --hard", your changes to these files will be lost. You can save them with "git diff HEAD -- $this_path $that_path..."

which is probably too long for that part of the output but that is what we would want to say if we want to be helpful.

When either rebase without --merge or am is in progress, there would be .dotest/ directory (whose name could be changed but I think this was a mistake and we would be better off using fixed names for this kind of application) for git-status to notice. The next user action would be:

3-1. The user resolves the conflict or manually apply the
patch, update-index the paths involved and proceeds with "rebase --continue" or "am --resolved". "Changed but not updated" paths should not be touched in this case, similarly to 2-1.

3-2. The user gives up. Same as 2-2.

Designing for the "rebase --merge" case and coming up with other cases are left as exercise to the list for further discussion.

#258 lore raw

Re: Cleaning up git user-interface warts

In reply to Han-Wen Nienhuys
Quoted 4 lines · Han-Wen Nienhuys

Until that time, it would be good goal to remove all idiosyncrasies, all gratuitious asymetries and needless limitations in the commands of git, eg.

Well, a lot of the assymmetries aren't actually gratuitous at all.

Quoted 1 line

- clone but not a put-clone,

As mentioned, in order to "put-clone", you generally have to "create" first, so the "put-clone" really makes no sense.

The _true_ reverse is really your

- "git init-db" on both sides

- "git pull" (your workflow ;) on receiving

- "git push" on sending.

The fact that we can do "git clone" on the _receiving_ side is an assymmetry, but it's not gratutous: when receiving we don't need any extra permissions or setup to create a new archive. In contrast, when sending, you do have to have that "get permission to create new archive" phase.

Quoted 1 line

- pull = merge + fetch, but no command for merge + throw

Again, this is not gratuitous, and the reason is very similar: when you pull, you're pulling into something that _you_ control and _you_ have access to, namely your working directory. In order to merge you have to have the ability to fix up conflicts (whether automatically or manually), and this is something that you _fundamentally_ can only do when you own the repo space.

Again, when you do "push", the reason you can't merge is not a "gratuitous assymmetry", but a _fundamental_ assymmetry: by definition, you're pushing to a _remote_ thing, and as such you can't merge, because you can't fix up any merge problems.

See?

In many ways, if you want _symmetry_, you need to make sure that the _cases_ are symmetrical. If you have ssh shell access, you can often do that, and the "reverse" of a "git pull" is actually just another "git pull" from the other side:

ssh other-side "cd repo ; git pull back"

Now they really _are_ symmetrical: "git pull" is really in many ways ITS OWN reverse operation.

But "push" and "pull" _fundamentally_ aren't symmetric operations, and you simply cannot possibly make them symmetric. Any system that tries would be absolutely horrible to use, exactly because it would be either:

- making local/remote operations totally equivalent

This sounds like a "good" thing, but from a real user perspective it's actually horribly horribly bad. Knowing the difference between local and remote is what allows a lot of performance optimizations, and a lot of security. Your local repo is _yours_, and nobody can take that away from you, and that's a really fundamental reason for why the symmetry cannot exist, and why local/remote operations MUST NOT be something that you can mix without thinking about them,

- limit local operations in a way to make them effectively unusable and unscriptable.

You'd basically have to do everything even _locally_ through some server interface, and you'd not be allowed to ever touch your local checked-out repository directly. Again: local repositories really _are_ special, because you can touch the checked out copy. If you try to suppress that, you're screwed.

Quoted 2 lines

- clone for getting all branches of a repo, but no command for updating all branches of a repo.

As in sending? Sure there is: use "git push --all". It will push out every branch (and tag) you have. Add "--force" if you want to make sure that it also pushed out branches even if the result isn't a strict superset (of course, the receiving end may actually end up refusing to take it, there's a option for the receiver to say "I will refuse any update that isn't a strict superset of what I had").

If you mean as in "receiving new branches", then yeah, you do have to script it, with some fairly trivial "git ls-remote" to make sure you get the new remotes.

#104 lore raw
In reply to Shawn Pearce
Quoted 5 lines · Shawn Pearce

But I'm not sure that git-add should output anything. Last I checked the 'mv' command in Linux doesn't say "Move 5 files" when I move 5 files into a directory. Likewise I don't think that knowing that 6781 files were added is useful, what if it should have really been 6782 files? I'm unlikely to know, care, or realize it.

That's a very particular example you've picked out there. Of course the user won't know if it should be 6781 or 6782; they might know if it should have been 2 or 10 though; 0 or 100. In your example, output like "about six and a half thousand", would probably be perfectly useful, but why not just output the number?

Quoted 5 lines

Your niggle list (is that what you called it) has been useful fodder for discussion. I'm glad you took the time to write it up, and to argue it so well on the list. There's a number of items on it that I'd like to see happen too; enough that I may code some of them if nobody beats me to it.

I'm glad it was useful. I never know how many disclaimers to put on these things. I always feel that every message I write should begin with "I love git and use it every day, so please don't take this the wrong way, but..."

Andy

Signature · 1 line
Dr Andy Parkins, M Eng (hons), MIEE
#175 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth

The git interface refactoring should be I think the cause for git 2.0.0 release...

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#31 lore raw
In reply to Shawn Pearce
Quoted 26 lines · Shawn Pearce
Quoted 11 lines · Andy Parkins

How's this then:

$ git commit
$ git commit
$ git commit
$ git reset HEAD^^^

"AGGGHHHHHH! I meant HEAD^^"

At this point I start running "git-prune -n | grep commit" and some liberal use of git-show to try and find the hash of the object so I can do

At this point I usually try to politely suggest that users do:

  git repo-config --global core.logAllRefUpdates true

and in the future do something like:

Quoted 6 lines
$ git commit         # {4}
$ git commit         # {3}
$ git commit         # {2}
$ git reset HEAD^^^  # {1}

"AGGGHHHHHH! I meant HEAD^^"

Quoted 7 lines
  $ git reset HEAD@{4}

should give you what

  $ git reset HEAD^^

would have given had you not added the extra ^. :-)

Correct but a bad example that does not demonstrate the real power of reflog. Andy's AGGGHHHHHH can be recovered with a simple:

	$ git reset ORIG_HEAD

The real beauty of reflog is that you can usually count number of commands (not just commit) the way you did and recover with the @{n} syntax. With one caveat -- a porcelain might implement what it does as more than one transaction on the ref, in which case counting commands does not help. You need to first make sure the value of n in @{n} you thought is appropriate is really the one you want; you would always run "git show -s HEAD@{4}" before doing the recovering reset in practice, in other words.

And it is not very easy to view where ref was in each step with existing set of tools.

Not until the attached patch, which was very lightly tested. You would use it like this:

    $ git-show-branch --reflog next
    ! [next@{0}] Merge branch 'js/show' into next
     ! [next@{1}] Merge branch 'jc/cdup' into next
      ! [next@{2}] Merge branch 'master' into next
       ! [next@{3}] Merge branch 'jc/cdup' into next
    ----
    -    [next@{0}] Merge branch 'js/show' into next
    +    [next@{0}^2] git-show: grok blobs, trees and tags, too
    --   [next@{1}] Merge branch 'jc/cdup' into next
    ++   [next@{1}^2] git-reset [--mixed] <tree> [--] <paths>...
    ++   [next@{1}^2^] git-reset: make it work from within a subdirectory.
    ++   [next@{1}^2~2] git-fetch: make it work from within a subdirectory.
    ++   [next@{0}^2^] INSTALL: no need to have GNU diff installed
    --   [next@{0}^2~2] Merge branch 'maint'
    ++   [next@{0}^2~2^2] Bypass expensive content comparsion during...
       - [next@{3}] Merge branch 'jc/cdup' into next
       + [next@{3}^2] git-reset [--mixed] <tree> [--] <paths>...
       + [next@{3}^2^] git-reset: make it work from within a subdirectory.
       + [next@{3}^2~2] git-fetch: make it work from within a subdirectory.
       + [next@{3}^2~3] Bypass expensive content comparsion during re...
    ++ + [next@{0}^2~3] Update git-diff documentation
    -- - [next@{0}^2~4] Merge branch 'jc/diff--cached'
    ++ + [next@{0}^2~5] git-svn: allow both diff.color and color.diff
    ++ + [next@{0}^2~6] repacked packs should be read-only
    ---- [next@{2}] Merge branch 'master' into next

This shows the actual reflog from the 'next' branch on my primary repository. It shows that I did a merge of jc/cdup branch into 'next' to run tests at next@{3}, but later rewound that merge at next@{2} and merged the rebased jc/cdup again later at next@{1} [*1*].

[Footnote]

*1* Of course, I did all of the above rewinding and rebasing before pushing the result out, so the general public do not have to worry about rewinding and rebasing.

---

builtin-show-branch.c +30 -5
index fb1a400..559bb18 100644
@@ -6,7 +6,7 @@
 #include "builtin.h"
 
 static const char show_branch_usage[] =
-"git-show-branch [--sparse] [--current] [--all] [--heads] [--tags] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [<refs>...]";
+"git-show-branch [--sparse] [--current] [--all] [--heads] [--tags] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [<refs>...] | --reflog[=n] <branch>";
 
 static int default_num;
 static int default_alloc;
@@ -17,6 +17,8 @@ static const char **default_arg;
 #define REV_SHIFT	 2
 #define MAX_REVS	(FLAG_BITS - REV_SHIFT) /* should not exceed bits_per_int - REV_SHIFT */
 
+#define DEFAULT_REFLOG	4
+
 static struct commit *interesting(struct commit_list *list)
 {
 	while (list) {
@@ -570,6 +572,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
 	int head_at = -1;
 	int topics = 0;
 	int dense = 1;
+	int reflog = 0;
 
 	git_config(git_show_branch_config);
 
@@ -615,6 +618,15 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
 			dense = 0;
 		else if (!strcmp(arg, "--date-order"))
 			lifo = 0;
+		else if (!strcmp(arg, "--reflog")) {
+			reflog = DEFAULT_REFLOG;
+		}
+		else if (!strncmp(arg, "--reflog=", 9)) {
+			char *end;
+			reflog = strtoul(arg + 9, &end, 10);
+			if (*end != '\0')
+				die("unrecognized reflog count '%s'", arg + 9);
+		}
 		else
 			usage(show_branch_usage);
 		ac--; av++;
@@ -622,7 +634,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
 	ac--; av++;
 
 	/* Only one of these is allowed */
-	if (1 < independent + merge_base + (extra != 0))
+	if (1 < independent + merge_base + (extra != 0) + (!!reflog))
 		usage(show_branch_usage);
 
 	/* If nothing is specified, show all branches by default */
@@ -631,9 +643,22 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
 
 	if (all_heads + all_tags)
 		snarf_refs(all_heads, all_tags);
-	while (0 < ac) {
-		append_one_rev(*av);
-		ac--; av++;
+	if (reflog) {
+		int reflen;
+		if (!ac)
+			die("--reflog option needs one branch name");
+		reflen = strlen(*av);
+		for (i = 0; i < reflog; i++) {
+			char *name = xmalloc(reflen + 20);
+			sprintf(name, "%s@{%d}", *av, i);
+			append_one_rev(name);
+		}
+	}
+	else {
+		while (0 < ac) {
+			append_one_rev(*av);
+			ac--; av++;
+		}
 	}
 
 	head_p = resolve_ref("HEAD", head_sha1, 1, NULL);
#111 lore raw

Re: [PATCH] git-clone: lose the traditional 'no-separate-remote' layout

In reply to Junio C Hamano
Quoted 3 lines · Junio C Hamano

And this drops it; modulo bugs, I think this is about it for v1.5.0 around this area.

Ahh, you said that yourself, and I hadn't even noticed that you already merged xdl_merge into master too.

So here's an "AOL high five": <me too>.

#367 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano

Hi,

Quoted 5 lines · Junio C Hamano
Quoted 1 line · Nicolas Pitre

1) make "git init" an alias for "git init-db".

Or even better, have "gh init".

Please no. It only makes things even more confusing. "git init" is perfect as it is. We can always have internal aliases from "init-db" to "init" to account for older usages.

Quoted 6 lines
Quoted 1 line

2) "pull" and "push" should be symmetrical operations

I think that makes a lot of sense to have "gh pull" and "gh push" as symmetric operations, and make "gh merge" do the fast-forward and 3-way merge magic done in the current "git pull". These three words would have a lot saner meaning.

I am really opposed to do "gh pull". Not only because of "gh" being completely confusing (we already _have_ "git", and for porcelains different TLAs), but "pull" _really_ is confusing by now. And Mercurial did not help one wit by insisting on their own interpretation.

Why not do something like "get/put" instead? It is

- easier to remember
- not bogus (AFAICT the meaning is not used in diametrical senses)
- shorter to type than download/upload

As for "git merge": Just by the number of arguments you can discern between the original usage and the new usage, so I am all in favour of replacing "git pull <blabla>" by "git merge <blabla>". Where "<blabla>" can be a branch or a remote or a URL (with cogito style #branchname).

Ciao,
Dscho

#381 lore raw

Re: Cleaning up git user-interface warts

In reply to Junio C Hamano
Quoted 1 line · Junio C Hamano

Or even better, have "gh init".

Why gh? Is Git just Mercurial backwards? :)

I'm all in favor of this discussion, and in particular of just breaking the entire UI in 2.0 by using a new frontend command. I'm just not sure that "Mercurial backwards" describes Git well.

#318 lore raw

Re: Cleaning up git user-interface warts

In reply to Alexandre Julliard
Quoted 8 lines · Alexandre Julliard
Quoted 2 lines · Junio C Hamano

I would rather say "use 'git branch' to make sure if you are ready to merge". Who teaches not to use "git pull"?

We do that for Wine. The problem is that we recommend using git-rebase to make it easier for occasional developers to keep a clean history, and rebase and pull interfere badly.

How do those developers submit their changes? Do they push? If they do, git-rebase can be saving one merge at most, and the merge is actually a good thing (someone should write some nice standalone writeup about that).

If they don't have push access and maintain their patches locally until they get accepted, perhaps it would be far simpler for them to use StGIT?

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
#188 lore raw

Re: Cleaning up git user-interface warts

In reply to Jakub Narebski

Jakub Narebski escreveu:

Quoted 5 lines
Quoted 2 lines

- --pretty option with wholly uninformative options full, medium,
short, raw. It's not even documented what each option does.

And 'oneline' and undocumented 'email'. True, git lacks documentation (and this one of main complaints in git survey).

The recently posted patch documenting is an improvement, but why not add an option so you can do

--format 'committer %c\nauthor %a\n'

this catches all combinations, and is easier for scripting.

Right now, I have some scripts that have to munge log output with regular expressions to strip out the "author:" prefixes.

Signature · 1 line
 Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen
#368 lore raw

Re: Cleaning up git user-interface warts

In reply to Johannes Schindelin
Quoted 11 lines · Johannes Schindelin
Quoted 8 lines · Junio C Hamano
Quoted 1 line · Nicolas Pitre

2) "pull" and "push" should be symmetrical operations

I think that makes a lot of sense to have "gh pull" and "gh push" as symmetric operations, and make "gh merge" do the fast-forward and 3-way merge magic done in the current "git pull". These three words would have a lot saner meaning.

Quoted 4 lines

I am really opposed to do "gh pull". Not only because of "gh" being completely confusing (we already _have_ "git", and for porcelains different TLAs), but "pull" _really_ is confusing by now. And Mercurial did not help one wit by insisting on their own interpretation.

I completely agree that creating yet another command prefix for basically the same tools would be a disaster. We have "git" already so let's stick to it and make its usage just more sane.

Quoted 5 lines

Why not do something like "get/put" instead? It is

- easier to remember
- not bogus (AFAICT the meaning is not used in diametrical senses)
- shorter to type than download/upload

Well, of all compromizes this is probably the best one so far. I would have prefered to bite the bullet and fix "pull" instead of adding yet more commands. But if the consensus is that there is no way on earth that "pull" can be salvaged then get/put is probably more enjoyable than download/upload. This way pull/fetch/push could still be available (albeit burried somewhere out of sight).

#303 lore raw

Re: Cleaning up git user-interface warts

In reply to Carl Worth
Quoted 5 lines · Carl Worth

Well, one of the problems is that with current git I can teach, (and I have), that there's a conceptual:

pull = fetch + merge

Quoted 8 lines

But then shortly after I have to teach an interface notion:

merge = pull .

So there's this goofy circular notion that people end up with mentally. If we fix it so that a local merge really is performed with "git merge <branch>" instead of "git pull . <branch>" then teaching pull=fetch+merge really is a lot easier.

On a conceptual level, can we not perhaps explain that if

pull = fetch + merge

then

merge = pull - fetch

and that the latter (pull - fetch) happens to be expressed with the interface as 'git pull .' ?

My 2 cents.
Jérôme

#187 lore raw

Re: Cleaning up git user-interface warts

In reply to Han-Wen Nienhuys
Quoted 4 lines · Han-Wen Nienhuys

As another example:  annoyances regarding program invocation

  - option handling: -x -f -z != -xfz , "--max-count 1" doesn't work, but needs an '='

That's true, and the probable cause is that git tries to first, avoid dependency on options parsers like getopt/getopt_long/argp or popt for commands in C, getopt for commands in shell, Getopt::Std/Getopt::Long for commands in Perl, and something for commands in Python (if there are any left); second, existing options parsers do not deal (I think) with distinction between arguments to wrapper and arguments to command, '--' to separate revisions from pathnames not options from arguments, and the whole revisions and revision list specifying syntax (where "a --not b" is not equivalent to "--not a b").

That said, perhaps we should craft our own options parsing (or modify existing one)...

Quoted 1 line

  - git --help lists an unordered set, which is too long scan quickly.

It is one page of alphabetically ordered commands.

git(7) gives whole list of commands, divided into categories, by the way.

Quoted 5 lines

I'd expect that list to either contain everything or the minimum set for daily use. I.e. the set introduced in a first tutorial.  Why are merge, prune, verify-tag there?

Try "bzr help" for comparison.

I wonder why "repack" isn't there, if "prune" is.

Quoted 2 lines

  - --pretty option with wholly uninformative options full, medium, short, raw.  It's not even documented what each option does.

And 'oneline' and undocumented 'email'. True, git lacks documentation (and this one of main complaints in git survey).

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#51 lore raw

Re: [PATCH] make commit message a little more consistent and conforting

In reply to Nicolas Pitre
Quoted 10 lines · Nicolas Pitre
Quoted 4 lines · Shawn Pearce
Quoted 1 line · Andreas Ericsson

diffstats can be huge though. I'd rather have those only with -v option.

But they are on by default for pull/merge, and disabled by -n.

And it is true that diffstat can be quite large. I wouldn't mind the diffstat to be added to the commit message summary in the text editor though. And displaying it when -v is used makes also a lot of sense. But not by default please.

OK, two votes against diffstats by default in commit. Since I haven't written a patch for it yet consider it dropped. ;-)

#253 lore raw

Re: Cleaning up git user-interface warts

In reply to Han-Wen Nienhuys
Quoted 1 line · Han-Wen Nienhuys

- clone but not a put-clone,

What's put-clone? Care to explain?

Quoted 1 line

- pull = merge + fetch, but no command for merge + throw

What's merge+throw? Care to explain?

Quoted 2 lines

- clone for getting all branches of a repo, but no command for updating all branches of a repo.

This one I can understand, but how would you propose to "update all branches", in other words what's your design for mapping remote branch names to local branch namespaces?

It would be nice if the design does not straightjacket different repository layouts different people seem to like, but I think it would be Ok to limit ourselves only to support the straight one-to-one mapping and support only separate-remote layout.

#114 lore raw

PATCH 1/1 Document git-merge-file

In reply to Junio C Hamano

Most of this is derived from the documentation of RCS merge.

---

On Sat, 16 Dec 2006, Junio C Hamano wrote:

> >> - 'git-merge-file' needs to be documented and linked from
> >> git.txt.

 Documentation/git-merge-file.txt |   92 ++++++++++++++++++++++++++++++++++++++
 Documentation/git.txt            |    3 +
 2 files changed, 95 insertions(+), 0 deletions(-)
Documentation/git-merge-file.txt new file +92 -0
new file mode 100644
index 0000000..0b41d66
@@ -0,0 +1,92 @@
+git-merge-file(1)
+============
+
+NAME
+----
+git-merge-file - threeway file merge
+
+
+SYNOPSIS
+--------
+[verse]
+'git-merge-file' [-L <current-name> [-L <base-name> [-L <other-name>]]]
+	[-p|--stdout] [-q|--quiet] <current-file> <base-file> <other-file>
+
+
+DESCRIPTION
+-----------
+git-file-merge incorporates all changes that lead from the `<base-file>`
+to `<other-file>` into `<current-file>`. The result ordinarily goes into
+`<current-file>`. git-merge-file is useful for combining separate changes
+to an original. Suppose `<base-file>` is the original, and both
+`<current-file>` and `<other-file>` are modifications of `<base-file>`.
+Then git-merge-file combines both changes.
+
+A conflict occurs if both `<current-file>` and `<other-file>` have changes
+in a common segment of lines. If a conflict is found, git-merge-file
+normally outputs a warning and brackets the conflict with <<<<<<< and
+>>>>>>> lines. A typical conflict will look like this:
+
+	<<<<<<< A
+	lines in file A
+	=======
+	lines in file B
+	>>>>>>> B
+
+If there are conflicts, the user should edit the result and delete one of
+the alternatives.
+
+The exit value of this program is negative on error, and the number of
+conflicts otherwise. If the merge was clean, the exit value is 0.
+
+git-merge-file is designed to be a minimal clone of RCS merge, that is, it
+implements all of RCS merge's functionality which is needed by
+gitlink:git[1].
+
+
+OPTIONS
+-------
+
+-L <label>::
+	This option may be given up to three times, and
+	specifies labels to be used in place of the
+	corresponding file names in conflict reports. That is,
+	`git-merge-file -L x -L y -L z a b c` generates output that
+	looks like it came from files x, y and z instead of
+	from files a, b and c.
+
+-p::
+	Send results to standard output instead of overwriting
+	`<current-file>`.
+
+-q::
+	Quiet;  do  not  warn about conflicts.
+
+
+EXAMPLES
+--------
+
+git merge-file README.my README README.upstream::
+
+	combines the changes of README.my and README.upstream since README,
+	tries to merge them and writes the result into README.my.
+
+git merge-file -L a -L b -L c tmp/a123 tmp/b234 tmp/c345::
+
+	merges tmp/a123 and tmp/c345 with the base tmp/b234, but uses labels
+	`a` and `c` instead of `tmp/a123` and `tmp/c345`.
+
+
+Author
+------
+Written by Johannes Schindelin <[email protected]>
+
+
+Documentation
+--------------
+Documentation by Johannes Schindelin and the git-list <[email protected]>,
+with parts copied from the original documentation of RCS merge.
+
+GIT
+---
+Part of the gitlink:git[7] suite
Documentation/git.txt +3 -0
index b9b1e63..b9fc9ae 100644
@@ -359,6 +359,9 @@ gitlink:git-init-db[1]::
 	Creates an empty git object database, or reinitialize an
 	existing one.
 
+gitlink:git-merge-file[1]::
+	Runs a threeway merge.
+
 gitlink:git-merge-index[1]::
 	Runs a merge for files needing merging.
 
Signature · 1 line
1.4.4.2.g5dc03