All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Git User's Survey 2007 unfinished summary continued
@ 2007-10-08 20:55 Jakub Narebski
  2007-10-12 22:08 ` Jakub Narebski
  0 siblings, 1 reply; 161+ messages in thread
From: Jakub Narebski @ 2007-10-08 20:55 UTC (permalink / raw)
  To: git

This is continuation of partial summary of Git User's Survey 2007,
ending at state from 28 September 2007.

The survey can be found here:
  http://www.survey.net.nz/survey.php?94e135ff41e871a1ea5bcda3ee1856d9
  http://tinyurl.com/26774s

The data this summary is based on can be found here:
  http://git.or.cz/gitwiki/GitSurvey2007?action=AttachFile&do=get&target=surveydata.csv
  http://tinyurl.com/yusomo

----
There were 683 individual responses

About you
~~~~~~~~~

00. Date of response

  Date                           | Count
  ------------------------------------------
  Before                         | 7
  During                         | 584
  After                          | 92
  ------------------------------------------

The ranges 'before', 'during' and 'after' refers to official duration
of Git User's Survey 2007, from 20 August 2007 to 10 September 2007.
Actually they are corrected to take into account the fact that local
date on survey's server (or UTC date) might be different from local
date on user computer, so duration of survey is taken as from
2007-08-19 to 2007-09-11.

Most responses are from the start of survey, 20 and 21 August (133 and
103 responses respectively).  If anyone is interested I can provide
full date by date histogram.


Getting started with GIT
~~~~~~~~~~~~~~~~~~~~~~~~

07. What helped you most in learning to use it?

  TO DO
  646 / 683 non-empty responses

Some of the responses:
 * documentation (generic)
 * man pages
 * examples / usage cases in man pages
 * everyday GIT, tutorials and user's manual
 * wiki examples
 * reading mailing list / comp.version-control.git
 * people on IRC (not only #git)
 * advice from other users / friends / colleagues
 * (unofficial) documentation on the web: guides, articles, blogs etc.
   [here probably should be a sublist of them, with count]
 * a development community and/or its documentation, mailing list
   e.g. WINE wiki, Source Mage GNU/Linux development community
 * Google (Google searches)
 * helpful error messages
 * source code, reading the parts of git in shell script
 * cogito
 * using git in a live project / experimenting / trial and error
  (That I was able to just delete the entire repository and start
   over.  That all my mistakes stayed local and didn't affect upstream
   repos.)
 * working on an established project that had documented processes for
   using git
 * writing code for both plumbing and Porcelain
   writing documentation / tutorial for project / article
 * understanding the internal representation of the repository;
   good / simple design, basic principles; understanding concepts
 * experience of working in software industry;
   prior experience with version control systems (GNU Arch, SVN, BK, hg)
 * version 1.5
 * gitk, qgit; git-gui

One of more interesting:
 * We hired a consultant to give us a tutorial


08. What did you find hardest?

  TO DO
  596 / 683 non-empty responses

Some of the responses:
 * the level of complexity
 * user interface:
   too much / inconsistent commands, too many / cryptic options
   distinction between plumbing and porcelain
   many ways to do a task
   insufficient error messages
   'git <cmd> --help' prints manpage, not concise help summary
 * obtuse command messages
 * weak porcelain
   e.g. git-update-index very central
 * git-merge was plumbing
 * remote / tracking branches
   fetching, pushing and pulling, synchronizing repositories
   the fact that push is not an opposite of pull
   understanding the difference between committing and publishing
 * handling multiple remote repositories
 * merge vs rebase, deciding on proper workflow
   working with topic branches
   modifying a patch series
 * merge defaults (which branch gets merged)
 * git vs StGIT: slightly different merge conflict handling
 * making it work in non-POSIX environments
   working with git on case-insensitive and other strange filesystems
   compiling on exotic OS, for example AIX
   generating man pages
 * lack of / bad / outdated / insufficient / badly structured docs
   hard to find something in the documentation
   git lingo in documentation, documentation for users who know git
   using Cogito in some of documentation
 * understanding of concepts, thinking in git way
   understanding basic concepts and terminology
 * distributed SCM concepts, paradigm shift
   idea of non-linear history
 * index (staging area): understanding, having it visible
 * git-diff not showing added files
 * commands named differently from equivalents in other SCM
   differences from other SCM: git-commit needs '-a' to commit all
   changes, strange semantics of git-add, multiple branches in repo
   understanding terminology
 * importing history from other SCM (bzr, svn)
 * reverting changes, amending commit, undoing a commit
 * keeping track of where am I, of which version I'm working with
   finding which branch the change was made on
 * lerning to use it as maintainer
   maintaining "perfect patch series", keeping history clean
   rewritig history before 'git rebase -i'
 * dealing with merge conflicts
   figuring how to undo failed merge and restart it
 * learning conventions git expects but didn't document clearly
   like commit message formatting
 * setting up shared repo / shared server
   setting up remote repository
 * dealing with modified files (dirty tree) when switching branches,
   merging (pulling) and rebasing
 * checking out past revisions (or tagged revisions) with the
   intention to return to newer revision
 * creating independent branch, i.e. branch without ancestry
 * exploring the history and previous versions of particular files
   which are renamed and/or moved around, especially before --follow
   was added
 * some hot-shot peple in the community (on the mailing list)
 * setting up gitweb
 * having to use CLI interface
 * no <some language> documentation

More interesting:
 * All idiosyncrasies that make (made) sense for Linus' workflow but
   aren't really orthogonal or predictable.
 * Listening to whiners complain about how hard it was to learn
 * Thinking outside the narrow box defined by previous SCMs.
 * Not having used an SCM before!
 * Following the explosive growth of features.
 * Having a day job taking most of my time away from git.
 * Convincing my boss to use it.

Conclusions:
 - some of the things got corrected, like separate remote layout being
   default for non-bare repositories, using git-add (porcelain)
   instead of git-update-index (plumbing) in documentation and command
   messages, promoting git-merge to porcelain, creating git-remote for
   managing multiple repositories and remote branches, better
   documentation including creating git user's manual.
 - some things are hard because of historical reasons, such like
   naming of commands, or consistency of options, and would be
   difficult to change.
 - doing things "git way", such as making index visible (and requiring
   'git commit -a' to commit changes in all files), or rename
   detection instead of rename tracking, or storing filenames and file
   contents 'as-is' (without translation) are I think here to stay
 - some of things are intrinsically hard, and would stay that way,
   for example the distributed SCM concept, or nonlinear history.


How you use GIT
~~~~~~~~~~~~~~~

22. What projects do you track (or download) using GIT
    (or git web interface)?

  TO TABULARIZE
  560 / 683 non-empty responses

A note: this question was meant to list projects which one _tracks_,
not the ones he/she maintains, meaning the projects in the remotes
(section).

Tracked projects can be divided into the following categories:
 * undisclosed: proprietary code / work projects, own projects, etc.
 * Linux kernel an kernel related projects (like udev or kvm)
 * git related: git, gitk, git-gui, git-gui-i18n, stgit, tig,...
 * freedesktop (and related) projects: XCB, Compiz, Mesa3D, Cairo,...
 * Linux distributions: Source Mage, Slind,... (a few)
 * tracked via git-svn, e.g. nsd, KDE, GIMP, FreeCiv
 * others with official git repositories (like XMMS2 or ELinks)
 * others with unofficial git repositories (like OpenOffice.org)

There are more that 100 different projects tracked mentioned in survey
(not all of them _choose_ git as their SCM).


Internationalization
~~~~~~~~~~~~~~~~~~~~

32. What do you need translated?

  TO TABULARIZE
  172 / 683 non-empty responses

Summary of responses, without count (which I guess is most important):
 * user interface: command messages and error messages
 * GUI: git-gui, gitk
 * man pages and commands usage
   ('git <cmd> --help' , git <cmd> --usage')
 * user's manual, tutorials, intro, howtos
 * website / homepage

-- 
Jakub Narebski
Poland
(temporarily away from Internet)

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Git User's Survey 2007 unfinished summary continued
  2007-10-08 20:55 Git User's Survey 2007 unfinished summary continued Jakub Narebski
@ 2007-10-12 22:08 ` Jakub Narebski
  2007-10-12 23:36   ` Frank Lichtenheld
                     ` (2 more replies)
  0 siblings, 3 replies; 161+ messages in thread
From: Jakub Narebski @ 2007-10-12 22:08 UTC (permalink / raw)
  To: git

This is continuation of partial summary of Git User's Survey 2007,
ending at state from 28 September 2007.
(response ident "46f95167c967b").

The survey can be found here:
  http://www.survey.net.nz/survey.php?94e135ff41e871a1ea5bcda3ee1856d9
  http://tinyurl.com/26774s

The data this summary is base on can be found here:


----
There were 683 individual responses


Other SCMs
~~~~~~~~~~

13. What would you require from GIT to enable you to change,
    if you use other SCM for your project?

  TO DO
  474 / 683 non-empty responses

List of answers, without count (which for this question is, I think,
less important), divided into broad categories, is shown below

Generic
 * being more user-friendly, easier to use
   more friendly output from commands
   better and clearer error messages
   stable command semantics
 * reduced number of (visible) commands
   clear separation of plumbing and porcelain
 * consistent set of commands
   consistency if command flags
 * easier to learn (easier learning curve)
 * more stability
 * support UTF-16

 * A clearer UI. Read the monotone list archive. 70% of the mails are
   UI related. The result is an clear and easy to use intuitive UI
   that does what you expect in most cases.

Performance
 * better performance on massive trees (FreeBSD)
 * good speed on NTFS (MS WIndows)

Documentation
 * a good documentation
   user/installation documentation
   troubleshooting guide
   'Git For Dummies', 'The Git Book'
 * documented workflows (including centralized repo workflow, or at
   least documenting how and why replace it with better workflow)
 * development model tutorials
   more example usage
   best practices
   case studies
 * guide for designing a branch policy for a shared repository
 * screencasts
 * documentation in one's native language
 * good in-depth administative documentation
 * maybe git-tutor program

Specific features
 * partial-tree checkouts (partial checkout)
   checking out arbitrary subdirectories
 * granular permissions (ACL) within the tree
   e.g. restricting translators to the po/ subdirectory
 * shallow clone from a given commit: git clone --depth <commit>
 * automatic (re)packing
 * lightweight working copies
 * better and well documented submodule support
 * multi-project support / multiple sandboxes support
 * git-bind/unbind (like in bzr)
 * git-sync
 * cvs-compatible syntax as an option
 * tracking empty directories
 * more friendliness with corporate firewalls
 * ability to preserve permissions/modes/EA of files and directories
   access control features /  visibility access control
   disabling some users from accessing certain parts of the repository
 * being able to merge directories (instead of branches)
 * FastCGI gitweb
 * some embedded keyword capabilities similar to those provided by CVS
   and Subversion
 * ignore files during merge
 * R/W git server (allow push), with NIS, LDAP support
 * pull/rebase into dirty tree
 * clearcase dynamic view-like support (externally?)
 * better http(s) push via WebDAV: hooks
   working and easy to setup push over https
 * plain simple FTP upload (push) and download (clone, fetch)
 * better working through corporate firewalls

Portability
 * native MS Windows support, easy installer package
   even better support for all platforms
   easier setup on Solaris and AIX
 * pre-prepared _static_ binaries for FreeBSD, MacOS X, MS Windows
 * less dependencies
 * support for more platforms
 * a portable version of git, one binary + library (gitbox)
 * Windows version(s) mentioned on homepage

GUI
 * better (G)UI
   TortoiseGit for MS Windows, or other Windows front-end
   good, advanced GTK+ 2.x tool to visualize git
 * history graph conected to file tree in GUIs
 * easier management of remotes using GUI
 * better diff viewing tools (side-by-side, like KDiff3)

Other SCMs
 * seamless import
   BitKeeper / ClearCase import/sync
   tool to import TeamWare history into Git
   better SCM interop
 * SCM rosetta / "Git for <SCM> users" documentation
 * import/export tools supporting incremental import and export
 * 100% subversion interoperability
 * git update (stash, fetch, rebase, unstash) a la CVS
 * git-svnserve
 * svn:externals support

Tools
 * improved administrative tools
 * reasonable plugins for IDE (e.g. Visual Studio, KDevelop, NetBeans)
   full Eclipse / NetBeans / IntelliJ support
 * good integration with apps like Trac and Bugzilla
   work with continuous integration tools (cruise control etc...)
 * Git+Launchpad
 * libification (for tools support)

Other
 * SourceForge / Gna! / Google Projects support
   (free) hosting with git facilities
   FOSS hosting sites supporting git
 * commercial support / corporate backing
   contractual service
 * number of users, to convince my co-workers that they're not
   a silly minority
   popularity
 * projects switching to git
 * user education
 * marketing, advocacy videos
 * convincing coworkers / other members / boss
   willingness of the other developers to learn to use it
 * training/certification
 * a stop to the constant bashing of other SCMs - this doesn't get you
   any friends drop the arrogant attitude, work with the rest of the
   community and try to make something people can understand in an
   hour

 * http://wiki.FreeBSD.org/VersionControl

 * At work it'd require some kind of miracle. Huge Perforce repository
   of highly interrelated stuff in which people can make sweeping
   changes in a single changelist. Lots of tools that access Perforce.
   Slow as hell.



Getting help, staying in touch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

61. Did you have problems getting GIT help on mailing list
    or on IRC channel? What were it? What could be improved?

  TO TABULARIZE
  99 / 683 non-empty responses


Problems and suggestion for mailing list:

 * I answered my own question and no one even commented it. User and
   development discussion should be separated. Just release
   announcements in the user list.

   You need another mailing list for users. The current mailing list
   is very developer centric.

   The mailing list feels like it's more for developers rather than
   users and it's a little intimidating to ask newbie questions there.
   Maybe separate git-users and git-dev lists would make sense.

   Git mailing list needs a users and developers list. Mixing up the
   two is intimidating with all the traffic and the number of patches
   and advanced topics that shoot around.

   Having separate git-users and git-devel lists would be nice. I
   might read both but I hate to ask a newbie question on a list where
   50% of the submissions contain patches.

   (Other users find mailing list very responsive. Splitting the list
   into either git-devel and git-users, or git and git-announce has
   its advantages and disadvantages. You can always filter out patch
   submission and comments on patches thanks to the "[PATCH .*]"
   prefix convention present on mailing list.)

 * A question or two with no response at all. In hindsight my query
   was way too long-winded but it's still frustrating to be ignored.

   I answered my own question and no one even commented it.

   (See above)

 * The git mailing list is too high traffic to remain on. Maybe split
   it into a few lower traffic versions?

   Biggest problem is that smaller problems are getting lost in the
   growing size of the mailing list.

   The sheer amount of traffic makes the mailing list hard to deal
   with sometimes.  Getting your email tools set up correctly can help
   (i.e. auto tag+archive in GMail), but ultimately you still have to
   wade around in hundreds of emails you don't care about in order to
   find the ones you do care about.

   (Most people find traffic levels on git mailing list OK, see
   question 58.)

 * Will not go through corporate firewall.

   (I think it was about mailing list, but perhaps it was about IRC)

   I no longer subscribe to the GIT mailing list as ML subscription is
   forbidden at my new job, and I have no time at home to read it all.

   (You can read git mailing list through many archives / web
   interfaces, including MARC and GMane ones, and throught NNTP
   (aka. Usenet, aka news) interface on GMane. You don't need to be
   subscribed to git mailing list to post.)

 * People responded quickly to mailing list queries usually helpfully.
   However there was occasionally a touch of annoying 'groupthink' to
   the responses; sometimes new users are just confused and really
   would be better served by just changing their working habits, but
   other times there appeared to be a bit of tunnel-vision on the part
   of the longtime git users.

 * Trolls could be thrown out ;-) Seriously we had only a few there,
   but they are mighty annoying.

 * Mostly no. But little help on applying email-patches in win32 using
   GMail.  I'll get there though :)

   (Late addition of smtpserver (with ability to select port number),
   smtpuser, smtppass and smtpssl configuration variables / options to
   git-send-email should help with _sending_ patches using GMail. As
   to applying email-patches, git-am understand both mbox and maildir
   formats, not that it help much with win32 mail programs; but you
   can always try to save email in raw format from GMail WWW
   interface)


Problems and suggestions for IRC:

 * The IRC channel has too few people who know answers to questions;
   if you're there at the wrong time of day when none of them happen
   to be around it's useless. But if you're there at the right time
   it's pretty good.

 * IRC channel seems to respond to newbie git users quite well, but
   mid-level experience often gets no response.

 * Traffic on the IRC channel is a bit high. It may need to be split
   into a few different high-level topics in the near future.

   (IRC channel or git mailing list? I don't remember IRC channel
   having high traffic...)

 * It's hard to improve IRC. It's such a poor medium for understanding
   the communication going on.

   (On the other hand it is responsive. I think pastebins helps to
   sidestep limitations of the medium. Nevertheless the main medium of
   communication is git mailing list, not #git channel.)

 * IRC is blocked from work :-( I may try it by tunneling out.

   (Any suggestions here?)


Generic problems and suggestions:

 * Sometimes you get no answer (on git mailing list or #git channel)
   but that happens

 * People seem to think the problem isn't with git, and yet I find git
   extremely buggy and non-intuitive. Your "Git in 5 minutes" doesn't
   even include +x a hook or mention of hooks; neither does linus
   speech. If you don't +x a hook, try to figure out what is going
   on. I dare you. Git fails silently a bunch, maybe half of the time
   by design. Which shouldn't be acceptable.

   Try addressing an ssh address in url format: it isn't consistent
   and it will fail in half the apps. Same thing with git-ls-remote:
   it might have an --upload-pack that works, but this isn't across
   the board! From my own debugging none of the shell scripts have an
   --upload-pack option that work.

   (Not here. This is question about getting help from people, not
   about documentation or what you find hardest in GIT.)

 * After the last thread the GIT FAQ is almost begging for a 'Please
   don't ask about C++' section.

   (Truly, Git FAQ (which resides on Git wiki, but perhaps we should
   consider extracting it and adding to distribution tarballs) needs
   maintenance, updating and adding new frequently asked
   questions. Currently there is no FAQ maintainer.)


The other side: getting help success stories:

 * Quite the contrary. When Source Mage GNU/Linux switched to using
   GIT our developers spent a considerable amount of time asking
   questions and discussing features and bugs on #git. The feedback
   that we got was fabulous: the GIT developers were helpful
   interested in our needs and productive when it came to fixing
   bugs. One bug we discovered was even handled by Linus Torvalds
   himself and in just a matter of hours! In our eyes the GIT
   development community gained rightful reputation as one of the most
   friendly and helpful communities there is.

 * No, the mailing list has been very responsive. I have never asked a
   question on IRC but I sometimes answer newbie questions.

 * Mailing list is very interesting especially as I'm working on
   egit. IRC is more immediately helpful.

 * I'd like to say that I consider #git to be the most useful IRC
   channel I've ever been to when it came to getting answers to my
   questions. Thanks guys!

   The IRC channel is wonderful. The people there do a good job with
   questions.

 * No problems. In fact the mailing list/IRC could substitute the
   documentation but I guess that
     (1) does not work in offline mode
     (2) _is_ going to get on peoples nerves after a while
	 (recurring questions)



Open forum
~~~~~~~~~~

62. What other comments or suggestions do you have, that are not
    covered by the questions above?

  TO DO
  141 / 683 non-empty responses

There are many "keep up the great work!" (and equivalent) as answers
to this questions, and a few "worst SCM I've used". Those are excluded
from the lists below.


Suggestions for git:

 * One of the biggest complaints I hear is that mercurial's UI is much
   more 'intuitive' and user friendly.  Perhaps looking at it's
   operation and comparing/contrasting would be good.

   (Note that changing names of commands for example might be
   impossible because of historical reasons and large usebase.
   On the other hand perhaps this is just a steep learning curve,
   unavoidable for a power tool)

 * Mercurial has an excellent tutorial which had my team up and
   running in less than a hour after a week struggling to make git do
   anything useful.

   (I hope that late work on "Git User's Manual" helps here)

 * Handling of Unicode (UTF-16 encoded) files is a big pain with git.
   Even SVN can do a diff of them.

   (The idea that blob is just a bag of bytes will not change; but we
   have input/output filters, and soon before-diff filters, connected
   with gitattributes)

 * I like how in Subversion the commands work relative to the current
   directory. With Git I always seem to be dealing with longer paths
   and/or have to change to the root.

   (Running git from within directory deep within repository structure
   should 'just work'. If not, then it is an error... unless in
   situation like referring to tree-ish, where path is almost always
   relative to project root).

 * Keep up the UI simplification and make sure the docs start off with
   usage somewhat similar to CVS/SVN. I think many users are scared by
   Git because they see the more powerful commands thrown around too
   early and get scared.

   Git is just too complicated for a typical project. I understand
   it's probably great for the Linux kernel but for a smaller project
   like mine (Mesa) it's overkill and a frustration. (...)  With git
   everything seems hard. (...)  I've _wasted_ hours trying to figure
   out git. That alone is a huge issue. I guess I could go into
   specific details about my problems with git but I've already spent
   enough time on this survey.

   Figure out why people find git hard to learn and eliminate those
   barriers to entry.  Make git more task-oriented rather than
   data-model-oriented the way it is now.

   It's a great idea and a powerful tool but it's got a long way to go
   before it reaches wider adoption because it's so damn hard to use.

   (...) I'm evaluating Mercurial despite its being based on Python
   because it feels cleaner and simpler to use. I would prefer to use
   Git.

   (I think the 1.4 and 1.5 series is a good step in simplifying git
   for simple tasks and ordinary user. Core git porcelain improved
   much, and now there is no need to use plumbing for every-day tasks)

 * No one-pager cheat sheet with the 6 most basic commands on it so
   people can go use git.

   (This got corrected. There is git cheat sheet on the Internet;
   there is link on GitWiki to it)

 * Having a git library where other apps can integrate git, along with
   bindings for Python would be great.

   Make it easier to use by graphical clients like KGit.

   (The libification projects from Google Summer of Code would help
   there, I think)

 * I think that moving away from shell scripts to builtins is a
   necessary step but I don't really like it. It would help if you
   kept them around, perhaps in contrib/, so that others can learn how
   to use the plumbing (I learned a lot about git from reading these
   shell scripts).

   (Doing it: shell scripts which are moved to builtin are retired to
   contrib/examples/ directory).

 * Building git is a pain. (SHA1 sources being a problem). Can't git
   use autoconf? Also I've heard people have issues with git's
   portability (for example some BSD variant). Shell scrips weren't
   portable to non bash IIRC and often relied on GNU extensions in
   some programs. Native Windows port is also important.

   Probably the toughest challenge for Git IMO is that Mercurial,
   Darcs and Bazaar are good and similar. Lack of Windows support
   makes some people rule out Git altogether even though it may be
   better overall.

   I'd like to just stress support for windows and central
   repositories. (...) In fact most of my friends really wanted to use
   git but they wanted a solid native port.

   I think key to the adoption of git is that it is made to run on
   Windows as well as the other major OSes.

   (Git tries to use autoconf in a way that is totally optional, to do
   detection and write options for Makefile; you are welcome to
   contribute to configure.ac.  People work on making git more
   portable, for example trying to make it work with dash, defining
   in the meantime minimal POSIX-like shell compatibility required.
   Native MinGW Windows port is in the development)

 * I think that it is very nice that git is in the native OS
   repositories for Fedora. The Debian version needs updating.

   (git Makefile has rpm target, and git.spec target; perhaps this is
   the cause)

 * git-blame is manageable (with gc and reduced history etc) but that
   slowness still seems to be a negative point for many of my peers. I
   wouldn't mind better performance there either. Maybe some kind of
   optional indexing for those who want fast blame?

   (I recall there were some ideas about how to make git-blame faster
   on git mailing list.  Making it interactive for graphical blame
   tools reduced latency; there is I think a bit place for easy
   improvement for reblaming.  Maybe packv4 would help with blame
   performance...  What is I think unchangeable is the fact that
   snapshot driven / whole history driven SCMs _always_ would be
   slower at least a bit than single-file based SCMs.  This tradeoff
   is not possible to avoid.  But don't forget that git has other
   tools for examining history, like path (subsystem) limiting,
   searching commit messages, pickaxe search and graphical history
   browsing tools like gitk or qgit)

 * Get a mascot perhaps O'Reilly animal for O'Reilly GitBook
   (Git User's Manual) like the svnbook.

   (What animal could Git use for O'Reilly? Herd of horses, or a
   pony?)

 * I'm wondering what the overall goal is - git's origin as a neutral
   ground was fine but it hasn't seemed to take off as a viable
   alternative for general use.  Do you care about that?  Is it ok
   that git is it's own little niche?

   (Junio, Linus?)


Suggestions about git mailing list:

 * Git adoption will be limited by the actions and attitudes of those
   on the mailing list. 'If you can't say anything nice...'

   (We are nice, I think... to a point)

 * The ML had way too much traffic. I think there should be at least a
   git-patches@ where people submit there patches and git@ remains for
   user/dev discussions.

   (Most users find level of traffic on git mailing list O.K. It is
   not that hard to separate patch submission and their discussion
   from the rest of traffic thanks to [PATCH] prefix convention used.)


Suggestions and comments about this survey:

 * Various questions need 'other' options such as the programming
   language question. Various questions that already have 'other' as a
   possible choice need a text box to fill in the specifics.

   (I am not sure if it is possible mixing radiobutton/checkbox with
   text field with currently used free survey service, survey.net.nz)

 * The text fields (and text areas) of this survey are way too small!

   (I am not sure if changing this is possible with currently used
   free survey service, survey.net.nz)

 * You should do a survey of feature requests.

   (See questions 13, 38, 41 and especially 37)

 * Shorten survey length. This survey is too damn long. Make the
   survey shorter!

   Cut down the number of questions on this survey by a factor of 4.

   (I think removing the questions which asks very similar question
   but in different context be a good start. But that aside: which
   questions should be dropped, which concatenated (and which split);
   which are useful and which are not?)

 * Questions not asked: what can be improved on GitWiki, workflows
   used and tools used, kind of repository hosting used for project,
   programming experience level and version control experience, using
   git for non-programming repositories like ikiwiki or documents,
   perceived git stability and number of bugs.

   (The surveys is very long as it is now. Those questions are nice,
   but it would make survey too long I think.)

 * The survey asks about new features that are not in a stable version
   of git yet. git-stash comes to mind. This is silly. Not everybody
   will track your development branch. I certainly don't. I don't for
   other SCMs I use either.

   (I tried to put only features which are in released, i.e. numbered,
   version. git-stash is in 1.5.3, see Documentation/RelNotes-1.5.3.txt)

 * Regarding Q19 (How do you obtain GIT?). I actually use all three
   forms on different systems.
     Mac: pull from MacPorts
     Ubuntu: from git.git
     remote systems: tar balls.

   (Should it be made multiple choice question, then?)


Some other comments:

 * I've been so busy with other projects. I didn't realize so many
   interfaces exist.  Thanks to this survey I'll spend some time
   checking out the wiki for the other interfaces.

   I didn't even know about any of the new git features listed in
   question 43.

   I need to get an up to date version as there are things mentioned
   in this survey that I don't know about.

 * At the 'Solutions Linux 2007' exhibition in Paris I have been
   looking for a service provider that could propose some training
   sessions for Git. I couldn't find one. Maybe in 2008...

-- 
Jakub Narebski
(away from Internet)

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-12 22:08 ` Jakub Narebski
@ 2007-10-12 23:36   ` Frank Lichtenheld
  2007-10-13  0:46   ` Johannes Schindelin
  2007-10-13  3:04   ` Shawn O. Pearce
  2 siblings, 0 replies; 161+ messages in thread
From: Frank Lichtenheld @ 2007-10-12 23:36 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

On Sat, Oct 13, 2007 at 12:08:18AM +0200, Jakub Narebski wrote:
>  * I think that it is very nice that git is in the native OS
>    repositories for Fedora. The Debian version needs updating.
> 
>    (git Makefile has rpm target, and git.spec target; perhaps this is
>    the cause)

Nah, the Debian problem is just bad timing. Debian stable is stuck with
1.4.4 which is unfortunate but not fixable. unstable is very fast with
updates and backports.org is very good, too (but lacks at least 10 days
due to upload policy).

Gruesse,
-- 
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-12 22:08 ` Jakub Narebski
  2007-10-12 23:36   ` Frank Lichtenheld
@ 2007-10-13  0:46   ` Johannes Schindelin
  2007-10-13  2:13     ` J. Bruce Fields
                       ` (6 more replies)
  2007-10-13  3:04   ` Shawn O. Pearce
  2 siblings, 7 replies; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-13  0:46 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

Hi,

Jakub, thank you very much for doing this.  It is a very tedious work, and 
I deem it invaluable.

On Sat, 13 Oct 2007, Jakub Narebski wrote:

>  * IRC is blocked from work :-( I may try it by tunneling out.
> 
>    (Any suggestions here?)

I had the same problem, and somebody pointed me to 
http://ircatwork.com/cgi-bin/irc/irc.cgi

(But please be nice, or else it will be shut down...)

>  * Keep up the UI simplification and make sure the docs start off with
>    usage somewhat similar to CVS/SVN. I think many users are scared by
>    Git because they see the more powerful commands thrown around too
>    early and get scared.
> 
>    Git is just too complicated for a typical project. I understand
>    it's probably great for the Linux kernel but for a smaller project
>    like mine (Mesa) it's overkill and a frustration. (...)  With git
>    everything seems hard. (...)  I've _wasted_ hours trying to figure
>    out git. That alone is a huge issue. I guess I could go into
>    specific details about my problems with git but I've already spent
>    enough time on this survey.

I find it always a little strange how people want to use something like 
git, but are unwilling to ask.  Is this such a big attack on the manliness 
to admist one needs help or what?

>    Figure out why people find git hard to learn and eliminate those
>    barriers to entry.  Make git more task-oriented rather than
>    data-model-oriented the way it is now.

Frankly, expectations like these make me want to bang somebody's head on 
the wall.  Why do people expect others to work for them for free?  Hard?

>    (...) I'm evaluating Mercurial despite its being based on Python
>    because it feels cleaner and simpler to use. I would prefer to use
>    Git.

You cannot do much about feelings, not with technical means, you can't.

>  * No one-pager cheat sheet with the 6 most basic commands on it so
>    people can go use git.
> 
>    (This got corrected. There is git cheat sheet on the Internet;
>    there is link on GitWiki to it)

I think it'd be a good idea to put it on git://git.kernel.org/, linked 
right before the links to the man pages.  Who has permissions to change 
that page?

>    I'd like to just stress support for windows and central
>    repositories. (...) In fact most of my friends really wanted to use
>    git but they wanted a solid native port.

If you read what I wrote above, you know exactly what I want to do here.

>  * Get a mascot perhaps O'Reilly animal for O'Reilly GitBook
>    (Git User's Manual) like the svnbook.
> 
>    (What animal could Git use for O'Reilly? Herd of horses, or a
>    pony?)

OMG Ponies!

Seriously again, is the cheetah taken already?

Speaking of cheetah: there is a project called git-cheetah, its goal being 
to provide a TortoiseCVS lookalike for git.

Just wanted to mention it, in case people want it, and are not too shy to 
participate in making it closer to the goal.

>  * I'm wondering what the overall goal is - git's origin as a neutral
>    ground was fine but it hasn't seemed to take off as a viable
>    alternative for general use.  Do you care about that?  Is it ok
>    that git is it's own little niche?
> 
>    (Junio, Linus?)

I am neither, but FWIW I did not have the impression that it is in its own 
little niche.

At the GSoC mentor summit, I encountered a rather different stance: people 
did not _know_ what distributed SCM means, and were rather afraid of the 
concept.  Some of them seemed to fight changing their known procedures 
tooth and nail.  Which is fine by me (I don't have to force anybody to 
use git, thankyouverymuch).



A word about the GitFAQ... there was one suggestion that there should be a 
FAQ maintainer.

I really have to ask myself why not more people just edit the GitFAQ on 
the wiki.  I mean, that is the whole purpose of it being on the wiki.  
It's not hard either.

Less hard in any case than to find a volunteer for a FAQ maintainer -- I 
mean, if most are too busy/lazy/shy to edit the FAQ at all, how do they 
expect somebody else to step up?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-13  0:46   ` Johannes Schindelin
@ 2007-10-13  2:13     ` J. Bruce Fields
  2007-10-13  2:53     ` Shawn O. Pearce
                       ` (5 subsequent siblings)
  6 siblings, 0 replies; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-13  2:13 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, git

On Sat, Oct 13, 2007 at 01:46:40AM +0100, Johannes Schindelin wrote:
> On Sat, 13 Oct 2007, Jakub Narebski wrote:
... (from survey response:)
> >    Figure out why people find git hard to learn and eliminate those
> >    barriers to entry.  Make git more task-oriented rather than
> >    data-model-oriented the way it is now.
> 
> Frankly, expectations like these make me want to bang somebody's head on 
> the wall.  Why do people expect others to work for them for free?  Hard?

Well, hey, we asked for suggestions.  Think of it as a project someone
might want to work on, rather than as a command.

I don't know what they mean by "make git more task-oriented rather than
data-model-oriented", but the first suggestion ("Find out why people
find git hard to learn...") is certainly something I'd enjoy working on
if I found the time.

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-13  0:46   ` Johannes Schindelin
  2007-10-13  2:13     ` J. Bruce Fields
@ 2007-10-13  2:53     ` Shawn O. Pearce
  2007-10-13 12:58     ` Frank Lichtenheld
                       ` (4 subsequent siblings)
  6 siblings, 0 replies; 161+ messages in thread
From: Shawn O. Pearce @ 2007-10-13  2:53 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> On Sat, 13 Oct 2007, Jakub Narebski wrote:
> >  * I'm wondering what the overall goal is - git's origin as a neutral
> >    ground was fine but it hasn't seemed to take off as a viable
> >    alternative for general use.  Do you care about that?  Is it ok
> >    that git is it's own little niche?
> > 
> >    (Junio, Linus?)
> 
> I am neither, but FWIW I did not have the impression that it is in its own 
> little niche.

I'm neither too.  But I don't think Git is in a niche.  OK, well,
in the overall world of software development its certainly in the
niche of version control, as uh, it doesn't do Enterprise Resource
Planning and Large Scale Embezzlement of Monies (ERPaLSEM).

Actually I've seen a number of people on the interweb saying things
like they were switching their project to Git because they felt
it had more staying power than say Monotone or Mercurial, partly
because the kernel devs were actively using it, partly because the
file formats are so simple and sane, and partly because lots of
other projects are using it or are seriously considering it.

> At the GSoC mentor summit, I encountered a rather different stance: people 
> did not _know_ what distributed SCM means, and were rather afraid of the 
> concept.  Some of them seemed to fight changing their known procedures 
> tooth and nail.  Which is fine by me (I don't have to force anybody to 
> use git, thankyouverymuch).

Yes, this attitude *shocked the hell out of me*.  I really did not
expect it.  I nearly keeled over and died when I realized what the
folks in the back corner of the room were saying.

WINE uses Git.  Some folks were outright pissed off that there
was only one committer in WINE.  I think they felt the project
was maybe going to die because there was only one committer who
could apply patches.  That may wind up being true (there's only so
far that one human can scale without trusted helpers for different
submodules of a large system) but its not Git's fault, or any other
DVCS's fault for that matter.  At least its easy to fork WINE.

On the other hand active participants of two major organizations (KDE
and Eclipse) are starting to seriously look at Git.  The interest
in Git is growing in both of those groups, which can only be good
for us.  We'll learn more about how these groups do development,
and how we can best help them to accomplish more.
 
-- 
Shawn.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-12 22:08 ` Jakub Narebski
  2007-10-12 23:36   ` Frank Lichtenheld
  2007-10-13  0:46   ` Johannes Schindelin
@ 2007-10-13  3:04   ` Shawn O. Pearce
  2 siblings, 0 replies; 161+ messages in thread
From: Shawn O. Pearce @ 2007-10-13  3:04 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git, Johannes Schindelin

Jakub Narebski <jnareb@gmail.com> wrote:
> Other
>  * SourceForge / Gna! / Google Projects support
>    (free) hosting with git facilities
>    FOSS hosting sites supporting git

We may find support for Git on SourceForge in the future, but not
on Google Projects anytime soon, if ever.

At the Google Summer of Code Mentor Summit last Saturday Dscho had a
short chat with someone from the Google Code group.  Apparently they
did at least look at Git briefly but concluded that they cannot
implement it on their site as our backend storage database is just
plain files on the local filesystem.

One of the reasons (probably among many but whatever) that I think
Google hired the "SVN guys" as employees is to develop a Google
specific backend for SVN (replaces fsfs and bdb) that stores the
SVN revision data in a Google BigTable cell rather than on the
local filesystem.  This allows Google to efficently manage the
entire site, including distributed replication, hot failover, etc...
BigTable is one of their key technologies at this point.

If you don't know about BigTable but want to know more you can
search for details about it via this awesome search engine I have
heard about: http://www.google.com/ :-)

I've managed to glean enough details on BigTable to know that the
Git backend is *not* easily layered on top of it.  But the SVN
fsfs backend is actually fairly easy to translate into BigTable,
so I imagine it didn't take the "SVN guys" very long to develop
the new backend, test it, and thus deploy SVN onto Google Projects.


Funny aside: If you really want to know about BigTable apparently
you also need to visit (one of?) the men's room in building 43
on the second floor.  There were tutorial posters hanging on the
wall describing how to use BigTable and Sawzall to summerize a
large dataset.  Most pubs hang sports pages from the local paper;
Google hangs BigTable documentation.  Nerds.  All of 'em.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-13  0:46   ` Johannes Schindelin
  2007-10-13  2:13     ` J. Bruce Fields
  2007-10-13  2:53     ` Shawn O. Pearce
@ 2007-10-13 12:58     ` Frank Lichtenheld
  2007-10-13 13:04       ` Johannes Schindelin
  2007-10-13 18:00     ` Andreas Ericsson
                       ` (3 subsequent siblings)
  6 siblings, 1 reply; 161+ messages in thread
From: Frank Lichtenheld @ 2007-10-13 12:58 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, git

On Sat, Oct 13, 2007 at 01:46:40AM +0100, Johannes Schindelin wrote:
> On Sat, 13 Oct 2007, Jakub Narebski wrote:
> >    Figure out why people find git hard to learn and eliminate those
> >    barriers to entry.  Make git more task-oriented rather than
> >    data-model-oriented the way it is now.
> 
> Frankly, expectations like these make me want to bang somebody's head on 
> the wall.  Why do people expect others to work for them for free?  Hard?

It's called "User". And since this is the Git _User's_ Survey, I guess
you will have to live with that. And anyway, where in the above you find
something about "expectation" rather than "suggestion"?

Gruesse,
-- 
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-13 12:58     ` Frank Lichtenheld
@ 2007-10-13 13:04       ` Johannes Schindelin
  0 siblings, 0 replies; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-13 13:04 UTC (permalink / raw)
  To: Frank Lichtenheld; +Cc: Jakub Narebski, git

Hi,

On Sat, 13 Oct 2007, Frank Lichtenheld wrote:

> On Sat, Oct 13, 2007 at 01:46:40AM +0100, Johannes Schindelin wrote:
> > On Sat, 13 Oct 2007, Jakub Narebski wrote:
> > >    Figure out why people find git hard to learn and eliminate those
> > >    barriers to entry.  Make git more task-oriented rather than
> > >    data-model-oriented the way it is now.
> > 
> > Frankly, expectations like these make me want to bang somebody's head 
> > on the wall.  Why do people expect others to work for them for free?  
> > Hard?
> 
> It's called "User". And since this is the Git _User's_ Survey, I guess 
> you will have to live with that. And anyway, where in the above you find 
> something about "expectation" rather than "suggestion"?

"Figure out" sounds to me like an imperative.

But my real point is: these guys know exactly what they find hard in git.  
Why don't they just come and tell us?

Just like Carl Worth did, way back when.  And it worked, didn't it?  Git 
1.5 is vastly more user friendly than pre 1.5.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-13  0:46   ` Johannes Schindelin
                       ` (2 preceding siblings ...)
  2007-10-13 12:58     ` Frank Lichtenheld
@ 2007-10-13 18:00     ` Andreas Ericsson
  2007-10-13 19:59     ` David Kastrup
                       ` (2 subsequent siblings)
  6 siblings, 0 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-13 18:00 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, git

Johannes Schindelin wrote:
> 
> At the GSoC mentor summit, I encountered a rather different stance: people 
> did not _know_ what distributed SCM means, and were rather afraid of the 
> concept.  Some of them seemed to fight changing their known procedures 
> tooth and nail.  Which is fine by me (I don't have to force anybody to 
> use git, thankyouverymuch).
> 

I recently attended a fairly large opensource conference in germany, where
companies that somehow do business around the opensource network
monitoring tool named Nagios gather and drink themselves and each other
into insensibility once a year. I ran into much the same issues there, even though
it would have made all our lives a whole lot easier if we could pull patches from
each others repositories.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-13  0:46   ` Johannes Schindelin
                       ` (3 preceding siblings ...)
  2007-10-13 18:00     ` Andreas Ericsson
@ 2007-10-13 19:59     ` David Kastrup
  2007-10-13 20:27       ` J. Bruce Fields
  2007-10-14 21:49       ` Jakub Narebski
  2007-10-14 21:10     ` David Tweed
  2007-10-19 20:57     ` Federico Mena Quintero
  6 siblings, 2 replies; 161+ messages in thread
From: David Kastrup @ 2007-10-13 19:59 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Jakub, thank you very much for doing this.  It is a very tedious
> work, and I deem it invaluable.

And yet you trash the results.

>>    Git is just too complicated for a typical project. I understand
>>    it's probably great for the Linux kernel but for a smaller
>>    project like mine (Mesa) it's overkill and a frustration. (...)
>>    With git everything seems hard. (...)  I've _wasted_ hours
>>    trying to figure out git. That alone is a huge issue. I guess I
>>    could go into specific details about my problems with git but
>>    I've already spent enough time on this survey.
>
> I find it always a little strange how people want to use something
> like git, but are unwilling to ask.  Is this such a big attack on
> the manliness to admist one needs help or what?

Not everybody likes getting the kind of treatment you find fit to dish
out.

>>    Figure out why people find git hard to learn and eliminate those
>>    barriers to entry.  Make git more task-oriented rather than
>>    data-model-oriented the way it is now.
>
> Frankly, expectations like these make me want to bang somebody's
> head on the wall.

And you wonder that people are unwilling to ask for things on the
list?  When even mentioning something in a _survey_ makes core
developers want to bang their heads against a wall?

I find it a pity that my suggestion to ask about how comfortable
people are with the tone on the list did not make it into the survey.
Enough core developers make the tone sufficiently unconstructive to
make it quite understandable that people are unwilling to ask
questions here, in order to avoid getting their heads banged against a
wall, virtual or not.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-13 19:59     ` David Kastrup
@ 2007-10-13 20:27       ` J. Bruce Fields
  2007-10-13 20:57         ` David Kastrup
  2007-10-14  0:36         ` Johannes Schindelin
  2007-10-14 21:49       ` Jakub Narebski
  1 sibling, 2 replies; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-13 20:27 UTC (permalink / raw)
  To: David Kastrup; +Cc: Johannes Schindelin, Jakub Narebski, git

On Sat, Oct 13, 2007 at 09:59:41PM +0200, David Kastrup wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
...survey quote:
> >>    Figure out why people find git hard to learn and eliminate those
> >>    barriers to entry.  Make git more task-oriented rather than
> >>    data-model-oriented the way it is now.
> >
> > Frankly, expectations like these make me want to bang somebody's
> > head on the wall.
> 
> And you wonder that people are unwilling to ask for things on the
> list?  When even mentioning something in a _survey_ makes core
> developers want to bang their heads against a wall?

Well, he does have a point that they could have been more specific.

But, yes, "I wish we could get people to be more specific" might be the
better way to put it.

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-13 20:27       ` J. Bruce Fields
@ 2007-10-13 20:57         ` David Kastrup
  2007-10-14  0:36         ` Johannes Schindelin
  1 sibling, 0 replies; 161+ messages in thread
From: David Kastrup @ 2007-10-13 20:57 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Johannes Schindelin, Jakub Narebski, git

"J. Bruce Fields" <bfields@fieldses.org> writes:

> On Sat, Oct 13, 2007 at 09:59:41PM +0200, David Kastrup wrote:
>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> 
> ...survey quote:
>> >>    Figure out why people find git hard to learn and eliminate those
>> >>    barriers to entry.  Make git more task-oriented rather than
>> >>    data-model-oriented the way it is now.
>> >
>> > Frankly, expectations like these make me want to bang somebody's
>> > head on the wall.
>> 
>> And you wonder that people are unwilling to ask for things on the
>> list?  When even mentioning something in a _survey_ makes core
>> developers want to bang their heads against a wall?
>
> Well, he does have a point that they could have been more specific.

He did not write "vague phrasings like this".  He wrote
"_expectations_ like these make [him] want to bang somebody's head on
the wall".

> But, yes, "I wish we could get people to be more specific" might be
> the better way to put it.

It is something entirely different.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-13 20:27       ` J. Bruce Fields
  2007-10-13 20:57         ` David Kastrup
@ 2007-10-14  0:36         ` Johannes Schindelin
  2007-10-14  1:13           ` Linus Torvalds
  1 sibling, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-14  0:36 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Jakub Narebski, git

Hi,

On Sat, 13 Oct 2007, J. Bruce Fields wrote:

> On Sat, Oct 13, 2007 at 09:59:41PM +0200, David Kastrup wrote:
> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> > 
> ...survey quote:
> > >>    Figure out why people find git hard to learn and eliminate those
> > >>    barriers to entry.  Make git more task-oriented rather than
> > >>    data-model-oriented the way it is now.
> > >
> > > Frankly, expectations like these make me want to bang somebody's
> > > head on the wall.
> > 
> > And you wonder that people are unwilling to ask for things on the
> > list?

That is utter rubbish.

> Well, he does have a point that they could have been more specific.
> 
> But, yes, "I wish we could get people to be more specific" might be the 
> better way to put it.

Yes, there are politer ways to phrase it.

My main point is -- and always was -- that I'd like people to realise how 
much it depends on _them_ if (and when) their wishes come true.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14  0:36         ` Johannes Schindelin
@ 2007-10-14  1:13           ` Linus Torvalds
  2007-10-14  1:44             ` Shawn O. Pearce
  2007-10-14  2:06             ` Johannes Schindelin
  0 siblings, 2 replies; 161+ messages in thread
From: Linus Torvalds @ 2007-10-14  1:13 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: J. Bruce Fields, Jakub Narebski, git



On Sun, 14 Oct 2007, Johannes Schindelin wrote:
>
> My main point is -- and always was -- that I'd like people to realise how 
> much it depends on _them_ if (and when) their wishes come true.

Dscho, that's just not fair.

The fact is, stating what you wish for *is* taking an action. Starting to 
complain about people stating their wishes (which you have done several 
times) is simply unreasonable.

You don't have to *do* what they wish for, but I really wish you stopped 
complaining about people bringing up their hopes for improvement.

Complain about it when somebody asks for something *stupid*. Explain why 
it would be wrong to do something like that. But don't complain about 
people having wish-lists, even if those people may not work on them.

Not everybody is a "doer". It's important to get input from people who are 
just plain users, or hope to be.

		Linus

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14  1:13           ` Linus Torvalds
@ 2007-10-14  1:44             ` Shawn O. Pearce
  2007-10-14  3:15               ` Linus Torvalds
  2007-10-14 10:20               ` Reece Dunn
  2007-10-14  2:06             ` Johannes Schindelin
  1 sibling, 2 replies; 161+ messages in thread
From: Shawn O. Pearce @ 2007-10-14  1:44 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Johannes Schindelin, J. Bruce Fields, Jakub Narebski, git

Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Sun, 14 Oct 2007, Johannes Schindelin wrote:
> >
> > My main point is -- and always was -- that I'd like people to realise how 
> > much it depends on _them_ if (and when) their wishes come true.
> 
> Dscho, that's just not fair.
...
> Complain about it when somebody asks for something *stupid*. Explain why 
> it would be wrong to do something like that. But don't complain about 
> people having wish-lists, even if those people may not work on them.
> 
> Not everybody is a "doer". It's important to get input from people who are 
> just plain users, or hope to be.

I agree with both of you.  My understanding of Dscho's original
comment was that people weren't saying *what* specifically their
wish-list was, which means we have no hope as a community of meeting
their requests.

Carl and Andy both had submitted a long list of very specific issues
that they had with Git.  The result of those lists being posted was
a number of people contributed improvements that lead us to 1.5.
Nobody can argue with that.

But just saying "MY GOD FIX THE UI" is not a wishlist item (yes,
that was a real survey answer).  It provides the community no
chance to understand what parts of the UI we need to work on, and
what parts the end-user is OK with or just hasn't even tried to use.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14  1:13           ` Linus Torvalds
  2007-10-14  1:44             ` Shawn O. Pearce
@ 2007-10-14  2:06             ` Johannes Schindelin
  2007-10-14  8:45               ` Andreas Ericsson
  1 sibling, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-14  2:06 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: J. Bruce Fields, Jakub Narebski, git

Hi,

On Sat, 13 Oct 2007, Linus Torvalds wrote:

> On Sun, 14 Oct 2007, Johannes Schindelin wrote:
> >
> > My main point is -- and always was -- that I'd like people to realise 
> > how much it depends on _them_ if (and when) their wishes come true.
> 
> Dscho, that's just not fair.
> 
> The fact is, stating what you wish for *is* taking an action. Starting 
> to complain about people stating their wishes (which you have done 
> several times) is simply unreasonable.

Well, maybe I overreacted.

> You don't have to *do* what they wish for, but I really wish you stopped 
> complaining about people bringing up their hopes for improvement.

Fair enough, I'll shut up about these issues.

At least as long as I can hold my breath ;-)

> Complain about it when somebody asks for something *stupid*. Explain why 
> it would be wrong to do something like that. But don't complain about 
> people having wish-lists, even if those people may not work on them.
> 
> Not everybody is a "doer". It's important to get input from people who are 
> just plain users, or hope to be.

A pity, but you're probably right.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14  1:44             ` Shawn O. Pearce
@ 2007-10-14  3:15               ` Linus Torvalds
  2007-10-14  3:43                 ` david
  2007-10-14 10:20               ` Reece Dunn
  1 sibling, 1 reply; 161+ messages in thread
From: Linus Torvalds @ 2007-10-14  3:15 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Johannes Schindelin, J. Bruce Fields, Jakub Narebski, git



On Sat, 13 Oct 2007, Shawn O. Pearce wrote:
> 
> But just saying "MY GOD FIX THE UI" is not a wishlist item (yes,
> that was a real survey answer).  It provides the community no
> chance to understand what parts of the UI we need to work on, and
> what parts the end-user is OK with or just hasn't even tried to use.

Heh. I do agree that some people just ask for unreasonable or stupid 
things (or maybe they are just really bad at explaining them, and may have 
something non-stupid in mind but just cannot articulate it).

And I also agree that there are tons of people who are just lazy and don't 
even bother to try to explain themselves.

And I'll flame people myself. I can't even say that's a rare event. So I 
shouldn't throw _too_ many stones, or one of them might bounce back. 

But at the same time, just accepting that there are people who will 
potentially never really be productive members of society (whether 
"society" is git or something bigger), is probably a good idea. They 
aren't worth complaining about: they don't generally tend to take anything 
away from the community unless the community itself reacts negatively to 
them.

			Linus

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14  3:15               ` Linus Torvalds
@ 2007-10-14  3:43                 ` david
  2007-10-14  3:55                   ` Linus Torvalds
  0 siblings, 1 reply; 161+ messages in thread
From: david @ 2007-10-14  3:43 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Shawn O. Pearce, Johannes Schindelin, J. Bruce Fields,
	Jakub Narebski, git

On Sat, 13 Oct 2007, Linus Torvalds wrote:

> But at the same time, just accepting that there are people who will
> potentially never really be productive members of society (whether
> "society" is git or something bigger), is probably a good idea. They
> aren't worth complaining about: they don't generally tend to take anything
> away from the community unless the community itself reacts negatively to
> them.

I'll also point out that being a 'productive member of society' may have a 
wider definition then you may think initially.

is a sysadmin who never contribures a line of code, but switches hundreds 
of servers to linux and assists friends in migrating to Linux a productive 
member? he doesn't contribute any code, so some people would say no, but 
in spreading the use he is increasing the number of potential contributers 
so others would say yes.

keep this in mind before you assume that someone isn't worth anything.

David Lang

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14  3:43                 ` david
@ 2007-10-14  3:55                   ` Linus Torvalds
  0 siblings, 0 replies; 161+ messages in thread
From: Linus Torvalds @ 2007-10-14  3:55 UTC (permalink / raw)
  To: david
  Cc: Shawn O. Pearce, Johannes Schindelin, J. Bruce Fields,
	Jakub Narebski, git



On Sat, 13 Oct 2007, david@lang.hm wrote:
>
> I'll also point out that being a 'productive member of society' may have a
> wider definition then you may think initially.

I actually meant it in the absolutely most narrow possible meaning: you 
take the least productive person imaginable, who is certainly not going to 
do anything at all, and in the end, who cares? It's not like nonproductive 
people really hurt.

Some people in the open source / free software world get really upset 
about "freeloaders". I think that's silly. First off, I agree with you 
that a lot of people don't even end up being freeloaders - even if you 
never code a single line of code, there are ton of ways to be usefully 
involved (and some of them will be entirely invisible to any developer - 
helping random people outside the development lists, for example).

But more importantly, even somebody who really isn't productive at all 
generally can't be messing things up either - so it's a nonissue. Unless 
it results in tons of flaming ...

		Linus

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14  2:06             ` Johannes Schindelin
@ 2007-10-14  8:45               ` Andreas Ericsson
  2007-10-14  9:21                 ` David Kastrup
  0 siblings, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-14  8:45 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Linus Torvalds, J. Bruce Fields, Jakub Narebski, git

Johannes Schindelin wrote:
> Hi,
> 
> On Sat, 13 Oct 2007, Linus Torvalds wrote:
> 
>>
>> Not everybody is a "doer". It's important to get input from people who are 
>> just plain users, or hope to be.
> 
> A pity, but you're probably right.
> 

It's not a pity, and he's most definitely right. Users tend to think in terms
of "I'd like to get this task done" while coders tend to think in terms of
"this would be cool/possible to implement". The reason git actually *works* so
great is, I'm sure, the fact that it was originally designed around a very specific
need by someone thinking like a *user*. The fact that it happened to be a pretty
competent programmer just meant he could express his wishes as algorithms in a
programming language and make it happen.

I'm 100% sure that if Linus had been so interested in SCM's that he'd abandoned
the Linux kernel to be full-time maintainer for git instead, it would have had
all sorts of oddities in it that nobody uses, just because they're possible to
do.

I also think Linus made a very wise decision in picking Junio to maintain it. So
far, I haven't seen him accept a single feature-patch into git that wasn't
explained to solve a specific problem.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14  8:45               ` Andreas Ericsson
@ 2007-10-14  9:21                 ` David Kastrup
  0 siblings, 0 replies; 161+ messages in thread
From: David Kastrup @ 2007-10-14  9:21 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Johannes Schindelin, Linus Torvalds, J. Bruce Fields,
	Jakub Narebski, git

Andreas Ericsson <ae@op5.se> writes:

> I also think Linus made a very wise decision in picking Junio to
> maintain it. So far, I haven't seen him accept a single
> feature-patch into git that wasn't explained to solve a specific
> problem.

While I hold Junio's technical judgment in high regard, it is actually
the area of communication skills and conversation tone where I would
really wish more to follow his example.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14  1:44             ` Shawn O. Pearce
  2007-10-14  3:15               ` Linus Torvalds
@ 2007-10-14 10:20               ` Reece Dunn
  2007-10-14 18:12                 ` Steven Grimm
  1 sibling, 1 reply; 161+ messages in thread
From: Reece Dunn @ 2007-10-14 10:20 UTC (permalink / raw)
  To: Shawn O. Pearce
  Cc: Linus Torvalds, Johannes Schindelin, J. Bruce Fields,
	Jakub Narebski, git

On 14/10/2007, Shawn O. Pearce <spearce@spearce.org> wrote:
> But just saying "MY GOD FIX THE UI" is not a wishlist item (yes,
> that was a real survey answer).  It provides the community no
> chance to understand what parts of the UI we need to work on, and
> what parts the end-user is OK with or just hasn't even tried to use.

My interpretation of that answer is that your average user
(specifically Windows user) is more focused on a graphical interface,
and will mean GUI when they say UI.

The core plumbing in git is solid. The porcelain, with the 1.5 series,
makes git simpler to use from the command line. Now, the GUI available
for git is seriously lacking.

If you look at the GUI tools available for CVS, SVN, Perforce and
others, these offer you the complete functionality of those tools from
within them. They provide command line tools for those that need them,
but also come with a GUI application that allows the user to manage
their files within the source control system they are using (e.g.
WinCVS and P4V), shell integration (e.g. TortoiseCVS/SVN), IDE
integration and others.

At the moment, git has a good timeline view of commits through the
GUI, but have found the mingw version to be slow in places (I can't
remember when, but was likely before some performance improvements in
that area were made) and haven't tried out the Linux version yet. This
is a good starting point to build on, but to be more useful it needs
to extend to all of git's functionality.

- Reece

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 10:20               ` Reece Dunn
@ 2007-10-14 18:12                 ` Steven Grimm
  2007-10-14 18:40                   ` J. Bruce Fields
  2007-10-14 19:44                   ` Nicolas Pitre
  0 siblings, 2 replies; 161+ messages in thread
From: Steven Grimm @ 2007-10-14 18:12 UTC (permalink / raw)
  To: Reece Dunn
  Cc: Shawn O. Pearce, Linus Torvalds, Johannes Schindelin,
	J. Bruce Fields, Jakub Narebski, git

Reece Dunn wrote:
> The core plumbing in git is solid. The porcelain, with the 1.5 series,
> makes git simpler to use from the command line. Now, the GUI available
> for git is seriously lacking.
>   

I'm not sure I agree with that. Here's the section on git from the 
"Comparison with other systems" part of the Mercurial book. I'll 
reproduce it in its entirety here and add my own comments about each 
paragraph.

 > Git is a distributed revision control tool that was developed for 
managing the
 > Linux kernel source tree. Like Mercurial, its early design was 
somewhat influenced
 > by Monotone.

No argument there.

 > Git has an overwhelming command set, with version 1.5.0 providing 139
 > individual commands. It has a reputation for being difficult to 
learn. It does not have
 > a user manual, only documentation for individual commands.

The part about the user manual is bunk (and was bunk in version 1.5.0, 
IIRC, so I'm not sure where he gets that.) But the first part of that is 
the key here. I admit that's even bitten me from time to time. I 
couldn't remember the name of the "git-instaweb" command just yesterday; 
doing "ls /usr/local/bin/git-*" was, I'd have to agree, pretty overwhelming.

We could probably solve that by tucking the plumbing commands away in a 
lib or libexec directory and only exposing the porcelain commands in the 
directory the end user is likely to look at.

But that's just an aspect of a more general fact: it's hard to use git 
without getting exposed to the plumbing at least a little. Another 
example is the manpages: try to look up the commonly-used options to 
"git diff" (porcelain) and you will be forced to learn about "git 
rev-parse" (plumbing).

The point is, though, that this is a valid complaint about git's UI that 
has nothing to do with GUIs.

 > In terms of performance, git is extremely fast. There are several 
common cases
 > in which it is faster than Mercurial, at least on Linux. However, its 
performance
 > on (and general support for) Windows is, at the time of writing, far 
behind that of
 > Mercurial.

A fair statement, though of course that's been improving by leaps and 
bounds of late and hopefully will soon be an outdated argument. The 
Windows user experience has been subpar historically.

 > While a Mercurial repository needs no maintenance, a Git repository 
requires frequent
 > manual “repacks” of its metadata. Without these, performance 
degrades, while space
 > usage grows rapidly. A server that contains many Git repositories 
that are not rigorously
 > and frequently repacked will become heavily disk-bound during 
backups, and there
 > have been instances of daily backups taking far longer than 24 hours 
as a result.
 > A freshly packed Git repository is slightly smaller than a Mercurial 
repository, but an
 > unpacked repository is several orders of magnitude larger.

This was true at the time the hg book was written. Now that we have the 
auto-packing code, hopefully it will be a moot point. So that's one "fix 
the UI" complaint that has been addressed; whether *successfully* or 
not, time will tell. But hg definitely had a user experience advantage 
here until very recently.

 > The core of Git is written in C. Many Git commands are implemented as 
shell or Perl
 > scripts, and the quality of these scripts varies widely. I have 
encountered a number of
 > instances where scripts charged along blindly in the presence of 
errors that should have
 > been fatal.

No doubt this is true as well. Obviously the C-ification process will 
take care of a lot of this, though of course one can charge along 
blindly in the presence of errors in any language (including, shock of 
shocks given the implication here, Python.) To the extent we can find 
places where this is still true, obviously they should be fixed. I 
wonder if anyone knows the author of the book well enough to ferret some 
specifics out of him toward that end.

Now, about hg vs. git in general. I actually spent some time this 
weekend coming up to speed on hg basics just to see what all the UI fuss 
was about. As far as I can see it is about a wash all told; some things 
are easier in git and some in hg. However, here's my speculation about 
why people might claim hg is easier. I see three things:

Multiple branches per repo. Mercurial allows them, but you won't find 
them mentioned anywhere in any of the beginner tutorials. They encourage 
people to use a "one repo per branch" model. Having gotten used to git's 
branching model, you'd have to pry that feature out of my cold, dead 
fingers, but it's fundamentally much easier to understand a model of "if 
you want to make two unrelated changes to your code, just make two 
copies of the source tree." It's possible git's introductory 
documentation should delay talking about "git branch" until later, and 
start off talking about how to work with one (checked out) branch per repo.

Update to a dirty working copy. I think there's a tendency in these 
parts to vastly underestimate the importance of being able to pull down 
updates from a master repository while you're in the middle of 
development. Mercurial's equivalent to bare "git pull", namely "hg pull" 
followed by "hg update", works fine if you have edits in your working 
copy; if there are conflicting changes, it pops you into a conflict 
resolution UI (or adds conflict markers, depending on your settings) and 
you continue on your merry way after resolving everything. This workflow 
is really common, especially in corporate settings where there's very 
fine-grained collaboration going on during initial development (a huge 
difference from the open-source world where most of the time it's just 
one person doing an initial prototype.) Right now working this way is a 
pain in git. Less so now that we have "git stash", but it could still be 
much, much smoother.

Verbosity. IMO Mercurial swings too far in this direction, but in 
general it's either completely silent or very terse in its output. There 
is never, as far as I can see, any low-level diagnostic information spit 
out to the user unless an hg command is run with a "verbose" option. 
Here's "hg pull; hg update", for example (and "pull" is one of hg's 
chattier commands):

pulling from ../child1
searching for changes
adding changesets
adding manifests
adding file changes
added 8 changesets with 8 changes to 3 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
3 files updated, 0 files merged, 0 files removed, 0 files unresolved

Compare with the equivalent "git pull" and put yourself in the shoes of 
a user who is running that command for the first time:

remote: Generating pack...
remote: Counting objects: 9
remote: Done counting 1118 objects.
Result has 832 objects.
remote: Deltifying 822 objects...
remote: 100% (822/822) done
Indexing 832 objects...
remote: Total 832 (delta 668), reused 0 (delta 0)
100% (832/832) done
Resolving 668 deltas...
100% (668/668) done
258 objects were added to complete this thin pack.
* refs/remotes/origin/session-fix: fast forward to branch 'session-fix' 
of ssh://devrs005/~/www
old..new: 3de27db..a3d44c1
Already up-to-date.

So anyway, there are a few specifics. That's based on just a bit of 
playing around with hg; maybe the differences go deeper than this, but I 
think there isn't a huge usability gap between the two systems any more.

-Steve

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 18:12                 ` Steven Grimm
@ 2007-10-14 18:40                   ` J. Bruce Fields
  2007-10-14 19:25                     ` Steven Grimm
  2007-10-14 19:50                     ` Andreas Ericsson
  2007-10-14 19:44                   ` Nicolas Pitre
  1 sibling, 2 replies; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-14 18:40 UTC (permalink / raw)
  To: Steven Grimm
  Cc: Reece Dunn, Shawn O. Pearce, Linus Torvalds, Johannes Schindelin,
	Jakub Narebski, git

On Sun, Oct 14, 2007 at 11:12:07AM -0700, Steven Grimm wrote:
> But that's just an aspect of a more general fact: it's hard to use git 
> without getting exposed to the plumbing at least a little. Another example 
> is the manpages: try to look up the commonly-used options to "git diff" 
> (porcelain) and you will be forced to learn about "git rev-parse" 
> (plumbing).

As "plumbing" goes, "git rev-parse" isn't that bad, and the reference
here (to the "SPECIFYING REVISIONS" section) strikes me as reasonable.
We could factor out the common documentation into a separate (hopefully
more user-friendly) manpage about specifying revisions, I guess, and
refer to it everywhere instead of git-rev-parse.  I don't know--any
other ideas?

> It's possible git's introductory documentation should delay talking 
> about "git branch" until later, and start off talking about how to work 
> with one (checked out) branch per repo.

One frequent use case is the case of a tester that wants to try out a
bugfix in some topic branch.  You want to tell them: "please test the
fix-that-bug branch in git://myproject.org/~me/repo.git".  They need to
get that checked out somehow.  And they should be able to do it without
re-cloning every time.

That's one motivation, among others, for including git-branch (and
git-remote) very early.

Though actually the quickest way to checkout an arbitrary revision is
with detached heads, and that doesn't require learning git-branch right
away.  I've tried rewriting the user-manual start that way but wasn't
happy with the result and didn't get too far.  (See
git://linux-nfs.org/~bfields/git.git docwork-detached.)

> Update to a dirty working copy. I think there's a tendency in these parts 
> to vastly underestimate the importance of being able to pull down updates 
> from a master repository while you're in the middle of development. 
> Mercurial's equivalent to bare "git pull", namely "hg pull" followed by "hg 
> update", works fine if you have edits in your working copy; if there are 
> conflicting changes, it pops you into a conflict resolution UI (or adds 
> conflict markers, depending on your settings) and you continue on your 
> merry way after resolving everything. This workflow is really common, 
> especially in corporate settings where there's very fine-grained 
> collaboration going on during initial development (a huge difference from 
> the open-source world where most of the time it's just one person doing an 
> initial prototype.) Right now working this way is a pain in git. Less so 
> now that we have "git stash", but it could still be much, much smoother.

I'm lost--how is "hg pull" different from "git pull" in this respect?

> Verbosity. IMO Mercurial swings too far in this direction, but in general 
> it's either completely silent or very terse in its output.

Yes, there's a lot of low-hanging fruit here for someone that's
interested in streamlining the default git command output.  The
challenge is to get it a little terser while still being helpful (and
preserving progress meters, and not obscuring what's going on any more
than necessary).

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 18:40                   ` J. Bruce Fields
@ 2007-10-14 19:25                     ` Steven Grimm
  2007-10-14 19:50                     ` Andreas Ericsson
  1 sibling, 0 replies; 161+ messages in thread
From: Steven Grimm @ 2007-10-14 19:25 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Reece Dunn, Shawn O. Pearce, Linus Torvalds, Johannes Schindelin,
	Jakub Narebski, git

J. Bruce Fields wrote:
> I'm lost--how is "hg pull" different from "git pull" in this respect?
>   

(Pedantry alert: "hg pull" is equivalent to "git fetch" and doesn't 
update the working copy. I'll talk here about the "hg pull; hg update" 
pair which seems to be standard procedure in hg land.)

Here's a simple example in each system to demonstrate the difference.

---
 mkdir parent
 cd parent
 git init
 echo 'my baloney has a first name' > song.txt
 echo "it's o-s-c-a-r" >> song.txt
 echo 'my baloney has a last name' >> song.txt
 git add song.txt
 git commit -m "test file"
 cd ..
 git clone parent child
 cd parent
 echo "it's m-a-y-e-r" >> song.txt
 git commit -a -m "another line in the song"
 cd ../child
 perl -pi -e 's/first name/given name/' song.txt
 git pull
---

Result: "fatal: Entry 'song.txt not uptodate. Cannot merge."

---
 mkdir hgparent
 cd hgparent
 hg init
 echo 'my baloney has a first name' > song.txt
 echo "it's o-s-c-a-r" >> song.txt
 echo 'my baloney has a last name' >> song.txt
 hg add song.txt
 hg commit -m "test file"
 cd ..
 hg clone hgparent hgchild
 cd hgparent
 echo "it's m-a-y-e-r" >> song.txt
 hg commit -m "another line in the song"
 cd ../hgchild
 perl -pi -e 's/first name/given name/' song.txt
 hg pull
 hg update
---

Result: "0 files updated, 1 files merged, 0 files removed, 0 files 
unresolved" and the file contains the change from the parent plus the 
change from the child, with the latter still an uncommitted edit that 
shows up in "hg diff".

-Steve

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 18:12                 ` Steven Grimm
  2007-10-14 18:40                   ` J. Bruce Fields
@ 2007-10-14 19:44                   ` Nicolas Pitre
  2007-10-15 23:20                     ` Shawn O. Pearce
  1 sibling, 1 reply; 161+ messages in thread
From: Nicolas Pitre @ 2007-10-14 19:44 UTC (permalink / raw)
  To: Steven Grimm
  Cc: Reece Dunn, Shawn O. Pearce, Linus Torvalds, Johannes Schindelin,
	J. Bruce Fields, Jakub Narebski, git

On Sun, 14 Oct 2007, Steven Grimm wrote:

> Verbosity. IMO Mercurial swings too far in this direction, but in general it's
> either completely silent or very terse in its output. There is never, as far
> as I can see, any low-level diagnostic information spit out to the user unless
> an hg command is run with a "verbose" option. Here's "hg pull; hg update", for
> example (and "pull" is one of hg's chattier commands):
> 
> pulling from ../child1
> searching for changes
> adding changesets
> adding manifests
> adding file changes
> added 8 changesets with 8 changes to 3 files (+1 heads)
> (run 'hg heads' to see heads, 'hg merge' to merge)
> 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
> 
> Compare with the equivalent "git pull" and put yourself in the shoes of a user
> who is running that command for the first time:

BTW I have patches here reworking the progress code for a more compact 
display which should mitigate this issue quite a bit.


Nicolas

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 18:40                   ` J. Bruce Fields
  2007-10-14 19:25                     ` Steven Grimm
@ 2007-10-14 19:50                     ` Andreas Ericsson
  2007-10-14 20:18                       ` Johannes Schindelin
  1 sibling, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-14 19:50 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Steven Grimm, Reece Dunn, Shawn O. Pearce, Linus Torvalds,
	Johannes Schindelin, Jakub Narebski, git

J. Bruce Fields wrote:
> On Sun, Oct 14, 2007 at 11:12:07AM -0700, Steven Grimm wrote:
> 
>> It's possible git's introductory documentation should delay talking 
>> about "git branch" until later, and start off talking about how to work 
>> with one (checked out) branch per repo.
> 
> One frequent use case is the case of a tester that wants to try out a
> bugfix in some topic branch.  You want to tell them: "please test the
> fix-that-bug branch in git://myproject.org/~me/repo.git".  They need to
> get that checked out somehow.  And they should be able to do it without
> re-cloning every time.
> 
> That's one motivation, among others, for including git-branch (and
> git-remote) very early.
> 
> Though actually the quickest way to checkout an arbitrary revision is
> with detached heads, and that doesn't require learning git-branch right
> away.

But the *easiest* way, where "easiest" means "involves the fewest commands
with smallest risk of fscking up your own repo", is to do


git clone <other-devs-repo> other-devs-repo
cd other-devs-repo
git checkout -b thebug <the-bug-hash>


The proper command-sequence for any other way of doing it will inevitably
be different depending on whether or not the user has changes in his
worktree or not, whether or not those changes conflict with the bug-spot,
whether or not he's got the other developer's repo added as a remote, etc,
etc.

Too many ifs, really, whereas the first way is guaranteed to work exactly
the same way everytime, at the cost of almost always being ridiculously
suboptimal.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 19:50                     ` Andreas Ericsson
@ 2007-10-14 20:18                       ` Johannes Schindelin
  2007-10-14 20:22                         ` Andreas Ericsson
  2007-10-14 20:24                         ` J. Bruce Fields
  0 siblings, 2 replies; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-14 20:18 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: J. Bruce Fields, Steven Grimm, Reece Dunn, Shawn O. Pearce,
	Linus Torvalds, Jakub Narebski, git

Hi,

On Sun, 14 Oct 2007, Andreas Ericsson wrote:

> J. Bruce Fields wrote:
>
> > Though actually the quickest way to checkout an arbitrary revision is 
> > with detached heads, and that doesn't require learning git-branch 
> > right away.
> 
> But the *easiest* way, where "easiest" means "involves the fewest 
> commands with smallest risk of fscking up your own repo", is to do
> 
> 
> git clone <other-devs-repo> other-devs-repo
> cd other-devs-repo
> git checkout -b thebug <the-bug-hash>

I'd just do

	git checkout <the-bug>^{commit}

and be done...

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 20:18                       ` Johannes Schindelin
@ 2007-10-14 20:22                         ` Andreas Ericsson
  2007-10-14 20:24                         ` J. Bruce Fields
  1 sibling, 0 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-14 20:22 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: J. Bruce Fields, Steven Grimm, Reece Dunn, Shawn O. Pearce,
	Linus Torvalds, Jakub Narebski, git

Johannes Schindelin wrote:
> Hi,
> 
> On Sun, 14 Oct 2007, Andreas Ericsson wrote:
> 
>> J. Bruce Fields wrote:
>>
>>> Though actually the quickest way to checkout an arbitrary revision is 
>>> with detached heads, and that doesn't require learning git-branch 
>>> right away.
>> But the *easiest* way, where "easiest" means "involves the fewest 
>> commands with smallest risk of fscking up your own repo", is to do
>>
>>
>> git clone <other-devs-repo> other-devs-repo
>> cd other-devs-repo
>> git checkout -b thebug <the-bug-hash>
> 
> I'd just do
> 
> 	git checkout <the-bug>^{commit}
> 
> and be done...
> 

So:

	if (have_bug_in_repo)
		do_the_dscho_way()
	else ...

See what I mean?

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 20:18                       ` Johannes Schindelin
  2007-10-14 20:22                         ` Andreas Ericsson
@ 2007-10-14 20:24                         ` J. Bruce Fields
  1 sibling, 0 replies; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-14 20:24 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Andreas Ericsson, Steven Grimm, Reece Dunn, Shawn O. Pearce,
	Linus Torvalds, Jakub Narebski, git

On Sun, Oct 14, 2007 at 09:18:16PM +0100, Johannes Schindelin wrote:
> Hi,
> 
> On Sun, 14 Oct 2007, Andreas Ericsson wrote:
> 
> > J. Bruce Fields wrote:
> >
> > > Though actually the quickest way to checkout an arbitrary revision is 
> > > with detached heads, and that doesn't require learning git-branch 
> > > right away.
> > 
> > But the *easiest* way, where "easiest" means "involves the fewest 
> > commands with smallest risk of fscking up your own repo", is to do
> > 
> > 
> > git clone <other-devs-repo> other-devs-repo
> > cd other-devs-repo
> > git checkout -b thebug <the-bug-hash>
> 
> I'd just do
> 
> 	git checkout <the-bug>^{commit}
> 
> and be done...

The detached-HEAD approach also has the advantage that you don't leave
around stuff (new branch heads) that may have to be cleaned up or
modified in the future.  So you can tell someone about

	git clone git://url/
	git fetch origin
	git checkout <whatever>
	git remote add remotename git://other-url/
	git fetch remotename

and as long as they're not making changes, that's pretty much all
they'll ever need to do to checkout any version.

Sure, you can tell them to reclone every time, but I think they'll get
frustrated with that pretty soon.

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-13  0:46   ` Johannes Schindelin
                       ` (4 preceding siblings ...)
  2007-10-13 19:59     ` David Kastrup
@ 2007-10-14 21:10     ` David Tweed
  2007-10-19 20:57     ` Federico Mena Quintero
  6 siblings, 0 replies; 161+ messages in thread
From: David Tweed @ 2007-10-14 21:10 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, git

On 10/13/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> >    Figure out why people find git hard to learn and eliminate those
> >    barriers to entry.  Make git more task-oriented rather than
> >    data-model-oriented the way it is now.
>
> Frankly, expectations like these make me want to bang somebody's head on
> the wall.  Why do people expect others to work for them for free?  Hard?

Since no-one else has mentioned it, I -- and I suspect some others --
try to use the "beer round" model with FOSS. When I go out for drinks
with people from work, I don't try and keep a precisely tally of who
has bought a drink for me and so whom I shoud buy a drink, and worry
about what how the accounting changes if me or someone goes home
early. I generally take the view that all the imbalances will roughly
balance out over the future. Sure you keep an eye out for complete
freeloaders, but you don't get overexcited about a temporary
imbalance.

Likewise, I will sometimes make suggestions -- hopefully politely --
of various projects where my skills don't fit. (Eg, I'm not going to
add non-trivial features to the git shell scripts because I just don't
know non-trivial shell.) Hopefully some minor patch I've submitted
somewhere has, possibly through helping someone else who's helped
someone else.... , helped you some minuscule amount.

I'm perfectly fine with someone politely saying "no developers are
interested in this, so it won't happen if you don't implement it
yourself", but when you accuse people who just bring up a possible
feature of being free-loaders it makes them question whether other
projects would be more productive places to spend one's time.

It's the difference between being told "I suspect you'll have to do it
yourself" and "how dare you even ask that! do it yourself!".

-- 
cheers, dave tweed__________________________
david.tweed@gmail.com
Rm 124, School of Systems Engineering, University of Reading.
"we had no idea that when we added templates we were adding a Turing-
complete compile-time language." -- C++ standardisation committee

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-13 19:59     ` David Kastrup
  2007-10-13 20:27       ` J. Bruce Fields
@ 2007-10-14 21:49       ` Jakub Narebski
  2007-10-14 22:08         ` Johannes Schindelin
  2007-10-14 22:12         ` David Kastrup
  1 sibling, 2 replies; 161+ messages in thread
From: Jakub Narebski @ 2007-10-14 21:49 UTC (permalink / raw)
  To: David Kastrup; +Cc: Johannes Schindelin, git

On 10/13/07, David Kastrup <dak@gnu.org> wrote:

> I find it a pity that my suggestion to ask about how comfortable
> people are with the tone on the list did not make it into the survey.
> Enough core developers make the tone sufficiently unconstructive to
> make it quite understandable that people are unwilling to ask
> questions here, in order to avoid getting their heads banged against a
> wall, virtual or not.

I think next to last question in the survey

 61. Did you have problems getting GIT help on mailing list or on IRC channel?
     What were it? What could be improved?

was the place to put complaints about git mailing list. I didn't want
to add separate question because this survey has too many questions
(is too long) already.

-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 21:49       ` Jakub Narebski
@ 2007-10-14 22:08         ` Johannes Schindelin
  2007-10-14 22:17           ` David Kastrup
  2007-10-14 22:12         ` David Kastrup
  1 sibling, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-14 22:08 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

Hi,

> > I find it a pity that my suggestion to ask about how comfortable
> > people are with the tone on the list did not make it into the survey.

Well, everybody knows who wanted to have that question in the survey, and 
everybody knows why.

> > Enough core developers make the tone sufficiently unconstructive to 
> > make it quite understandable that people are unwilling to ask 
> > questions here, in order to avoid getting their heads banged against a 
> > wall, virtual or not.

My experience is that people come here, ask questions, and get served.  
Often to stay.  So it cannot be that bad.

On Sun, 14 Oct 2007, Jakub Narebski wrote:

> I think next to last question in the survey
> 
>  61. Did you have problems getting GIT help on mailing list or on IRC channel?
>      What were it? What could be improved?
> 
> was the place to put complaints about git mailing list. I didn't want to 
> add separate question because this survey has too many questions (is too 
> long) already.

That is the problem of most surveys.  Usually you can see that after 
50-75% of the questions, people are too bored, and just stop the survey 
right then and there.  Or, if forced, give stupid answers because they are 
annoyed with them.

Given that only one answer hinted at that AFAIR (it was something along 
the lines "I already wasted too much time on this survey, so I cannot work 
on git" or some such), I think you did a good job, though.

Again, thanks for all the work that you did/will do.  I know how tedious 
it is to evaluate such surveys, especially the free form answers.  Must 
have taken you days of real effort.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 21:49       ` Jakub Narebski
  2007-10-14 22:08         ` Johannes Schindelin
@ 2007-10-14 22:12         ` David Kastrup
  2007-10-14 22:15           ` Jakub Narebski
  2007-10-14 22:23           ` Matthew Andrews
  1 sibling, 2 replies; 161+ messages in thread
From: David Kastrup @ 2007-10-14 22:12 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Johannes Schindelin, git

"Jakub Narebski" <jnareb@gmail.com> writes:

> On 10/13/07, David Kastrup <dak@gnu.org> wrote:
>
>> I find it a pity that my suggestion to ask about how comfortable
>> people are with the tone on the list did not make it into the survey.
>> Enough core developers make the tone sufficiently unconstructive to
>> make it quite understandable that people are unwilling to ask
>> questions here, in order to avoid getting their heads banged against a
>> wall, virtual or not.
>
> I think next to last question in the survey
>
>  61. Did you have problems getting GIT help on mailing list or on
>  IRC channel?  What were it? What could be improved?
>
> was the place to put complaints about git mailing list.

What if there are no problems getting help once you submit to letting
your head get bashed in?

The problem is not with getting help on the list: the list is
bristling with competent people.  The problem is the price to pay in
self-esteem and comfort.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 22:12         ` David Kastrup
@ 2007-10-14 22:15           ` Jakub Narebski
  2007-10-14 22:23           ` Matthew Andrews
  1 sibling, 0 replies; 161+ messages in thread
From: Jakub Narebski @ 2007-10-14 22:15 UTC (permalink / raw)
  To: David Kastrup; +Cc: Johannes Schindelin, git

On 10/15/07, David Kastrup <dak@gnu.org> wrote:
> "Jakub Narebski" <jnareb@gmail.com> writes:
>
> > On 10/13/07, David Kastrup <dak@gnu.org> wrote:
> >
> >> I find it a pity that my suggestion to ask about how comfortable
> >> people are with the tone on the list did not make it into the survey.
> >> Enough core developers make the tone sufficiently unconstructive to
> >> make it quite understandable that people are unwilling to ask
> >> questions here, in order to avoid getting their heads banged against a
> >> wall, virtual or not.
> >
> > I think next to last question in the survey
> >
> >  61. Did you have problems getting GIT help on mailing list or on
> >  IRC channel?  What were it? What could be improved?
> >
> > was the place to put complaints about git mailing list.
>
> What if there are no problems getting help once you submit to letting
> your head get bashed in?
>
> The problem is not with getting help on the list: the list is
> bristling with competent people.  The problem is the price to pay in
> self-esteem and comfort.

"What could be improved?"

-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 22:08         ` Johannes Schindelin
@ 2007-10-14 22:17           ` David Kastrup
  0 siblings, 0 replies; 161+ messages in thread
From: David Kastrup @ 2007-10-14 22:17 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi,
>
>> > I find it a pity that my suggestion to ask about how comfortable
>> > people are with the tone on the list did not make it into the
>> > survey.
>
> Well, everybody knows who wanted to have that question in the
> survey, and everybody knows why.

And would it not be good to corroborate that "who" is alone with his
opinion?  The purpose of a survey is to get, not to push opinions.  So
why fear the question?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 22:12         ` David Kastrup
  2007-10-14 22:15           ` Jakub Narebski
@ 2007-10-14 22:23           ` Matthew Andrews
  2007-10-14 22:30             ` David Kastrup
  1 sibling, 1 reply; 161+ messages in thread
From: Matthew Andrews @ 2007-10-14 22:23 UTC (permalink / raw)
  To: David Kastrup; +Cc: Jakub Narebski, Johannes Schindelin, git

I'm trying to see this negative tone that apparently exists on the
list. As a long-time lurker, I only see a fairly standard open-source
expectation of basic knowledge and strong opinion. The list is fairly
good about point people to existing documentation. If you do something
that somebody thinks is stupid, they'll tell you so. They don't coddle
you here, but they are more than willing to help.

On 10/14/07, David Kastrup <dak@gnu.org> wrote:
> "Jakub Narebski" <jnareb@gmail.com> writes:
>
> > On 10/13/07, David Kastrup <dak@gnu.org> wrote:
> >
> >> I find it a pity that my suggestion to ask about how comfortable
> >> people are with the tone on the list did not make it into the survey.
> >> Enough core developers make the tone sufficiently unconstructive to
> >> make it quite understandable that people are unwilling to ask
> >> questions here, in order to avoid getting their heads banged against a
> >> wall, virtual or not.
> >
> > I think next to last question in the survey
> >
> >  61. Did you have problems getting GIT help on mailing list or on
> >  IRC channel?  What were it? What could be improved?
> >
> > was the place to put complaints about git mailing list.
>
> What if there are no problems getting help once you submit to letting
> your head get bashed in?
>
> The problem is not with getting help on the list: the list is
> bristling with competent people.  The problem is the price to pay in
> self-esteem and comfort.
>
> --
> David Kastrup, Kriemhildstr. 15, 44793 Bochum
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 22:23           ` Matthew Andrews
@ 2007-10-14 22:30             ` David Kastrup
  0 siblings, 0 replies; 161+ messages in thread
From: David Kastrup @ 2007-10-14 22:30 UTC (permalink / raw)
  To: Matthew Andrews; +Cc: Jakub Narebski, Johannes Schindelin, git

"Matthew Andrews" <matthew.andrews@gmail.com> writes:

> I'm trying to see this negative tone that apparently exists on the
> list. As a long-time lurker, I only see a fairly standard
> open-source expectation of basic knowledge and strong opinion. The
> list is fairly good about point people to existing documentation. If
> you do something that somebody thinks is stupid, they'll tell you
> so. They don't coddle you here, but they are more than willing to
> help.

I never said that this list was not competent or helpful.

Anyway: if everybody had the same impression, we would not need a
survey, right?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-14 19:44                   ` Nicolas Pitre
@ 2007-10-15 23:20                     ` Shawn O. Pearce
  2007-10-16  2:48                       ` Nicolas Pitre
  0 siblings, 1 reply; 161+ messages in thread
From: Shawn O. Pearce @ 2007-10-15 23:20 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: Steven Grimm, Reece Dunn, Linus Torvalds, Johannes Schindelin,
	J. Bruce Fields, Jakub Narebski, git

Nicolas Pitre <nico@cam.org> wrote:
> BTW I have patches here reworking the progress code for a more compact 
> display which should mitigate this issue quite a bit.

git-gui is scraping the output of the current progress meter using
a regex and then building a graphical progress bar from that output.

Any change in how git produces the progress bar should still keep
it in a form that git-gui can regex match and scrape, preferably
without needing to know what version of git it is pulling that
output from.  For example just teach git-gui to try two different
regexps, new format and if that doesn't match then try the old
(aka current) format.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-15 23:20                     ` Shawn O. Pearce
@ 2007-10-16  2:48                       ` Nicolas Pitre
  2007-10-16 10:51                         ` Johannes Schindelin
  0 siblings, 1 reply; 161+ messages in thread
From: Nicolas Pitre @ 2007-10-16  2:48 UTC (permalink / raw)
  To: Shawn O. Pearce
  Cc: Steven Grimm, Reece Dunn, Linus Torvalds, Johannes Schindelin,
	J. Bruce Fields, Jakub Narebski, git

On Mon, 15 Oct 2007, Shawn O. Pearce wrote:

> Nicolas Pitre <nico@cam.org> wrote:
> > BTW I have patches here reworking the progress code for a more compact 
> > display which should mitigate this issue quite a bit.
> 
> git-gui is scraping the output of the current progress meter using
> a regex and then building a graphical progress bar from that output.

Erk!

> Any change in how git produces the progress bar should still keep
> it in a form that git-gui can regex match and scrape, preferably
> without needing to know what version of git it is pulling that
> output from.  For example just teach git-gui to try two different
> regexps, new format and if that doesn't match then try the old
> (aka current) format.

I think my new format might be easier for you as the "title" and the 
actual percentage and count is now on the same line.


Nicolas

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-16  2:48                       ` Nicolas Pitre
@ 2007-10-16 10:51                         ` Johannes Schindelin
  0 siblings, 0 replies; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-16 10:51 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: Shawn O. Pearce, Steven Grimm, Reece Dunn, Linus Torvalds,
	J. Bruce Fields, Jakub Narebski, git

Hi,

On Mon, 15 Oct 2007, Nicolas Pitre wrote:

> On Mon, 15 Oct 2007, Shawn O. Pearce wrote:
> 
> > Nicolas Pitre <nico@cam.org> wrote:
> > > BTW I have patches here reworking the progress code for a more compact 
> > > display which should mitigate this issue quite a bit.
> > 
> > git-gui is scraping the output of the current progress meter using
> > a regex and then building a graphical progress bar from that output.
> 
> Erk!
> 
> > Any change in how git produces the progress bar should still keep
> > it in a form that git-gui can regex match and scrape, preferably
> > without needing to know what version of git it is pulling that
> > output from.  For example just teach git-gui to try two different
> > regexps, new format and if that doesn't match then try the old
> > (aka current) format.
> 
> I think my new format might be easier for you as the "title" and the 
> actual percentage and count is now on the same line.

That might have been an advantage if Shawn did not do the code already.  
As it is, he'll have to maintain two different regexes, _and_ detect when 
to use which.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-13  0:46   ` Johannes Schindelin
                       ` (5 preceding siblings ...)
  2007-10-14 21:10     ` David Tweed
@ 2007-10-19 20:57     ` Federico Mena Quintero
  2007-10-19 23:27       ` Jakub Narebski
                         ` (2 more replies)
  6 siblings, 3 replies; 161+ messages in thread
From: Federico Mena Quintero @ 2007-10-19 20:57 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, git

On Sat, 2007-10-13 at 01:46 +0100, Johannes Schindelin wrote:

> Jakub, thank you very much for doing this.  It is a very tedious work, and 
> I deem it invaluable.

Seconded!  This survey is very valuable, Jakub!

> >    Figure out why people find git hard to learn and eliminate those
> >    barriers to entry.  Make git more task-oriented rather than
> >    data-model-oriented the way it is now.
> 
> Frankly, expectations like these make me want to bang somebody's head on 
> the wall.  Why do people expect others to work for them for free?  Hard?

The "barriers to entry" / "data model" comment came from me :)

"Find out why people find git hard to learn and eliminate those barriers
to entry" is what we do with usability tests e.g. in GNOME.  You ask
people to use your software to accomplish well-defined tasks ("send a
mail to foo@bar.com", "using the word processor, copy this fancy printed
layout").  Then, you see how they *expect* your software to work, you
see in which places it doesn't behave like that, and you fix it.  This
produces very good results.  For Git in particular this could be things
like, "Import this project from SVN, fix a bug, commit the patch", or
"You are a maintainer, merge in these two branches from two
contributors".

"Make git more task-oriented rather than data-model-oriented" is about
making the tool adapt to what you usually want to do, instead of making
*you* adapt to the way the tool wants to work.  Many commands in Git
have documentation like

  "option --foo updates the refs without modifying the index.  Requires
  a clean working tree"

This is gibberish for people who are not very familiar with Git's
internals.  "Git for computer scientists" provides a *very nice*
explanation of the DAG and refs and tags, but unfortunately it doesn't
explain the index, why you would want to know about it, etc.

Git introduces a lot of terminlogy:  refs, index, working tree, remotes,
origin, HEAD (which is not the same as CVS HEAD!), detached head,
rebasing, porcelains, etc.  Even the basic documentation is hard to read
when you don't know all the terms yet.

It's nice that Git lets you manipulate the repository in all kinds of
ways, but presenting porcelains at the same level as plumbing makes
things hard for users to learn.  I was just in our Beijing office,
teaching people about development tools and Git in particular.

  Federico: "get Git from this location"

  Beijing hacker: tap tap tap, "okay, it's installed now"

  Federico "Git commands all start with 'git'"

  Beijing hacker: git<Tab>
  
  Bash: Display all 150 possibilities?

  Beijing hacker: "oh, shit..."

It's hard to know where to begin :)  Do I need "git-cherry-pick" or
"git-cherry"?  Why is the "apply a patch" command called "git-am"?  Why
is it different from "git-apply"?  From "git-applypatch"?  Etc.

  Federico

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-19 20:57     ` Federico Mena Quintero
@ 2007-10-19 23:27       ` Jakub Narebski
  2007-10-19 23:37       ` Johannes Schindelin
  2007-10-20  8:03       ` Andreas Ericsson
  2 siblings, 0 replies; 161+ messages in thread
From: Jakub Narebski @ 2007-10-19 23:27 UTC (permalink / raw)
  To: Federico Mena Quintero; +Cc: Johannes Schindelin, git

On 10/19/07, Federico Mena Quintero <federico@novell.com> wrote:

> "Make git more task-oriented rather than data-model-oriented" is about
> making the tool adapt to what you usually want to do, instead of making
> *you* adapt to the way the tool wants to work.  Many commands in Git
> have documentation like
>
>   "option --foo updates the refs without modifying the index.  Requires
>   a clean working tree"
>
> This is gibberish for people who are not very familiar with Git's
> internals.  "Git for computer scientists" provides a *very nice*
> explanation of the DAG and refs and tags, but unfortunately it doesn't
> explain the index, why you would want to know about it, etc.

That is what "Git User's Manual" (and tutorials) is for. And there is
glossary in documentation.

[...]
> It's nice that Git lets you manipulate the repository in all kinds of
> ways, but presenting porcelains at the same level as plumbing makes
> things hard for users to learn.  I was just in our Beijing office,
> teaching people about development tools and Git in particular.
>
>   Federico: "get Git from this location"
>
>   Beijing hacker: tap tap tap, "okay, it's installed now"
>
>   Federico "Git commands all start with 'git'"
>
>   Beijing hacker: git<Tab>
>
>   Bash: Display all 150 possibilities?
>
>   Beijing hacker: "oh, shit..."

It is better to use bash (or zsh) completion, than rely on completion
of commands names.

Beijing hacker: git <Tab>

(that is, space after 'git') shows around 62 commands.

> It's hard to know where to begin :)  Do I need "git-cherry-pick" or
> "git-cherry"?  Why is the "apply a patch" command called "git-am"?  Why
> is it different from "git-apply"?  From "git-applypatch"?  Etc.

I think git-cherry will soon be obsoleted and removed, such like
git-applymbox and it companion git-applypatch are being obsoleted by
git-am.

git-am applies series of patches _with description_ from messagebox,
creating commits if patch applies without conflicts. It requires git
extended patch for sensible operation; it is best when patch is result
of git-format-patch. git-apply is to apply GNU patch (optionally git
patch) to working area, or working area and index, but do not create a
commit. It is improved version of GNU patch utility (it understands
git extended diff syntax), but it is not meant (alone) to work with
commits send by email.

-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-19 20:57     ` Federico Mena Quintero
  2007-10-19 23:27       ` Jakub Narebski
@ 2007-10-19 23:37       ` Johannes Schindelin
  2007-10-22 14:28         ` Federico Mena Quintero
  2007-10-20  8:03       ` Andreas Ericsson
  2 siblings, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-19 23:37 UTC (permalink / raw)
  To: Federico Mena Quintero; +Cc: Jakub Narebski, git

Hi,

On Fri, 19 Oct 2007, Federico Mena Quintero wrote:

>   Bash: Display all 150 possibilities?
> 
>   Beijing hacker: "oh, shit..."
> 
> It's hard to know where to begin :)  Do I need "git-cherry-pick" or 
> "git-cherry"?  Why is the "apply a patch" command called "git-am"?  Why 
> is it different from "git-apply"?  From "git-applypatch"?  Etc.

Yeah, I was arguing a bit about obsoleting the "git-*" programs.  But it 
seems that we are not getting it anytime soon.

FWIW try this:

	git<Space><Tab>

or even better:

	git<Enter>

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-19 20:57     ` Federico Mena Quintero
  2007-10-19 23:27       ` Jakub Narebski
  2007-10-19 23:37       ` Johannes Schindelin
@ 2007-10-20  8:03       ` Andreas Ericsson
  2007-10-20 10:19         ` Steffen Prohaska
  2 siblings, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-20  8:03 UTC (permalink / raw)
  To: Federico Mena Quintero; +Cc: Johannes Schindelin, Jakub Narebski, git

Federico Mena Quintero wrote:
> 
> "Find out why people find git hard to learn and eliminate those barriers
> to entry" is what we do with usability tests e.g. in GNOME.

And what every major corporation who's serious about UI's do. Windows
works the way it does because that's how idiots expect it to work. Sad but
true. If our aim is world domination, we need not cater to the morons, but
we must make it easier for them to start learning on their own.

>  You ask
> people to use your software to accomplish well-defined tasks ("send a
> mail to foo@bar.com", "using the word processor, copy this fancy printed
> layout").  Then, you see how they *expect* your software to work, you
> see in which places it doesn't behave like that, and you fix it.  This
> produces very good results.  For Git in particular this could be things
> like, "Import this project from SVN, fix a bug, commit the patch", or
> "You are a maintainer, merge in these two branches from two
> contributors".
> 

I like it. So much so that I'll see if I can get a non-programmer at work
to do these tasks. Now... to assemble that task-list. Suggestions welcome.

> 
> It's hard to know where to begin :)  Do I need "git-cherry-pick" or
> "git-cherry"?  Why is the "apply a patch" command called "git-am"?  Why
> is it different from "git-apply"?  From "git-applypatch"?  Etc.
> 

I agree completely. It wouldn't be hard to make git-apply figure out if
it's being fed something that 'am' would normally want, and if it's being
fed it inside a git repo. If so, make it work just like 'am'.
git-applypatch was deprecated a long time ago and has already been removed.

Personally, I can't help but think that the numerous times I've heard "oh
gods, that's a lot of commands" should finally mean something. I've started
taking a look at which of them one can bundle together. If we can drop the
porcelainish commands down to ~30 or so, and hide the plumbing from git-<tab>
listings, the initial hurdle people have to jump would be significantly lower.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-20  8:03       ` Andreas Ericsson
@ 2007-10-20 10:19         ` Steffen Prohaska
  2007-10-20 11:29           ` Andreas Ericsson
                             ` (2 more replies)
  0 siblings, 3 replies; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-20 10:19 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Federico Mena Quintero, Johannes Schindelin, Jakub Narebski, git


On Oct 20, 2007, at 10:03 AM, Andreas Ericsson wrote:

>
> Personally, I can't help but think that the numerous times I've  
> heard "oh
> gods, that's a lot of commands" should finally mean something. I've  
> started
> taking a look at which of them one can bundle together. If we can  
> drop the
> porcelainish commands down to ~30 or so, and hide the plumbing from  
> git-<tab>
> listings, the initial hurdle people have to jump would be  
> significantly lower.

Maybe we could group commands into more categories?

plumbing: should be hidden from the 'normal' user. Porcelain
   should be sufficient for every standard task.

core porcelain: this is what everyone needs who works in a
   pure git based workflow based on push/pull. You can't use
   git without these commands. But these commands are already
   sufficient to solve most of your tasks.

mail porcelain: the list will probably hate me for this, but
   I think all commands needed to create and send patches per
   mail are not essential. I suspect that I'll _never_ ask
   my colleagues at work to send me a patch by mail. They'll
   always push it to a shared repo.

import/export: Many commands are only used for importing
   from or exporting to other version control systems. Examples
   are git-cvs*, git-svn*. They are not needed once you switched
   to git.

admin: Some commands are not used in a typical workflow. For
   example git-filter-branch or git-fsck have a more admin
   flavor.

There might be more categories. I am not sure because there
a quite a few commands that I _never_ used and have no clear
idea about what they do.


So here are a few questions:

Could we find a small set of core porcelain commands that
completely cover a typical workflow? The core section of the
manual should only refer to those commands. Absolutely no
plumbing should be needed to tweak things. In principle, a
typical user should be able to work if _all other_ commands
except for core porcelain are hidden from his PATH.

Another section in the manual should describe a workflow based
on sending patches around. Obviously the mail porcelain is
needed for this.

... and so forth.

I don't know if we really want to hide the commands from PATH.
But maybe we should consider grouping them into subdirectories,
or provide another way to for the user to focus on the core
porcelain.

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-20 10:19         ` Steffen Prohaska
@ 2007-10-20 11:29           ` Andreas Ericsson
  2007-10-21  6:08             ` Dmitry Potapov
  2007-10-20 23:06           ` Jakub Narebski
  2007-10-21 22:12           ` J. Bruce Fields
  2 siblings, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-20 11:29 UTC (permalink / raw)
  To: Steffen Prohaska
  Cc: Federico Mena Quintero, Johannes Schindelin, Jakub Narebski, git

Steffen Prohaska wrote:
> 
> On Oct 20, 2007, at 10:03 AM, Andreas Ericsson wrote:
> 
>>
>> Personally, I can't help but think that the numerous times I've heard "oh
>> gods, that's a lot of commands" should finally mean something. I've 
>> started
>> taking a look at which of them one can bundle together. If we can drop 
>> the
>> porcelainish commands down to ~30 or so, and hide the plumbing from 
>> git-<tab>
>> listings, the initial hurdle people have to jump would be 
>> significantly lower.
> 
> Maybe we could group commands into more categories?
> 
> plumbing: should be hidden from the 'normal' user. Porcelain
>   should be sufficient for every standard task.
> 

Agreed. /usr/libexec/git/ seems to me to be the ideal spot for
it.

> core porcelain: this is what everyone needs who works in a
>   pure git based workflow based on push/pull. You can't use
>   git without these commands. But these commands are already
>   sufficient to solve most of your tasks.
> 

Agreed.

> mail porcelain: the list will probably hate me for this, but
>   I think all commands needed to create and send patches per
>   mail are not essential. I suspect that I'll _never_ ask
>   my colleagues at work to send me a patch by mail. They'll
>   always push it to a shared repo.
> 

Disagreed, for obvious reasons. Many OSS projects are patch-centric
and developed much like git. OTOH, having to run "git format-patch"
rather than "git-format-patch" probably isn't so hampering that we
can't live with it.

> import/export: Many commands are only used for importing
>   from or exporting to other version control systems. Examples
>   are git-cvs*, git-svn*. They are not needed once you switched
>   to git.
> 

But very nifty for incremental imports. I track several CVS repos
that I continuously import. They're also self-explanatory, so
they don't add much to the clutter. Same reasons as above though;
there's no real reason not to invoke them as "git cvsimport" rather
than "git-cvsimport".

> admin: Some commands are not used in a typical workflow. For
>   example git-filter-branch or git-fsck have a more admin
>   flavor.
> 

git-filter-branch could definitely live its life hidden somewhere.
git-fsck probably should stay with the plumbing, as it's used by
other porcelainish programs more often than run directly by the
user.

> There might be more categories. I am not sure because there
> a quite a few commands that I _never_ used and have no clear
> idea about what they do.
> 
> 
> So here are a few questions:
> 
> Could we find a small set of core porcelain commands that
> completely cover a typical workflow? The core section of the
> manual should only refer to those commands. Absolutely no
> plumbing should be needed to tweak things. In principle, a
> typical user should be able to work if _all other_ commands
> except for core porcelain are hidden from his PATH.
> 

Note that this is already possible, using a libexec-dir and
passing --exec-dir to the git wrapper. The only thing that isn't
done is deciding what's *definitely* plumbing. Once that's defined,
the makefile can install plumbing to a separate directory and
the /usr/bin/git-<tab> should shrink by roughly half.

> Another section in the manual should describe a workflow based
> on sending patches around. Obviously the mail porcelain is
> needed for this.
> 
> ... and so forth.
> 
> I don't know if we really want to hide the commands from PATH.
> But maybe we should consider grouping them into subdirectories,
> or provide another way to for the user to focus on the core
> porcelain.
> 

Hiding the really core plumbing and getting rid of redundant
programs (git-am, git-apply, git-applypatch, ...) would do wonders,
methinks.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-20 10:19         ` Steffen Prohaska
  2007-10-20 11:29           ` Andreas Ericsson
@ 2007-10-20 23:06           ` Jakub Narebski
  2007-10-20 23:33             ` Johannes Schindelin
  2007-10-21 22:12           ` J. Bruce Fields
  2 siblings, 1 reply; 161+ messages in thread
From: Jakub Narebski @ 2007-10-20 23:06 UTC (permalink / raw)
  To: Steffen Prohaska
  Cc: Andreas Ericsson, Federico Mena Quintero, Johannes Schindelin, git

On 10/20/07, Steffen Prohaska <prohaska@zib.de> wrote:

> Maybe we could group commands into more categories?
>
> plumbing: should be hidden from the 'normal' user. Porcelain
>    should be sufficient for every standard task.

The problem is division between what is porcelain and what is plumbing.
Some commands are right on border (git-fsck, git-update-index, git-rev-parse
comes to mind).

But it should be fairly easy to:
 1. put only porcelain in bash / zsh completion ('git <tab>' shows
only porcelain
 2. move plumbing out of PATH, but use exec-dir instead.

[...]
> mail porcelain: the list will probably hate me for this, but
>    I think all commands needed to create and send patches per
>    mail are not essential. I suspect that I'll _never_ ask
>    my colleagues at work to send me a patch by mail. They'll
>    always push it to a shared repo.

Usually mail porcelain is in separate binary package, git-mail for
RPMS packages for example. But iMVHO git-format-patch is as often used
as other commands, and is certainly  porcelain.

> import/export: Many commands are only used for importing
>    from or exporting to other version control systems. Examples
>    are git-cvs*, git-svn*. They are not needed once you switched
>    to git.

Those are also in separate packages.

> admin: Some commands are not used in a typical workflow. For
>    example git-filter-branch or git-fsck have a more admin
>    flavor.

These are a few commands only. I'm not sure about how to separate
those from ordinary commands.

[...]
> So here are a few questions:
>
> Could we find a small set of core porcelain commands that
> completely cover a typical workflow? The core section of the
> manual should only refer to those commands. Absolutely no
> plumbing should be needed to tweak things. In principle, a
> typical user should be able to work if _all other_ commands
> except for core porcelain are hidden from his PATH.

The problem here I suppose might lie with the same reason why
(almost?) all Office Lite systems failed: because even if 80% of people
use only 20% of functaionality, it is not the _same_ 20%.

-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-20 23:06           ` Jakub Narebski
@ 2007-10-20 23:33             ` Johannes Schindelin
  2007-10-21  7:17               ` Andreas Ericsson
  0 siblings, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-20 23:33 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: Steffen Prohaska, Andreas Ericsson, Federico Mena Quintero, git

Hi,

On Sun, 21 Oct 2007, Jakub Narebski wrote:

> On 10/20/07, Steffen Prohaska <prohaska@zib.de> wrote:
> 
> > Maybe we could group commands into more categories?
> >
> > plumbing: should be hidden from the 'normal' user. Porcelain
> >    should be sufficient for every standard task.
> 
> The problem is division between what is porcelain and what is plumbing. 
> Some commands are right on border (git-fsck, git-update-index, 
> git-rev-parse comes to mind).

Sorry, but my impression from the latest mails was that the commands are 
fine.  What is lacking is a nice, _small_ collection of recommended 
workflows.  And when we have agreed on such a set of workflows, we 
optimize the hell out of them.  Only this time it is not performance, but 
user-friendliness.

Hmm?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-20 11:29           ` Andreas Ericsson
@ 2007-10-21  6:08             ` Dmitry Potapov
  0 siblings, 0 replies; 161+ messages in thread
From: Dmitry Potapov @ 2007-10-21  6:08 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Steffen Prohaska, Federico Mena Quintero, Johannes Schindelin,
	Jakub Narebski, git

On Sat, Oct 20, 2007 at 01:29:31PM +0200, Andreas Ericsson wrote:
> Steffen Prohaska wrote:
> >
> >plumbing: should be hidden from the 'normal' user. Porcelain
> >  should be sufficient for every standard task.
> >
> 
> Agreed. /usr/libexec/git/ seems to me to be the ideal spot for
> it.

/usr/libexec is against the Filesystem Hierarchy Standard (FHS).
It is better to use /usr/lib/git/ for that.

Dmitry

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-20 23:33             ` Johannes Schindelin
@ 2007-10-21  7:17               ` Andreas Ericsson
  2007-10-21 22:15                 ` Johannes Schindelin
  0 siblings, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-21  7:17 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Jakub Narebski, Steffen Prohaska, Federico Mena Quintero, git

Johannes Schindelin wrote:
> Hi,
> 
> On Sun, 21 Oct 2007, Jakub Narebski wrote:
> 
>> On 10/20/07, Steffen Prohaska <prohaska@zib.de> wrote:
>>
>>> Maybe we could group commands into more categories?
>>>
>>> plumbing: should be hidden from the 'normal' user. Porcelain
>>>    should be sufficient for every standard task.
>> The problem is division between what is porcelain and what is plumbing. 
>> Some commands are right on border (git-fsck, git-update-index, 
>> git-rev-parse comes to mind).
> 
> Sorry, but my impression from the latest mails was that the commands are 
> fine.  What is lacking is a nice, _small_ collection of recommended 
> workflows.  And when we have agreed on such a set of workflows, we 
> optimize the hell out of them.  Only this time it is not performance, but 
> user-friendliness.
> 

http://www.kernel.org/pub/software/scm/git/docs/everyday.html would be a
good starting point, I think.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-20 10:19         ` Steffen Prohaska
  2007-10-20 11:29           ` Andreas Ericsson
  2007-10-20 23:06           ` Jakub Narebski
@ 2007-10-21 22:12           ` J. Bruce Fields
  2 siblings, 0 replies; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-21 22:12 UTC (permalink / raw)
  To: Steffen Prohaska
  Cc: Andreas Ericsson, Federico Mena Quintero, Johannes Schindelin,
	Jakub Narebski, git

On Sat, Oct 20, 2007 at 12:19:45PM +0200, Steffen Prohaska wrote:
> mail porcelain: the list will probably hate me for this, but
>   I think all commands needed to create and send patches per
>   mail are not essential. I suspect that I'll _never_ ask
>   my colleagues at work to send me a patch by mail. They'll
>   always push it to a shared repo.

That's not going to fly.  There are too many projects for which email is
the preferred way to submit patches (especially for new or occasional
developers).

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-21  7:17               ` Andreas Ericsson
@ 2007-10-21 22:15                 ` Johannes Schindelin
  2007-10-22  7:59                   ` Andreas Ericsson
  2007-10-22 22:53                   ` Steven Grimm
  0 siblings, 2 replies; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-21 22:15 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Jakub Narebski, Steffen Prohaska, Federico Mena Quintero, git

Hi,

On Sun, 21 Oct 2007, Andreas Ericsson wrote:

> Johannes Schindelin wrote:
> 
> > On Sun, 21 Oct 2007, Jakub Narebski wrote:
> > 
> > > On 10/20/07, Steffen Prohaska <prohaska@zib.de> wrote:
> > > 
> > > > Maybe we could group commands into more categories?
> > > > 
> > > > plumbing: should be hidden from the 'normal' user. Porcelain
> > > >    should be sufficient for every standard task.
> > >
> > > The problem is division between what is porcelain and what is 
> > > plumbing. Some commands are right on border (git-fsck, 
> > > git-update-index, git-rev-parse comes to mind).
> > 
> > Sorry, but my impression from the latest mails was that the commands 
> > are fine.  What is lacking is a nice, _small_ collection of 
> > recommended workflows.  And when we have agreed on such a set of 
> > workflows, we optimize the hell out of them.  Only this time it is not 
> > performance, but user-friendliness.
> 
> http://www.kernel.org/pub/software/scm/git/docs/everyday.html would be a 
> good starting point, I think.

I don't think so.  Way too few authors were involved in writing this 
document, so it is not "typical" in and of itself.

I'd really like people to respond not so much with broad and general 
statements to my mail (those statements tend to be rather useless to find 
how to make git more suitable to newbies), but rather with concrete top 
ten lists of what they do daily.

My top ten list:

- git diff
- git commit
- git status
- git fetch
- git rebase
- git pull
- git cherry-pick
- git bisect
- git push
- git add

Of course, my list is somewhat skewed (because I am quite comfortable with 
the commands git provided; otherwise I would have provided -- unlike 
others, probably -- patches, and would have fought -- also unlike others 
-- to get them in, such as --color-words).

So again, I'd like people who did _not_ tweak git to their likings to tell 
the most common steps they do.  My hope is that we see things that are 
good practices, but could use an easier user interface.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-21 22:15                 ` Johannes Schindelin
@ 2007-10-22  7:59                   ` Andreas Ericsson
  2007-10-22 11:04                     ` best git practices, was " Johannes Schindelin
                                       ` (2 more replies)
  2007-10-22 22:53                   ` Steven Grimm
  1 sibling, 3 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-22  7:59 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Jakub Narebski, Steffen Prohaska, Federico Mena Quintero, git

Johannes Schindelin wrote:
> Hi,
> 
> On Sun, 21 Oct 2007, Andreas Ericsson wrote:
> 
>> Johannes Schindelin wrote:
>>
>>> On Sun, 21 Oct 2007, Jakub Narebski wrote:
>>>
>>>> On 10/20/07, Steffen Prohaska <prohaska@zib.de> wrote:
>>>>
>>>>> Maybe we could group commands into more categories?
>>>>>
>>>>> plumbing: should be hidden from the 'normal' user. Porcelain
>>>>>    should be sufficient for every standard task.
>>>> The problem is division between what is porcelain and what is 
>>>> plumbing. Some commands are right on border (git-fsck, 
>>>> git-update-index, git-rev-parse comes to mind).
>>> Sorry, but my impression from the latest mails was that the commands 
>>> are fine.  What is lacking is a nice, _small_ collection of 
>>> recommended workflows.  And when we have agreed on such a set of 
>>> workflows, we optimize the hell out of them.  Only this time it is not 
>>> performance, but user-friendliness.
>> http://www.kernel.org/pub/software/scm/git/docs/everyday.html would be a 
>> good starting point, I think.
> 
> I don't think so.  Way too few authors were involved in writing this 
> document, so it is not "typical" in and of itself.
> 
> I'd really like people to respond not so much with broad and general 
> statements to my mail (those statements tend to be rather useless to find 
> how to make git more suitable to newbies), but rather with concrete top 
> ten lists of what they do daily.
> 
> My top ten list:
> 
> - git diff
> - git commit
> - git status
> - git fetch
> - git rebase
> - git pull
> - git cherry-pick
> - git bisect
> - git push
> - git add
> 
> So again, I'd like people who did _not_ tweak git to their likings to tell 
> the most common steps they do.  My hope is that we see things that are 
> good practices, but could use an easier user interface.
> 

I'm not so sure we'd want to hide commands that git-gurus simply do not 
use, such as git-blame. In my opinion, we should just locate the highest 
level available of UI tool that implements a particular feature and have 
that listed in the git[- ]<tab> view.

I doubt many people on this list regularly use git-blame but it's a 
command that's definitely non-trivial to script out using only the 
"proper" commands, and CVS/SVN users expect it to be there, so it's 
probably worth listing anyhow.

Similarly, it might be helpful to have help topics the gdb way, like 
"git help patches". It's one of those things that people have come to 
expect from a software tool, so perhaps we should humor them? Given gits 
"every help topic is a man-page" idiom, this shouldn't require any real 
technical effort.

Such topics should probably include
merge/merges/merging - overview of various ways of putting two lines of 
development back together
patch/patches - how to create, send and apply
tags/branches/refs - what they are, why they're good, link to merging

I'm currently swanked with day-job work, but I'll see if I can get some 
prototype docs done later this week and check if it requires any code 
support. If anyone's well-versed in asciidoc HTML-indexing and wants to 
provide pointers to what I should think about for generating those topic 
menus as html docs, feel free to chuck me an email.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22  7:59                   ` Andreas Ericsson
@ 2007-10-22 11:04                     ` Johannes Schindelin
  2007-10-22 12:44                       ` Andreas Ericsson
                                         ` (4 more replies)
  2007-10-22 12:26                     ` Jakub Narebski
  2007-10-22 14:53                     ` Federico Mena Quintero
  2 siblings, 5 replies; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-22 11:04 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Jakub Narebski, Steffen Prohaska, Federico Mena Quintero, git

Hi,

On Mon, 22 Oct 2007, Andreas Ericsson wrote:

> Johannes Schindelin wrote:
> 
> > I'd really like people to respond not so much with broad and general 
> > statements to my mail (those statements tend to be rather useless to 
> > find how to make git more suitable to newbies), but rather with 
> > concrete top ten lists of what they do daily.
> > 
> > My top ten list:
> > 
> > - git diff
> > - git commit
> > - git status
> > - git fetch
> > - git rebase
> > - git pull
> > - git cherry-pick
> > - git bisect
> > - git push
> > - git add
> > 
> > So again, I'd like people who did _not_ tweak git to their likings to 
> > tell the most common steps they do.  My hope is that we see things 
> > that are good practices, but could use an easier user interface.
> 
> I'm not so sure we'd want to hide commands that git-gurus simply do not 
> use, such as git-blame.

I was not talking about commands that git gurus simply do not use.  I 
explicitely avoided asking "git gurus" for what they use.

> In my opinion, we should just locate the highest level available of UI 
> tool that implements a particular feature and have that listed in the 
> git[- ]<tab> view.

>From the survey it is utterly clear that the available UI tools are still 
not good enough.

So once again, what operations involving git do people use regularly?

<rationale>There is a good chance that git is not optimised for most 
people's daily workflows, as project maintainers seemed to be much more 
forthcoming with patches, and therefore maintainers' tasks are much more 
optimised than in other SCMs.</rationale>

Ciao,
Dscho

P.S.: If nobody replies with actual daily workflows to this mail, I'll 
just assume that this complaint in the user survey was just bullocks, and 
no change in git is needed.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22  7:59                   ` Andreas Ericsson
  2007-10-22 11:04                     ` best git practices, was " Johannes Schindelin
@ 2007-10-22 12:26                     ` Jakub Narebski
  2007-10-22 13:45                       ` Johannes Schindelin
  2007-10-22 14:29                       ` Andreas Ericsson
  2007-10-22 14:53                     ` Federico Mena Quintero
  2 siblings, 2 replies; 161+ messages in thread
From: Jakub Narebski @ 2007-10-22 12:26 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Johannes Schindelin, Steffen Prohaska, Federico Mena Quintero, git

On 10/22/07, Andreas Ericsson <ae@op5.se> wrote:
[...]
>>>>> On 10/20/07, Steffen Prohaska <prohaska@zib.de> wrote:
>>>>>
>>>>>> Maybe we could group commands into more categories?

> Similarly, it might be helpful to have help topics the gdb way, like
> "git help patches". It's one of those things that people have come to
> expect from a software tool, so perhaps we should humor them? Given gits
> "every help topic is a man-page" idiom, this shouldn't require any real
> technical effort.
>
> Such topics should probably include
> merge/merges/merging - overview of various ways of putting two lines of
> development back together
> patch/patches - how to create, send and apply
> tags/branches/refs - what they are, why they're good, link to merging

Very good idea. It is definitely something that can be worked on.

By the way, what do you think about "spying" version of git, specially
marked release which gathers statistics of porcelain used, with
frequency of its use, and git-sendstats command added in this release?

-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 11:04                     ` best git practices, was " Johannes Schindelin
@ 2007-10-22 12:44                       ` Andreas Ericsson
  2007-10-22 13:48                         ` Johannes Schindelin
  2007-10-22 13:17                       ` Wincent Colaiuta
                                         ` (3 subsequent siblings)
  4 siblings, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-22 12:44 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Jakub Narebski, Steffen Prohaska, Federico Mena Quintero, git

Johannes Schindelin wrote:
> So once again, what operations involving git do people use regularly?
> 

diff
qgit
commit
fetch
rebase
merge
status
push
cherry-pick
grep
bisect
add
show-ref

If I were to suggest any improvements, it'd be to change the semantics 
of git-pull to always update the local branches set up to be merged with 
the remote tracking branches when they, prior to fetching, pointed to 
the same commit, such that when

$ git show-ref master
d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/heads/master
d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/remotes/origin/master

refs/heads/master gets set to refs/remotes/origin/master post-fetch.

This would save me from this command sequence, which I currently have to 
do for git.

git fetch
git checkout next
git merge spearce/next
git checkout master
git merge spearce/master
git checkout maint
git merge spearce/maint
git checkout pu
git reset --hard spearce/pu

<rinse and repeat for every tracked branch>

git could definitely help here. I want the local branches to be 
up-to-date with the remote ones, because I frequently run diffs against 
the various branches to see if anything that I should be aware of has 
changed, and just as frequently I forget to add that 'origin/' prefix, 
which means I *might* be looking at old code.

I usually do that on internal projects, where we have "master", "next", 
"testing", and "stable" branches for pretty much every repo. We have 54 
git repos. The typing adds up. This is also one of the most frequent 
causes of confusion for my (even) less git-savvy co-workers. The 
argument usually goes like this:
"Umm... Peter, why did you commit your fix on top of 7 weeks old code?"
"Oh? I did git-pull first, just as you said, so it should have been the 
latest, shouldn't it?"
"Well, what branch were you on when you pulled?"
"Err.. does that matter? I didn't have any local modifications on the 
branch when I pulled, so it should have just updated it."

What's happened prior to such an argument is usually this:
next or master is inevitably checked out. The user does git-pull to get 
up to date. They then change branch and get down to business with 
rebasing, merging and editing. When it's time to push, git tells them 
"not a strict subset. use git-pull!", and they do, and sometimes it 
fails, and I have a hard time explaining why since I really don't see a 
reason for *not* updating all "to-merge" branches when they point to the 
same commit as their tracking-branch before the pull.

Patch to follow (at some point), although it's likely to make git-pull a 
built-in since I have no idea how to maintain coupled lists in shell.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 11:04                     ` best git practices, was " Johannes Schindelin
  2007-10-22 12:44                       ` Andreas Ericsson
@ 2007-10-22 13:17                       ` Wincent Colaiuta
  2007-10-22 13:33                         ` David Symonds
                                           ` (2 more replies)
  2007-10-22 13:36                       ` Nguyen Thai Ngoc Duy
                                         ` (2 subsequent siblings)
  4 siblings, 3 replies; 161+ messages in thread
From: Wincent Colaiuta @ 2007-10-22 13:17 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Andreas Ericsson, Jakub Narebski, Steffen Prohaska,
	Federico Mena Quintero, git

El 22/10/2007, a las 13:04, Johannes Schindelin escribió:

> So once again, what operations involving git do people use regularly?

Here are my top ten commands, sorted by the number of times they  
appear in my ~/.bash_history:

533 status
342 diff
252 commit
234 add
123 checkout
116 log
106 push
97 config
83 show
83 branch

Not very scientific, but it gives a rough idea of how one Git newbie  
(using it for several months) with a very basic workflow uses Git.

Cheers,
Wincent

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 13:17                       ` Wincent Colaiuta
@ 2007-10-22 13:33                         ` David Symonds
  2007-10-22 13:38                         ` Johannes Schindelin
  2007-10-23 22:13                         ` Alex Riesen
  2 siblings, 0 replies; 161+ messages in thread
From: David Symonds @ 2007-10-22 13:33 UTC (permalink / raw)
  To: Wincent Colaiuta
  Cc: Johannes Schindelin, Andreas Ericsson, Jakub Narebski,
	Steffen Prohaska, Federico Mena Quintero, git

On 22/10/2007, Wincent Colaiuta <win@wincent.com> wrote:
> El 22/10/2007, a las 13:04, Johannes Schindelin escribió:
>
> > So once again, what operations involving git do people use regularly?
>
> Here are my top ten commands, sorted by the number of times they
> appear in my ~/.bash_history:

Sounds like a good idea. Here's mine (my .bash_history is limited to
500 commands, though):

$ cat ~/.bash_history | grep ^git | cut -c5- | cut -d' ' -f1 | sort |
uniq -c | sort -nr | head -10
  64 status
  37 diff
  23 push
  13 checkout
  12 add
   9 log
   9 commit
   8 rebase
   8 branch
   5 count-objects


Dave.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 11:04                     ` best git practices, was " Johannes Schindelin
  2007-10-22 12:44                       ` Andreas Ericsson
  2007-10-22 13:17                       ` Wincent Colaiuta
@ 2007-10-22 13:36                       ` Nguyen Thai Ngoc Duy
  2007-10-22 15:24                       ` best git practices, was Re: Git User's Survey 2007 unfinished summarycontinued Federico Mena Quintero
  2007-10-24  2:06                       ` best git practices, was Re: Git User's Survey 2007 unfinished summary continued Jakub Narebski
  4 siblings, 0 replies; 161+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2007-10-22 13:36 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Andreas Ericsson, Jakub Narebski, Steffen Prohaska,
	Federico Mena Quintero, git

On 10/22/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> So once again, what operations involving git do people use regularly?

All operations in my laptop since May:

    621 git log
    614 git diff
    510 git status
    378 git grep
    203 git checkout
    166 git add
    159 git commit
    106 git fetch
     87 git branch
     61 git help
     55 git am
     49 git ls-files
     48 git format-patch
     46 git show
     46 git reset
     46 git clone
     44 git cherry-pick
     42 git merge
     36 git apply
     26 git cherry
     25 git push
     25 git describe
     24 git rev-list
     20 git rebase
     18 git pull
     17 gitview
     16 git shortlog
     15 git revert
     15 git cat-file
     12 git name-rev
     11 git update-index
     11 git ls-tree
     11 git count-objects
     10 git tag
      9 git send-email
      9 git rev-parse
      7 git svn
      7 git read-tree
      6 git repack
      6 git fsck
      4 git init
      4 git clean
      3 git rm
      3 git gc
      2 git submodule
      2 git prune
      2 git ls
      2 gitk
      2 git gui
      2 git config
      1 git mailinfo
      1 git lost-found
-- 
Duy

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 13:17                       ` Wincent Colaiuta
  2007-10-22 13:33                         ` David Symonds
@ 2007-10-22 13:38                         ` Johannes Schindelin
  2007-10-22 17:48                           ` Robin Rosenberg
  2007-10-23 22:13                         ` Alex Riesen
  2 siblings, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-22 13:38 UTC (permalink / raw)
  To: Wincent Colaiuta
  Cc: Andreas Ericsson, Jakub Narebski, Steffen Prohaska,
	Federico Mena Quintero, git

Hi,

On Mon, 22 Oct 2007, Wincent Colaiuta wrote:

> El 22/10/2007, a las 13:04, Johannes Schindelin escribi?:
> 
> > So once again, what operations involving git do people use regularly?
> 
> Here are my top ten commands, sorted by the number of times they appear 
> in my ~/.bash_history:

Thanks.  That's a really good idea.  I did the same, and it turns out that 
my list was wrong:

     68 log
     50 fetch
     36 show
     33 diff
     19 grep
     19 commit
     14 ps (my alias which runs -p status)
     10 config
      8 rebase
      8 push

Everybody who wants to find out the same: this is how I did it:

cat .bash_history |
	tr ";" "\\n" |
	sed -n "s/^ *git[- ]\([^ ]*\).*$/\1/p" |
	sort |
	uniq -c |
	sort -r -n

One thing that I realised by looking at my list: It probably makes more 
sense teaching people about "fetch" in the beginning, teach other parts 
about git, and only then "push".

We tend to teach people about "fetch" and "push" at the same time, but 
this is not consistent with any workflow.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 12:26                     ` Jakub Narebski
@ 2007-10-22 13:45                       ` Johannes Schindelin
  2007-10-22 14:29                       ` Andreas Ericsson
  1 sibling, 0 replies; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-22 13:45 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: Andreas Ericsson, Steffen Prohaska, Federico Mena Quintero, git

Hi,

On Mon, 22 Oct 2007, Jakub Narebski wrote:

> On 10/22/07, Andreas Ericsson <ae@op5.se> wrote:
> [...]
> >>>>> On 10/20/07, Steffen Prohaska <prohaska@zib.de> wrote:
> >>>>>
> >>>>>> Maybe we could group commands into more categories?
> 
> > Similarly, it might be helpful to have help topics the gdb way, like
> > "git help patches". It's one of those things that people have come to
> > expect from a software tool, so perhaps we should humor them? Given gits
> > "every help topic is a man-page" idiom, this shouldn't require any real
> > technical effort.
> >
> > Such topics should probably include
> > merge/merges/merging - overview of various ways of putting two lines of
> > development back together
> > patch/patches - how to create, send and apply
> > tags/branches/refs - what they are, why they're good, link to merging
> 
> Very good idea. It is definitely something that can be worked on.
> 
> By the way, what do you think about "spying" version of git, specially
> marked release which gathers statistics of porcelain used, with
> frequency of its use, and git-sendstats command added in this release?

I like Wincent's approach, scanning .bash_history.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 12:44                       ` Andreas Ericsson
@ 2007-10-22 13:48                         ` Johannes Schindelin
  2007-10-22 14:31                           ` Andreas Ericsson
  2007-10-22 18:06                           ` Daniel Barkalow
  0 siblings, 2 replies; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-22 13:48 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Jakub Narebski, Steffen Prohaska, Federico Mena Quintero, git

Hi,

On Mon, 22 Oct 2007, Andreas Ericsson wrote:

> If I were to suggest any improvements, it'd be to change the semantics of
> git-pull to always update the local branches set up to be merged with the
> remote tracking branches when they, prior to fetching, pointed to the same
> commit, such that when
> 
> $ git show-ref master
> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/heads/master
> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/remotes/origin/master
> 
> refs/heads/master gets set to refs/remotes/origin/master post-fetch.

In general, this should fail.  Because you are expected to have local 
changes in the local branches.  What you describe suggests that you should 
not use the branch name "master" at all, but "origin/master".

That said, there is a pretty simple way to achieve what you want (even if 
it does not help the confusion you create between local and remote 
branches):

	git config --add remote.origin.fetch master:master

Of course, when you checkout "master" and pull then, you'll get even more 
problems, _exactly_ because you muddled up the clear distinction between 
local and remote branches.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-19 23:37       ` Johannes Schindelin
@ 2007-10-22 14:28         ` Federico Mena Quintero
  0 siblings, 0 replies; 161+ messages in thread
From: Federico Mena Quintero @ 2007-10-22 14:28 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, git

On Sat, 2007-10-20 at 00:37 +0100, Johannes Schindelin wrote:

> FWIW try this:
> 
> 	git<Space><Tab>
> 
> or even better:
> 
> 	git<Enter>

Hmm, this didn't work.  I'm still using git 1.5.4.2 from the 
stock openSUSE 10.3 packages --- did this get added in a newer version?

  Federico

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 12:26                     ` Jakub Narebski
  2007-10-22 13:45                       ` Johannes Schindelin
@ 2007-10-22 14:29                       ` Andreas Ericsson
  1 sibling, 0 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-22 14:29 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: Johannes Schindelin, Steffen Prohaska, Federico Mena Quintero, git

Jakub Narebski wrote:
> On 10/22/07, Andreas Ericsson <ae@op5.se> wrote:
> [...]
>>>>>> On 10/20/07, Steffen Prohaska <prohaska@zib.de> wrote:
>>>>>>
>>>>>>> Maybe we could group commands into more categories?
> 
>> Similarly, it might be helpful to have help topics the gdb way, like
>> "git help patches". It's one of those things that people have come to
>> expect from a software tool, so perhaps we should humor them? Given gits
>> "every help topic is a man-page" idiom, this shouldn't require any real
>> technical effort.
>>
>> Such topics should probably include
>> merge/merges/merging - overview of various ways of putting two lines of
>> development back together
>> patch/patches - how to create, send and apply
>> tags/branches/refs - what they are, why they're good, link to merging
> 
> Very good idea. It is definitely something that can be worked on.
> 
> By the way, what do you think about "spying" version of git, specially
> marked release which gathers statistics of porcelain used, with
> frequency of its use, and git-sendstats command added in this release?
> 

I like it and I'd use it. What's more interesting is that I could 
probably get my co-workers to do the same.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 13:48                         ` Johannes Schindelin
@ 2007-10-22 14:31                           ` Andreas Ericsson
  2007-10-22 15:00                             ` Johannes Schindelin
  2007-10-22 23:35                             ` Jakub Narebski
  2007-10-22 18:06                           ` Daniel Barkalow
  1 sibling, 2 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-22 14:31 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Jakub Narebski, Steffen Prohaska, Federico Mena Quintero, git

Johannes Schindelin wrote:
> Hi,
> 
> On Mon, 22 Oct 2007, Andreas Ericsson wrote:
> 
>> If I were to suggest any improvements, it'd be to change the semantics of
>> git-pull to always update the local branches set up to be merged with the
>> remote tracking branches when they, prior to fetching, pointed to the same
>> commit, such that when
>>
>> $ git show-ref master
>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/heads/master
>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/remotes/origin/master
>>
>> refs/heads/master gets set to refs/remotes/origin/master post-fetch.
> 
> In general, this should fail.  Because you are expected to have local 
> changes in the local branches.


BS argument. Git knows when I haven't got any changes on my local 
branches, and it can be fairly safely assumed that when I feel like 
making any, I'd like to make them off as fresh a tip as possible unless 
I explicitly tell git otherwise.

Nice hint though. I'm working on a patch for it now but I've only looked 
at it 15 minutes over lunch today, so it'll probably be a few days.


>  What you describe suggests that you should 
> not use the branch name "master" at all, but "origin/master".
> 

No. I want the ability to commit locally without it affecting my 
upstream tracking branches, but I also want to make sure that when I 
want to work on some branch I don't frequently touch, git will make sure 
it's kept up-to-speed with the branch I explicitly have told it to merge 
with, without me having to remember if I was on that branch when I last 
did git-pull (I might not have a network connection), and without having 
to remember what I decided to call my locally-modifiable branch.


> That said, there is a pretty simple way to achieve what you want (even if 
> it does not help the confusion you create between local and remote 
> branches):
> 
> 	git config --add remote.origin.fetch master:master
> 
> Of course, when you checkout "master" and pull then, you'll get even more 
> problems, _exactly_ because you muddled up the clear distinction between 
> local and remote branches.
> 

That's not what I want at all. I must have been unclear in my original 
post. I'm talking about git doing automatically what every single user 
I've ever talked to wants it to do, which is to maintain the state of 
sync that the "local-and-modifiable" branches had with the 
"local-non-modifiable-aka-remote-tracking" branches. Note that the state 
of sync is more important to users than git never ever touching the 
branches that they *could* have (but don't have) changes on.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22  7:59                   ` Andreas Ericsson
  2007-10-22 11:04                     ` best git practices, was " Johannes Schindelin
  2007-10-22 12:26                     ` Jakub Narebski
@ 2007-10-22 14:53                     ` Federico Mena Quintero
  2007-10-22 23:27                       ` Jakub Narebski
  2 siblings, 1 reply; 161+ messages in thread
From: Federico Mena Quintero @ 2007-10-22 14:53 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: Johannes Schindelin, Jakub Narebski, git

On Mon, 2007-10-22 at 09:59 +0200, Andreas Ericsson wrote:

> I doubt many people on this list regularly use git-blame but it's a 
> command that's definitely non-trivial to script out using only the 
> "proper" commands, and CVS/SVN users expect it to be there, so it's 
> probably worth listing anyhow.

Hmmm, I don't really want to turn the "summary" thread into oodles of
sub-threads, but here goes :)

Personally I find git-blame *EXTREMELY* useful.  The workflow is:

1. Bug #12345 for FooApp gets assigned to you.

2. git-svn clone fooapp's repository

3. git checkout -b my-bugfix-branch-for-12345

4. debug debug debug

5. "WTF?  Who wrote this crappy code?"

6. git blame culprit-file.c

7. "Oh, it was $person with $commit_id... what were they thinking at the
time?"

8. git show $commit_id

9. "Oh, I see their intentions now... what was going on at that time?"

10. git log <date range around $commit_id>

11. etc.

Git-blame is very nice for code archaeology (long explanation at
http://mail.gnome.org/archives/desktop-devel-list/2007-September/msg00238.html).

> Similarly, it might be helpful to have help topics the gdb way, like 
> "git help patches".

This would be simply fantastic.  If those help topics suggested
workflows, I'd be delighted :)  Feel free to poke me if you write up
some text; I'd love to help on this.

  Federico

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 14:31                           ` Andreas Ericsson
@ 2007-10-22 15:00                             ` Johannes Schindelin
  2007-10-22 15:16                               ` Andreas Ericsson
  2007-10-22 23:35                             ` Jakub Narebski
  1 sibling, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-22 15:00 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Jakub Narebski, Steffen Prohaska, Federico Mena Quintero, git

Hi,

On Mon, 22 Oct 2007, Andreas Ericsson wrote:

> Johannes Schindelin wrote:
> 
> > On Mon, 22 Oct 2007, Andreas Ericsson wrote:
> > 
> > > If I were to suggest any improvements, it'd be to change the 
> > > semantics of git-pull to always update the local branches set up to 
> > > be merged with the remote tracking branches when they, prior to 
> > > fetching, pointed to the same commit, such that when
> > > 
> > > $ git show-ref master
> > > d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/heads/master
> > > d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/remotes/origin/master
> > > 
> > > refs/heads/master gets set to refs/remotes/origin/master post-fetch.
> > 
> > In general, this should fail.  Because you are expected to have local 
> > changes in the local branches.
> 
> 
> BS argument.

Aha.  So you want to make sure that the local branches are no longer 
"purely" local.  And you want to stop updating them when unpushed changes 
are in the local branches.

Seems I cannot help you.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 15:00                             ` Johannes Schindelin
@ 2007-10-22 15:16                               ` Andreas Ericsson
  2007-10-22 15:42                                 ` Steffen Prohaska
  2007-10-22 19:36                                 ` Federico Mena Quintero
  0 siblings, 2 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-22 15:16 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Jakub Narebski, Steffen Prohaska, Federico Mena Quintero, git

Johannes Schindelin wrote:
> Hi,
> 
> On Mon, 22 Oct 2007, Andreas Ericsson wrote:
> 
>> Johannes Schindelin wrote:
>>
>>> On Mon, 22 Oct 2007, Andreas Ericsson wrote:
>>>
>>>> If I were to suggest any improvements, it'd be to change the 
>>>> semantics of git-pull to always update the local branches set up to 
>>>> be merged with the remote tracking branches when they, prior to 
>>>> fetching, pointed to the same commit, such that when
>>>>
>>>> $ git show-ref master
>>>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/heads/master
>>>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/remotes/origin/master
>>>>
>>>> refs/heads/master gets set to refs/remotes/origin/master post-fetch.
>>> In general, this should fail.  Because you are expected to have local 
>>> changes in the local branches.
>>
>> BS argument.
> 
> Aha.  So you want to make sure that the local branches are no longer 
> "purely" local.  And you want to stop updating them when unpushed changes 
> are in the local branches.
> 

To me, it's more along the lines of "let git help me not make the 
mistake of hacking on a six-week old codebase when I've explicitly asked 
it to merge these and those remote tracking branches into these and 
those local branches". Not updating those branches when there *are* 
changes on them is something users can understand and will probably also 
appreciate, but the reason for not allowing even fast-forwards escape me.

> Seems I cannot help you.
> 

Well, I knew that much from the start so I didn't ask you to, and since 
you seem to fail to grasp what I had in mind, I'm sure you'd botch the 
implementation anyway. Thanks for not quite offering though ;-)

I'm sure you'll review the patch though, and I'm equally sure I will 
appreciate your technical comments rather a lot more than this current 
bickering about a feature it seems I can't express clearly enough in words.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summarycontinued
  2007-10-22 11:04                     ` best git practices, was " Johannes Schindelin
                                         ` (2 preceding siblings ...)
  2007-10-22 13:36                       ` Nguyen Thai Ngoc Duy
@ 2007-10-22 15:24                       ` Federico Mena Quintero
  2007-10-24  2:06                       ` best git practices, was Re: Git User's Survey 2007 unfinished summary continued Jakub Narebski
  4 siblings, 0 replies; 161+ messages in thread
From: Federico Mena Quintero @ 2007-10-22 15:24 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Andreas Ericsson, Jakub Narebski, git

On Mon, 2007-10-22 at 12:04 +0100, Johannes Schindelin wrote:

> <rationale>There is a good chance that git is not optimised for most 
> people's daily workflows, as project maintainers seemed to be much more 
> forthcoming with patches, and therefore maintainers' tasks are much more 
> optimised than in other SCMs.</rationale>

The following are workflows that would be very useful for my cow-orkers
and project peers.

End-user workflows:

* Clone from another SCM (mostly svn).  Make a local branch to implement
something in various commits.  Rebase to the "latest upstream sources"
when you are done, and then do the equivalent to "svn dcommit" to upload
your final changes to the other SCM.  The use case for this is to fix a
complicated bug in GNOME, which uses SVN.

* While you are doing that, produce a patchset that you can send to the
maintainers for review.  I love "git-format-patch -n --thread --stdout >
foo", but it's pretty painful to have to 1. look up git-format-patch's
options in the man page (if you use --stdout, shouldn't -n and --thread
be turned on by default?); 2. import "foo" into Evolution to then be
able to edit the zeroth mail, and then be able to use Evo's SMTP
configuration to send out the mails while preserving the threading.

* Clone a git repository which has several interesting branches.  Figure
out which branch you are interested in.  Create a local branch based on
that; do your changes there.  Keep your code up to date (rebase?  when
to fetch / pull / etc?).

* You have a personal branch with a bunch of commits:  a mess of "real
work", "remove debugging printf", "fix typo", etc.  Reformat / reorder
those patches into something suitable for submission.  [I just found out
about git rebase --interactive and it's *FANTASTIC* for this!]

Maintainer workflows:

* Start a personal project in git and publish it for others to clone.
Assume several possible setups:  dumb web server with no git installed,
git installed but no git-daemon, git installed with git-daemon running.
I've found that publishing is not trivial at all; it's a rather
cumbersome multi-step process.

* Several of your contributors publish their own git repositories.
Integrate changes from them, or review them.  This interesting because
you'll have to do a lot of navigation in repos with which you aren't
familiar, you'll have to use the merging and conflict resolution tools,
you'll have to maintain the signoffs, etc.

* Set up a public repository to which other people can push.

* Publish just some of your branches.  Do that often, say, because you
have new work to show in each of those branches.

  Federico

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 15:16                               ` Andreas Ericsson
@ 2007-10-22 15:42                                 ` Steffen Prohaska
  2007-10-22 19:36                                 ` Federico Mena Quintero
  1 sibling, 0 replies; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-22 15:42 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Johannes Schindelin, Jakub Narebski, Federico Mena Quintero, git


On Oct 22, 2007, at 5:16 PM, Andreas Ericsson wrote:

> Johannes Schindelin wrote:
>> Hi,
>> On Mon, 22 Oct 2007, Andreas Ericsson wrote:
>>> Johannes Schindelin wrote:
>>>
>>>> On Mon, 22 Oct 2007, Andreas Ericsson wrote:
>>>>
>>>>> If I were to suggest any improvements, it'd be to change the  
>>>>> semantics of git-pull to always update the local branches set  
>>>>> up to be merged with the remote tracking branches when they,  
>>>>> prior to fetching, pointed to the same commit, such that when
>>>>>
>>>>> $ git show-ref master
>>>>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/heads/master
>>>>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/remotes/origin/ 
>>>>> master
>>>>>
>>>>> refs/heads/master gets set to refs/remotes/origin/master post- 
>>>>> fetch.
>>>> In general, this should fail.  Because you are expected to have  
>>>> local changes in the local branches.
>>>
>>> BS argument.
>> Aha.  So you want to make sure that the local branches are no  
>> longer "purely" local.  And you want to stop updating them when  
>> unpushed changes are in the local branches.
>
> To me, it's more along the lines of "let git help me not make the  
> mistake of hacking on a six-week old codebase when I've explicitly  
> asked it to merge these and those remote tracking branches into  
> these and those local branches". Not updating those branches when  
> there *are* changes on them is something users can understand and  
> will probably also appreciate, but the reason for not allowing even  
> fast-forwards escape me.

Here's also an interesting asymmetry. By default, git push
updates all remote branches matching a local branch. But git
pull "updates" only the current local branch to the state of
the remote head (by updating all local copies of the remote
branches, but merging only a single of these heads).

Maybe this asymmetry adds to the confusion. I see arguments
for both behaviours:
1) In both cases, update only the branch you're on
or
2) in both cases update all matching branches.
(btw, if I do not intend to merge at all, you can always use
"git fetch".)

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 13:38                         ` Johannes Schindelin
@ 2007-10-22 17:48                           ` Robin Rosenberg
  0 siblings, 0 replies; 161+ messages in thread
From: Robin Rosenberg @ 2007-10-22 17:48 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Wincent Colaiuta, Andreas Ericsson, Jakub Narebski,
	Steffen Prohaska, Federico Mena Quintero, git


My list

     61 show
     35 gitk
     31 diff
     23 fetch
     12 reset
     12 blame
     11 clone
     11 checkout
     10 remote
     10 rebase
      9 status
      5 commit
      4 branch
      3 clean
      2 revert
      2 merge
      2 ls-remote
      2 gui

-- robin

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 13:48                         ` Johannes Schindelin
  2007-10-22 14:31                           ` Andreas Ericsson
@ 2007-10-22 18:06                           ` Daniel Barkalow
  1 sibling, 0 replies; 161+ messages in thread
From: Daniel Barkalow @ 2007-10-22 18:06 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Andreas Ericsson, Jakub Narebski, Steffen Prohaska,
	Federico Mena Quintero, git

On Mon, 22 Oct 2007, Johannes Schindelin wrote:

> Hi,
> 
> On Mon, 22 Oct 2007, Andreas Ericsson wrote:
> 
> > If I were to suggest any improvements, it'd be to change the semantics of
> > git-pull to always update the local branches set up to be merged with the
> > remote tracking branches when they, prior to fetching, pointed to the same
> > commit, such that when
> > 
> > $ git show-ref master
> > d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/heads/master
> > d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/remotes/origin/master
> > 
> > refs/heads/master gets set to refs/remotes/origin/master post-fetch.
> 
> In general, this should fail.  Because you are expected to have local 
> changes in the local branches.  What you describe suggests that you should 
> not use the branch name "master" at all, but "origin/master".

If you push your changes to the origin soon after making them, you'll only 
have local changes if somebody else changed something while you were 
working on a change. You're expected to create local changes in the local 
branches, but you shouldn't generally sit on them forever, and when you've 
pushed them, you no longer have any difference in content between local 
and remote.

If the project has multiple branches in the central repository, and you 
make changes for each of them at different times, but only one each day, 
the normal case will be to have local changes sitting in at most one of 
the branches, and, in particular, no local changes left in any branch 
other than HEAD.

	-Daniel
*This .sig left intentionally blank*

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 15:16                               ` Andreas Ericsson
  2007-10-22 15:42                                 ` Steffen Prohaska
@ 2007-10-22 19:36                                 ` Federico Mena Quintero
  2007-10-22 23:21                                   ` Johannes Schindelin
  1 sibling, 1 reply; 161+ messages in thread
From: Federico Mena Quintero @ 2007-10-22 19:36 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: Johannes Schindelin, git

On Mon, 2007-10-22 at 17:16 +0200, Andreas Ericsson wrote:

> To me, it's more along the lines of "let git help me not make the 
> mistake of hacking on a six-week old codebase when I've explicitly asked 
> it to merge these and those remote tracking branches into these and 
> those local branches". Not updating those branches when there *are* 
> changes on them is something users can understand and will probably also 
> appreciate, but the reason for not allowing even fast-forwards escape me.

I'd love this behavior, FWIW.

The "branches should not track their origin by default" seems suited
only to Linux kernel maintainers who frequently pull from many different
people, not to "random hacker who wants to keep track of a project he
doesn't maintain" :)

  Federico

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-21 22:15                 ` Johannes Schindelin
  2007-10-22  7:59                   ` Andreas Ericsson
@ 2007-10-22 22:53                   ` Steven Grimm
  1 sibling, 0 replies; 161+ messages in thread
From: Steven Grimm @ 2007-10-22 22:53 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Andreas Ericsson, Jakub Narebski, Steffen Prohaska,
	Federico Mena Quintero, git

Johannes Schindelin wrote:
> I'd really like people to respond not so much with broad and general 
> statements to my mail (those statements tend to be rather useless to find 
> how to make git more suitable to newbies), but rather with concrete top 
> ten lists of what they do daily.
>   

Maybe not top 10 per se, but here are a couple of my common command 
sequences and some comments about how they could maybe be simplified. I 
mostly use git to talk to an svn repo, which in some sense is a corner 
case but which I suspect is both (a) really common already, and (b) 
potentially even *more* common if we can make git an even easier way to 
work with svn repositories.

Pulling updates from svn:

git stash
git svn rebase
git stash apply

A "git svn up" command could do the above automatically (svn users are 
accustomed to doing "svn up" with dirty working copies.)

Committing my work:

git commit -a
(ask someone for a code review, usually involves "git diff" or "git show")
git commit --amend (to indicate in my commit message who did the review)
git svn rebase
git svn dcommit

This isn't too bad as is. I could save myself the "git commit --amend" 
if there were an option to "git svn dcommit" to pop up a commit message 
editor (using the existing text as the default, of course) but it 
doesn't bother me much.

A more extreme possibility which I predict approximately 0 people on 
this list will like: if the working copy is dirty but there is no local 
commit, "git svn dcommit" could pop up an editor for a commit message, 
make a local commit, then send it to svn. That would simplify the 
git-based workflow even further for svn users who don't care about local 
versioning. I'm not sure *I* even like this idea, mind you, but it would 
certainly address the "Why this extra step I don't need in svn?" 
complaint svn users sometimes raise.

Working in a topic branch:

git checkout whateverbranch
git svn rebase
git commit -a   (a bunch of times)
git checkout -b temp trunk
git merge --squash whateverbranch
git commit
(get code review)
git commit --amend
git svn dcommit

This could be shortened a bit with the above idea (edit commit message) 
plus an option to git-svn dcommit to squash everything into one svn commit.

Of course, whether adding more options like that would make things more 
newbie-friendly is a valid question in and of itself; a shorter workflow 
is not necessarily a more discoverable one.

-Steve

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 19:36                                 ` Federico Mena Quintero
@ 2007-10-22 23:21                                   ` Johannes Schindelin
  2007-10-25 19:04                                     ` Carl Worth
  0 siblings, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-22 23:21 UTC (permalink / raw)
  To: Federico Mena Quintero; +Cc: Andreas Ericsson, git

Hi,

On Mon, 22 Oct 2007, Federico Mena Quintero wrote:

> On Mon, 2007-10-22 at 17:16 +0200, Andreas Ericsson wrote:
> 
> > To me, it's more along the lines of "let git help me not make the 
> > mistake of hacking on a six-week old codebase when I've explicitly asked 
> > it to merge these and those remote tracking branches into these and 
> > those local branches". Not updating those branches when there *are* 
> > changes on them is something users can understand and will probably also 
> > appreciate, but the reason for not allowing even fast-forwards escape me.
> 
> I'd love this behavior, FWIW.
> 
> The "branches should not track their origin by default" seems suited
> only to Linux kernel maintainers who frequently pull from many different
> people, not to "random hacker who wants to keep track of a project he
> doesn't maintain" :)

The problem I see here is not that the kernel folks would suffer, but that 
the behaviour would not be easy to explain.  Which is a sure way to not 
only give people rope, but put their heads in the noose.

Not having clear semantics is prone to lead to misunderstandings, and 
mistakes.

IOW while I trust you when you say it would make things easier for you, I 
am quite certain it would make things much harder for a substantial part 
of the rest of humanity.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 14:53                     ` Federico Mena Quintero
@ 2007-10-22 23:27                       ` Jakub Narebski
  0 siblings, 0 replies; 161+ messages in thread
From: Jakub Narebski @ 2007-10-22 23:27 UTC (permalink / raw)
  To: Federico Mena Quintero; +Cc: Andreas Ericsson, Johannes Schindelin, git

On 10/22/07, Federico Mena Quintero <federico@novell.com> wrote:
> On Mon, 2007-10-22 at 09:59 +0200, Andreas Ericsson wrote:
>
>> I doubt many people on this list regularly use git-blame but it's a
>> command that's definitely non-trivial to script out using only the
>> "proper" commands, and CVS/SVN users expect it to be there, so it's
>> probably worth listing anyhow.

> Personally I find git-blame *EXTREMELY* useful.  The workflow is:

> 5. "WTF?  Who wrote this crappy code?"
>
> 6. git blame culprit-file.c
>
> 7. "Oh, it was $person with $commit_id... what were they thinking at the
> time?"
>
> 8. git show $commit_id

You don't need blame for that (by the way, as git-blame is slow, you
can try -L option to limit range of lines; it is a pity that 'git gui
blame' does not support it yet). You can use 'pickaxe search', i.e.
"git log -S'<crappy code>'". Sometimes it is better than git-blame...

-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 14:31                           ` Andreas Ericsson
  2007-10-22 15:00                             ` Johannes Schindelin
@ 2007-10-22 23:35                             ` Jakub Narebski
  2007-10-23  5:38                               ` Steffen Prohaska
  2007-10-23  7:24                               ` Andreas Ericsson
  1 sibling, 2 replies; 161+ messages in thread
From: Jakub Narebski @ 2007-10-22 23:35 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Johannes Schindelin, Steffen Prohaska, Federico Mena Quintero, git

On 10/22/07, Andreas Ericsson <ae@op5.se> wrote:
> Johannes Schindelin wrote:
>> On Mon, 22 Oct 2007, Andreas Ericsson wrote:
>>
>>> If I were to suggest any improvements, it'd be to change the semantics of
>>> git-pull to always update the local branches set up to be merged with the
>>> remote tracking branches when they, prior to fetching, pointed to the same
>>> commit, such that when
>>>
>>> $ git show-ref master
>>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/heads/master
>>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/remotes/origin/master
>>>
>>> refs/heads/master gets set to refs/remotes/origin/master post-fetch.
>>
>> In general, this should fail.  Because you are expected to have local
>> changes in the local branches.
>
>
> BS argument. Git knows when I haven't got any changes on my local
> branches, and it can be fairly safely assumed that when I feel like
> making any, I'd like to make them off as fresh a tip as possible unless
> I explicitly tell git otherwise.
[cut]

It would be I think possible to make git behave as you want, although I'd rather
(at least at first) have behaviour described above turned on by some option
or config variable. I guess that it would be not that hard to make script to do
what you ant (and probably it would be best if you tried your idea that way).

There are the following caveats.
1. For each local branch that is to be updated on pull, this branch
must be marked as tracking some branch of some repository. This has to
be explicitely done; for example by creating those branches using
--track option.
2. Git can do a merge with conflicts _only_ if that branch is checked
out. So for all local branches which you want to get updated using
"git pull --update-all <repo>" (or something like that), the merge
with remote branch should be either fast-forward, trivial merge, or
merge without conflicts. "git pull --update-all <repo>" would return
then list of updated branches and list of branches which cannot be
updated.

So... are you going to try to implement that?
-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 23:35                             ` Jakub Narebski
@ 2007-10-23  5:38                               ` Steffen Prohaska
  2007-10-23 10:58                                 ` Johannes Schindelin
  2007-10-23  7:24                               ` Andreas Ericsson
  1 sibling, 1 reply; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-23  5:38 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: Andreas Ericsson, Johannes Schindelin, Federico Mena Quintero, git


On Oct 23, 2007, at 1:35 AM, Jakub Narebski wrote:

> On 10/22/07, Andreas Ericsson <ae@op5.se> wrote:
>> Johannes Schindelin wrote:
>>> On Mon, 22 Oct 2007, Andreas Ericsson wrote:
>>>
>>>> If I were to suggest any improvements, it'd be to change the  
>>>> semantics of
>>>> git-pull to always update the local branches set up to be merged  
>>>> with the
>>>> remote tracking branches when they, prior to fetching, pointed  
>>>> to the same
>>>> commit, such that when
>>>>
>>>> $ git show-ref master
>>>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/heads/master
>>>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/remotes/origin/master
>>>>
>>>> refs/heads/master gets set to refs/remotes/origin/master post- 
>>>> fetch.
>>>
>>> In general, this should fail.  Because you are expected to have  
>>> local
>>> changes in the local branches.
>>
>>
>> BS argument. Git knows when I haven't got any changes on my local
>> branches, and it can be fairly safely assumed that when I feel like
>> making any, I'd like to make them off as fresh a tip as possible  
>> unless
>> I explicitly tell git otherwise.
> [cut]
>
> It would be I think possible to make git behave as you want,  
> although I'd rather
> (at least at first) have behaviour described above turned on by  
> some option
> or config variable. I guess that it would be not that hard to make  
> script to do
> what you ant (and probably it would be best if you tried your idea  
> that way).
>
> There are the following caveats.
> 1. For each local branch that is to be updated on pull, this branch
> must be marked as tracking some branch of some repository. This has to
> be explicitely done; for example by creating those branches using
> --track option.

True, and only the branches matching the remote currently pulled
should be considered. Tracking branches pointing to a different
remote need to be skipped.


> 2. Git can do a merge with conflicts _only_ if that branch is checked
> out.

Andreas' proposal contains an important requirement that
avoids this problem. His proposal states "when they, prior
to fetching, pointed to the same commit [the head in remotes
pointed to]". That is only fast-forwards are needed, which
never have merge conflicts.


> So for all local branches which you want to get updated using
> "git pull --update-all <repo>" (or something like that), the merge
> with remote branch should be either fast-forward, trivial merge, or
> merge without conflicts. "git pull --update-all <repo>" would return
> then list of updated branches and list of branches which cannot be
> updated.

Maybe Andreas' proposal could be extended as you describe.
But I don't think any merging should automatically be done. I'd
only support fast forwards. Merging always includes a risk
of unexpected changes to the code; even if there are no merge
conflicts detected by git. I think it is reasonable to leave
all such cases to the user for manual resolution. Supporting
fast-forward should be sufficient.

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 23:35                             ` Jakub Narebski
  2007-10-23  5:38                               ` Steffen Prohaska
@ 2007-10-23  7:24                               ` Andreas Ericsson
  1 sibling, 0 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-23  7:24 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: Johannes Schindelin, Steffen Prohaska, Federico Mena Quintero, git

Jakub Narebski wrote:
> On 10/22/07, Andreas Ericsson <ae@op5.se> wrote:
>> Johannes Schindelin wrote:
>>> On Mon, 22 Oct 2007, Andreas Ericsson wrote:
>>>
>>>> If I were to suggest any improvements, it'd be to change the semantics of
>>>> git-pull to always update the local branches set up to be merged with the
>>>> remote tracking branches when they, prior to fetching, pointed to the same
>>>> commit, such that when
>>>>
>>>> $ git show-ref master
>>>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/heads/master
>>>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/remotes/origin/master
>>>>
>>>> refs/heads/master gets set to refs/remotes/origin/master post-fetch.
>>> In general, this should fail.  Because you are expected to have local
>>> changes in the local branches.
>>
>> BS argument. Git knows when I haven't got any changes on my local
>> branches, and it can be fairly safely assumed that when I feel like
>> making any, I'd like to make them off as fresh a tip as possible unless
>> I explicitly tell git otherwise.
> [cut]
> 
> It would be I think possible to make git behave as you want, although I'd rather
> (at least at first) have behaviour described above turned on by some option
> or config variable. I guess that it would be not that hard to make script to do
> what you ant (and probably it would be best if you tried your idea that way).
> 
> There are the following caveats.
> 1. For each local branch that is to be updated on pull, this branch
> must be marked as tracking some branch of some repository. This has to
> be explicitely done; for example by creating those branches using
> --track option.
> 2. Git can do a merge with conflicts _only_ if that branch is checked
> out. So for all local branches which you want to get updated using
> "git pull --update-all <repo>" (or something like that), the merge
> with remote branch should be either fast-forward, trivial merge, or
> merge without conflicts. "git pull --update-all <repo>" would return
> then list of updated branches and list of branches which cannot be
> updated.
> 
> So... are you going to try to implement that?

Yes, but only for fast-forward cases. When there *are* local changes, 
the user must decide when to merge those, since he/she may not be done 
with them. It doesn't make sense to merge local canges on a not checked 
out branch automagically, because then we end up in the very unclear 
semantics that Dscho (and myself) fear.

Also, as Steffen pointed out in his mail, this will make "git pull" 
largely symmetrical with "git push", which *does* update all the remote 
branches, but only if the update results in a fast-forward.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-23  5:38                               ` Steffen Prohaska
@ 2007-10-23 10:58                                 ` Johannes Schindelin
  2007-10-24 18:48                                   ` Steffen Prohaska
  0 siblings, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-23 10:58 UTC (permalink / raw)
  To: Steffen Prohaska
  Cc: Jakub Narebski, Andreas Ericsson, Federico Mena Quintero, git

Hi,

On Tue, 23 Oct 2007, Steffen Prohaska wrote:

> 
> On Oct 23, 2007, at 1:35 AM, Jakub Narebski wrote:
> 
> > 2. Git can do a merge with conflicts _only_ if that branch is checked 
> > out.
> 
> Andreas' proposal contains an important requirement that avoids this 
> problem. His proposal states "when they, prior to fetching, pointed to 
> the same commit [the head in remotes pointed to]". That is only 
> fast-forwards are needed, which never have merge conflicts.

You know what I do not like with this proposal?  The whole _point_ of this 
discussion is to make git _easier_.  Go ahead, try to explain to a 
complete git newbie the proposed behaviour.  I have a pound here which 
says that there is _no_ _way_ that this newbie says "well, that's easy".

Some people may not get this, but git has a reputation of being 
complicated, and my "BS" argument was, is, and will be, that we should 
keep clear and simple semantics, because they are the _only_ way to battle 
that reputation.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 13:17                       ` Wincent Colaiuta
  2007-10-22 13:33                         ` David Symonds
  2007-10-22 13:38                         ` Johannes Schindelin
@ 2007-10-23 22:13                         ` Alex Riesen
  2 siblings, 0 replies; 161+ messages in thread
From: Alex Riesen @ 2007-10-23 22:13 UTC (permalink / raw)
  To: Wincent Colaiuta
  Cc: Johannes Schindelin, Andreas Ericsson, Jakub Narebski,
	Steffen Prohaska, Federico Mena Quintero, git

Wincent Colaiuta, Mon, Oct 22, 2007 15:17:19 +0200:
>
>> So once again, what operations involving git do people use regularly?
>
> Here are my top ten commands, sorted by the number of times they appear in 
> my ~/.bash_history:

from my (short, 500) .bash_history:

     26 am
     22 gitk
     21 fetch
     15 reset
     10 log
      9 merge
      8 cherry-pick
      7 status
      5 commit
      4 svn
      4 push
      4 gc
      4 diff
      3 gui
      3 format-patch
      2 pull
      2 clone
      1 show
      1 rebase
      1 grep
      1 cat-file
      1 branch
      1 apply

branch, cat-file and show are actually fairly common, the history just
shorted and I lost them.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 11:04                     ` best git practices, was " Johannes Schindelin
                                         ` (3 preceding siblings ...)
  2007-10-22 15:24                       ` best git practices, was Re: Git User's Survey 2007 unfinished summarycontinued Federico Mena Quintero
@ 2007-10-24  2:06                       ` Jakub Narebski
  2007-10-24 10:29                         ` Karl Hasselström
  4 siblings, 1 reply; 161+ messages in thread
From: Jakub Narebski @ 2007-10-24  2:06 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Andreas Ericsson, Steffen Prohaska, Federico Mena Quintero, git

On 10/22/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

> So once again, what operations involving git do people use regularly?
>
> <rationale>There is a good chance that git is not optimised for most
> people's daily workflows, as project maintainers seemed to be much more
> forthcoming with patches, and therefore maintainers' tasks are much more
> optimised than in other SCMs.</rationale>

For working on gitweb in git.git repository.
1. Fetch (when I am on topic branch) or pull (in rare cases I am on master)
2. "stg rebase origin"
3. work, work, work, using StGIT to generate perfect patch series
(going back and forth between patches, reordering patches, adding
patch in the middle of series, concatenating two patches, etc.; for
example when I notice that something should be changed in previous
patch, be it either bug noticed just now, or change in preparatory
patch to better suit main one)
4. fetch and rebase just between publishing
5. git format-patch to generate patch series; use git-shortlog or
grepping for patches subjects and git-diff --stat to generate
introductory email. Unfortunately StGIT template for introductory
email does have neither shortlog nor diffstat fields to atomatically
fill. Add comments to patches if needed.
6. Either use KMail + attach inline (no word wrap), or git-send-mail
(with sendmail configured to use gmail account; now I could use simply
git-send-mail configuration in user config) to send patches to git
mailing list
7. Push changes (if I don't forget) to repo.or.cz repository (jnareb-git.git).

-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24  2:06                       ` best git practices, was Re: Git User's Survey 2007 unfinished summary continued Jakub Narebski
@ 2007-10-24 10:29                         ` Karl Hasselström
  2007-10-24 11:04                           ` Jakub Narebski
  0 siblings, 1 reply; 161+ messages in thread
From: Karl Hasselström @ 2007-10-24 10:29 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: Johannes Schindelin, Andreas Ericsson, Steffen Prohaska,
	Federico Mena Quintero, git

On 2007-10-24 04:06:38 +0200, Jakub Narebski wrote:

> 5. git format-patch to generate patch series; use git-shortlog or
> grepping for patches subjects and git-diff --stat to generate
> introductory email. Unfortunately StGIT template for introductory
> email does have neither shortlog nor diffstat fields to atomatically
> fill.

It does now! (I don't think it's in any released version yet, though.)

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 10:29                         ` Karl Hasselström
@ 2007-10-24 11:04                           ` Jakub Narebski
  2007-10-24 11:31                             ` Karl Hasselström
  2007-10-24 13:15                             ` Catalin Marinas
  0 siblings, 2 replies; 161+ messages in thread
From: Jakub Narebski @ 2007-10-24 11:04 UTC (permalink / raw)
  To: Karl Hasselström
  Cc: Johannes Schindelin, Andreas Ericsson, Steffen Prohaska,
	Federico Mena Quintero, git

On 10/24/07, Karl Hasselström <kha@treskal.com> wrote:
> On 2007-10-24 04:06:38 +0200, Jakub Narebski wrote:
>
>> 5. git format-patch to generate patch series; use git-shortlog or
>> grepping for patches subjects and git-diff --stat to generate
>> introductory email. Unfortunately StGIT template for introductory
>> email does have neither shortlog nor diffstat fields to atomatically
>> fill.
>
> It does now! (I don't think it's in any released version yet, though.)

That is nice to hear.

By the way, there is SRPM for StGIT in
http://homepage.ntlworld.com/cmarinas/stgit/
(I need it because I have Python 2.4), but it is not listed on downloads page...

-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 11:04                           ` Jakub Narebski
@ 2007-10-24 11:31                             ` Karl Hasselström
  2007-10-24 23:27                               ` Jakub Narebski
  2007-10-24 13:15                             ` Catalin Marinas
  1 sibling, 1 reply; 161+ messages in thread
From: Karl Hasselström @ 2007-10-24 11:31 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: Johannes Schindelin, Andreas Ericsson, Steffen Prohaska,
	Federico Mena Quintero, git, Catalin Marinas

On 2007-10-24 13:04:01 +0200, Jakub Narebski wrote:

> By the way, there is SRPM for StGIT in
> http://homepage.ntlworld.com/cmarinas/stgit/ (I need it because I
> have Python 2.4), but it is not listed on downloads page...

I'll leave the webpage question to Catalin, but I'm curious about the
Python version remark. What exactly is the problem?

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 11:04                           ` Jakub Narebski
  2007-10-24 11:31                             ` Karl Hasselström
@ 2007-10-24 13:15                             ` Catalin Marinas
  1 sibling, 0 replies; 161+ messages in thread
From: Catalin Marinas @ 2007-10-24 13:15 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: Karl Hasselström, Johannes Schindelin, Andreas Ericsson,
	Steffen Prohaska, Federico Mena Quintero, git

On Wed, 2007-10-24 at 13:04 +0200, Jakub Narebski wrote:
> On 10/24/07, Karl Hasselström <kha@treskal.com> wrote:
> > On 2007-10-24 04:06:38 +0200, Jakub Narebski wrote:
> >
> >> 5. git format-patch to generate patch series; use git-shortlog or
> >> grepping for patches subjects and git-diff --stat to generate
> >> introductory email. Unfortunately StGIT template for introductory
> >> email does have neither shortlog nor diffstat fields to atomatically
> >> fill.
> >
> > It does now! (I don't think it's in any released version yet, though.)
> 
> That is nice to hear.
> 
> By the way, there is SRPM for StGIT in
> http://homepage.ntlworld.com/cmarinas/stgit/
> (I need it because I have Python 2.4), but it is not listed on downloads page...

I never thought anyone would need it. I find the .tar.gz better.

BTW, what is the problem with Python 2.4? Was the RPM built for a
different version? The upcoming 0.14 release will be based on Python 2.5
but we keep the compatibility with 2.4 (we dropped 2.3).

-- 
Catalin

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-23 10:58                                 ` Johannes Schindelin
@ 2007-10-24 18:48                                   ` Steffen Prohaska
  2007-10-24 19:20                                     ` J. Bruce Fields
  0 siblings, 1 reply; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-24 18:48 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Jakub Narebski, Andreas Ericsson, Federico Mena Quintero, git


On Oct 23, 2007, at 12:58 PM, Johannes Schindelin wrote:

> On Tue, 23 Oct 2007, Steffen Prohaska wrote:
>
>>
>> On Oct 23, 2007, at 1:35 AM, Jakub Narebski wrote:
>>
>>> 2. Git can do a merge with conflicts _only_ if that branch is  
>>> checked
>>> out.
>>
>> Andreas' proposal contains an important requirement that avoids this
>> problem. His proposal states "when they, prior to fetching,  
>> pointed to
>> the same commit [the head in remotes pointed to]". That is only
>> fast-forwards are needed, which never have merge conflicts.
>
> You know what I do not like with this proposal?  The whole _point_  
> of this
> discussion is to make git _easier_.  Go ahead, try to explain to a
> complete git newbie the proposed behaviour.  I have a pound here which
> says that there is _no_ _way_ that this newbie says "well, that's  
> easy".
>
> Some people may not get this, but git has a reputation of being
> complicated, and my "BS" argument was, is, and will be, that we should
> keep clear and simple semantics, because they are the _only_ way to  
> battle
> that reputation.

I try to explain the workflow that I'd use the feature for.
Maybe an easier setup could be used to achieve the same.
Any suggestions for a simpler setup are welcome.

The workflow is used by a group of developers that all have
access to a shared repository. One major goal is to keep the
setup for most developers simple. They are new to git and
as few commands as possible should be sufficient to start
working. Besides the typical stable branches (master, next)
shared topic branches should be available that can be used
to develop and review features before they are merged to the
stable branches. Patches are not send by email.

So here's the setup:

The central shared repo is called project-shared.git and contains,
for example, the following branches:
    master
    next
    work/topicA
    work/topicB
    ...


Developers clone the repo and check out the branches they are
interested in. For example a developer may want to track next
and work on topicB:

    git clone ssh://central.example.com/project-shared.git project
    cd project
    git checkout -b next origin/next
    git checkout -b work/topicB origin/work/topicB

This is sufficient. No adding of remotes is needed. Neither
is a private repository on a server required. After cloning,
developers have all they need.

Later work/topicB has new commits and should be pushed:

    git push origin

The default behaviour of push is fine. Only matching branches
are pushed.

_But_, origin is a shared repository. Therefore branches may
have advanced and git push may report

error: remote 'refs/heads/next' is not a strict subset of local ref  
'refs/heads/next'. maybe you are not up-to-date and need to pull first?

So here's the problem. The developer didn't do anything wrong.
But git complaints with an error. Git also recommends to run
pull, so the developer runs "git pull". But this doesn't help,
because it's only updating work/topicB and "git push" will
complain with the very same error.

What you need to do is

    git checkout <local-branch>
    git pull
    git checkout <local-branch2>
    git pull
    ...

for every local branch.

This is absolutely stupid. Therefore the developer starts
to hate git, or she just starts to ignore the errors because
they don't have a real meaning most of the times. And later,
when the error could be helpful she would ignore it, too.

The problem described can only happen with a shared repository.
In a workflow that pulls from read-only repos and pushes to a
private repo that is read-only for others, such a problem cannot
happen. Because in a non-shared repository the branches cannot
be advanced by others. But in a shared repository they can.

I see two reasonable solutions:
1) "git push" only pushes the current branch.
2) "git pull" pulls all branches as proposed by Andreas.

Maybe something that I don't see is fundamentally wrong with
the setup.

Johannes, you mentioned that it is essential to distinguish
remote branches from local branches. In general, I agree. The
problem described above is 'smaller' if you have less local
branches that you're not actively working on. But I believe
it is reasonable to have more than one of them. The remotes
track everything and your local branches are a subset of things
you're interested in although you're not working on each of
the branch every day. I don't think it's reasonable to delete
a local branch immediately each time you stopped working on it.

I think root of the problem is that git is more focused on
pulling from read-only and pushing to non-shared repos. The
support for shared repos needs to be improved before it
is perfect.

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 18:48                                   ` Steffen Prohaska
@ 2007-10-24 19:20                                     ` J. Bruce Fields
  2007-10-24 19:41                                       ` Andreas Ericsson
  0 siblings, 1 reply; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-24 19:20 UTC (permalink / raw)
  To: Steffen Prohaska
  Cc: Johannes Schindelin, Jakub Narebski, Andreas Ericsson,
	Federico Mena Quintero, git

On Wed, Oct 24, 2007 at 08:48:54PM +0200, Steffen Prohaska wrote:
> The central shared repo is called project-shared.git and contains,
> for example, the following branches:
>    master
>    next
>    work/topicA
>    work/topicB
>    ...
>
>
> Developers clone the repo and check out the branches they are
> interested in. For example a developer may want to track next
> and work on topicB:
>
>    git clone ssh://central.example.com/project-shared.git project
>    cd project
>    git checkout -b next origin/next
>    git checkout -b work/topicB origin/work/topicB
>
> This is sufficient. No adding of remotes is needed. Neither
> is a private repository on a server required. After cloning,
> developers have all they need.
>
> Later work/topicB has new commits and should be pushed:
>
>    git push origin
>
> The default behaviour of push is fine. Only matching branches
> are pushed.
>
> _But_, origin is a shared repository. Therefore branches may
> have advanced and git push may report
>
> error: remote 'refs/heads/next' is not a strict subset of local ref 
> 'refs/heads/next'. maybe you are not up-to-date and need to pull first?
>
> So here's the problem. The developer didn't do anything wrong.
> But git complaints with an error. Git also recommends to run
> pull, so the developer runs "git pull". But this doesn't help,
> because it's only updating work/topicB and "git push" will
> complain with the very same error.
>
> What you need to do is
>
>    git checkout <local-branch>
>    git pull
>    git checkout <local-branch2>
>    git pull
>    ...
>
> for every local branch.

Or just

	git push origin work/topicB

since that's all you really wanted to push anyway.

> The problem described can only happen with a shared repository.
> In a workflow that pulls from read-only repos and pushes to a
> private repo that is read-only for others, such a problem cannot
> happen. Because in a non-shared repository the branches cannot
> be advanced by others. But in a shared repository they can.

Actually I push to my public repo from multiple working repositories
(because usually I work on my laptop, but sometimes I do work from a
different machine), so the above can still happen.

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 19:20                                     ` J. Bruce Fields
@ 2007-10-24 19:41                                       ` Andreas Ericsson
  2007-10-24 19:48                                         ` J. Bruce Fields
  2007-10-24 23:48                                         ` Jakub Narebski
  0 siblings, 2 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-24 19:41 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Steffen Prohaska, Johannes Schindelin, Jakub Narebski,
	Federico Mena Quintero, git

J. Bruce Fields wrote:
> On Wed, Oct 24, 2007 at 08:48:54PM +0200, Steffen Prohaska wrote:
>> The central shared repo is called project-shared.git and contains,
>> for example, the following branches:
>>    master
>>    next
>>    work/topicA
>>    work/topicB
>>    ...
>>
>>
>> Developers clone the repo and check out the branches they are
>> interested in. For example a developer may want to track next
>> and work on topicB:
>>
>>    git clone ssh://central.example.com/project-shared.git project
>>    cd project
>>    git checkout -b next origin/next
>>    git checkout -b work/topicB origin/work/topicB
>>
>> This is sufficient. No adding of remotes is needed. Neither
>> is a private repository on a server required. After cloning,
>> developers have all they need.
>>
>> Later work/topicB has new commits and should be pushed:
>>
>>    git push origin
>>
>> The default behaviour of push is fine. Only matching branches
>> are pushed.
>>
>> _But_, origin is a shared repository. Therefore branches may
>> have advanced and git push may report
>>
>> error: remote 'refs/heads/next' is not a strict subset of local ref 
>> 'refs/heads/next'. maybe you are not up-to-date and need to pull first?
>>
>> So here's the problem. The developer didn't do anything wrong.
>> But git complaints with an error. Git also recommends to run
>> pull, so the developer runs "git pull". But this doesn't help,
>> because it's only updating work/topicB and "git push" will
>> complain with the very same error.
>>
>> What you need to do is
>>
>>    git checkout <local-branch>
>>    git pull
>>    git checkout <local-branch2>
>>    git pull
>>    ...
>>
>> for every local branch.
> 
> Or just
> 
> 	git push origin work/topicB
> 
> since that's all you really wanted to push anyway.
> 

git pull. Not git push. git pull operates on one working branch
at a time (by default), whereas git push uploads and fast-forwards
all the common branches (by default). I want git pull to work like
git push.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 19:41                                       ` Andreas Ericsson
@ 2007-10-24 19:48                                         ` J. Bruce Fields
  2007-10-24 20:12                                           ` Steffen Prohaska
  2007-10-24 20:13                                           ` Andreas Ericsson
  2007-10-24 23:48                                         ` Jakub Narebski
  1 sibling, 2 replies; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-24 19:48 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Steffen Prohaska, Johannes Schindelin, Jakub Narebski,
	Federico Mena Quintero, git

On Wed, Oct 24, 2007 at 09:41:05PM +0200, Andreas Ericsson wrote:
> J. Bruce Fields wrote:
>> On Wed, Oct 24, 2007 at 08:48:54PM +0200, Steffen Prohaska wrote:
>>> The central shared repo is called project-shared.git and contains,
>>> for example, the following branches:
>>>    master
>>>    next
>>>    work/topicA
>>>    work/topicB
>>>    ...
>>>
>>>
>>> Developers clone the repo and check out the branches they are
>>> interested in. For example a developer may want to track next
>>> and work on topicB:
>>>
>>>    git clone ssh://central.example.com/project-shared.git project
>>>    cd project
>>>    git checkout -b next origin/next
>>>    git checkout -b work/topicB origin/work/topicB
>>>
>>> This is sufficient. No adding of remotes is needed. Neither
>>> is a private repository on a server required. After cloning,
>>> developers have all they need.
>>>
>>> Later work/topicB has new commits and should be pushed:
>>>
>>>    git push origin
>>>
>>> The default behaviour of push is fine. Only matching branches
>>> are pushed.
>>>
>>> _But_, origin is a shared repository. Therefore branches may
>>> have advanced and git push may report
>>>
>>> error: remote 'refs/heads/next' is not a strict subset of local ref 
>>> 'refs/heads/next'. maybe you are not up-to-date and need to pull first?
>>>
>>> So here's the problem. The developer didn't do anything wrong.
>>> But git complaints with an error. Git also recommends to run
>>> pull, so the developer runs "git pull". But this doesn't help,
>>> because it's only updating work/topicB and "git push" will
>>> complain with the very same error.
>>>
>>> What you need to do is
>>>
>>>    git checkout <local-branch>
>>>    git pull
>>>    git checkout <local-branch2>
>>>    git pull
>>>    ...
>>>
>>> for every local branch.
>> Or just
>> 	git push origin work/topicB
>> since that's all you really wanted to push anyway.
>
> git pull. Not git push. git pull operates on one working branch
> at a time (by default), whereas git push uploads and fast-forwards
> all the common branches (by default).

I understand.  I was just suggesting that if the goal was to avoid the
error message on push, then specifying the branch to push explicitly
would be a solution.

> I want git pull to work like git push.

That strikes me as a less complete solution, since it only helps in the
case where the other branches all happen to be unmodified locally (hence
can be fast-forwarded).  In other cases the "git push" will still emit a
spurious error.

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 19:48                                         ` J. Bruce Fields
@ 2007-10-24 20:12                                           ` Steffen Prohaska
  2007-10-24 20:33                                             ` J. Bruce Fields
  2007-10-24 20:13                                           ` Andreas Ericsson
  1 sibling, 1 reply; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-24 20:12 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Andreas Ericsson, Johannes Schindelin, Jakub Narebski,
	Federico Mena Quintero, git

On Oct 24, 2007, at 9:48 PM, J. Bruce Fields wrote:

>
>> I want git pull to work like git push.
>
> That strikes me as a less complete solution, since it only helps in  
> the
> case where the other branches all happen to be unmodified locally  
> (hence
> can be fast-forwarded).  In other cases the "git push" will still  
> emit a
> spurious error.

Well, but then there's something you should really think
about. Then you _have_ local changes that are not at the remote.
You need to handle them somehow. Maybe you forgot to push
earlier and now the remote advanced.

Btw, the 'new' git pull should already have reported a warning
that it failed to fast forward the local branch. git pull
should have suggested to explicitly merge the branch with
local changes.

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 19:48                                         ` J. Bruce Fields
  2007-10-24 20:12                                           ` Steffen Prohaska
@ 2007-10-24 20:13                                           ` Andreas Ericsson
  1 sibling, 0 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-24 20:13 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Steffen Prohaska, Johannes Schindelin, Jakub Narebski,
	Federico Mena Quintero, git

J. Bruce Fields wrote:
> On Wed, Oct 24, 2007 at 09:41:05PM +0200, Andreas Ericsson wrote:
>> J. Bruce Fields wrote:
>>> On Wed, Oct 24, 2007 at 08:48:54PM +0200, Steffen Prohaska wrote:
>>>> The central shared repo is called project-shared.git and contains,
>>>> for example, the following branches:
>>>>    master
>>>>    next
>>>>    work/topicA
>>>>    work/topicB
>>>>    ...
>>>>
>>>>
>>>> Developers clone the repo and check out the branches they are
>>>> interested in. For example a developer may want to track next
>>>> and work on topicB:
>>>>
>>>>    git clone ssh://central.example.com/project-shared.git project
>>>>    cd project
>>>>    git checkout -b next origin/next
>>>>    git checkout -b work/topicB origin/work/topicB
>>>>
>>>> This is sufficient. No adding of remotes is needed. Neither
>>>> is a private repository on a server required. After cloning,
>>>> developers have all they need.
>>>>
>>>> Later work/topicB has new commits and should be pushed:
>>>>
>>>>    git push origin
>>>>
>>>> The default behaviour of push is fine. Only matching branches
>>>> are pushed.
>>>>
>>>> _But_, origin is a shared repository. Therefore branches may
>>>> have advanced and git push may report
>>>>
>>>> error: remote 'refs/heads/next' is not a strict subset of local ref 
>>>> 'refs/heads/next'. maybe you are not up-to-date and need to pull first?
>>>>
>>>> So here's the problem. The developer didn't do anything wrong.
>>>> But git complaints with an error. Git also recommends to run
>>>> pull, so the developer runs "git pull". But this doesn't help,
>>>> because it's only updating work/topicB and "git push" will
>>>> complain with the very same error.
>>>>
>>>> What you need to do is
>>>>
>>>>    git checkout <local-branch>
>>>>    git pull
>>>>    git checkout <local-branch2>
>>>>    git pull
>>>>    ...
>>>>
>>>> for every local branch.
>>> Or just
>>> 	git push origin work/topicB
>>> since that's all you really wanted to push anyway.
>> git pull. Not git push. git pull operates on one working branch
>> at a time (by default), whereas git push uploads and fast-forwards
>> all the common branches (by default).
> 
> I understand.  I was just suggesting that if the goal was to avoid the
> error message on push, then specifying the branch to push explicitly
> would be a solution.
> 

A better way to avoid that error message is ofcourse to make sure one
always starts development off of the latest version of the particular
branch one wants to work on.

>> I want git pull to work like git push.
> 
> That strikes me as a less complete solution, since it only helps in the
> case where the other branches all happen to be unmodified locally (hence
> can be fast-forwarded).

For a corporate environment with multiple modules, the scenario where the
upstream is modified and the local branches aren't is more common than
anything else. The failure on push happens because developers do

git pull; # Yup, gotta do that to get the latest changes
git checkout whatever; # Here's where I want to work
work work work
git push; # ach crivens! bloody stupid git of a tool to ALWAYS BREAK!

>  In other cases the "git push" will still emit a
> spurious error.
> 

If the tool can make it happen as few times as possible, that's good
enough for me. It's a lot easier to explain to my co-workers that
their push failed because someone else worked on it simultaneously
and pushed before they did, rather than telling them that they did
the pull/checkout sequence in the wrong order.

In the one scenario, it's "oh, I see". In the other, it's "god damn
piece of shit tool". Simple as that.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 20:12                                           ` Steffen Prohaska
@ 2007-10-24 20:33                                             ` J. Bruce Fields
  2007-10-24 21:06                                               ` Andreas Ericsson
  2007-10-24 21:16                                               ` Steffen Prohaska
  0 siblings, 2 replies; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-24 20:33 UTC (permalink / raw)
  To: Steffen Prohaska
  Cc: Andreas Ericsson, Johannes Schindelin, Jakub Narebski,
	Federico Mena Quintero, git

On Wed, Oct 24, 2007 at 10:12:29PM +0200, Steffen Prohaska wrote:
> On Oct 24, 2007, at 9:48 PM, J. Bruce Fields wrote:
>
>>
>>> I want git pull to work like git push.
>>
>> That strikes me as a less complete solution, since it only helps in the
>> case where the other branches all happen to be unmodified locally (hence
>> can be fast-forwarded).  In other cases the "git push" will still emit a
>> spurious error.
>
> Well, but then there's something you should really think
> about.

Perhaps, but not necessarily; you may have some branches with local
changes that you're content to leave unpushed (and un-updated).

So the case where this proposal helps is the case where:
	- the user hasn't learned how to name individual branches on the
	  push commandline, or has learned to do so, but wants less
	  typing, and
	- the user has one or more unmodified copies of remote branches
	  lying around, and
	- the user minds being reminded that those copies are out of
	  date, and
	- the user either has no *modified* copies of local branches, or
	  has some but doesn't mind being reminded that they're out of
	  date on each push.

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 20:33                                             ` J. Bruce Fields
@ 2007-10-24 21:06                                               ` Andreas Ericsson
  2007-10-24 21:20                                                 ` J. Bruce Fields
  2007-10-24 21:28                                                 ` Peter Baumann
  2007-10-24 21:16                                               ` Steffen Prohaska
  1 sibling, 2 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-24 21:06 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Steffen Prohaska, Johannes Schindelin, Jakub Narebski,
	Federico Mena Quintero, git

J. Bruce Fields wrote:
> On Wed, Oct 24, 2007 at 10:12:29PM +0200, Steffen Prohaska wrote:
>> On Oct 24, 2007, at 9:48 PM, J. Bruce Fields wrote:
>>
>>>> I want git pull to work like git push.
>>> That strikes me as a less complete solution, since it only helps in the
>>> case where the other branches all happen to be unmodified locally (hence
>>> can be fast-forwarded).  In other cases the "git push" will still emit a
>>> spurious error.
>> Well, but then there's something you should really think
>> about.
> 
> Perhaps, but not necessarily; you may have some branches with local
> changes that you're content to leave unpushed (and un-updated).
> 

Sure, but that won't change. The only thing I'm proposing is that
local copies of remote branches are automatically fast-forwarded
on every pull, but only if

* the branch has no modifications what so ever
* the branch is set up to auto-merge with the particular branch
fetched from the particular remote

I really don't see any downsides what so ever with this. Those
of you who do, please enlighten me.

> 	- the user has one or more unmodified copies of remote branches
> 	  lying around, and

Extremely common case for a large group of users. The worst part is
that this problem can get extremely annoying pretty quickly, with a
large number of repos and a large number of branches, whereas the
one dev per repo folks will never have big worries about it.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 20:33                                             ` J. Bruce Fields
  2007-10-24 21:06                                               ` Andreas Ericsson
@ 2007-10-24 21:16                                               ` Steffen Prohaska
  1 sibling, 0 replies; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-24 21:16 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Andreas Ericsson, Johannes Schindelin, Jakub Narebski,
	Federico Mena Quintero, git


On Oct 24, 2007, at 10:33 PM, J. Bruce Fields wrote:

> On Wed, Oct 24, 2007 at 10:12:29PM +0200, Steffen Prohaska wrote:
>> On Oct 24, 2007, at 9:48 PM, J. Bruce Fields wrote:
>>
>>>
>>>> I want git pull to work like git push.
>>>
>>> That strikes me as a less complete solution, since it only helps  
>>> in the
>>> case where the other branches all happen to be unmodified locally  
>>> (hence
>>> can be fast-forwarded).  In other cases the "git push" will still  
>>> emit a
>>> spurious error.
>>
>> Well, but then there's something you should really think
>> about.
>
> Perhaps, but not necessarily; you may have some branches with local
> changes that you're content to leave unpushed (and un-updated).

Personally, I don't dare to work that way. But if you do want
to keep local changes on branches that would normally be pushed
but you do not want to push them now, you must not call "git
push" without arguments in the first place. Then you'll never
see the error emitted by push.

I put local changes that I do not intend to change right away
on a special branch for/<branch>. I only merge them to <branch>
if I decided to push them, and then I push them soon (maybe
after I prepared more branches and then push all at once).


> So the case where this proposal helps is the case where:
> 	- the user hasn't learned how to name individual branches on the
> 	  push commandline, or has learned to do so, but wants less
> 	  typing, and

Well, as I wrote above "git push" is a too sharp knife for
me. I _never_ have local changes that I don't intend to push.
So "git push" always does the right thing for me.


> 	- the user has one or more unmodified copies of remote branches
> 	  lying around, and
> 	- the user minds being reminded that those copies are out of
> 	  date, and
> 	- the user either has no *modified* copies of local branches, or
> 	  has some but doesn't mind being reminded that they're out of
> 	  date on each push.

I see your point. These are may requirements to make the
proposed behaviour of "git pull" useful. But I'd recommend to
use git exactly as you described when working with a shared
repository:

Just use "git pull" and "git push" and everything will be fine
if you work as follows:
- Use the same branch names that are used on the origin.
- Only check out branches locally that you are especially interested in.
- Only put changes on those branches if you intend to push them.
- Use "git pull" before you start to prepare branches for
   "git push".
- Keep you privat work on branches that are named differently
   from branches in the shared repository.

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 21:06                                               ` Andreas Ericsson
@ 2007-10-24 21:20                                                 ` J. Bruce Fields
  2007-10-24 21:28                                                 ` Peter Baumann
  1 sibling, 0 replies; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-24 21:20 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Steffen Prohaska, Johannes Schindelin, Jakub Narebski,
	Federico Mena Quintero, git

On Wed, Oct 24, 2007 at 11:06:24PM +0200, Andreas Ericsson wrote:
> J. Bruce Fields wrote:
>> On Wed, Oct 24, 2007 at 10:12:29PM +0200, Steffen Prohaska wrote:
>>> On Oct 24, 2007, at 9:48 PM, J. Bruce Fields wrote:
>>>
>>>>> I want git pull to work like git push.
>>>> That strikes me as a less complete solution, since it only helps in the
>>>> case where the other branches all happen to be unmodified locally (hence
>>>> can be fast-forwarded).  In other cases the "git push" will still emit a
>>>> spurious error.
>>> Well, but then there's something you should really think
>>> about.
>> Perhaps, but not necessarily; you may have some branches with local
>> changes that you're content to leave unpushed (and un-updated).
>
> Sure, but that won't change. The only thing I'm proposing is that
> local copies of remote branches are automatically fast-forwarded
> on every pull, but only if
>
> * the branch has no modifications what so ever
> * the branch is set up to auto-merge with the particular branch
> fetched from the particular remote
>
> I really don't see any downsides what so ever with this. Those
> of you who do, please enlighten me.

The downsides are that it makes the behavior of pull slightly more
complicated, and that it changes long-established default behavior of a
major subcommand.  (Those aren't huge disadvantages, but they are
disadvantages.)

>
>> 	- the user has one or more unmodified copies of remote branches
>> 	  lying around, and
>
> Extremely common case for a large group of users.

OK, but that was one part of a four-"and" clause.  I don't see any
absolute clincher here, but on balance I think the disadvantages win
out.

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 21:06                                               ` Andreas Ericsson
  2007-10-24 21:20                                                 ` J. Bruce Fields
@ 2007-10-24 21:28                                                 ` Peter Baumann
  2007-10-24 21:47                                                   ` Steffen Prohaska
  2007-10-24 21:54                                                   ` best git practices, was Re: Git User's Survey 2007 unfinished summary continued Andreas Ericsson
  1 sibling, 2 replies; 161+ messages in thread
From: Peter Baumann @ 2007-10-24 21:28 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: J. Bruce Fields, Steffen Prohaska, Johannes Schindelin,
	Jakub Narebski, Federico Mena Quintero, git

On Wed, Oct 24, 2007 at 11:06:24PM +0200, Andreas Ericsson wrote:
> J. Bruce Fields wrote:
>> On Wed, Oct 24, 2007 at 10:12:29PM +0200, Steffen Prohaska wrote:
>>> On Oct 24, 2007, at 9:48 PM, J. Bruce Fields wrote:
>>>
>>>>> I want git pull to work like git push.
>>>> That strikes me as a less complete solution, since it only helps in the
>>>> case where the other branches all happen to be unmodified locally (hence
>>>> can be fast-forwarded).  In other cases the "git push" will still emit a
>>>> spurious error.
>>> Well, but then there's something you should really think
>>> about.
>> Perhaps, but not necessarily; you may have some branches with local
>> changes that you're content to leave unpushed (and un-updated).
>
> Sure, but that won't change. The only thing I'm proposing is that
> local copies of remote branches are automatically fast-forwarded
> on every pull, but only if
>
> * the branch has no modifications what so ever
> * the branch is set up to auto-merge with the particular branch
> fetched from the particular remote
>
> I really don't see any downsides what so ever with this. Those
> of you who do, please enlighten me.
>

You can't check what got added in your pull, e.g you can't review the new
code with something like

	gitk next..origin/next

I often do something like this, just to see what got changed. So at least
in my opinion you have to add a third point:

  * the branch has no modifications what so ever
  * the branch is set up to auto-merge with the particular branch
    fetched from the particular remote
				AND
  * the user set a config option to always autofastfoward if the above
    conditions are true! This could be implemented as a global option with
    a per branch overwrite.

Only if this option is added so a user can mark a branch to never
autofastforward (but it is still possible to  have an auto-merge config) you won't
loose valuable information.

-Peter

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 21:28                                                 ` Peter Baumann
@ 2007-10-24 21:47                                                   ` Steffen Prohaska
  2007-10-24 22:14                                                     ` Johannes Schindelin
  2007-10-24 21:54                                                   ` best git practices, was Re: Git User's Survey 2007 unfinished summary continued Andreas Ericsson
  1 sibling, 1 reply; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-24 21:47 UTC (permalink / raw)
  To: Peter Baumann
  Cc: Andreas Ericsson, J. Bruce Fields, Johannes Schindelin,
	Jakub Narebski, Federico Mena Quintero, git


On Oct 24, 2007, at 11:28 PM, Peter Baumann wrote:

> On Wed, Oct 24, 2007 at 11:06:24PM +0200, Andreas Ericsson wrote:
>> J. Bruce Fields wrote:
>>> On Wed, Oct 24, 2007 at 10:12:29PM +0200, Steffen Prohaska wrote:
>>>> On Oct 24, 2007, at 9:48 PM, J. Bruce Fields wrote:
>>>>
>>>>>> I want git pull to work like git push.
>>>>> That strikes me as a less complete solution, since it only  
>>>>> helps in the
>>>>> case where the other branches all happen to be unmodified  
>>>>> locally (hence
>>>>> can be fast-forwarded).  In other cases the "git push" will  
>>>>> still emit a
>>>>> spurious error.
>>>> Well, but then there's something you should really think
>>>> about.
>>> Perhaps, but not necessarily; you may have some branches with local
>>> changes that you're content to leave unpushed (and un-updated).
>>
>> Sure, but that won't change. The only thing I'm proposing is that
>> local copies of remote branches are automatically fast-forwarded
>> on every pull, but only if
>>
>> * the branch has no modifications what so ever
>> * the branch is set up to auto-merge with the particular branch
>> fetched from the particular remote
>>
>> I really don't see any downsides what so ever with this. Those
>> of you who do, please enlighten me.
>>
>
> You can't check what got added in your pull, e.g you can't review  
> the new
> code with something like
>
> 	gitk next..origin/next

You're not forced to pull. Just use "git fetch" if you
want to do this. Or is something missing if you'd be
limited to "git fetch"?


> I often do something like this, just to see what got changed. So at  
> least
> in my opinion you have to add a third point:
>
>   * the branch has no modifications what so ever
>   * the branch is set up to auto-merge with the particular branch
>     fetched from the particular remote
> 				AND
>   * the user set a config option to always autofastfoward if the above
>     conditions are true! This could be implemented as a global  
> option with
>     a per branch overwrite.

I (and, as I understood, Andreas, too) want to change the
default. Because we believe that git would be easier to use
in workflows based on a shared repository.

But if we fail to convince the list, maybe a global
configuration variable that configures "git pull" to autoforward
branches as propose would be a nearly equally good solution.

However, I think it is dangerous to introduce many of such
configuration options. Explaining the behaviour of git will
become harder. The behaviour will become dependent on the
local configuration and eventually the first question before
answering a question will be "send me the output of 'git config
--list'. I need to see how your git is configured."

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 21:28                                                 ` Peter Baumann
  2007-10-24 21:47                                                   ` Steffen Prohaska
@ 2007-10-24 21:54                                                   ` Andreas Ericsson
  2007-10-24 22:17                                                     ` Johannes Schindelin
  2007-10-25  7:26                                                     ` Peter Baumann
  1 sibling, 2 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-24 21:54 UTC (permalink / raw)
  To: Peter Baumann
  Cc: J. Bruce Fields, Steffen Prohaska, Johannes Schindelin,
	Jakub Narebski, Federico Mena Quintero, git

Peter Baumann wrote:
> On Wed, Oct 24, 2007 at 11:06:24PM +0200, Andreas Ericsson wrote:
>> J. Bruce Fields wrote:
>>> On Wed, Oct 24, 2007 at 10:12:29PM +0200, Steffen Prohaska wrote:
>>>> On Oct 24, 2007, at 9:48 PM, J. Bruce Fields wrote:
>>>>
>>>>>> I want git pull to work like git push.
>>>>> That strikes me as a less complete solution, since it only helps in the
>>>>> case where the other branches all happen to be unmodified locally (hence
>>>>> can be fast-forwarded).  In other cases the "git push" will still emit a
>>>>> spurious error.
>>>> Well, but then there's something you should really think
>>>> about.
>>> Perhaps, but not necessarily; you may have some branches with local
>>> changes that you're content to leave unpushed (and un-updated).
>> Sure, but that won't change. The only thing I'm proposing is that
>> local copies of remote branches are automatically fast-forwarded
>> on every pull, but only if
>>
>> * the branch has no modifications what so ever
>> * the branch is set up to auto-merge with the particular branch
>> fetched from the particular remote
>>
>> I really don't see any downsides what so ever with this. Those
>> of you who do, please enlighten me.
>>
> 
> You can't check what got added in your pull, e.g you can't review the new
> code with something like
> 
> 	gitk next..origin/next
> 

That's what git-fetch is for.

> I often do something like this, just to see what got changed. So at least
> in my opinion you have to add a third point:
> 
>   * the branch has no modifications what so ever
>   * the branch is set up to auto-merge with the particular branch
>     fetched from the particular remote
> 				AND
>   * the user set a config option to always autofastfoward if the above
>     conditions are true! This could be implemented as a global option with
>     a per branch overwrite.
> 

I'd be fine with that, except I think it's fairly dangerous to have
different defaults. The two first points are sort of the core of the
case I've been arguing all along.

> Only if this option is added so a user can mark a branch to never
> autofastforward (but it is still possible to  have an auto-merge config) you won't
> loose valuable information.
> 

Sure. I was thinking something along these lines:

[branch "foo"]
	remote = bar
	merge = some-branch
	autofastforward = false


Or use git-fetch. git-pull is "fetch + merge". Conceptually, I don't
think it'll be any problem what so ever telling anyone that the branches
that aren't currently checked out get merged automatically only if they
result in a fast-forward.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 21:47                                                   ` Steffen Prohaska
@ 2007-10-24 22:14                                                     ` Johannes Schindelin
  2007-10-24 22:33                                                       ` Steffen Prohaska
  2007-10-25 16:06                                                       ` Federico Mena Quintero
  0 siblings, 2 replies; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-24 22:14 UTC (permalink / raw)
  To: Steffen Prohaska
  Cc: Peter Baumann, Andreas Ericsson, J. Bruce Fields, Jakub Narebski,
	Federico Mena Quintero, git

Hi,

On Wed, 24 Oct 2007, Steffen Prohaska wrote:

> On Oct 24, 2007, at 11:28 PM, Peter Baumann wrote:
> 
> > You can't check what got added in your pull, e.g you can't review the 
> > new code with something like
> > 
> > 	gitk next..origin/next
> 
> You're not forced to pull. Just use "git fetch" if you want to do this. 
> Or is something missing if you'd be limited to "git fetch"?

I am more concerned about having very fuzzy meanings of our nomenclature. 
As of now, "pull = fetch + merge".  You want to change that, and I am sure 
that it is harder to explain, Andreas' insistence on my being wrong 
notwithstanding.

Whenever I told people "pull = fetch + merge", they got it.  Often I would 
start a talk about git by introducing distributed development.  By stating 
that working in a working directory is already forking, only without 
commiting.  Then I'd go into details, by saying that there are multiple 
repositories, and that you can update local copies of the remote branches 
by "git fetch".  And you can merge by "git merge".  And then I would write 
down on the blackboard -- the first written thing in my talk! -- pull = 
fetch + merge.

My "pupils" _always_ liked the preciseness of the nomenclature.  And they 
made many less mistakes because they had a clear mental model of what is 
remote, and what is local.  And that local branches are always forks.

> > I often do something like this, just to see what got changed. So at 
> > least in my opinion you have to add a third point:
> > 
> >  * the branch has no modifications what so ever
> >  * the branch is set up to auto-merge with the particular branch
> >    fetched from the particular remote
> > 				AND
> >  * the user set a config option to always autofastfoward if the above
> >    conditions are true! This could be implemented as a global option with
> >    a per branch overwrite.
> 
> I (and, as I understood, Andreas, too) want to change the default. 
> Because we believe that git would be easier to use in workflows based on 
> a shared repository.

And here I have to disagree strongly.  In a workflow based on a shared 
repository, you do not want to merge.  You want to rebase.  First thing 
you do when switching to another branch is fetch + rebase (that's why I 
want an option to "pull --rebase" other branches).

But _even if_ you merge instead of rebase, I fail to see how the current 
situation is different from CVS (which many people maintain is _easier_ 
than gi), where first thing you do is to "cvs update".  Just for git it is 
"git pull".

But I think I have to drive my message home again: if what you desire 
becomes reality, you take away the clear distinction between local 
and remote branches.  In fact, those branches are neither local (because 
the next pull will automatically update them with remote changes, but 
_only_ if they fast-forward) nor remote (because you plan to work on them 
locally).

But here is a proposal which should make you and your developers happy, 
_and_ should be even easier to explain:

Work with topic branches.  And when you're done, delete them.

So the beginning of the day could look like this:

	git fetch
	git checkout -b todays-topic origin/master

	[hack hack hack]
	[test test test]
	[debug debug debug]
	[occasionally commit]
	[occasionally git rebase -i origin/master]

and the end of the topic

	git branch -M master
	git push origin master

If you should not be ready to push by the end of the day, no need to 
worry.  Just stay on that topic branch, and before pushing, do

	git fetch
	git rebase origin/master

In _every_ case where I explained git, I found that people appreciated the 
two-step procedures (like you will find in the examples I showed you 
above): one git command to work locally, and one to push/fetch to/from 
origin.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 21:54                                                   ` best git practices, was Re: Git User's Survey 2007 unfinished summary continued Andreas Ericsson
@ 2007-10-24 22:17                                                     ` Johannes Schindelin
  2007-10-25  8:07                                                       ` Andreas Ericsson
  2007-10-25  7:26                                                     ` Peter Baumann
  1 sibling, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-24 22:17 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Peter Baumann, J. Bruce Fields, Steffen Prohaska, Jakub Narebski,
	Federico Mena Quintero, git

Hi,

On Wed, 24 Oct 2007, Andreas Ericsson wrote:

> Conceptually, I don't think it'll be any problem what so ever telling 
> anyone that the branches that aren't currently checked out get merged 
> automatically only if they result in a fast-forward.

It would be a matter of seconds until someone asks "why only 
fast-forwards?  Would it not be _much_ better to merge _always_?  Stupid 
git."

And all because the concept of "local" vs "remote" was blurred.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 22:14                                                     ` Johannes Schindelin
@ 2007-10-24 22:33                                                       ` Steffen Prohaska
  2007-10-24 22:38                                                         ` J. Bruce Fields
  2007-10-24 23:28                                                         ` Johannes Schindelin
  2007-10-25 16:06                                                       ` Federico Mena Quintero
  1 sibling, 2 replies; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-24 22:33 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Peter Baumann, Andreas Ericsson, J. Bruce Fields, Jakub Narebski,
	Federico Mena Quintero, git


On Oct 25, 2007, at 12:14 AM, Johannes Schindelin wrote:

> And here I have to disagree strongly.  In a workflow based on a shared
> repository, you do not want to merge.  You want to rebase.  First  
> thing
> you do when switching to another branch is fetch + rebase (that's  
> why I
> want an option to "pull --rebase" other branches).
>
> But _even if_ you merge instead of rebase, I fail to see how the  
> current
> situation is different from CVS (which many people maintain is  
> _easier_
> than gi), where first thing you do is to "cvs update".  Just for  
> git it is
> "git pull".
>
> But I think I have to drive my message home again: if what you desire
> becomes reality, you take away the clear distinction between local
> and remote branches.  In fact, those branches are neither local  
> (because
> the next pull will automatically update them with remote changes, but
> _only_ if they fast-forward) nor remote (because you plan to work  
> on them
> locally).

Exactly, because I do not work on those branches alone. These
are _shared_ branches. I can work on such a branch with a
group of developers. I'm willing to accept this bit of chaos.

Your rebase workflow is not possible if more than one dev wants
to work on the topic branch together.

Eventually you can linearize such a topic branch using rebase.
But you need to agree first that everyone else needs to delete
the branch.



> But here is a proposal which should make you and your developers  
> happy,
> _and_ should be even easier to explain:
>
> Work with topic branches.  And when you're done, delete them.

Again, if you want to share the topic branch the situation gets
more complex.

I absolutely agree that for purely local work topic branches that
are deleted before pushing are a good solution.


> So the beginning of the day could look like this:
>
> 	git fetch
> 	git checkout -b todays-topic origin/master
>
> 	[hack hack hack]
> 	[test test test]
> 	[debug debug debug]
> 	[occasionally commit]
> 	[occasionally git rebase -i origin/master]
>
> and the end of the topic
>
> 	git branch -M master
> 	git push origin master
>
> If you should not be ready to push by the end of the day, no need to
> worry.  Just stay on that topic branch, and before pushing, do
>
> 	git fetch
> 	git rebase origin/master
>
> In _every_ case where I explained git, I found that people  
> appreciated the
> two-step procedures (like you will find in the examples I showed you
> above): one git command to work locally, and one to push/fetch to/from
> origin.

Maybe. I know git quite well now and in a shared workflow "git pull"
with auto-fast-forward would help me. I often need to run "for each
local branch: git checkout ; git merge" to get rid of the errors
reported by "git push".

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 22:33                                                       ` Steffen Prohaska
@ 2007-10-24 22:38                                                         ` J. Bruce Fields
  2007-10-24 22:51                                                           ` Steffen Prohaska
  2007-10-24 23:28                                                         ` Johannes Schindelin
  1 sibling, 1 reply; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-24 22:38 UTC (permalink / raw)
  To: Steffen Prohaska
  Cc: Johannes Schindelin, Peter Baumann, Andreas Ericsson,
	Jakub Narebski, Federico Mena Quintero, git

On Thu, Oct 25, 2007 at 12:33:37AM +0200, Steffen Prohaska wrote:
> Maybe. I know git quite well now and in a shared workflow "git pull"
> with auto-fast-forward would help me. I often need to run "for each
> local branch: git checkout ; git merge" to get rid of the errors
> reported by "git push".

Hm.  There's gotta be more efficient ways to do that.  Maybe "git push .
origin/branch:branch" for each local "branch"?

But I'm still a little confused why you don't just want to "git push
name-of-branch" and avoid the whole problem.

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 22:38                                                         ` J. Bruce Fields
@ 2007-10-24 22:51                                                           ` Steffen Prohaska
  0 siblings, 0 replies; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-24 22:51 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Johannes Schindelin, Peter Baumann, Andreas Ericsson,
	Jakub Narebski, Federico Mena Quintero, git


On Oct 25, 2007, at 12:38 AM, J. Bruce Fields wrote:

> On Thu, Oct 25, 2007 at 12:33:37AM +0200, Steffen Prohaska wrote:
>> Maybe. I know git quite well now and in a shared workflow "git pull"
>> with auto-fast-forward would help me. I often need to run "for each
>> local branch: git checkout ; git merge" to get rid of the errors
>> reported by "git push".
>
> Hm.  There's gotta be more efficient ways to do that.  Maybe "git  
> push .
> origin/branch:branch" for each local "branch"?
>
> But I'm still a little confused why you don't just want to "git push
> name-of-branch" and avoid the whole problem.

There are two points:

- The current implementation of "git push" creates a remote branch
   if it does not yet exist. I want a safety net: "git push" only pushes
   if the remote branch already exists. In a sense "git push" is safer
   than "git push branch-with-typo". I use "git push branchname"
   exclusively for _creating_ new branches on the remote.

- Sometimes I updated two local branches and want to push. "git push"
   just works.

I started to believe that "git push" should always do the right
thing. Maybe it is not possible, but actually "git push" always
does the right thing for me if I ignore the error messages
about local branches that need merging. I tend to merge all
such branches right away, although it is a bit of a hassel.
Otherwise, there will be a day I'll miss an important error.

What concerns me more is how to explain the behaviour to others.
Right now, I can't tell them that "git push" just works but need
to go into a lot of details.

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 11:31                             ` Karl Hasselström
@ 2007-10-24 23:27                               ` Jakub Narebski
  2007-10-25  6:10                                 ` Karl Hasselström
  0 siblings, 1 reply; 161+ messages in thread
From: Jakub Narebski @ 2007-10-24 23:27 UTC (permalink / raw)
  To: Karl Hasselström; +Cc: git, Catalin Marinas

On 10/24/07, Karl Hasselström <kha@treskal.com> wrote:
> On 2007-10-24 13:04:01 +0200, Jakub Narebski wrote:
>
>> By the way, there is SRPM for StGIT in
>> http://homepage.ntlworld.com/cmarinas/stgit/ (I need it because I
>> have Python 2.4), but it is not listed on downloads page...
>
> I'll leave the webpage question to Catalin, but I'm curious about the
> Python version remark. What exactly is the problem?

If I remember correctly the StGIT RPM requires python 2.5
(and is build using python 2.5, so install with --force doesn't work).

BTW. SRPM is better than tar.gz because I can simply do "rpmbuild
--rebuild" to get binary RPM to install.

-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 22:33                                                       ` Steffen Prohaska
  2007-10-24 22:38                                                         ` J. Bruce Fields
@ 2007-10-24 23:28                                                         ` Johannes Schindelin
  2007-10-25  6:02                                                           ` Steffen Prohaska
  2007-10-25  7:15                                                           ` Andreas Ericsson
  1 sibling, 2 replies; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-24 23:28 UTC (permalink / raw)
  To: Steffen Prohaska
  Cc: Peter Baumann, Andreas Ericsson, J. Bruce Fields, Jakub Narebski,
	Federico Mena Quintero, git

Hi,

On Thu, 25 Oct 2007, Steffen Prohaska wrote:

> On Oct 25, 2007, at 12:14 AM, Johannes Schindelin wrote:
> 
> > But I think I have to drive my message home again: if what you desire 
> > becomes reality, you take away the clear distinction between local and 
> > remote branches.  In fact, those branches are neither local (because 
> > the next pull will automatically update them with remote changes, but 
> > _only_ if they fast-forward) nor remote (because you plan to work on 
> > them locally).
> 
> Exactly, because I do not work on those branches alone. These are 
> _shared_ branches. I can work on such a branch with a group of 
> developers. I'm willing to accept this bit of chaos.

It is not just a chaos.  I see a serious problem here.  On _your_ 
computer, you do _not_ have a shared branch.  Which is visible _even_ in 
your modified work flow when you have unpushed changes.

So your desired illusion that your local branches are anything but local 
branches will never be perfect enough.

> Your rebase workflow is not possible if more than one dev wants to work 
> on the topic branch together.

Why not?  I do it all the time.  CVS users do it all the time, for that 
matter.

> Eventually you can linearize such a topic branch using rebase. But you 
> need to agree first that everyone else needs to delete the branch.

No, you can linearize your branch already while cleaning up your local 
branch before continuing to work on the topic.

> > But here is a proposal which should make you and your developers 
> > happy, _and_ should be even easier to explain:
> > 
> > Work with topic branches.  And when you're done, delete them.
> 
> Again, if you want to share the topic branch the situation gets
> more complex.

Hardly so.  In my proposed solution to your problem, there is nothing 
which prevents you from working off of another branch than "master".

> > So the beginning of the day could look like this:
> > 
> > 	git fetch
> > 	git checkout -b todays-topic origin/master
> > 
> > 	[hack hack hack]
> > 	[test test test]
> > 	[debug debug debug]
> > 	[occasionally commit]
> > 	[occasionally git rebase -i origin/master]
> > 
> > and the end of the topic
> > 
> > 	git branch -M master
> > 	git push origin master
> > 
> > If you should not be ready to push by the end of the day, no need to
> > worry.  Just stay on that topic branch, and before pushing, do
> > 
> > 	git fetch
> > 	git rebase origin/master
> > 
> > In _every_ case where I explained git, I found that people appreciated the
> > two-step procedures (like you will find in the examples I showed you
> > above): one git command to work locally, and one to push/fetch to/from
> > origin.
> 
> Maybe. I know git quite well now and in a shared workflow "git pull"
> with auto-fast-forward would help me. I often need to run "for each
> local branch: git checkout ; git merge" to get rid of the errors
> reported by "git push".

The problem I see here: you know git quite well.  Others don't, and will 
be mightily confused why pull updates local branches sometimes, and 
sometimes not.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 19:41                                       ` Andreas Ericsson
  2007-10-24 19:48                                         ` J. Bruce Fields
@ 2007-10-24 23:48                                         ` Jakub Narebski
  2007-10-25  7:42                                           ` Andreas Ericsson
  2007-10-25 16:16                                           ` Federico Mena Quintero
  1 sibling, 2 replies; 161+ messages in thread
From: Jakub Narebski @ 2007-10-24 23:48 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: J. Bruce Fields, Steffen Prohaska, Johannes Schindelin,
	Federico Mena Quintero, git

On 10/24/07, Andreas Ericsson <ae@op5.se> wrote:

> git pull. Not git push. git pull operates on one working branch
> at a time (by default), whereas git push uploads and fast-forwards
> all the common branches (by default). I want git pull to work like
> git push.

git push is opposite (almost) to git fetch, not to git pull.

-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 23:28                                                         ` Johannes Schindelin
@ 2007-10-25  6:02                                                           ` Steffen Prohaska
  2007-10-25 10:27                                                             ` Johannes Schindelin
  2007-10-25  7:15                                                           ` Andreas Ericsson
  1 sibling, 1 reply; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-25  6:02 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Peter Baumann, Andreas Ericsson, J. Bruce Fields, Jakub Narebski,
	Federico Mena Quintero, git


On Oct 25, 2007, at 1:28 AM, Johannes Schindelin wrote:

> On Thu, 25 Oct 2007, Steffen Prohaska wrote:
>
>> On Oct 25, 2007, at 12:14 AM, Johannes Schindelin wrote:
>>
>>> But I think I have to drive my message home again: if what you  
>>> desire
>>> becomes reality, you take away the clear distinction between  
>>> local and
>>> remote branches.  In fact, those branches are neither local (because
>>> the next pull will automatically update them with remote changes,  
>>> but
>>> _only_ if they fast-forward) nor remote (because you plan to work on
>>> them locally).
>>
>> Exactly, because I do not work on those branches alone. These are
>> _shared_ branches. I can work on such a branch with a group of
>> developers. I'm willing to accept this bit of chaos.
>
> It is not just a chaos.  I see a serious problem here.  On _your_
> computer, you do _not_ have a shared branch.  Which is visible  
> _even_ in
> your modified work flow when you have unpushed changes.
>
> So your desired illusion that your local branches are anything but  
> local
> branches will never be perfect enough.

Ok, there is not a fundamental difference between local branches
that automatically merge from remotes and local branches that
are purely local and _never_ merge anything automatically. Both
are only local branches.

But these two types of branches already behave differently when
I call "git pull". There is already some kind of "illusion"
that some local branches are more tightly connected to remote
branches than others.

"git pull" could help to make the illusion even better. The
illusion would be better if it was easier to keep the heads
of the local branches near to the heads of branches they
automatically merge from, as long as this is easily possible.


>> Your rebase workflow is not possible if more than one dev wants to  
>> work
>> on the topic branch together.
>
> Why not?  I do it all the time.  CVS users do it all the time, for  
> that
> matter.

You're right. You can rebase your local changes on top of the new
shared remote head. And this is probably the best thing you can do
to get a clean history. Maybe it should be easier.

So, do I understand correctly, what you propose is:
- never merge but only rebase
- Due to lacking support for this in "git pull", never use
   git pull when working with shared branches but instead _always_ use
   "git fetch; git rebase origin/<branch_I'm_on>".

So you say that one of the first messages in "git for CVS users",
"The equivalent of cvs update is git pull origin" [1], is wrong.
I don't think I'm able to sell your proposed workflow with the current
documentation. But maybe I try if I'm absolutely convinced that it
is superior.

[1] http://www.kernel.org/pub/software/scm/git/docs/cvs-migration.html


>>> But here is a proposal which should make you and your developers
>>> happy, _and_ should be even easier to explain:
>>>
>>> Work with topic branches.  And when you're done, delete them.
>>
>> Again, if you want to share the topic branch the situation gets
>> more complex.
>
> Hardly so.  In my proposed solution to your problem, there is nothing
> which prevents you from working off of another branch than "master".

Well if you have several local branches checked out that are
shared with others you run into the "git push" problem again ...
(see below at git push origin master).


>>> So the beginning of the day could look like this:
>>>
>>> 	git fetch
>>> 	git checkout -b todays-topic origin/master
>>>
>>> 	[hack hack hack]
>>> 	[test test test]
>>> 	[debug debug debug]
>>> 	[occasionally commit]
>>> 	[occasionally git rebase -i origin/master]
>>>
>>> and the end of the topic
>>>
>>> 	git branch -M master

Isn't this a bit dangerous? It forces to overwrite master
no matter what's on it. You don't see diffstats nor a fast
forward message that confirms what you're doing.


>>> 	git push origin master

I'd like to see "git push" here. But to make this work without
error you'd need to _delete_ master after you pushed. Otherwise
it could happen that you later work on a different shared
branch and "git push" would complain about master. "git push"
would recommend to do a "git pull" and we're back where the
discussion started.

Or do you propose to delete master at this point? That is do
you propose to _never_ have remote branches checked out locally.
Except for a very short period when you do

     git branch -m <shared_branch>
     git push origin <shared_branch>
     git checkout do-not-work-here
     git branch -D <shared_branch>


>>> If you should not be ready to push by the end of the day, no need to
>>> worry.  Just stay on that topic branch, and before pushing, do
>>>
>>> 	git fetch
>>> 	git rebase origin/master
>>>
>>> In _every_ case where I explained git, I found that people  
>>> appreciated the
>>> two-step procedures (like you will find in the examples I showed you
>>> above): one git command to work locally, and one to push/fetch to/ 
>>> from
>>> origin.
>>
>> Maybe. I know git quite well now and in a shared workflow "git pull"
>> with auto-fast-forward would help me. I often need to run "for each
>> local branch: git checkout ; git merge" to get rid of the errors
>> reported by "git push".
>
> The problem I see here: you know git quite well.  Others don't, and  
> will
> be mightily confused why pull updates local branches sometimes, and
> sometimes not.

But it already happens now. "git pull" sometimes merges a
remote branch (--track) and sometimes it reports an error that
is fails to do so (--no-track). It would only do more work
automatically in the future and report appropriate warnings
or errors if it runs into a problem.

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 23:27                               ` Jakub Narebski
@ 2007-10-25  6:10                                 ` Karl Hasselström
  0 siblings, 0 replies; 161+ messages in thread
From: Karl Hasselström @ 2007-10-25  6:10 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git, Catalin Marinas

On 2007-10-25 01:27:10 +0200, Jakub Narebski wrote:

> On 10/24/07, Karl Hasselström <kha@treskal.com> wrote:
>
> > On 2007-10-24 13:04:01 +0200, Jakub Narebski wrote:
> >
> > > By the way, there is SRPM for StGIT in
> > > http://homepage.ntlworld.com/cmarinas/stgit/ (I need it because
> > > I have Python 2.4), but it is not listed on downloads page...
> >
> > I'll leave the webpage question to Catalin, but I'm curious about
> > the Python version remark. What exactly is the problem?
>
> If I remember correctly the StGIT RPM requires python 2.5 (and is
> build using python 2.5, so install with --force doesn't work).

Hmm. That's overkill, considering that only 2.4 is actually required
(and until recently, we tried to be careful to only require 2.3).

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 23:28                                                         ` Johannes Schindelin
  2007-10-25  6:02                                                           ` Steffen Prohaska
@ 2007-10-25  7:15                                                           ` Andreas Ericsson
  2007-10-25  7:31                                                             ` Peter Baumann
  2007-10-25 10:17                                                             ` Johannes Schindelin
  1 sibling, 2 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25  7:15 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Steffen Prohaska, Peter Baumann, J. Bruce Fields, Jakub Narebski,
	Federico Mena Quintero, git

Johannes Schindelin wrote:
> Hi,
> 
> On Thu, 25 Oct 2007, Steffen Prohaska wrote:
> 
>> On Oct 25, 2007, at 12:14 AM, Johannes Schindelin wrote:
>>
>>> But I think I have to drive my message home again: if what you desire 
>>> becomes reality, you take away the clear distinction between local and 
>>> remote branches.  In fact, those branches are neither local (because 
>>> the next pull will automatically update them with remote changes, but 
>>> _only_ if they fast-forward) nor remote (because you plan to work on 
>>> them locally).
>> Exactly, because I do not work on those branches alone. These are 
>> _shared_ branches. I can work on such a branch with a group of 
>> developers. I'm willing to accept this bit of chaos.
> 
> It is not just a chaos.  I see a serious problem here.  On _your_ 
> computer, you do _not_ have a shared branch.  Which is visible _even_ in 
> your modified work flow when you have unpushed changes.
> 

Ofcourse it is. People might pull from it. That's the whole point of a
distributed model.

> So your desired illusion that your local branches are anything but local 
> branches will never be perfect enough.
> 
>> Your rebase workflow is not possible if more than one dev wants to work 
>> on the topic branch together.
> 
> Why not?  I do it all the time.  CVS users do it all the time, for that 
> matter.
> 

For 200 branches at a time, where any of them might have changed? Do they
*really* go into all those branches and make really, really sure they run
git pull before they ever do anything? Isn't there a teensy weensy risk of
them forgetting that sometime when they really meant to do it?

On the other hand, if they absolutely *must* fork a branch at a specific
point in history (rather than "the latest published work this branch has"),
won't they run gitk/qgit/git-log/whatever, regardless of where their branch
head is?

> 
> The problem I see here: you know git quite well.  Others don't, and will 
> be mightily confused why pull updates local branches sometimes, and 
> sometimes not.

Do you know this, or are you just guessing? I'm getting the exact same
confusion with the current behaviour. "Why the hell doesn't git update
all the branches I told the damn stupid tool to auto-merge when I pull?"
frequently echoes around the office. My co-workers aren't interested in
learning about git internals, or its reasons for doing what it does.
They don't give a damn about local vs remote namespaces for their branches.
They want to get some work done the smoothest way possible, but with our
small forest of repositories and the bushel of branches in each repo
makes life difficult for them, because they just can't imagine that
git doesn't do what they told it to, which is "this branch tracks that".
They may work on "this", but still want it to track "that" so they don't
have to run "git-update-all.sh", or "git-walk-everything.sh" or any other
of a dozen small and near-identical scripts floating around the office.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 21:54                                                   ` best git practices, was Re: Git User's Survey 2007 unfinished summary continued Andreas Ericsson
  2007-10-24 22:17                                                     ` Johannes Schindelin
@ 2007-10-25  7:26                                                     ` Peter Baumann
  1 sibling, 0 replies; 161+ messages in thread
From: Peter Baumann @ 2007-10-25  7:26 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: J. Bruce Fields, Steffen Prohaska, Johannes Schindelin,
	Jakub Narebski, Federico Mena Quintero, git

On Wed, Oct 24, 2007 at 11:54:49PM +0200, Andreas Ericsson wrote:
> Peter Baumann wrote:
>> On Wed, Oct 24, 2007 at 11:06:24PM +0200, Andreas Ericsson wrote:
>>> J. Bruce Fields wrote:
>>>> On Wed, Oct 24, 2007 at 10:12:29PM +0200, Steffen Prohaska wrote:
>>>>> On Oct 24, 2007, at 9:48 PM, J. Bruce Fields wrote:
>>>>>
>>>>>>> I want git pull to work like git push.
>>>>>> That strikes me as a less complete solution, since it only helps in 
>>>>>> the
>>>>>> case where the other branches all happen to be unmodified locally 
>>>>>> (hence
>>>>>> can be fast-forwarded).  In other cases the "git push" will still emit 
>>>>>> a
>>>>>> spurious error.
>>>>> Well, but then there's something you should really think
>>>>> about.
>>>> Perhaps, but not necessarily; you may have some branches with local
>>>> changes that you're content to leave unpushed (and un-updated).
>>> Sure, but that won't change. The only thing I'm proposing is that
>>> local copies of remote branches are automatically fast-forwarded
>>> on every pull, but only if
>>>
>>> * the branch has no modifications what so ever
>>> * the branch is set up to auto-merge with the particular branch
>>> fetched from the particular remote
>>>
>>> I really don't see any downsides what so ever with this. Those
>>> of you who do, please enlighten me.
>>>
>> You can't check what got added in your pull, e.g you can't review the new
>> code with something like
>> 	gitk next..origin/next
>
> That's what git-fetch is for.
>

If I run git pull <remote> and have a auto-merge setup, I would merge the
remote side into my local branch. Then doing

	gitk ORIG_HEAD..

does the trick for to review what got added _and_ merged into my local
branch. I can't use this for other local branches not checked out. And as
I normally want to merge, your suggested behaviour is fine with me *IFF*
it is configurable _per_ branch.

>> I often do something like this, just to see what got changed. So at least
>> in my opinion you have to add a third point:
>>   * the branch has no modifications what so ever
>>   * the branch is set up to auto-merge with the particular branch
>>     fetched from the particular remote
>> 				AND
>>   * the user set a config option to always autofastfoward if the above
>>     conditions are true! This could be implemented as a global option with
>>     a per branch overwrite.
>
> I'd be fine with that, except I think it's fairly dangerous to have
> different defaults. The two first points are sort of the core of the
> case I've been arguing all along.
>

I aggree. And thats why I think your autofastforward should be set to
"false" per default, so that the distinction between local and remote
branches would still be clearly defined. Changing this would confuse new
users a lot more, me thinks.

But having the option for power users sounds fine!

>> Only if this option is added so a user can mark a branch to never
>> autofastforward (but it is still possible to  have an auto-merge config) 
>> you won't
>> loose valuable information.
>
> Sure. I was thinking something along these lines:
>
> [branch "foo"]
> 	remote = bar
> 	merge = some-branch
> 	autofastforward = false
>

Thats exactlcy what I had in mind. Maybe and a

[core]
	global_autofastforward = true

so you could have a sane default for every branch which is missing the
autofastforward statement. (or make it per [remote "foo"] ?)

> Or use git-fetch. git-pull is "fetch + merge". Conceptually, I don't
> think it'll be any problem what so ever telling anyone that the branches
> that aren't currently checked out get merged automatically only if they
> result in a fast-forward.
>

I'm not so sure about that.

-Peter

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25  7:15                                                           ` Andreas Ericsson
@ 2007-10-25  7:31                                                             ` Peter Baumann
  2007-10-25  7:57                                                               ` Andreas Ericsson
  2007-10-25 10:17                                                             ` Johannes Schindelin
  1 sibling, 1 reply; 161+ messages in thread
From: Peter Baumann @ 2007-10-25  7:31 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Johannes Schindelin, Steffen Prohaska, J. Bruce Fields,
	Jakub Narebski, Federico Mena Quintero, git

On Thu, Oct 25, 2007 at 09:15:35AM +0200, Andreas Ericsson wrote:
> Johannes Schindelin wrote:
>> Hi,
>> On Thu, 25 Oct 2007, Steffen Prohaska wrote:
>>> On Oct 25, 2007, at 12:14 AM, Johannes Schindelin wrote:
>>>
>>>> But I think I have to drive my message home again: if what you desire 
>>>> becomes reality, you take away the clear distinction between local and 
>>>> remote branches.  In fact, those branches are neither local (because the 
>>>> next pull will automatically update them with remote changes, but _only_ 
>>>> if they fast-forward) nor remote (because you plan to work on them 
>>>> locally).
>>> Exactly, because I do not work on those branches alone. These are 
>>> _shared_ branches. I can work on such a branch with a group of 
>>> developers. I'm willing to accept this bit of chaos.
>> It is not just a chaos.  I see a serious problem here.  On _your_ 
>> computer, you do _not_ have a shared branch.  Which is visible _even_ in 
>> your modified work flow when you have unpushed changes.
>
> Ofcourse it is. People might pull from it. That's the whole point of a
> distributed model.
>
>> So your desired illusion that your local branches are anything but local 
>> branches will never be perfect enough.
>>> Your rebase workflow is not possible if more than one dev wants to work 
>>> on the topic branch together.
>> Why not?  I do it all the time.  CVS users do it all the time, for that 
>> matter.
>
> For 200 branches at a time, where any of them might have changed? Do they
> *really* go into all those branches and make really, really sure they run
> git pull before they ever do anything? Isn't there a teensy weensy risk of
> them forgetting that sometime when they really meant to do it?
>
> On the other hand, if they absolutely *must* fork a branch at a specific
> point in history (rather than "the latest published work this branch has"),
> won't they run gitk/qgit/git-log/whatever, regardless of where their branch
> head is?
>
>> The problem I see here: you know git quite well.  Others don't, and will 
>> be mightily confused why pull updates local branches sometimes, and 
>> sometimes not.
>
> Do you know this, or are you just guessing? I'm getting the exact same
> confusion with the current behaviour. "Why the hell doesn't git update
> all the branches I told the damn stupid tool to auto-merge when I pull?"
> frequently echoes around the office. My co-workers aren't interested in
> learning about git internals, or its reasons for doing what it does.
> They don't give a damn about local vs remote namespaces for their branches.
> They want to get some work done the smoothest way possible, but with our
> small forest of repositories and the bushel of branches in each repo
> makes life difficult for them, because they just can't imagine that
> git doesn't do what they told it to, which is "this branch tracks that".
> They may work on "this", but still want it to track "that" so they don't
> have to run "git-update-all.sh", or "git-walk-everything.sh" or any other
> of a dozen small and near-identical scripts floating around the office.
>

What actually wonders me why you guys do have 200 local branches. I
usually just create a local branch from the remote IFF I'd like to do some
work on it. And for inspecting a remote branch, a detached HEAD works just as
fine ...

-Peter

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 23:48                                         ` Jakub Narebski
@ 2007-10-25  7:42                                           ` Andreas Ericsson
  2007-10-25 10:07                                             ` Johannes Schindelin
  2007-10-25 16:16                                           ` Federico Mena Quintero
  1 sibling, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25  7:42 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: J. Bruce Fields, Steffen Prohaska, Johannes Schindelin,
	Federico Mena Quintero, git

Jakub Narebski wrote:
> On 10/24/07, Andreas Ericsson <ae@op5.se> wrote:
> 
>> git pull. Not git push. git pull operates on one working branch
>> at a time (by default), whereas git push uploads and fast-forwards
>> all the common branches (by default). I want git pull to work like
>> git push.
> 
> git push is opposite (almost) to git fetch, not to git pull.
> 

Not to an end user that has no idea or desire to learn about git remotes
or anything else. They see "ok, push updates all the remote branches, but
only if it's a fast-forward". They also see "righto, git pull updates all
the local branches, and even merges and does other funny things", but they
*don't* understand why git-pull (in their eyes) only update ONE branch that
they can actually check out. From a technical standpoint, fetch and push
are the same, but from the user perspective, push and pull seem much more
alike.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25  7:31                                                             ` Peter Baumann
@ 2007-10-25  7:57                                                               ` Andreas Ericsson
  2007-10-25  8:25                                                                 ` Steffen Prohaska
  0 siblings, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25  7:57 UTC (permalink / raw)
  To: Peter Baumann
  Cc: Johannes Schindelin, Steffen Prohaska, J. Bruce Fields,
	Jakub Narebski, Federico Mena Quintero, git

Peter Baumann wrote:
> On Thu, Oct 25, 2007 at 09:15:35AM +0200, Andreas Ericsson wrote:
>> Johannes Schindelin wrote:
>>> Hi,
>>> On Thu, 25 Oct 2007, Steffen Prohaska wrote:
>>>> On Oct 25, 2007, at 12:14 AM, Johannes Schindelin wrote:
>>>>
>>>>> But I think I have to drive my message home again: if what you desire 
>>>>> becomes reality, you take away the clear distinction between local and 
>>>>> remote branches.  In fact, those branches are neither local (because the 
>>>>> next pull will automatically update them with remote changes, but _only_ 
>>>>> if they fast-forward) nor remote (because you plan to work on them 
>>>>> locally).
>>>> Exactly, because I do not work on those branches alone. These are 
>>>> _shared_ branches. I can work on such a branch with a group of 
>>>> developers. I'm willing to accept this bit of chaos.
>>> It is not just a chaos.  I see a serious problem here.  On _your_ 
>>> computer, you do _not_ have a shared branch.  Which is visible _even_ in 
>>> your modified work flow when you have unpushed changes.
>> Ofcourse it is. People might pull from it. That's the whole point of a
>> distributed model.
>>
>>> So your desired illusion that your local branches are anything but local 
>>> branches will never be perfect enough.
>>>> Your rebase workflow is not possible if more than one dev wants to work 
>>>> on the topic branch together.
>>> Why not?  I do it all the time.  CVS users do it all the time, for that 
>>> matter.
>> For 200 branches at a time, where any of them might have changed? Do they
>> *really* go into all those branches and make really, really sure they run
>> git pull before they ever do anything? Isn't there a teensy weensy risk of
>> them forgetting that sometime when they really meant to do it?
>>
>> On the other hand, if they absolutely *must* fork a branch at a specific
>> point in history (rather than "the latest published work this branch has"),
>> won't they run gitk/qgit/git-log/whatever, regardless of where their branch
>> head is?
>>
>>> The problem I see here: you know git quite well.  Others don't, and will 
>>> be mightily confused why pull updates local branches sometimes, and 
>>> sometimes not.
>> Do you know this, or are you just guessing? I'm getting the exact same
>> confusion with the current behaviour. "Why the hell doesn't git update
>> all the branches I told the damn stupid tool to auto-merge when I pull?"
>> frequently echoes around the office. My co-workers aren't interested in
>> learning about git internals, or its reasons for doing what it does.
>> They don't give a damn about local vs remote namespaces for their branches.
>> They want to get some work done the smoothest way possible, but with our
>> small forest of repositories and the bushel of branches in each repo
>> makes life difficult for them, because they just can't imagine that
>> git doesn't do what they told it to, which is "this branch tracks that".
>> They may work on "this", but still want it to track "that" so they don't
>> have to run "git-update-all.sh", or "git-walk-everything.sh" or any other
>> of a dozen small and near-identical scripts floating around the office.
>>
> 
> What actually wonders me why you guys do have 200 local branches. I
> usually just create a local branch from the remote IFF I'd like to do some
> work on it. And for inspecting a remote branch, a detached HEAD works just as
> fine ...
> 

50+ repositories, with stable, testing and maint branches. Some repos have more
than that, so it amounts to roughly 200 branches. Each branch can be modified by
anyone (we're a small company - everyone still works everywhere), but all changes
should be done to the tip of the upstream branch. Especially for maint this is a
bit of a problem, since we frequently have consultants out and about, and they
sometimes find a bug that they commit locally to their own repo. They're in a
hurry though, and have no connection to the mothership repo so they can't git-pull
to get up to date. They aren't exactly developers, but savvy enough to fix a few
simple bugs, but the concept of the locally-modifiable branches not being updated
to their remote-tracking counterparts with each git-pull is just incomprehensible
to them. To me, that suggests that we're doing something wrong.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 22:17                                                     ` Johannes Schindelin
@ 2007-10-25  8:07                                                       ` Andreas Ericsson
  2007-10-25 10:12                                                         ` Johannes Schindelin
  0 siblings, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25  8:07 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Peter Baumann, J. Bruce Fields, Steffen Prohaska, Jakub Narebski,
	Federico Mena Quintero, git

Johannes Schindelin wrote:
> Hi,
> 
> On Wed, 24 Oct 2007, Andreas Ericsson wrote:
> 
>> Conceptually, I don't think it'll be any problem what so ever telling 
>> anyone that the branches that aren't currently checked out get merged 
>> automatically only if they result in a fast-forward.
> 
> It would be a matter of seconds until someone asks "why only 
> fast-forwards?  Would it not be _much_ better to merge _always_?  Stupid 
> git."
> 
> And all because the concept of "local" vs "remote" was blurred.
> 

It's already blurred, since we have git-pull instead of just git-fetch.
pull is the dwim version of fetch for anyone who isn't frequently pulling
from multiple repos that aren't configured as remotes (99% of git's users).
It really is. You configure it to merge this and that branch to those and
these branches. Sometimes it does and sometimes it doesn't, and the decision
is based on what branch you're currently on.

Only git-fetch has the clear local vs remote distinction, because it *never*
merges anything.

On a side-note, I'm starting to see why hg has gotten such a user-base.
Their docs focus on one repo per branch, which doesn't have this problem at
all.

So in short, letting "git-pull" fast-forward (or rebase; I like that idea)
the local copies of the remote tracking branches onto those remote tracking
branches will make life easier for:
* People who collaborate with others in a shared environment, where branch
  heads frequently change in the mothership repo but all development is
  supposed to be done at the tip of those mothership branches anyway.
  Nearly all corporate users fall into this category.
* People who just want to track and test the latest and greatest version of
  software X. Sometimes trying latest stable, and sometimes going with the
  freshest beta. They won't want to do "git merge beta origin/beta" after
  having done "git checkout beta", but they sure as hell don't want to run
  anything but the latest either. They may contribute once in a while, but
  generally just want to make sure they've got the bleeding edge.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25  7:57                                                               ` Andreas Ericsson
@ 2007-10-25  8:25                                                                 ` Steffen Prohaska
  0 siblings, 0 replies; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-25  8:25 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Peter Baumann, Johannes Schindelin, J. Bruce Fields,
	Jakub Narebski, Federico Mena Quintero, git


On Oct 25, 2007, at 9:57 AM, Andreas Ericsson wrote:

> 50+ repositories, with stable, testing and maint branches. Some  
> repos have more
> than that, so it amounts to roughly 200 branches. Each branch can  
> be modified by
> anyone (we're a small company - everyone still works everywhere),  
> but all changes
> should be done to the tip of the upstream branch. Especially for  
> maint this is a
> bit of a problem, since we frequently have consultants out and  
> about, and they
> sometimes find a bug that they commit locally to their own repo.  
> They're in a
> hurry though, and have no connection to the mothership repo so they  
> can't git-pull
> to get up to date. They aren't exactly developers, but savvy enough  
> to fix a few
> simple bugs, but the concept of the locally-modifiable branches not  
> being updated
> to their remote-tracking counterparts with each git-pull is just  
> incomprehensible
> to them. To me, that suggests that we're doing something wrong.

Johannes described a workflow using rebase. It would create
a very clean history avoiding long "parallel roads" and it
mimics what experience git users would probably do: Just work
if you have no connection but cleanup your work by using rebase
before pushing it.

Johannes, and Peter, too, propose to delete local branches
asap to avoid the third copy besides the copy on the server
and the copy in remotes. They suggest that local branches
should be absolutely reserved for local work.

However, my feeling is that the current tools make it too hard
to work the way described. Therefore it's hard to sell such a
workflow to an unexperienced developer. For example checking
out a remote branch for doing some local work, pushing this
work, and cleaning up requires

    git checkout -b <branch> origin/<branch>
    # work work ...
    git push origin <branch>
    git checkout <don-t-work-here>
    git branch -D <branch>

These are a lot of commands and some of them look quite
redundant.  Nearly every command contains <branch>. Why isn't is
sufficient to tell the name of the branch I'm working on once.
And '-D' looks even dangerous to me because it overrides all
safety checks. This should not be needed in daily work.

Here are some questions:
Do you think a workflow using rebase is feasible for
unexperienced git users?
What would be needed to bring such a workflow down to a few,
simple and reliable commands?

I think the general question is what I described in a previous
mail: You have a shared repository containing stable and topic
branches. Provide a workflow that is as simple as possible
for as many as possible developers. The average developer
should need nothing more than equivalents of "cvs update",
"cvs commit" for daily work if there are no conflicts. Note,
there are no redundant branch names allowed in the commands.
If a developer doesn't switch branches there's no need to
tell the branch name. "git pull ; ... ; git push" is simple
but it has the problem of reporting errors that average devs
don't understand.

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25  7:42                                           ` Andreas Ericsson
@ 2007-10-25 10:07                                             ` Johannes Schindelin
  2007-10-25 10:39                                               ` Steffen Prohaska
  0 siblings, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-25 10:07 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Jakub Narebski, J. Bruce Fields, Steffen Prohaska,
	Federico Mena Quintero, git

Hi,

On Thu, 25 Oct 2007, Andreas Ericsson wrote:

> Jakub Narebski wrote:
> > On 10/24/07, Andreas Ericsson <ae@op5.se> wrote:
> > 
> > > git pull. Not git push. git pull operates on one working branch at a 
> > > time (by default), whereas git push uploads and fast-forwards all 
> > > the common branches (by default). I want git pull to work like git 
> > > push.
> > 
> > git push is opposite (almost) to git fetch, not to git pull.
> 
> Not to an end user that has no idea or desire to learn about git remotes 
> or anything else.

At some point you _have_ to expect your users to learn something.  In the 
git documentation, we never pretend that pull is anything else than "fetch 
+ merge".

So this assumption of your end user is a lack of training, really.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25  8:07                                                       ` Andreas Ericsson
@ 2007-10-25 10:12                                                         ` Johannes Schindelin
  2007-10-25 10:24                                                           ` Andreas Ericsson
  0 siblings, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-25 10:12 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Peter Baumann, J. Bruce Fields, Steffen Prohaska, Jakub Narebski,
	Federico Mena Quintero, git

Hi,

On Thu, 25 Oct 2007, Andreas Ericsson wrote:

> Johannes Schindelin wrote:
> 
> > On Wed, 24 Oct 2007, Andreas Ericsson wrote:
> > 
> > > Conceptually, I don't think it'll be any problem what so ever 
> > > telling anyone that the branches that aren't currently checked out 
> > > get merged automatically only if they result in a fast-forward.
> > 
> > It would be a matter of seconds until someone asks "why only 
> > fast-forwards? Would it not be _much_ better to merge _always_?  
> > Stupid git."
> > 
> > And all because the concept of "local" vs "remote" was blurred.
> 
> It's already blurred, since we have git-pull instead of just git-fetch.

Huh?  How is "I ask git pull to fetch the remote branch, and merge it into 
my local branch" a blurring of local vs remote branch?

The local branch is still the local branch where it is _my_ responsibility 
to update or change anything.  The remote branch is not.  If at all, I can 
push -- iff it fast-forwards.

The fact that you can set up local mirroring branches (with "git remote 
add") which are only updated via "git fetch" is _no_ blurring of the 
concepts: we make it quite explicit that you cannot check them out.  They 
are not local branches.

Hth,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25  7:15                                                           ` Andreas Ericsson
  2007-10-25  7:31                                                             ` Peter Baumann
@ 2007-10-25 10:17                                                             ` Johannes Schindelin
  2007-10-25 10:33                                                               ` Andreas Ericsson
  1 sibling, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-25 10:17 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Steffen Prohaska, Peter Baumann, J. Bruce Fields, Jakub Narebski,
	Federico Mena Quintero, git

Hi,

On Thu, 25 Oct 2007, Andreas Ericsson wrote:

> Johannes Schindelin wrote:
> 
> > On Thu, 25 Oct 2007, Steffen Prohaska wrote:
> > 
> > > On Oct 25, 2007, at 12:14 AM, Johannes Schindelin wrote:
> > > 
> > > > But I think I have to drive my message home again: if what you 
> > > > desire becomes reality, you take away the clear distinction 
> > > > between local and remote branches.  In fact, those branches are 
> > > > neither local (because the next pull will automatically update 
> > > > them with remote changes, but _only_ if they fast-forward) nor 
> > > > remote (because you plan to work on them locally).
> > >
> > > Exactly, because I do not work on those branches alone. These are 
> > > _shared_ branches. I can work on such a branch with a group of 
> > > developers. I'm willing to accept this bit of chaos.
> > 
> > It is not just a chaos.  I see a serious problem here.  On _your_ 
> > computer, you do _not_ have a shared branch.  Which is visible _even_ 
> > in your modified work flow when you have unpushed changes.
> 
> Ofcourse it is. People might pull from it. That's the whole point of a 
> distributed model.

By that reasoning, left is right.  Because your "left" is my "right".

> > So your desired illusion that your local branches are anything but 
> > local branches will never be perfect enough.
> > 
> > > Your rebase workflow is not possible if more than one dev wants to 
> > > work on the topic branch together.
> > 
> > Why not?  I do it all the time.  CVS users do it all the time, for 
> > that matter.
> 
> For 200 branches at a time, where any of them might have changed?

I slowly start to understand why your users are confused.  _Nobody_ works 
on 200 branches at the same time.  (No, maintainers don't count: they do 
not work _on_ the branches, but _with_; they merge them.)

When you're done with a topic, why do you leave it around?  Cluttering up 
your "git branch" output?

> > The problem I see here: you know git quite well.  Others don't, and 
> > will be mightily confused why pull updates local branches sometimes, 
> > and sometimes not.
> 
> Do you know this, or are you just guessing? I'm getting the exact same
> confusion with the current behaviour. "Why the hell doesn't git update
> all the branches I told the damn stupid tool to auto-merge when I pull?"

That's easy.  A merge can have conflicts.  Conflicts need a working 
directory.  You cannot have multiple working directories.  (Actually, you 
can, with git-new-workdir, which would break down _horribly_ with your 
desired change.)

Oh?  You don't have local changes?  Then why _on earth_ do you have a 
local branch?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 10:12                                                         ` Johannes Schindelin
@ 2007-10-25 10:24                                                           ` Andreas Ericsson
  2007-10-25 11:39                                                             ` Johannes Schindelin
  0 siblings, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25 10:24 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Peter Baumann, J. Bruce Fields, Steffen Prohaska, Jakub Narebski,
	Federico Mena Quintero, git

Johannes Schindelin wrote:
> Hi,
> 
> On Thu, 25 Oct 2007, Andreas Ericsson wrote:
> 
>> Johannes Schindelin wrote:
>>
>>> On Wed, 24 Oct 2007, Andreas Ericsson wrote:
>>>
>>>> Conceptually, I don't think it'll be any problem what so ever 
>>>> telling anyone that the branches that aren't currently checked out 
>>>> get merged automatically only if they result in a fast-forward.
>>> It would be a matter of seconds until someone asks "why only 
>>> fast-forwards? Would it not be _much_ better to merge _always_?  
>>> Stupid git."
>>>
>>> And all because the concept of "local" vs "remote" was blurred.
>> It's already blurred, since we have git-pull instead of just git-fetch.
> 
> Huh?  How is "I ask git pull to fetch the remote branch, and merge it into 
> my local branch" a blurring of local vs remote branch?
> 
> The local branch is still the local branch where it is _my_ responsibility 
> to update or change anything.

True. So git pull saves you exactly one command. The various fetch-all-git-
repos-and-update-all-fast-forward-branches in circulation at the office
save us ~500 commands each time they're run. Or rather, they *could* do
that, but you can't know until you've run it.

So what should I do to make what I want possible, without having git-pull
muddy the waters of local vs remote? There's clearly a user desire for it,
besides that of my eight co-workers and myself. Introduce git-<cmd-156>?

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25  6:02                                                           ` Steffen Prohaska
@ 2007-10-25 10:27                                                             ` Johannes Schindelin
  2007-10-25 12:04                                                               ` Steffen Prohaska
  0 siblings, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-25 10:27 UTC (permalink / raw)
  To: Steffen Prohaska
  Cc: Peter Baumann, Andreas Ericsson, J. Bruce Fields, Jakub Narebski,
	Federico Mena Quintero, git

Hi,

On Thu, 25 Oct 2007, Steffen Prohaska wrote:

> On Oct 25, 2007, at 1:28 AM, Johannes Schindelin wrote:
> 
> > On Thu, 25 Oct 2007, Steffen Prohaska wrote:
> > 
> > > On Oct 25, 2007, at 12:14 AM, Johannes Schindelin wrote:
> > > 
> > > > But I think I have to drive my message home again: if what you 
> > > > desire becomes reality, you take away the clear distinction 
> > > > between local and remote branches.  In fact, those branches are 
> > > > neither local (because the next pull will automatically update 
> > > > them with remote changes, but _only_ if they fast-forward) nor 
> > > > remote (because you plan to work on them locally).
> > > 
> > > Exactly, because I do not work on those branches alone. These are 
> > > _shared_ branches. I can work on such a branch with a group of 
> > > developers. I'm willing to accept this bit of chaos.
> > 
> > It is not just a chaos.  I see a serious problem here.  On _your_ 
> > computer, you do _not_ have a shared branch.  Which is visible _even_ 
> > in your modified work flow when you have unpushed changes.
> > 
> > So your desired illusion that your local branches are anything but 
> > local branches will never be perfect enough.
> 
> Ok, there is not a fundamental difference between local branches
> that automatically merge from remotes and local branches that
> are purely local and _never_ merge anything automatically. Both
> are only local branches.

Actually, not really.  For refs/remotes/* you expect them to change 
possibly at the same time.  For your local branches, I'd expect them only 
to change when I am actually working on them (and yes, that includes a 
pull into the current branch).

> > > Your rebase workflow is not possible if more than one dev wants to 
> > > work on the topic branch together.
> > 
> > Why not?  I do it all the time.  CVS users do it all the time, for 
> > that matter.
> 
> You're right. You can rebase your local changes on top of the new shared 
> remote head. And this is probably the best thing you can do to get a 
> clean history. Maybe it should be easier.

It should.  Thus my question about best practices (which is technically in 
this thread, but we are in a subthread which permuted into "I want git 
pull to behave differently")

I _want_ this to be easier.

> So, do I understand correctly, what you propose is:
> - never merge but only rebase
> - Due to lacking support for this in "git pull", never use
>  git pull when working with shared branches but instead _always_ use
>  "git fetch; git rebase origin/<branch_I'm_on>".
> 
> So you say that one of the first messages in "git for CVS users", "The 
> equivalent of cvs update is git pull origin" [1], is wrong. I don't 
> think I'm able to sell your proposed workflow with the current 
> documentation. But maybe I try if I'm absolutely convinced that it is 
> superior.

Hehe.  You just experienced the tremendous speed at which git moves.  In 
the beginning, we really thought that "git pull" is all you'll ever want 
to have.

But in the meantime, one of the biggest Enemies of the Rebase (yours 
truly) converted to an avid fan of it, because it really helps 
development.  It also makes for clean history, which is always good.

> > > > But here is a proposal which should make you and your developers 
> > > > happy, _and_ should be even easier to explain:
> > > > 
> > > > Work with topic branches.  And when you're done, delete them.
> > > 
> > > Again, if you want to share the topic branch the situation gets more 
> > > complex.
> > 
> > Hardly so.  In my proposed solution to your problem, there is nothing 
> > which prevents you from working off of another branch than "master".
> 
> Well if you have several local branches checked out that are
> shared with others you run into the "git push" problem again ...
> (see below at git push origin master).

Do the same as I, always say "git push origin master" (of course, you 
should exchange "master" with whatever branch you want to push).  Be 
precise.

> > > > So the beginning of the day could look like this:
> > > > 
> > > > 	git fetch
> > > > 	git checkout -b todays-topic origin/master
> > > > 
> > > > 	[hack hack hack]
> > > > 	[test test test]
> > > > 	[debug debug debug]
> > > > 	[occasionally commit]
> > > > 	[occasionally git rebase -i origin/master]
> > > > 
> > > > and the end of the topic
> > > > 
> > > > 	git branch -M master
> 
> Isn't this a bit dangerous? It forces to overwrite master no matter 
> what's on it. You don't see diffstats nor a fast forward message that 
> confirms what you're doing.

Yeah, I should have said something like "git branch -m master" 
(implicitely assuming that you have no current "master" branch).

> > > > 	git push origin master
> 
> I'd like to see "git push" here.

I think it is not asking too much for the user to be a bit more precise.  
If you really do not trust your developers to be capable of that, point 
them to git gui.

>    git branch -m <shared_branch>
>    git push origin <shared_branch>
>    git checkout do-not-work-here
>    git branch -D <shared_branch>

Actually, the last two commands would better be

	git checkout HEAD^{commit}
	git branch -d <shared_branch>

> > The problem I see here: you know git quite well.  Others don't, and 
> > will be mightily confused why pull updates local branches sometimes, 
> > and sometimes not.
> 
> But it already happens now. "git pull" sometimes merges a remote branch 
> (--track) and sometimes it reports an error that is fails to do so 
> (--no-track).

If there really is an inconsistent behaviour, then we'll have to fix that.  
We should not introduce inconsistent behaviour on top of that.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 10:17                                                             ` Johannes Schindelin
@ 2007-10-25 10:33                                                               ` Andreas Ericsson
  2007-10-25 12:09                                                                 ` Steffen Prohaska
                                                                                   ` (2 more replies)
  0 siblings, 3 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25 10:33 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Steffen Prohaska, Peter Baumann, J. Bruce Fields, Jakub Narebski,
	Federico Mena Quintero, git

Johannes Schindelin wrote:
> Hi,
> 
> On Thu, 25 Oct 2007, Andreas Ericsson wrote:
> 
>> Johannes Schindelin wrote:
>>
>>> On Thu, 25 Oct 2007, Steffen Prohaska wrote:
>>>
>>>> On Oct 25, 2007, at 12:14 AM, Johannes Schindelin wrote:
>>>>
>>>>> But I think I have to drive my message home again: if what you 
>>>>> desire becomes reality, you take away the clear distinction 
>>>>> between local and remote branches.  In fact, those branches are 
>>>>> neither local (because the next pull will automatically update 
>>>>> them with remote changes, but _only_ if they fast-forward) nor 
>>>>> remote (because you plan to work on them locally).
>>>> Exactly, because I do not work on those branches alone. These are 
>>>> _shared_ branches. I can work on such a branch with a group of 
>>>> developers. I'm willing to accept this bit of chaos.
>>> It is not just a chaos.  I see a serious problem here.  On _your_ 
>>> computer, you do _not_ have a shared branch.  Which is visible _even_ 
>>> in your modified work flow when you have unpushed changes.
>> Ofcourse it is. People might pull from it. That's the whole point of a 
>> distributed model.
> 
> By that reasoning, left is right.  Because your "left" is my "right".
> 
>>> So your desired illusion that your local branches are anything but 
>>> local branches will never be perfect enough.
>>>
>>>> Your rebase workflow is not possible if more than one dev wants to 
>>>> work on the topic branch together.
>>> Why not?  I do it all the time.  CVS users do it all the time, for 
>>> that matter.
>> For 200 branches at a time, where any of them might have changed?
> 
> I slowly start to understand why your users are confused.  _Nobody_ works 
> on 200 branches at the same time.  (No, maintainers don't count: they do 
> not work _on_ the branches, but _with_; they merge them.)
> 
> When you're done with a topic, why do you leave it around?  Cluttering up 
> your "git branch" output?
> 

We have 91 repositories at work. Roughly 60 of those are in active use.
The active repos are organized pretty much like the git repo with
'master', 'next' and 'maint'. We *do* work on all branches, but not
every day, ofcourse. They're NOT topic branches. We implement features
on topic-branches that we DO throw away, but those branches HAVE to be
there for us to be able to handle supporting of old versions as well as
implementing new features in a sane way. Throwing them away locally would
mean having to re-create them very frequently, and since they have to
exist in the upstream repo, "git fetch" would fetch and re-create them
every single time anyway.

So please, pretty please just drop the entire "use topic branches" argument.
We do that, but still have this problem, and it *is* a problem.

>>> The problem I see here: you know git quite well.  Others don't, and 
>>> will be mightily confused why pull updates local branches sometimes, 
>>> and sometimes not.
>> Do you know this, or are you just guessing? I'm getting the exact same
>> confusion with the current behaviour. "Why the hell doesn't git update
>> all the branches I told the damn stupid tool to auto-merge when I pull?"
> 
> That's easy.  A merge can have conflicts.  Conflicts need a working 
> directory.  You cannot have multiple working directories.  (Actually, you 
> can, with git-new-workdir, which would break down _horribly_ with your 
> desired change.)
> 
> Oh?  You don't have local changes?  Then why _on earth_ do you have a 
> local branch?
> 

Because it's convenient, ofcourse. Don't you have 'maint', 'next' and 'master'
in your clone of git.git? I'm guessing at least 99% of the people on this
list have those branches lying around in their clones, even if they only
ever use 'next' and/or 'master'.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 10:07                                             ` Johannes Schindelin
@ 2007-10-25 10:39                                               ` Steffen Prohaska
  0 siblings, 0 replies; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-25 10:39 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Andreas Ericsson, Jakub Narebski, J. Bruce Fields,
	Federico Mena Quintero, git


On Oct 25, 2007, at 12:07 PM, Johannes Schindelin wrote:

> Hi,
>
> On Thu, 25 Oct 2007, Andreas Ericsson wrote:
>
>> Jakub Narebski wrote:
>>> On 10/24/07, Andreas Ericsson <ae@op5.se> wrote:
>>>
>>>> git pull. Not git push. git pull operates on one working branch  
>>>> at a
>>>> time (by default), whereas git push uploads and fast-forwards all
>>>> the common branches (by default). I want git pull to work like git
>>>> push.
>>>
>>> git push is opposite (almost) to git fetch, not to git pull.
>>
>> Not to an end user that has no idea or desire to learn about git  
>> remotes
>> or anything else.
>
> At some point you _have_ to expect your users to learn something.   
> In the
> git documentation, we never pretend that pull is anything else than  
> "fetch
> + merge".
>
> So this assumption of your end user is a lack of training, really.

I typically describe in detail every step they need to get
there work done. I expect that a few, simple commands that can
be used per copy & paste should solve 90% of the cases.

Some users will learn more, some will refuse to learn
more. Users from the second group will typically consult a
more experienced user if they hit a problem. At at that point
they are forced to learn.

I don't expect that all users know all details and the users
expect that their daily workflow is well supported with a
few commands.

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 10:24                                                           ` Andreas Ericsson
@ 2007-10-25 11:39                                                             ` Johannes Schindelin
  2007-10-25 12:46                                                               ` Andreas Ericsson
  0 siblings, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-25 11:39 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Peter Baumann, J. Bruce Fields, Steffen Prohaska, Jakub Narebski,
	Federico Mena Quintero, git

Hi,

On Thu, 25 Oct 2007, Andreas Ericsson wrote:

> Johannes Schindelin wrote:
> 
> > On Thu, 25 Oct 2007, Andreas Ericsson wrote:
> > 
> > > Johannes Schindelin wrote:
> > > 
> > > > On Wed, 24 Oct 2007, Andreas Ericsson wrote:
> > > > 
> > > > > Conceptually, I don't think it'll be any problem what so ever 
> > > > > telling anyone that the branches that aren't currently checked 
> > > > > out get merged automatically only if they result in a 
> > > > > fast-forward.
> > > >
> > > > It would be a matter of seconds until someone asks "why only 
> > > > fast-forwards? Would it not be _much_ better to merge _always_?  
> > > > Stupid git."
> > > > 
> > > > And all because the concept of "local" vs "remote" was blurred.
> > >
> > > It's already blurred, since we have git-pull instead of just 
> > > git-fetch.
> > 
> > Huh?  How is "I ask git pull to fetch the remote branch, and merge it 
> > into my local branch" a blurring of local vs remote branch?
> > 
> > The local branch is still the local branch where it is _my_ 
> > responsibility to update or change anything.
> 
> True. So git pull saves you exactly one command. The various 
> fetch-all-git- repos-and-update-all-fast-forward-branches in circulation 
> at the office save us ~500 commands each time they're run. Or rather, 
> they *could* do that, but you can't know until you've run it.

As I pointed out, there is no way to sensibly have 500 _local_ branches 
lying around.

It is ridiculous to assume that you have to have local branches for all 
the stable, maintenance, whatever branches.

When you have to change something, you branch, hack, develop, commit, 
push, and then _clean up_ after yourself.  No need to clutter your 
local branch space with unused branches.

> So what should I do to make what I want possible, without having 
> git-pull muddy the waters of local vs remote? There's clearly a user 
> desire for it, besides that of my eight co-workers and myself. Introduce 
> git-<cmd-156>?

If you _insist_ on your workflow, hey, git is a free program, and you can 
do what you want to do with an alias easily enough.  You can even make 
that alias part of the templates, so you can force your desires down the 
throat of every of your coworkers.

However, that does not mean that you can insist on support for your 
workflow in upstream git.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 10:27                                                             ` Johannes Schindelin
@ 2007-10-25 12:04                                                               ` Steffen Prohaska
  0 siblings, 0 replies; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-25 12:04 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Peter Baumann, Andreas Ericsson, J. Bruce Fields, Jakub Narebski,
	Federico Mena Quintero, git


On Oct 25, 2007, at 12:27 PM, Johannes Schindelin wrote:

> Hi,
>
> On Thu, 25 Oct 2007, Steffen Prohaska wrote:
>
>> On Oct 25, 2007, at 1:28 AM, Johannes Schindelin wrote:
>>
>>> On Thu, 25 Oct 2007, Steffen Prohaska wrote:
>>>
>>>> On Oct 25, 2007, at 12:14 AM, Johannes Schindelin wrote:

[...]

>>>>> But here is a proposal which should make you and your developers
>>>>> happy, _and_ should be even easier to explain:
>>>>>
>>>>> Work with topic branches.  And when you're done, delete them.
>>>>
>>>> Again, if you want to share the topic branch the situation gets  
>>>> more
>>>> complex.
>>>
>>> Hardly so.  In my proposed solution to your problem, there is  
>>> nothing
>>> which prevents you from working off of another branch than "master".
>>
>> Well if you have several local branches checked out that are
>> shared with others you run into the "git push" problem again ...
>> (see below at git push origin master).
>
> Do the same as I, always say "git push origin master" (of course, you
> should exchange "master" with whatever branch you want to push).  Be
> precise.

Well, I'm lazy. git already knows everything. It knows that
the current branch is associated with a specific remote and it
pushes matching branches by default. And I took care to not
pollute the namespace. All my branches are named identical
in all repositories I'm dealing with. It's reasonable to want
"git push" to do the right thing.



>>>>> So the beginning of the day could look like this:
>>>>>
>>>>> 	git fetch
>>>>> 	git checkout -b todays-topic origin/master
>>>>>
>>>>> 	[hack hack hack]
>>>>> 	[test test test]
>>>>> 	[debug debug debug]
>>>>> 	[occasionally commit]
>>>>> 	[occasionally git rebase -i origin/master]
>>>>>
>>>>> and the end of the topic
>>>>>
>>>>> 	git branch -M master
>>
>> Isn't this a bit dangerous? It forces to overwrite master no matter
>> what's on it. You don't see diffstats nor a fast forward message that
>> confirms what you're doing.
>
> Yeah, I should have said something like "git branch -m master"
> (implicitely assuming that you have no current "master" branch).
>
>>>>> 	git push origin master
>>
>> I'd like to see "git push" here.
>
> I think it is not asking too much for the user to be a bit more  
> precise.
> If you really do not trust your developers to be capable of that,  
> point
> them to git gui.

Well I was more precise and got lazy over time. Now the most I do
is "git push --dry-run" and if it looks good I do "git push".
Most of the time I just say "git push".

As I pointed out earlier, "git push origin <some-branch>" can create
a new branch on the remote. "git push" never creates a new branch.
I believe "git push" is safer.


>>    git branch -m <shared_branch>
>>    git push origin <shared_branch>
>>    git checkout do-not-work-here
>>    git branch -D <shared_branch>
>
> Actually, the last two commands would better be
>
> 	git checkout HEAD^{commit}
> 	git branch -d <shared_branch>

Wow, looks weird (not too me but to someone who doesn't know git).


>>> The problem I see here: you know git quite well.  Others don't, and
>>> will be mightily confused why pull updates local branches sometimes,
>>> and sometimes not.
>>
>> But it already happens now. "git pull" sometimes merges a remote  
>> branch
>> (--track) and sometimes it reports an error that is fails to do so
>> (--no-track).
>
> If there really is an inconsistent behaviour, then we'll have to  
> fix that.
> We should not introduce inconsistent behaviour on top of that.

It's not inconsistent. It's an option of a branch. Git supports two
flavours of local branches. Some branches automatically merge and other
don't.

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 10:33                                                               ` Andreas Ericsson
@ 2007-10-25 12:09                                                                 ` Steffen Prohaska
  2007-10-25 12:58                                                                 ` Johannes Schindelin
  2007-10-25 13:24                                                                 ` Theodore Tso
  2 siblings, 0 replies; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-25 12:09 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Johannes Schindelin, Peter Baumann, J. Bruce Fields,
	Jakub Narebski, Federico Mena Quintero, git


On Oct 25, 2007, at 12:33 PM, Andreas Ericsson wrote:

>> I slowly start to understand why your users are confused.   
>> _Nobody_ works on 200 branches at the same time.  (No, maintainers  
>> don't count: they do not work _on_ the branches, but _with_; they  
>> merge them.)
>> When you're done with a topic, why do you leave it around?   
>> Cluttering up your "git branch" output?
>
> We have 91 repositories at work. Roughly 60 of those are in active  
> use.
> The active repos are organized pretty much like the git repo with
> 'master', 'next' and 'maint'. We *do* work on all branches, but not
> every day, ofcourse. They're NOT topic branches. We implement features
> on topic-branches that we DO throw away, but those branches HAVE to be
> there for us to be able to handle supporting of old versions as  
> well as
> implementing new features in a sane way. Throwing them away locally  
> would
> mean having to re-create them very frequently, and since they have to
> exist in the upstream repo, "git fetch" would fetch and re-create them
> every single time anyway.
>
> So please, pretty please just drop the entire "use topic branches"  
> argument.
> We do that, but still have this problem, and it *is* a problem.

This is an interesting situation. If we find a good solution
that is accepted by the average developer in daily work. We
can probably learn a lot.

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 11:39                                                             ` Johannes Schindelin
@ 2007-10-25 12:46                                                               ` Andreas Ericsson
  2007-10-25 14:51                                                                 ` Karl Hasselström
  0 siblings, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25 12:46 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Peter Baumann, J. Bruce Fields, Steffen Prohaska, Jakub Narebski,
	Federico Mena Quintero, git

Johannes Schindelin wrote:
> Hi,
> 
> On Thu, 25 Oct 2007, Andreas Ericsson wrote:
> 
>> Johannes Schindelin wrote:
>>
>>> On Thu, 25 Oct 2007, Andreas Ericsson wrote:
>>>
>>>> Johannes Schindelin wrote:
>>>>
>>>>> On Wed, 24 Oct 2007, Andreas Ericsson wrote:
>>>>>
>>>>>> Conceptually, I don't think it'll be any problem what so ever 
>>>>>> telling anyone that the branches that aren't currently checked 
>>>>>> out get merged automatically only if they result in a 
>>>>>> fast-forward.
>>>>> It would be a matter of seconds until someone asks "why only 
>>>>> fast-forwards? Would it not be _much_ better to merge _always_?  
>>>>> Stupid git."
>>>>>
>>>>> And all because the concept of "local" vs "remote" was blurred.
>>>> It's already blurred, since we have git-pull instead of just 
>>>> git-fetch.
>>> Huh?  How is "I ask git pull to fetch the remote branch, and merge it 
>>> into my local branch" a blurring of local vs remote branch?
>>>
>>> The local branch is still the local branch where it is _my_ 
>>> responsibility to update or change anything.
>> True. So git pull saves you exactly one command. The various 
>> fetch-all-git- repos-and-update-all-fast-forward-branches in circulation 
>> at the office save us ~500 commands each time they're run. Or rather, 
>> they *could* do that, but you can't know until you've run it.
> 
> As I pointed out, there is no way to sensibly have 500 _local_ branches 
> lying around.
> 
> It is ridiculous to assume that you have to have local branches for all 
> the stable, maintenance, whatever branches.
> 
> When you have to change something, you branch, hack, develop, commit, 
> push, and then _clean up_ after yourself.  No need to clutter your 
> local branch space with unused branches.
> 

error: The branch 'next' is not a strict subset of your current HEAD.
If you are sure you want to delete it, run 'git branch -D next'.

So you want me to tell all the developers they should use "git branch
-D maint" instead, so they can bypass the built-in security checks? No
thanks.

>> So what should I do to make what I want possible, without having 
>> git-pull muddy the waters of local vs remote? There's clearly a user 
>> desire for it, besides that of my eight co-workers and myself. Introduce 
>> git-<cmd-156>?
> 
> If you _insist_ on your workflow, hey, git is a free program, and you can 
> do what you want to do with an alias easily enough.

With a git alias? No. There aren't even any switches in git to make it do
what I want. With a shell alias? Sure, it's doable, but cumbersome. With a
shell-script I can get it done, but it's ugly, inefficient and has to parse
everything twice. It's also a time-sink, and time is something I don't have
very much of right now.

>  You can even make 
> that alias part of the templates, so you can force your desires down the 
> throat of every of your coworkers.
> 

They're the ones that requested I hack it into git, but the result would
remain the same, ofcourse.

> However, that does not mean that you can insist on support for your 
> workflow in upstream git.
> 

I'm not. We're currently discussing the pros and the cons, and I'm spending
my free 20 minutes every night working on a patch-series to make git-pull
a built-in and then implementing the switch/config-option/whatever that
makes it do what I want it to do. Apart from Junio, that's how everyone
that wants a feature implemented has to do it, so I'd hardly call that
insisting. If Junio decides the patch does something evil, I'll have to
settle for cherry-picking it into whatever branch I want to build from.

On a side note; I'd *love* for it to have a rebase option as well. Perhaps
I'll do that next. In the mean-time, I'd settle for just updating locally
modifiable copies of tracking branches that I've already configured git to
merge with a tracking branch when it happens to be a fast-forward.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 10:33                                                               ` Andreas Ericsson
  2007-10-25 12:09                                                                 ` Steffen Prohaska
@ 2007-10-25 12:58                                                                 ` Johannes Schindelin
  2007-10-25 13:24                                                                 ` Theodore Tso
  2 siblings, 0 replies; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-25 12:58 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Steffen Prohaska, Peter Baumann, J. Bruce Fields, Jakub Narebski,
	Federico Mena Quintero, git

Hi,

On Thu, 25 Oct 2007, Andreas Ericsson wrote:

> Johannes Schindelin wrote:
> 
> > When you're done with a topic, why do you leave it around?  
> > Cluttering up your "git branch" output?
> 
> We have 91 repositories at work. Roughly 60 of those are in active use.
> The active repos are organized pretty much like the git repo with
> 'master', 'next' and 'maint'. We *do* work on all branches, but not
> every day, ofcourse. They're NOT topic branches.

I already explained in another mail (wasn't it even the one you replied 
to?) how this can be done more efficiently.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 10:33                                                               ` Andreas Ericsson
  2007-10-25 12:09                                                                 ` Steffen Prohaska
  2007-10-25 12:58                                                                 ` Johannes Schindelin
@ 2007-10-25 13:24                                                                 ` Theodore Tso
  2007-10-25 14:58                                                                   ` Andreas Ericsson
  2 siblings, 1 reply; 161+ messages in thread
From: Theodore Tso @ 2007-10-25 13:24 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Johannes Schindelin, Steffen Prohaska, Peter Baumann,
	J. Bruce Fields, Jakub Narebski, Federico Mena Quintero, git

On Thu, Oct 25, 2007 at 12:33:09PM +0200, Andreas Ericsson wrote:
> Because it's convenient, ofcourse. Don't you have 'maint', 'next'
> and 'master' in your clone of git.git? I'm guessing at least 99% of
> the people on this list have those branches lying around in their
> clones, even if they only ever use 'next' and/or 'master'.

I find it just as easy to say: "git checkout origin/maint" or "git
checkout origin/next" when I want to examine some other branch.

If I want to make a change against maint, then I follow up "git
checkout origin/maint" with a "git checkout -b <topic-name>".  Part of
the reason though, why I *want* to keep the topic branch around is
precisely because I don't get to push to the central repository.  So I
want to keep it around so either (a) the central maintainer can pull
from me, and I delete it only after he's done the pull, or (b) so I
can use git-chery so I can see when patches that I created and sent
via git-format-patch and git-send-email have been accepted.

You're using a diferent workflow, and with users who aren't interested
in learning the fine points of git.  But main issue is that git isn't
optimized for what you want to do.  So I can suggest a couple of
different approaches.  One is to simply do things the 'hg' way.
Explicitly set up different repos for the different branches.  It's
more inefficient, but it does work.  And if the bulk of your users
are, ah, "aggressive ignorant" about git --- and many developers don't
care about learning the fine points of their tools, and a successful
software company needs to learn how to leverage the skills of such
mid-level engineers (only at a startup or if you are at Google can you
insist only only hiring the best and brightest) --- then it might be
that the 'hg' approach is easier.  Certainly that was the approach
Larry McVoy has always used with BitKeeper, and he is focused on
meeting the needs of his corporate customers.

Another would be to set up a wrapper script for "git-clone" that
creates a separate local working directory for each branch.  So for
example, it might do something like this:

#!/bin/sh
# Usage: get-repo <URL> [dir]
URL=$1
dir=$2
branches=`git-ls-remote --heads $URL | sed -e 's;.*/;;'`
if [ "$dir"x = "x" ]; then dir=`basename $URL`; fi
git clone $URL .temp-repo
mkdir $dir
cd $dir
for i in $branches; do
    mkdir $i
    cd $i
    git init
    git remote add -t $i origin $URL
    echo ref: refs/heads/$i > .git/HEAD
    git fetch ../../.temp-repo refs/remotes/origin/$i:refs/remotes/origin/$i
    # do it a second time to get the tags (bug in fetch?)
    git fetch ../../.temp-repo refs/remotes/origin/$i:refs/remotes/origin/$i
    git merge origin/$i
    git config remote.origin.push $i:$i
    cd ..
done
cd ..
rm -rf .temp-repo

For bonus points, this script could be made smarter so that each of
the branches shared a common git object database, and some error
checking would be nice, but hopefully this gets the basic idea across.

This way, the "basic git users" get a separate working directory for
each branch, where "git pull" updates that particular branch, and "git
push" updates changes to the remote branch.  

Does this do what you want?

							- Ted

P.S.  Note by the way that if you are having everyone own access to
push into a single central repository, having a "next" branch probably
doesn't make seense.  You're probably way better off just simply
having "master" (which would be your devel branch), and "maint" for
bug fixes.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 12:46                                                               ` Andreas Ericsson
@ 2007-10-25 14:51                                                                 ` Karl Hasselström
  2007-10-25 17:10                                                                   ` Andreas Ericsson
  0 siblings, 1 reply; 161+ messages in thread
From: Karl Hasselström @ 2007-10-25 14:51 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Johannes Schindelin, Peter Baumann, J. Bruce Fields,
	Steffen Prohaska, Jakub Narebski, Federico Mena Quintero, git

On 2007-10-25 14:46:54 +0200, Andreas Ericsson wrote:

> error: The branch 'next' is not a strict subset of your current
> HEAD. If you are sure you want to delete it, run 'git branch -D
> next'.
>
> So you want me to tell all the developers they should use "git
> branch -D maint" instead, so they can bypass the built-in security
> checks? No thanks.

Maybe the solution here is to let "git branch -d" succeed if the
branch is a subset of HEAD or the branch it is tracking? That way,
deleting would succeed if upstream has all your commits.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 13:24                                                                 ` Theodore Tso
@ 2007-10-25 14:58                                                                   ` Andreas Ericsson
  2007-10-25 15:21                                                                     ` Theodore Tso
  0 siblings, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25 14:58 UTC (permalink / raw)
  To: Theodore Tso
  Cc: Johannes Schindelin, Steffen Prohaska, Peter Baumann,
	J. Bruce Fields, Jakub Narebski, Federico Mena Quintero, git

Theodore Tso wrote:
> On Thu, Oct 25, 2007 at 12:33:09PM +0200, Andreas Ericsson wrote:
>> Because it's convenient, ofcourse. Don't you have 'maint', 'next'
>> and 'master' in your clone of git.git? I'm guessing at least 99% of
>> the people on this list have those branches lying around in their
>> clones, even if they only ever use 'next' and/or 'master'.
> 
> I find it just as easy to say: "git checkout origin/maint" or "git
> checkout origin/next" when I want to examine some other branch.
> 
> If I want to make a change against maint, then I follow up "git
> checkout origin/maint" with a "git checkout -b <topic-name>".  Part of

Except that <topic-name> in this case will always be maint, since
only small bugfixes go on that branch. We tried using different-named
branches earlier, but the "git push <local-branch>" behaviour was
much too common, and we ended up with far too many randomly named
branches on the mothership repository.

> 
> You're using a diferent workflow, and with users who aren't interested
> in learning the fine points of git.  But main issue is that git isn't
> optimized for what you want to do.

Correct. I'm working on optimizing it right now though :)

>  So I can suggest a couple of
> different approaches.  One is to simply do things the 'hg' way.
> Explicitly set up different repos for the different branches.  It's
> more inefficient, but it does work.

That makes diffing harder to do, and for those few long-living topics
that get pushed to mothership, there's no logical way for the user to
get only that branch. With the *:refs/remotes/foo/* config thing, this
works seemlessly today.

> 
> Another would be to set up a wrapper script for "git-clone" that
> creates a separate local working directory for each branch.  So for
> example, it might do something like this:
> 
> #!/bin/sh
> # Usage: get-repo <URL> [dir]
> URL=$1
> dir=$2
> branches=`git-ls-remote --heads $URL | sed -e 's;.*/;;'`
> if [ "$dir"x = "x" ]; then dir=`basename $URL`; fi
> git clone $URL .temp-repo
> mkdir $dir
> cd $dir
> for i in $branches; do
>     mkdir $i
>     cd $i
>     git init
>     git remote add -t $i origin $URL
>     echo ref: refs/heads/$i > .git/HEAD
>     git fetch ../../.temp-repo refs/remotes/origin/$i:refs/remotes/origin/$i
>     # do it a second time to get the tags (bug in fetch?)
>     git fetch ../../.temp-repo refs/remotes/origin/$i:refs/remotes/origin/$i
>     git merge origin/$i
>     git config remote.origin.push $i:$i
>     cd ..
> done
> cd ..
> rm -rf .temp-repo
> 
> For bonus points, this script could be made smarter so that each of
> the branches shared a common git object database, and some error
> checking would be nice, but hopefully this gets the basic idea across.
> 
> This way, the "basic git users" get a separate working directory for
> each branch, where "git pull" updates that particular branch, and "git
> push" updates changes to the remote branch.  
> 
> Does this do what you want?
> 

Not really, I'm afraid. Apart from missing out on the auto-download of
new repos you get with "fetch = refs/heads/*:refs/remotes/origin/*",
it seems inelegant.

> 							- Ted
> 
> P.S.  Note by the way that if you are having everyone own access to
> push into a single central repository, having a "next" branch probably
> doesn't make seense.  You're probably way better off just simply
> having "master" (which would be your devel branch), and "maint" for
> bug fixes.
> 

We have
maint = maintenance code. some repos have several maint-branches
master = integration-tested code that will end up in next release
testing = unit-tested features, ready for integration testing

We can't really do without them, but perhaps I can do what Dscho
suggested in another email and force everyone to delete their
locally-modifiable branches once they're done making changes to
them. It'll end up being more commands to run for a single fix,
but at least it's not error-prone.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 14:58                                                                   ` Andreas Ericsson
@ 2007-10-25 15:21                                                                     ` Theodore Tso
  2007-10-25 17:05                                                                       ` Andreas Ericsson
  2007-10-25 18:02                                                                       ` best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued Federico Mena Quintero
  0 siblings, 2 replies; 161+ messages in thread
From: Theodore Tso @ 2007-10-25 15:21 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Johannes Schindelin, Steffen Prohaska, Peter Baumann,
	J. Bruce Fields, Jakub Narebski, Federico Mena Quintero, git

On Thu, Oct 25, 2007 at 04:58:13PM +0200, Andreas Ericsson wrote:
>
> Correct. I'm working on optimizing it right now though :)

We await your patches.  :-)

>> Another would be to set up a wrapper script for "git-clone" that
>> creates a separate local working directory for each branch.  So for
>> example, it might do something like this:
>>
>> #!/bin/sh
>> # Usage: get-repo <URL> [dir]
>> ...

> Not really, I'm afraid. Apart from missing out on the auto-download of
> new repos you get with "fetch = refs/heads/*:refs/remotes/origin/*",
> it seems inelegant.

You mean new branches, right?

And of course it's inelegant.  You just told us we were dealing with
CVS-brain-damaged corporate developers who can't be bothered to learn
about the fine points of using things the git way.  And I thought you
said there were only a few branches, "master", maint", etc. and all
the developers worked on were the tips of the branches of the
corporate mothership repository.  

It's like complaining that a car with manual transmission is too hard
to drive, and then when someone points out how this could be done with
an automatic transmission, and then complaining that that you don't
have the fine control of a manual transmission.  Well, of course you
don't!  Having that fine control requires that you *learn* how to use
that fine control correctly.

The solution I presented is more elegant than what hg does with
separate repositories, but sure, it does require disk space.  But this
disk space is cheap, even when compared with the salary costs of
CVS-damanged developers.  :-)

						- Ted

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-24 22:14                                                     ` Johannes Schindelin
  2007-10-24 22:33                                                       ` Steffen Prohaska
@ 2007-10-25 16:06                                                       ` Federico Mena Quintero
  2007-10-25 16:38                                                         ` J. Bruce Fields
  2007-10-26  4:41                                                         ` [PATCH] Make rebase smarter Steven Walter
  1 sibling, 2 replies; 161+ messages in thread
From: Federico Mena Quintero @ 2007-10-25 16:06 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Steffen Prohaska, git

On Wed, 2007-10-24 at 23:14 +0100, Johannes Schindelin wrote:

> Whenever I told people "pull = fetch + merge", they got it.
[snip]
> My "pupils" _always_ liked the preciseness of the nomenclature.  And they 
> made many less mistakes because they had a clear mental model of what is 
> remote, and what is local.  And that local branches are always forks.

This is a *very* powerful concept.  Unfortunately, it is not 100% clear
in the documentation, at least not when you are reading about
fetch/merge/pull initially.

After reading the user's manual, I just could not understand what
"fetch" does, and therefore "merge" and "pull" did not make sense.  I
could not understand where Git stored the new changes from upstream
while also keeping my working directory in the same state it was.  After
10 years of using CVS/SVN, the assumption you have is, "whenever I get
changes from the remote repository, they will be visible in my working
copy (and merge conflicts are a fact of life)".

Some time later, I ran into "Git for computer scientists" and then
finally I got it, thanks to the nice diagrams and explanation.  I
realized how powerful a concept "fetch" is:  THIS is the right way to
examine what upstream worked on while you did your own local work.

Once you understand what's going on, however, it is not obvious how to
*visualize* the state of things after you do "git fetch".  Probably
"gitk --all" is the correct way to do it, but the presentation is not
ideal --- you have to hunt down the list of commits until you find your
own "master" (or whatever branch), and *there* is where you can say,
"oh, this is where we diverged; now let's see what I'll get when I
rebase later".

So, a few problems so far, with possible solutions:

* The docs do not make it easy to understand what git-fetch does.  Can
we just cut&paste most of "Git for computer scientists" into the Git
user's manual?).

* It's not obvious how to visualize the state after git-fetch, i.e.
"gitk --all" is not the first thing that occurs to you.  Maybe git-fetch
should suggest you to run "gitk --all" when your remotes get changes, so
that you can see what's going on?

* It's hard to find the "divergence point" in gitk's display, since you
have to scroll down the reverse-chronological list of commits until you
find your local refs and where they started diverging.  Would there be a
way to "flatten" the display a bit, so your local stuff is always easy
to find, and yet it's easy to see what the remote changes were?

> And here I have to disagree strongly.  In a workflow based on a
> shared 
> repository, you do not want to merge.  You want to rebase.

.. And after I understood what "fetch" does, "rebase" became obvious,
and *this* is where I started loving Git.  I understood that in the past
all I had been doing with CVS was to rebase by hand; that is where I
said "Git is such a powerful tool".

> But _even if_ you merge instead of rebase, I fail to see how the current 
> situation is different from CVS (which many people maintain is _easier_ 
> than gi), where first thing you do is to "cvs update".  Just for git it is 
> "git pull".

It's a matter of perception.  CVS requires *less* steps, even if you do
more manual work.  To commit something, you need to

  cvs update
  <resolve conflicts by hand - they are a fact of life, remember?>
  cvs commit

Whereas with Git you need

  git fetch
  git rebase <huh, what was the name of the remote branch?>
  <fix conflicts>
  git commit
  git push

[Maybe that's not 100% the right sequence, but you know what I mean.]

So your perception is that you have to fiddle more with Git (look up the
remote branch name, invoke more git commands), even if Git saved you a
lot of work when rebasing.

When you start using a complex tool like CVS or Git, you do it by
voodoo:  you learn sequences of commands, but you don't really
understand what they do.  If one tool makes you use less comands, it is
perceived as simpler and more powerful ("because the other one needs
more babysitting").

So, Git needs to make it very clear from the beginning (in the user's
manual or the distilled tutorials) that it has *very powerful* concepts
at your disposal.  It needs to *teach you* how it will save you a lot of
work when compared to traditional tools like CVS.

  Federico

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-24 23:48                                         ` Jakub Narebski
  2007-10-25  7:42                                           ` Andreas Ericsson
@ 2007-10-25 16:16                                           ` Federico Mena Quintero
  1 sibling, 0 replies; 161+ messages in thread
From: Federico Mena Quintero @ 2007-10-25 16:16 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

On Thu, 2007-10-25 at 01:48 +0200, Jakub Narebski wrote:

> git push is opposite (almost) to git fetch, not to git pull.

This asymmetry is also part of what makes Git hard to learn at first.

There is a lot of new terminology to learn:

  refs
  remotes
  fast-forwarding
  rebasing
  origin
  master
  HEAD (which is not quite the same as good old CVS's HEAD)
  etc.

The solution is not, "have a good glossary" (which is needed, anyway),
but to make the documentation introduce those concepts at the right
time, instead of being chock-full of them from the beginning :)

Carl Worth's git-ification of the Mercurial book chapter is very nice in
this regard; it doesn't dump all the terminology on you, but rather
takes its time to introduce each concept when you are ready to know
about it [1].

It's kind of sad that the first thing "man git-push" tells you is this:

       git-push - Update remote refs along with associated objects

So you go, "refs?  associated objects?  whaaaaaat?" :)

Imagine someone learning the GIMP a few versions ago.  "I want to make
this photo sharper".  You go to the Filters/Enhance menu and you see

  Laplace
  Sobel
  Sharpen
  Unsharp mask

All of those sharpen the image.  Which one do you pick?

[1] http://cworth.org/hgbook-git/

  Federico

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-25 16:06                                                       ` Federico Mena Quintero
@ 2007-10-25 16:38                                                         ` J. Bruce Fields
  2007-10-25 18:06                                                           ` Federico Mena Quintero
  2007-10-26  4:41                                                         ` [PATCH] Make rebase smarter Steven Walter
  1 sibling, 1 reply; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-25 16:38 UTC (permalink / raw)
  To: Federico Mena Quintero; +Cc: Johannes Schindelin, Steffen Prohaska, git

On Thu, Oct 25, 2007 at 11:06:26AM -0500, Federico Mena Quintero wrote:
> So, a few problems so far, with possible solutions:
> 
> * The docs do not make it easy to understand what git-fetch does.  Can
> we just cut&paste most of "Git for computer scientists" into the Git
> user's manual?).

It's definitely not a simple cut-and-paste--even with permission from
the author of "Git for computer scientists", fitting this in would
require rethinking the ordering of topics in the manual.  Also, there's
the restriction that we'd like to keep it looking good in plain ascii,
so diagrams have to be done in ascii somehow.

But as for using ideas from "Git for computer scientists", and/or
rethinking the ordering of the user's manual to make it more helpful.
Yes, that would be great!  Let me know what I can do to help.

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 15:21                                                                     ` Theodore Tso
@ 2007-10-25 17:05                                                                       ` Andreas Ericsson
  2007-10-25 18:33                                                                         ` Junio C Hamano
  2007-10-25 18:02                                                                       ` best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued Federico Mena Quintero
  1 sibling, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25 17:05 UTC (permalink / raw)
  To: Theodore Tso
  Cc: Johannes Schindelin, Steffen Prohaska, Peter Baumann,
	J. Bruce Fields, Jakub Narebski, Federico Mena Quintero, git

Theodore Tso wrote:
> On Thu, Oct 25, 2007 at 04:58:13PM +0200, Andreas Ericsson wrote:
>> Correct. I'm working on optimizing it right now though :)
> 
> We await your patches.  :-)
> 
>>> Another would be to set up a wrapper script for "git-clone" that
>>> creates a separate local working directory for each branch.  So for
>>> example, it might do something like this:
>>>
>>> #!/bin/sh
>>> # Usage: get-repo <URL> [dir]
>>> ...
> 
>> Not really, I'm afraid. Apart from missing out on the auto-download of
>> new repos you get with "fetch = refs/heads/*:refs/remotes/origin/*",
>> it seems inelegant.
> 
> You mean new branches, right?
> 

Yes. The few topic-branches that require input from several people are
distributed this way for peer review and trouble-shooting. It's nifty
if they're automatically downloaded, but not so much of an issue that
it matters.


> And of course it's inelegant.  You just told us we were dealing with
> CVS-brain-damaged corporate developers who can't be bothered to learn
> about the fine points of using things the git way.

No, they're just surprised that what they thought would be automatic
isn't, and the curse about it when they put themselves in trouble by
forgetting about it. I've done it myself, and I've been using git since
may 2005.

>  And I thought you
> said there were only a few branches, "master", maint", etc. and all
> the developers worked on were the tips of the branches of the
> corporate mothership repository.  
> 

It depends. For small bugfixes we sometimes commit directly on the
checked out branch. For larger issues we usually create a topic branch
and hack away, creating nicely ordered patch-series and such, but those
topic branches must be created from the tip of the upstream tracking
branch. What Dscho suggested would definitely work, but that would
mean I'd have to tell my co-workers to use 'git branch -D', which I'm
quite reluctant to do. One solution to that particular problem is
ofcourse to hack the delete-command of git-branch to honor remote
tracking branches when calculating dependencies, so the local branches
can safely be removed when they're done with them.

However, there's still this issue:
$ git checkout -b foo origin/pu
Branch foo set up to track remote branch refs/remotes/origin/pu.
Switched to a new branch "foo"

git checkout will say that every time a branch is created from a
tracking branch, unless one tells it --no-track (which people don't
learn about unless they're really into git), so it's quite natural
that people think git will actually make sure, within reasonable
limits, that 'foo' is kept in sync with refs/remotes/origin/pu.
That's not the case, however.

So we could either change the message to be:
"Branch foo set up to track remote branch refs/remotes/origin/pu,
provided you only ever issue git-pull while having branch foo
checked out."

Or we could make 'git checkout -b' default to --no-track, perhaps
giving annoying messages everytime someone "git-checkout -b"'s a
remote tracking branch.
Or we could make git-pull keep git checkout's promises.

I'm opting for the latter, since that's the one that makes a piece
of machinery do some work for me. I'd happily call the command
"git-update-all-local-branches-tracking-remote-tracking-branches"
and only ever make it actually do any work if I pass it the option
"--I-bask-in-the-glory-of-local-vs-remote-confusion", but I need
some sort of solution that
a) Doesn't normally present error messages.
b) Doesn't involve routinely using "git branch -D"
c) Doesn't require more than one or two commands per repo to get
the locally checked out copies of the remote tracking branches
(the ones git has "set up to track remote branch remotes/x/branch")
up to date with their remote counterpart.


> It's like complaining that a car with manual transmission is too hard
> to drive, and then when someone points out how this could be done with
> an automatic transmission, and then complaining that that you don't
> have the fine control of a manual transmission.  Well, of course you
> don't!  Having that fine control requires that you *learn* how to use
> that fine control correctly.
> 

Or invent the sensatronic transmission system and get the best of both
worlds. Engineering solutions so they fit humans? Good gods, that's a
novel idea! ;-)

> The solution I presented is more elegant than what hg does with
> separate repositories, but sure, it does require disk space.  But this
> disk space is cheap, even when compared with the salary costs of
> CVS-damanged developers.  :-)
> 

It's not so much CVS-damaged developers as it's conflicting messages.
I'm quite confused about it myself at times, but for me there's
nobody to harrass since I was the one vetoing in git as the scm to
use for all our corporate needs.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 14:51                                                                 ` Karl Hasselström
@ 2007-10-25 17:10                                                                   ` Andreas Ericsson
  0 siblings, 0 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25 17:10 UTC (permalink / raw)
  To: Karl Hasselström
  Cc: Johannes Schindelin, Peter Baumann, J. Bruce Fields,
	Steffen Prohaska, Jakub Narebski, Federico Mena Quintero, git

Karl Hasselström wrote:
> On 2007-10-25 14:46:54 +0200, Andreas Ericsson wrote:
> 
>> error: The branch 'next' is not a strict subset of your current
>> HEAD. If you are sure you want to delete it, run 'git branch -D
>> next'.
>>
>> So you want me to tell all the developers they should use "git
>> branch -D maint" instead, so they can bypass the built-in security
>> checks? No thanks.
> 
> Maybe the solution here is to let "git branch -d" succeed if the
> branch is a subset of HEAD or the branch it is tracking? That way,
> deleting would succeed if upstream has all your commits.
> 

Deleting branches sitting on a ref reachable from any other locally
checked out branch certainly works. Since this is done to protect
commits from being pruned, and prune honors remote tracking branches
when deciding which commits are unreachable, I see no harm in letting
branches pointing to commits reachable from any remote tracking branch
be deleted.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-25 15:21                                                                     ` Theodore Tso
  2007-10-25 17:05                                                                       ` Andreas Ericsson
@ 2007-10-25 18:02                                                                       ` Federico Mena Quintero
  2007-10-25 18:04                                                                         ` Mike Hommey
                                                                                           ` (3 more replies)
  1 sibling, 4 replies; 161+ messages in thread
From: Federico Mena Quintero @ 2007-10-25 18:02 UTC (permalink / raw)
  To: Theodore Tso; +Cc: git

On Thu, 2007-10-25 at 11:21 -0400, Theodore Tso wrote:

> And of course it's inelegant.  You just told us we were dealing with
> CVS-brain-damaged corporate developers who can't be bothered to learn
> about the fine points of using things the git way.

Ignore the corporate developers who use SCMs only because their company
requires them to.  Git is not the right thing for them; some
Eclipse-based monstrosity probably is.  It's like the horrendous
Oracle-based expense-reporting thing we have to use at Novell; I use it
because they make me, not because I'm particularly excited about
reporting expenses :)

However, *do think* of the free software developers who have been using
CVS forever.  You won't make friends among them if you keep saying, "you
use CVS?  You are brain-damaged, then."  CVS has been as good/bad to
them as to anyone else, and they are probably delighted to get a better
solution.  That solution needs to take into account the concepts to
which they have been exposed for the past N years.  Just because your
new concepts are better, doesn't mean that their old ones were wrong in
their time.

You don't find quantum physicists saying, "... yeah, like Newton's
brain-damaged followers" :)

  Federico

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-25 18:02                                                                       ` best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued Federico Mena Quintero
@ 2007-10-25 18:04                                                                         ` Mike Hommey
  2007-10-25 18:18                                                                           ` J. Bruce Fields
  2007-10-25 18:23                                                                         ` Theodore Tso
                                                                                           ` (2 subsequent siblings)
  3 siblings, 1 reply; 161+ messages in thread
From: Mike Hommey @ 2007-10-25 18:04 UTC (permalink / raw)
  To: Federico Mena Quintero; +Cc: Theodore Tso, git

On Thu, Oct 25, 2007 at 01:02:19PM -0500, Federico Mena Quintero wrote:
> On Thu, 2007-10-25 at 11:21 -0400, Theodore Tso wrote:
> 
> > And of course it's inelegant.  You just told us we were dealing with
> > CVS-brain-damaged corporate developers who can't be bothered to learn
> > about the fine points of using things the git way.
> 
> Ignore the corporate developers who use SCMs only because their company
> requires them to.  Git is not the right thing for them; some
> Eclipse-based monstrosity probably is.  It's like the horrendous
> Oracle-based expense-reporting thing we have to use at Novell; I use it
> because they make me, not because I'm particularly excited about
> reporting expenses :)
> 
> However, *do think* of the free software developers who have been using
> CVS forever.  You won't make friends among them if you keep saying, "you
> use CVS?  You are brain-damaged, then."  CVS has been as good/bad to
> them as to anyone else, and they are probably delighted to get a better
> solution.  That solution needs to take into account the concepts to
> which they have been exposed for the past N years.  Just because your
> new concepts are better, doesn't mean that their old ones were wrong in
> their time.

It's probably just a matter of writing a "git for CVS users" document.

Mike

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-25 16:38                                                         ` J. Bruce Fields
@ 2007-10-25 18:06                                                           ` Federico Mena Quintero
  2007-10-25 18:16                                                             ` J. Bruce Fields
  2007-10-25 20:19                                                             ` Andreas Ericsson
  0 siblings, 2 replies; 161+ messages in thread
From: Federico Mena Quintero @ 2007-10-25 18:06 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: git

On Thu, 2007-10-25 at 12:38 -0400, J. Bruce Fields wrote:

> It's definitely not a simple cut-and-paste--even with permission from
> the author of "Git for computer scientists", fitting this in would
> require rethinking the ordering of topics in the manual.

Oh, that can be done.  It's easier to move text around than to
rearchitect code :)

> Also, there's
> the restriction that we'd like to keep it looking good in plain ascii,
> so diagrams have to be done in ascii somehow.

Hmm, what's the rationale for this?  I'd assume that most people read
the user's manual as a web page (or as bedside reading if they can print
a PDF thereof), where diagrams can be pretty.

  Federico

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-25 18:06                                                           ` Federico Mena Quintero
@ 2007-10-25 18:16                                                             ` J. Bruce Fields
  2007-10-25 20:19                                                             ` Andreas Ericsson
  1 sibling, 0 replies; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-25 18:16 UTC (permalink / raw)
  To: Federico Mena Quintero; +Cc: git

On Thu, Oct 25, 2007 at 01:06:02PM -0500, Federico Mena Quintero wrote:
> On Thu, 2007-10-25 at 12:38 -0400, J. Bruce Fields wrote:
> 
> > It's definitely not a simple cut-and-paste--even with permission from
> > the author of "Git for computer scientists", fitting this in would
> > require rethinking the ordering of topics in the manual.
> 
> Oh, that can be done.  It's easier to move text around than to
> rearchitect code :)

OK!  I'm happy to help review patches, etc.

> > Also, there's
> > the restriction that we'd like to keep it looking good in plain ascii,
> > so diagrams have to be done in ascii somehow.
> 
> Hmm, what's the rationale for this?

There have always been a lot of complaints about the difficulty of
building the documentation.  (I don't know why; at least on Debian all
you need is an "apt-get build-dep git-core".)  And our response has been
"no problem, you can just read the source."  That's a big reason why
asciidoc was chosen.

> I'd assume that most people read the user's manual as a web page (or
> as bedside reading if they can print a PDF thereof), where diagrams
> can be pretty.

Yeah.  Heck, I just read it by pointing my web browser at kernel.org's
html copy....

So you might get some sympathy for a request for fancier diagrams, I
don't know.  It would require some more discussion, so I'd rather not
have other improvements blocked by this.

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-25 18:04                                                                         ` Mike Hommey
@ 2007-10-25 18:18                                                                           ` J. Bruce Fields
  0 siblings, 0 replies; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-25 18:18 UTC (permalink / raw)
  To: Mike Hommey; +Cc: Federico Mena Quintero, Theodore Tso, git

On Thu, Oct 25, 2007 at 08:04:51PM +0200, Mike Hommey wrote:
> On Thu, Oct 25, 2007 at 01:02:19PM -0500, Federico Mena Quintero wrote:
> > On Thu, 2007-10-25 at 11:21 -0400, Theodore Tso wrote:
> > 
> > > And of course it's inelegant.  You just told us we were dealing with
> > > CVS-brain-damaged corporate developers who can't be bothered to learn
> > > about the fine points of using things the git way.
> > 
> > Ignore the corporate developers who use SCMs only because their company
> > requires them to.  Git is not the right thing for them; some
> > Eclipse-based monstrosity probably is.  It's like the horrendous
> > Oracle-based expense-reporting thing we have to use at Novell; I use it
> > because they make me, not because I'm particularly excited about
> > reporting expenses :)
> > 
> > However, *do think* of the free software developers who have been using
> > CVS forever.  You won't make friends among them if you keep saying, "you
> > use CVS?  You are brain-damaged, then."  CVS has been as good/bad to
> > them as to anyone else, and they are probably delighted to get a better
> > solution.  That solution needs to take into account the concepts to
> > which they have been exposed for the past N years.  Just because your
> > new concepts are better, doesn't mean that their old ones were wrong in
> > their time.
> 
> It's probably just a matter of writing a "git for CVS users" document.

First google hit for "git for CVS users":

	http://www.kernel.org/pub/software/scm/git/docs/cvs-migration.html

patches welcomed....

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-25 18:02                                                                       ` best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued Federico Mena Quintero
  2007-10-25 18:04                                                                         ` Mike Hommey
@ 2007-10-25 18:23                                                                         ` Theodore Tso
  2007-10-25 20:08                                                                         ` Andreas Ericsson
  2007-10-26 20:01                                                                         ` David Kastrup
  3 siblings, 0 replies; 161+ messages in thread
From: Theodore Tso @ 2007-10-25 18:23 UTC (permalink / raw)
  Cc: git

On Thu, Oct 25, 2007 at 01:02:19PM -0500, Federico Mena Quintero wrote:
> On Thu, 2007-10-25 at 11:21 -0400, Theodore Tso wrote:
> 
> > And of course it's inelegant.  You just told us we were dealing with
> > CVS-brain-damaged corporate developers who can't be bothered to learn
> > about the fine points of using things the git way.
> 
> Ignore the corporate developers who use SCMs only because their company
> requires them to.  Git is not the right thing for them; some
> Eclipse-based monstrosity probably is.  It's like the horrendous
> Oracle-based expense-reporting thing we have to use at Novell; I use it
> because they make me, not because I'm particularly excited about
> reporting expenses :)

I think I misunderstand Andreas' problem statement.  What I proposed
is useful for corporate developers who are deeply confused by
branches, especially when a single working directory is constantly
jumping back and forth between several branches.  (Having the current
branch in your bash prompt is a *big* help here, but we can't count on
them having it.)

So setting up a solution where each branch gets its own working
directory is a great solution where you have some number of newbie
developers in a company that get easily confused, while still
providing advanced users the ability to use the full power of git, and
giving both the newbie and advanced users the advantages of
disconnected operations.  And, of course, hopefully some day the
newbie users will grow up to become advanced users.

Right now I suspect a number of projects who have picked hg or bzr do
so because the traditional git model is too confusing to newbie users.
So for those people, creating the model where branch == a separate
directory may make life easier for them.  That's probably the one
thing that bzr does much better than git; it has a number of modes
which act as training wheels for the easily confused user.  For
example, the bzr's "bound branch" requires you to have network access,
since anything that modifies the local repository requires hitting the
remote server as well.  Horrible!  Gives you all of the downsides of
CVS!  But it allows some users to use the SCM is CVS-style mode, while
allowing more advanced users to use it in a more distributed mode.

So I think it *is* useful to help the corporate developers, because
that means there are more git users --- and someday some of us on this
list might have to work at such a company, and better that they use
git than something like perforce or Clearcase, right?  :-)

> However, *do think* of the free software developers who have been using
> CVS forever.  You won't make friends among them if you keep saying, "you
> use CVS?  You are brain-damaged, then."  

Fair enough.  I used the term somewhat toungue-in-cheek, and I
probably should have said "newbie user" instead.

							- Ted

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 17:05                                                                       ` Andreas Ericsson
@ 2007-10-25 18:33                                                                         ` Junio C Hamano
  2007-10-25 20:18                                                                           ` Andreas Ericsson
  0 siblings, 1 reply; 161+ messages in thread
From: Junio C Hamano @ 2007-10-25 18:33 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Theodore Tso, Johannes Schindelin, Steffen Prohaska,
	Peter Baumann, J. Bruce Fields, Jakub Narebski,
	Federico Mena Quintero, git

Andreas Ericsson <ae@op5.se> writes:

> However, there's still this issue:
> $ git checkout -b foo origin/pu
> Branch foo set up to track remote branch refs/remotes/origin/pu.
> Switched to a new branch "foo"
>
> git checkout will say that every time a branch is created from a
> tracking branch, unless one tells it --no-track (which people don't
> learn about unless they're really into git), so it's quite natural
> that people think git will actually make sure, within reasonable
> limits, that 'foo' is kept in sync with refs/remotes/origin/pu.
> That's not the case, however.
>
> So we could either change the message to be:
> "Branch foo set up to track remote branch refs/remotes/origin/pu,
> provided you only ever issue git-pull while having branch foo
> checked out."
>
> Or we could make 'git checkout -b' default to --no-track, perhaps
> giving annoying messages everytime someone "git-checkout -b"'s a
> remote tracking branch.
> Or we could make git-pull keep git checkout's promises.

The thing is, if you have 200 local branches (because you
interact with 50 repositories with 4 primary branches each), you
do not constantly check all of them out anyway.  And the only
place that staleness of the local tracking fork matters is when
you check it out (that is, as long as you train your users that
the way to check differences with the upstream 'pu' in your case
is by doing operations with 'origin/pu' not with your local
'foo').

With that in mind, how about making "git checkout foo", after
foo is set up thusly, to show:

	git log --pretty=oneline --left-right origin/pu...foo

if (and only if) they have diverged?  Then you can deal with the
staleness of local tracking fork 'foo' in any way you want.

You could even go one step further and make this "checkout foo",
in addition to or instead of showing the above left-right log,

 - automatically run "git merge origin/pu" if it is a
   fast-forward, and say it did _not_ run that merge if it is
   not a fast-forward;

 - automatically run "git merge origin/pu" always, even if it is
   not a fast-forward;

 - automatically run "git rebase origin/pu" always;

Would that make your life easier?

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-22 23:21                                   ` Johannes Schindelin
@ 2007-10-25 19:04                                     ` Carl Worth
  0 siblings, 0 replies; 161+ messages in thread
From: Carl Worth @ 2007-10-25 19:04 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Federico Mena Quintero, Andreas Ericsson, git

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

On Tue, 23 Oct 2007 00:21:03 +0100 (BST), Johannes Schindelin wrote:
> On Mon, 22 Oct 2007, Federico Mena Quintero wrote:
> >
> > The "branches should not track their origin by default"


Did this change recently? I just wrote a long message arguing for the
"autosetupmerge = 1" behavior by default, but when I tested with
1.5.3.4 it seems to be there already.

Am I seeing that correctly?

If so, thank you and congratulations! Not having to pass --track nor
manually configure autosetupmerge to get this very useful behavior is
a very nice change!

A nice followup would be to improve the documentation for "git pull"
to better indicate some of the smarts that are now inherent in it.

I'll take a whack at that, (just as soon as I finish reading the rest
of this giant thread...).

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-25 18:02                                                                       ` best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued Federico Mena Quintero
  2007-10-25 18:04                                                                         ` Mike Hommey
  2007-10-25 18:23                                                                         ` Theodore Tso
@ 2007-10-25 20:08                                                                         ` Andreas Ericsson
  2007-10-26 20:01                                                                         ` David Kastrup
  3 siblings, 0 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25 20:08 UTC (permalink / raw)
  To: Federico Mena Quintero; +Cc: Theodore Tso, git

Federico Mena Quintero wrote:
> On Thu, 2007-10-25 at 11:21 -0400, Theodore Tso wrote:
> 
>> And of course it's inelegant.  You just told us we were dealing with
>> CVS-brain-damaged corporate developers who can't be bothered to learn
>> about the fine points of using things the git way.
> 
> Ignore the corporate developers who use SCMs only because their company
> requires them to.  Git is not the right thing for them;

Quite contrary to what I think, and quite contrary to what Linus said in
his google speach. The problem with using a chainsaw instead of a tooth-
pick is that it's much easier to hurt yourself with a chainsaw. It's a
lot easier to get real work done though.

> some
> Eclipse-based monstrosity probably is.  It's like the horrendous
> Oracle-based expense-reporting thing we have to use at Novell; I use it
> because they make me, not because I'm particularly excited about
> reporting expenses :)
> 

Nobody's particularly excited about reporting expenses. That's why there
are so few OSS solutions for it, and the ones that exist suck horribly
because whoever got the job of making the system knew his users would
simply hate it, no matter how perfect it was. It's one of those things ;-)

> However, *do think* of the free software developers who have been using
> CVS forever.  You won't make friends among them if you keep saying, "you
> use CVS?  You are brain-damaged, then."  CVS has been as good/bad to
> them as to anyone else, and they are probably delighted to get a better
> solution.  That solution needs to take into account the concepts to
> which they have been exposed for the past N years.  Just because your
> new concepts are better, doesn't mean that their old ones were wrong in
> their time.
> 

Well, perhaps they were. CVS was a fairly important learning phase, much
like Thomas Edison who first discovered 2000 ways of not making a light-
bulb. It doesn't make them less valuable though, and the reason to keep
going until perfection is reached is that machines are made for work, and
humans are made for fun.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 18:33                                                                         ` Junio C Hamano
@ 2007-10-25 20:18                                                                           ` Andreas Ericsson
  2007-10-26  6:18                                                                             ` Steffen Prohaska
  0 siblings, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25 20:18 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Theodore Tso, Johannes Schindelin, Steffen Prohaska,
	Peter Baumann, J. Bruce Fields, Jakub Narebski,
	Federico Mena Quintero, git

Junio C Hamano wrote:
> Andreas Ericsson <ae@op5.se> writes:
> 
>> However, there's still this issue:
>> $ git checkout -b foo origin/pu
>> Branch foo set up to track remote branch refs/remotes/origin/pu.
>> Switched to a new branch "foo"
>>
>> git checkout will say that every time a branch is created from a
>> tracking branch, unless one tells it --no-track (which people don't
>> learn about unless they're really into git), so it's quite natural
>> that people think git will actually make sure, within reasonable
>> limits, that 'foo' is kept in sync with refs/remotes/origin/pu.
>> That's not the case, however.
>>
>> So we could either change the message to be:
>> "Branch foo set up to track remote branch refs/remotes/origin/pu,
>> provided you only ever issue git-pull while having branch foo
>> checked out."
>>
>> Or we could make 'git checkout -b' default to --no-track, perhaps
>> giving annoying messages everytime someone "git-checkout -b"'s a
>> remote tracking branch.
>> Or we could make git-pull keep git checkout's promises.
> 
> The thing is, if you have 200 local branches (because you
> interact with 50 repositories with 4 primary branches each), you
> do not constantly check all of them out anyway.  And the only
> place that staleness of the local tracking fork matters is when
> you check it out (that is, as long as you train your users that
> the way to check differences with the upstream 'pu' in your case
> is by doing operations with 'origin/pu' not with your local
> 'foo').
> 

Probably, although I think the confusion of 'foo' being something
else than 'origin/pu' after it's been checked out would be hard
to explain. I'll see how the patch turns out. If it all goes tits
up, I'll see if a post-checkout hook can solve it.

> With that in mind, how about making "git checkout foo", after
> foo is set up thusly, to show:
> 
> 	git log --pretty=oneline --left-right origin/pu...foo
> 
> if (and only if) they have diverged?  Then you can deal with the
> staleness of local tracking fork 'foo' in any way you want.
> 
> You could even go one step further and make this "checkout foo",
> in addition to or instead of showing the above left-right log,
> 
>  - automatically run "git merge origin/pu" if it is a
>    fast-forward, and say it did _not_ run that merge if it is
>    not a fast-forward;
> 
>  - automatically run "git merge origin/pu" always, even if it is
>    not a fast-forward;
> 
>  - automatically run "git rebase origin/pu" always;
> 
> Would that make your life easier?

That it would, except the confusion would then be that it's automatically
rebased for the branches one currently hasn't got checked out while pulling,
and the branch that *is* checked out gets merged (crazy, yes), so those
who prefer the rebase would get what they want by doing something completely
bonkers, such as:

git checkout -b just-gonna-pull HEAD^
git pull
git checkout whatever-other-branch-they-were-on

(yes, "aggresively ignorant", I think Ted said in an earlier mail)

It'd probably be better to go with Dscho's suggestion, although I'm not quite
sure what that was any more. It involved automagical rebasing on fetch or pull
though.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-25 18:06                                                           ` Federico Mena Quintero
  2007-10-25 18:16                                                             ` J. Bruce Fields
@ 2007-10-25 20:19                                                             ` Andreas Ericsson
  2007-10-25 20:27                                                               ` J. Bruce Fields
  1 sibling, 1 reply; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-25 20:19 UTC (permalink / raw)
  To: Federico Mena Quintero; +Cc: J. Bruce Fields, git

Federico Mena Quintero wrote:
> On Thu, 2007-10-25 at 12:38 -0400, J. Bruce Fields wrote:
> 
>> It's definitely not a simple cut-and-paste--even with permission from
>> the author of "Git for computer scientists", fitting this in would
>> require rethinking the ordering of topics in the manual.
> 
> Oh, that can be done.  It's easier to move text around than to
> rearchitect code :)
> 

It misses the point though. Machines should work while humans are
lounging. If the humans have to read a lot to get the machines to
work, there's less time for lounging ;-)

>> Also, there's
>> the restriction that we'd like to keep it looking good in plain ascii,
>> so diagrams have to be done in ascii somehow.
> 
> Hmm, what's the rationale for this?  I'd assume that most people read
> the user's manual as a web page (or as bedside reading if they can print
> a PDF thereof), where diagrams can be pretty.
> 

man pages.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-25 20:19                                                             ` Andreas Ericsson
@ 2007-10-25 20:27                                                               ` J. Bruce Fields
  2007-10-26  9:17                                                                 ` David Kastrup
  0 siblings, 1 reply; 161+ messages in thread
From: J. Bruce Fields @ 2007-10-25 20:27 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: Federico Mena Quintero, git

On Thu, Oct 25, 2007 at 10:19:58PM +0200, Andreas Ericsson wrote:
> Federico Mena Quintero wrote:
>> On Thu, 2007-10-25 at 12:38 -0400, J. Bruce Fields wrote:
>>> Also, there's
>>> the restriction that we'd like to keep it looking good in plain ascii,
>>> so diagrams have to be done in ascii somehow.
>> Hmm, what's the rationale for this?  I'd assume that most people read
>> the user's manual as a web page (or as bedside reading if they can print
>> a PDF thereof), where diagrams can be pretty.
>
> man pages.

I think he's talking about Documentation/user-manual.txt, which isn't
turned into man pages.  (Might be nice if it could be though, I
suppose.)

--b.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* [PATCH] Make rebase smarter
  2007-10-25 16:06                                                       ` Federico Mena Quintero
  2007-10-25 16:38                                                         ` J. Bruce Fields
@ 2007-10-26  4:41                                                         ` Steven Walter
  2007-10-26  7:42                                                           ` Andreas Ericsson
                                                                             ` (2 more replies)
  1 sibling, 3 replies; 161+ messages in thread
From: Steven Walter @ 2007-10-26  4:41 UTC (permalink / raw)
  To: git, federico; +Cc: Steven Walter

It is a common workflow to run "git fetch; git rebase origin/<foo>" Where
foo is the remote tracking branch.  git-rebase should default to using
the remote tracking branch if no other ref is given.

Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
---
 git-rebase.sh |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index 058fcac..1a2b51b 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -261,8 +261,19 @@ case "$diff" in
 	;;
 esac
 
-# The upstream head must be given.  Make sure it is valid.
 upstream_name="$1"
+# Default to the remote tracking branch if we have one
+if [ -z "$upstream_name" ]
+then
+	curr_branch=$(git symbolic-ref -q HEAD)
+	curr_branch=${curr_branch//refs\/heads\//}
+	merge=$(git config branch.$curr_branch.merge)
+	remote=$(git config branch.$curr_branch.remote)
+	fetch=$(git config remote.$remote.fetch)
+
+	expanded=$(git fetch--tool expand-refs-wildcard "0000000000000000000000000000000000000000 $merge" "$remote" "$fetch")
+	upstream_name=${expanded/#*:/}
+fi
 upstream=`git rev-parse --verify "${upstream_name}^0"` ||
     die "invalid upstream $upstream_name"
 
-- 
1.5.3.4.1.gb4ad62-dirty

^ permalink raw reply related	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-25 20:18                                                                           ` Andreas Ericsson
@ 2007-10-26  6:18                                                                             ` Steffen Prohaska
  2007-10-26  7:53                                                                               ` Andreas Ericsson
  0 siblings, 1 reply; 161+ messages in thread
From: Steffen Prohaska @ 2007-10-26  6:18 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Junio C Hamano, Theodore Tso, Johannes Schindelin, Peter Baumann,
	J. Bruce Fields, Jakub Narebski, Federico Mena Quintero, git


On Oct 25, 2007, at 10:18 PM, Andreas Ericsson wrote:

> Junio C Hamano wrote:
>> Andreas Ericsson <ae@op5.se> writes:
>
>> With that in mind, how about making "git checkout foo", after
>> foo is set up thusly, to show:
>> 	git log --pretty=oneline --left-right origin/pu...foo
>> if (and only if) they have diverged?  Then you can deal with the
>> staleness of local tracking fork 'foo' in any way you want.
>> You could even go one step further and make this "checkout foo",
>> in addition to or instead of showing the above left-right log,
>>  - automatically run "git merge origin/pu" if it is a
>>    fast-forward, and say it did _not_ run that merge if it is
>>    not a fast-forward;
>>  - automatically run "git merge origin/pu" always, even if it is
>>    not a fast-forward;
>>  - automatically run "git rebase origin/pu" always;
>> Would that make your life easier?
>
> That it would, except the confusion would then be that it's  
> automatically
> rebased for the branches one currently hasn't got checked out while  
> pulling,
> and the branch that *is* checked out gets merged (crazy, yes), so  
> those
> who prefer the rebase would get what they want by doing something  
> completely
> bonkers, such as:
>
> git checkout -b just-gonna-pull HEAD^
> git pull
> git checkout whatever-other-branch-they-were-on
>
> (yes, "aggresively ignorant", I think Ted said in an earlier mail)
>
> It'd probably be better to go with Dscho's suggestion, although I'm  
> not quite
> sure what that was any more. It involved automagical rebasing on  
> fetch or pull
> though.

git pull's automagic and the automatic behaviour of git checkout
proposed by Junio should always do the same. git pull should
be changed to act a if your three commands were fused into it
(but obviously implemented differently).

I think teaching "git checkout" a dwim mode is quite
interesting.  The required work to bring a local branch
up-to-date with a remote branch is deferred until really needed.
An then "git checkout" does the right thing. A lot of automagic
but definitely intriguing.

	Steffen

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: [PATCH] Make rebase smarter
  2007-10-26  4:41                                                         ` [PATCH] Make rebase smarter Steven Walter
@ 2007-10-26  7:42                                                           ` Andreas Ericsson
  2007-10-26  9:57                                                           ` Johannes Schindelin
  2007-10-26 21:02                                                           ` Junio C Hamano
  2 siblings, 0 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-26  7:42 UTC (permalink / raw)
  To: Steven Walter; +Cc: git, federico

Steven Walter wrote:
> It is a common workflow to run "git fetch; git rebase origin/<foo>" Where
> foo is the remote tracking branch.  git-rebase should default to using
> the remote tracking branch if no other ref is given.
> 

I like it. :)

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
  2007-10-26  6:18                                                                             ` Steffen Prohaska
@ 2007-10-26  7:53                                                                               ` Andreas Ericsson
  0 siblings, 0 replies; 161+ messages in thread
From: Andreas Ericsson @ 2007-10-26  7:53 UTC (permalink / raw)
  To: Steffen Prohaska
  Cc: Junio C Hamano, Theodore Tso, Johannes Schindelin, Peter Baumann,
	J. Bruce Fields, Jakub Narebski, Federico Mena Quintero, git

Steffen Prohaska wrote:
> 
> On Oct 25, 2007, at 10:18 PM, Andreas Ericsson wrote:
> 
>> Junio C Hamano wrote:
>>> Andreas Ericsson <ae@op5.se> writes:
>>
>>> With that in mind, how about making "git checkout foo", after
>>> foo is set up thusly, to show:
>>>     git log --pretty=oneline --left-right origin/pu...foo
>>> if (and only if) they have diverged?  Then you can deal with the
>>> staleness of local tracking fork 'foo' in any way you want.
>>> You could even go one step further and make this "checkout foo",
>>> in addition to or instead of showing the above left-right log,
>>>  - automatically run "git merge origin/pu" if it is a
>>>    fast-forward, and say it did _not_ run that merge if it is
>>>    not a fast-forward;
>>>  - automatically run "git merge origin/pu" always, even if it is
>>>    not a fast-forward;
>>>  - automatically run "git rebase origin/pu" always;
>>> Would that make your life easier?
>>
>> That it would, except the confusion would then be that it's automatically
>> rebased for the branches one currently hasn't got checked out while 
>> pulling,
>> and the branch that *is* checked out gets merged (crazy, yes), so those
>> who prefer the rebase would get what they want by doing something 
>> completely
>> bonkers, such as:
>>
>> git checkout -b just-gonna-pull HEAD^
>> git pull
>> git checkout whatever-other-branch-they-were-on
>>
>> (yes, "aggresively ignorant", I think Ted said in an earlier mail)
>>
>> It'd probably be better to go with Dscho's suggestion, although I'm 
>> not quite
>> sure what that was any more. It involved automagical rebasing on fetch 
>> or pull
>> though.
> 
> git pull's automagic and the automatic behaviour of git checkout
> proposed by Junio should always do the same. git pull should
> be changed to act a if your three commands were fused into it
> (but obviously implemented differently).
> 

I think it would be better to implement it as a different command that
would do all those weird and tedious dwim things that suit a particular
kind of developer, but only so long as those operations succeed without
conflicts.

So for example the flow could go something like this;
---
read_branch_merge_config();

git fetch

if prefetch(local == remote_tracking)
	set ref local to match ref remote_tracking;
else if (--safe-rebase)
	try_rebase local onto remote_tracking;
---

It's such a common operation that I really do think it's worth
having support for it. Perhaps with a "--try-rebase" option to
git-pull.

If we then add a a "--push-after-pull" (to work on the current
branch only) we have the "git sync" alias readily available to
accommodate the average reluctant git user, and I'm sure gui
hackers could do wonders with it, especially on windows, where
people seem accustomed to a lot of things happening when clicking
a single button.

> I think teaching "git checkout" a dwim mode is quite
> interesting.  The required work to bring a local branch
> up-to-date with a remote branch is deferred until really needed.
> An then "git checkout" does the right thing. A lot of automagic
> but definitely intriguing.
> 

Yup, and it can be done with a post-checkout hook (which I notice
there are no examples for, so I've added that to my ever-growing
todo).

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-25 20:27                                                               ` J. Bruce Fields
@ 2007-10-26  9:17                                                                 ` David Kastrup
  0 siblings, 0 replies; 161+ messages in thread
From: David Kastrup @ 2007-10-26  9:17 UTC (permalink / raw)
  To: git

"J. Bruce Fields" <bfields@fieldses.org> writes:

> On Thu, Oct 25, 2007 at 10:19:58PM +0200, Andreas Ericsson wrote:
>> Federico Mena Quintero wrote:
>>> On Thu, 2007-10-25 at 12:38 -0400, J. Bruce Fields wrote:
>>>> Also, there's
>>>> the restriction that we'd like to keep it looking good in plain ascii,
>>>> so diagrams have to be done in ascii somehow.
>>> Hmm, what's the rationale for this?  I'd assume that most people read
>>> the user's manual as a web page (or as bedside reading if they can print
>>> a PDF thereof), where diagrams can be pretty.
>>
>> man pages.
>
> I think he's talking about Documentation/user-manual.txt, which
> isn't turned into man pages.  (Might be nice if it could be though,
> I suppose.)

I think it would be nicer if the man pages could be turned into an
appendix in the user manual.

I had no success in persuading the toolchain to do that, however.
_WAY_ above my head to figure out the interaction of Docbook, Asciidoc
and similar in order to achieve that effect.

-- 
David Kastrup

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: [PATCH] Make rebase smarter
  2007-10-26  4:41                                                         ` [PATCH] Make rebase smarter Steven Walter
  2007-10-26  7:42                                                           ` Andreas Ericsson
@ 2007-10-26  9:57                                                           ` Johannes Schindelin
  2007-10-26 21:02                                                           ` Junio C Hamano
  2 siblings, 0 replies; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-26  9:57 UTC (permalink / raw)
  To: Steven Walter; +Cc: git, federico

Hi,

On Fri, 26 Oct 2007, Steven Walter wrote:

> It is a common workflow to run "git fetch; git rebase origin/<foo>" 
> Where foo is the remote tracking branch.  git-rebase should default to 
> using the remote tracking branch if no other ref is given.

This is potentially dangerous, as git-rebase does not use a detached HEAD 
to replay the operations.  Therefore you cannot go back easily when 
you started "git rebase" just to see its usage, and instead it did 
unwanted things.

So I really think that you need a patch before this one, so that

	git reset --hard <branchname>@{1}

goes back to the pre-merge state after an inadvertent rebase.  (Note: this 
behaviour is already implemented in rebase -i, because detached HEAD was 
available at that time, as opposed to the time when git-rebase was 
written.)

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued
  2007-10-25 18:02                                                                       ` best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued Federico Mena Quintero
                                                                                           ` (2 preceding siblings ...)
  2007-10-25 20:08                                                                         ` Andreas Ericsson
@ 2007-10-26 20:01                                                                         ` David Kastrup
  3 siblings, 0 replies; 161+ messages in thread
From: David Kastrup @ 2007-10-26 20:01 UTC (permalink / raw)
  To: Federico Mena Quintero; +Cc: Theodore Tso, git

Federico Mena Quintero <federico@novell.com> writes:

> You don't find quantum physicists saying, "... yeah, like Newton's
> brain-damaged followers" :)

Oh, one does get this sort of comments.  Predominantly from those who
understand neither theory.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: [PATCH] Make rebase smarter
  2007-10-26  4:41                                                         ` [PATCH] Make rebase smarter Steven Walter
  2007-10-26  7:42                                                           ` Andreas Ericsson
  2007-10-26  9:57                                                           ` Johannes Schindelin
@ 2007-10-26 21:02                                                           ` Junio C Hamano
  2007-10-26 23:13                                                             ` Johannes Schindelin
  2 siblings, 1 reply; 161+ messages in thread
From: Junio C Hamano @ 2007-10-26 21:02 UTC (permalink / raw)
  To: Steven Walter; +Cc: git, federico

Steven Walter <stevenrwalter@gmail.com> writes:

> It is a common workflow to run "git fetch; git rebase origin/<foo>" Where
> foo is the remote tracking branch.  git-rebase should default to using
> the remote tracking branch if no other ref is given.

This would be a reasonable choice between refusing outright and
picking one possible action.  I do not have a strong preference
as to what that "one possible action" should be, but if people
like to base on the remote tracking branch set to merge by
default, I am fine with it.

> +	curr_branch=$(git symbolic-ref -q HEAD)
> +	curr_branch=${curr_branch//refs\/heads\//}
> +	merge=$(git config branch.$curr_branch.merge)
> +	remote=$(git config branch.$curr_branch.remote)
> +	fetch=$(git config remote.$remote.fetch)
> +
> +	expanded=$(git fetch--tool expand-refs-wildcard "0000000000000000000000000000000000000000 $merge" "$remote" "$fetch")
> +	upstream_name=${expanded/#*:/}
> +fi
>  upstream=`git rev-parse --verify "${upstream_name}^0"` ||
>      die "invalid upstream $upstream_name"

 * How does this work if there is no such tracking configuration?

   - branch.<curr>.merge may be missing;
   - branch.<curr>.remote may be missing;
   - remote.<remote>.fetch may be explicit, multiple and/or non-wildcard;

 * ${parameter/pattern/string} is a bashism we do not allow in
   git scripts.

Problems in the implementation aside, it probably makes sense to
first have a helper function that takes a local branch name and
computes the remote tracking branch that a given local branch is
set to merge from, if exists, and use it here.  I suspect there
are other places in the Porcelain that would benefit from such a
helper function.

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: [PATCH] Make rebase smarter
  2007-10-26 21:02                                                           ` Junio C Hamano
@ 2007-10-26 23:13                                                             ` Johannes Schindelin
  2007-10-26 23:29                                                               ` Junio C Hamano
  0 siblings, 1 reply; 161+ messages in thread
From: Johannes Schindelin @ 2007-10-26 23:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Steven Walter, git, federico

Hi,

On Fri, 26 Oct 2007, Junio C Hamano wrote:

> Steven Walter <stevenrwalter@gmail.com> writes:
> 
> > It is a common workflow to run "git fetch; git rebase origin/<foo>" 
> > Where foo is the remote tracking branch.  git-rebase should default to 
> > using the remote tracking branch if no other ref is given.
> 
> This would be a reasonable choice between refusing outright and
> picking one possible action.

Another sensible choice would be "git rebase FETCH_HEAD", at least just 
after a "git fetch <nick> <branch>"...

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 161+ messages in thread

* Re: [PATCH] Make rebase smarter
  2007-10-26 23:13                                                             ` Johannes Schindelin
@ 2007-10-26 23:29                                                               ` Junio C Hamano
  0 siblings, 0 replies; 161+ messages in thread
From: Junio C Hamano @ 2007-10-26 23:29 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Steven Walter, git, federico

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Fri, 26 Oct 2007, Junio C Hamano wrote:
>
>> Steven Walter <stevenrwalter@gmail.com> writes:
>> 
>> > It is a common workflow to run "git fetch; git rebase origin/<foo>" 
>> > Where foo is the remote tracking branch.  git-rebase should default to 
>> > using the remote tracking branch if no other ref is given.
>> 
>> This would be a reasonable choice between refusing outright and
>> picking one possible action.
>
> Another sensible choice would be "git rebase FETCH_HEAD", at least just 
> after a "git fetch <nick> <branch>"...

We can get the best of both worlds by noticing a line in
FETCH_HEAD without not-for-merge marker and use that as the
'onto' commit for the rebase.

^ permalink raw reply	[flat|nested] 161+ messages in thread

end of thread, other threads:[~2007-10-26 23:29 UTC | newest]

Thread overview: 161+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-08 20:55 Git User's Survey 2007 unfinished summary continued Jakub Narebski
2007-10-12 22:08 ` Jakub Narebski
2007-10-12 23:36   ` Frank Lichtenheld
2007-10-13  0:46   ` Johannes Schindelin
2007-10-13  2:13     ` J. Bruce Fields
2007-10-13  2:53     ` Shawn O. Pearce
2007-10-13 12:58     ` Frank Lichtenheld
2007-10-13 13:04       ` Johannes Schindelin
2007-10-13 18:00     ` Andreas Ericsson
2007-10-13 19:59     ` David Kastrup
2007-10-13 20:27       ` J. Bruce Fields
2007-10-13 20:57         ` David Kastrup
2007-10-14  0:36         ` Johannes Schindelin
2007-10-14  1:13           ` Linus Torvalds
2007-10-14  1:44             ` Shawn O. Pearce
2007-10-14  3:15               ` Linus Torvalds
2007-10-14  3:43                 ` david
2007-10-14  3:55                   ` Linus Torvalds
2007-10-14 10:20               ` Reece Dunn
2007-10-14 18:12                 ` Steven Grimm
2007-10-14 18:40                   ` J. Bruce Fields
2007-10-14 19:25                     ` Steven Grimm
2007-10-14 19:50                     ` Andreas Ericsson
2007-10-14 20:18                       ` Johannes Schindelin
2007-10-14 20:22                         ` Andreas Ericsson
2007-10-14 20:24                         ` J. Bruce Fields
2007-10-14 19:44                   ` Nicolas Pitre
2007-10-15 23:20                     ` Shawn O. Pearce
2007-10-16  2:48                       ` Nicolas Pitre
2007-10-16 10:51                         ` Johannes Schindelin
2007-10-14  2:06             ` Johannes Schindelin
2007-10-14  8:45               ` Andreas Ericsson
2007-10-14  9:21                 ` David Kastrup
2007-10-14 21:49       ` Jakub Narebski
2007-10-14 22:08         ` Johannes Schindelin
2007-10-14 22:17           ` David Kastrup
2007-10-14 22:12         ` David Kastrup
2007-10-14 22:15           ` Jakub Narebski
2007-10-14 22:23           ` Matthew Andrews
2007-10-14 22:30             ` David Kastrup
2007-10-14 21:10     ` David Tweed
2007-10-19 20:57     ` Federico Mena Quintero
2007-10-19 23:27       ` Jakub Narebski
2007-10-19 23:37       ` Johannes Schindelin
2007-10-22 14:28         ` Federico Mena Quintero
2007-10-20  8:03       ` Andreas Ericsson
2007-10-20 10:19         ` Steffen Prohaska
2007-10-20 11:29           ` Andreas Ericsson
2007-10-21  6:08             ` Dmitry Potapov
2007-10-20 23:06           ` Jakub Narebski
2007-10-20 23:33             ` Johannes Schindelin
2007-10-21  7:17               ` Andreas Ericsson
2007-10-21 22:15                 ` Johannes Schindelin
2007-10-22  7:59                   ` Andreas Ericsson
2007-10-22 11:04                     ` best git practices, was " Johannes Schindelin
2007-10-22 12:44                       ` Andreas Ericsson
2007-10-22 13:48                         ` Johannes Schindelin
2007-10-22 14:31                           ` Andreas Ericsson
2007-10-22 15:00                             ` Johannes Schindelin
2007-10-22 15:16                               ` Andreas Ericsson
2007-10-22 15:42                                 ` Steffen Prohaska
2007-10-22 19:36                                 ` Federico Mena Quintero
2007-10-22 23:21                                   ` Johannes Schindelin
2007-10-25 19:04                                     ` Carl Worth
2007-10-22 23:35                             ` Jakub Narebski
2007-10-23  5:38                               ` Steffen Prohaska
2007-10-23 10:58                                 ` Johannes Schindelin
2007-10-24 18:48                                   ` Steffen Prohaska
2007-10-24 19:20                                     ` J. Bruce Fields
2007-10-24 19:41                                       ` Andreas Ericsson
2007-10-24 19:48                                         ` J. Bruce Fields
2007-10-24 20:12                                           ` Steffen Prohaska
2007-10-24 20:33                                             ` J. Bruce Fields
2007-10-24 21:06                                               ` Andreas Ericsson
2007-10-24 21:20                                                 ` J. Bruce Fields
2007-10-24 21:28                                                 ` Peter Baumann
2007-10-24 21:47                                                   ` Steffen Prohaska
2007-10-24 22:14                                                     ` Johannes Schindelin
2007-10-24 22:33                                                       ` Steffen Prohaska
2007-10-24 22:38                                                         ` J. Bruce Fields
2007-10-24 22:51                                                           ` Steffen Prohaska
2007-10-24 23:28                                                         ` Johannes Schindelin
2007-10-25  6:02                                                           ` Steffen Prohaska
2007-10-25 10:27                                                             ` Johannes Schindelin
2007-10-25 12:04                                                               ` Steffen Prohaska
2007-10-25  7:15                                                           ` Andreas Ericsson
2007-10-25  7:31                                                             ` Peter Baumann
2007-10-25  7:57                                                               ` Andreas Ericsson
2007-10-25  8:25                                                                 ` Steffen Prohaska
2007-10-25 10:17                                                             ` Johannes Schindelin
2007-10-25 10:33                                                               ` Andreas Ericsson
2007-10-25 12:09                                                                 ` Steffen Prohaska
2007-10-25 12:58                                                                 ` Johannes Schindelin
2007-10-25 13:24                                                                 ` Theodore Tso
2007-10-25 14:58                                                                   ` Andreas Ericsson
2007-10-25 15:21                                                                     ` Theodore Tso
2007-10-25 17:05                                                                       ` Andreas Ericsson
2007-10-25 18:33                                                                         ` Junio C Hamano
2007-10-25 20:18                                                                           ` Andreas Ericsson
2007-10-26  6:18                                                                             ` Steffen Prohaska
2007-10-26  7:53                                                                               ` Andreas Ericsson
2007-10-25 18:02                                                                       ` best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued Federico Mena Quintero
2007-10-25 18:04                                                                         ` Mike Hommey
2007-10-25 18:18                                                                           ` J. Bruce Fields
2007-10-25 18:23                                                                         ` Theodore Tso
2007-10-25 20:08                                                                         ` Andreas Ericsson
2007-10-26 20:01                                                                         ` David Kastrup
2007-10-25 16:06                                                       ` Federico Mena Quintero
2007-10-25 16:38                                                         ` J. Bruce Fields
2007-10-25 18:06                                                           ` Federico Mena Quintero
2007-10-25 18:16                                                             ` J. Bruce Fields
2007-10-25 20:19                                                             ` Andreas Ericsson
2007-10-25 20:27                                                               ` J. Bruce Fields
2007-10-26  9:17                                                                 ` David Kastrup
2007-10-26  4:41                                                         ` [PATCH] Make rebase smarter Steven Walter
2007-10-26  7:42                                                           ` Andreas Ericsson
2007-10-26  9:57                                                           ` Johannes Schindelin
2007-10-26 21:02                                                           ` Junio C Hamano
2007-10-26 23:13                                                             ` Johannes Schindelin
2007-10-26 23:29                                                               ` Junio C Hamano
2007-10-24 21:54                                                   ` best git practices, was Re: Git User's Survey 2007 unfinished summary continued Andreas Ericsson
2007-10-24 22:17                                                     ` Johannes Schindelin
2007-10-25  8:07                                                       ` Andreas Ericsson
2007-10-25 10:12                                                         ` Johannes Schindelin
2007-10-25 10:24                                                           ` Andreas Ericsson
2007-10-25 11:39                                                             ` Johannes Schindelin
2007-10-25 12:46                                                               ` Andreas Ericsson
2007-10-25 14:51                                                                 ` Karl Hasselström
2007-10-25 17:10                                                                   ` Andreas Ericsson
2007-10-25  7:26                                                     ` Peter Baumann
2007-10-24 21:16                                               ` Steffen Prohaska
2007-10-24 20:13                                           ` Andreas Ericsson
2007-10-24 23:48                                         ` Jakub Narebski
2007-10-25  7:42                                           ` Andreas Ericsson
2007-10-25 10:07                                             ` Johannes Schindelin
2007-10-25 10:39                                               ` Steffen Prohaska
2007-10-25 16:16                                           ` Federico Mena Quintero
2007-10-23  7:24                               ` Andreas Ericsson
2007-10-22 18:06                           ` Daniel Barkalow
2007-10-22 13:17                       ` Wincent Colaiuta
2007-10-22 13:33                         ` David Symonds
2007-10-22 13:38                         ` Johannes Schindelin
2007-10-22 17:48                           ` Robin Rosenberg
2007-10-23 22:13                         ` Alex Riesen
2007-10-22 13:36                       ` Nguyen Thai Ngoc Duy
2007-10-22 15:24                       ` best git practices, was Re: Git User's Survey 2007 unfinished summarycontinued Federico Mena Quintero
2007-10-24  2:06                       ` best git practices, was Re: Git User's Survey 2007 unfinished summary continued Jakub Narebski
2007-10-24 10:29                         ` Karl Hasselström
2007-10-24 11:04                           ` Jakub Narebski
2007-10-24 11:31                             ` Karl Hasselström
2007-10-24 23:27                               ` Jakub Narebski
2007-10-25  6:10                                 ` Karl Hasselström
2007-10-24 13:15                             ` Catalin Marinas
2007-10-22 12:26                     ` Jakub Narebski
2007-10-22 13:45                       ` Johannes Schindelin
2007-10-22 14:29                       ` Andreas Ericsson
2007-10-22 14:53                     ` Federico Mena Quintero
2007-10-22 23:27                       ` Jakub Narebski
2007-10-22 22:53                   ` Steven Grimm
2007-10-21 22:12           ` J. Bruce Fields
2007-10-13  3:04   ` Shawn O. Pearce

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.