All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tommi Virtanen <tv@inoi.fi>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: The git newbie experience
Date: Mon, 15 May 2006 08:06:28 +0300	[thread overview]
Message-ID: <44680C54.8040206@inoi.fi> (raw)
In-Reply-To: <7vfyjcntro.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:
> Anyway, I think the time to commit is too late to save somebody
> who does not understand the index.  How would you explain why
> you sometimes need to use -A and sometimes -a? 

I guess what I really want is "a smarter -a".

> That is why I
> suggested to make "git pull" and "git merge" refuse to work if
> there are local changes for novice users, where the definition
> of novice is "git commit -a" is the only way to make a commit.
> We can have [core] novice = yes in .git/config for that.
> 
> If somebody does not understand the index, if the merge is
> prevented because the local change does conflict with it, how
> would you explain why sometimes you can merge and sometimes you
> cannot?

By the same logic that is already implemented. "pull refuses to pull
changes to files that are modified but not committed".

>> For example, we had a case where we absolutely _had_ to keep
>> an ugly workaround in the tree, in a file not otherwise
>> edited, but we definitely did not want to commit the kludge,
> Your example is a very ill-thought out one.
>
> If you are leaving the uncommitable kludge around, you cannot be
> using "commit -a" with the normal non-merge workflow.  Why
> would you worry about not being able to do "commit -a" on a
> merge then?

The indexless working mode means you know two kinds of commits.
"git commit -a" or "git commit FILE..". The uncommitted kludge hanging
around means people listed file names. The case where the merge differs
is that it's not just a few files, and they didn't even really
know what files to list. And "git status" showed them something
they were not used to seeing.

> For the beginning user without index, I would rewrite your
> scenario like this.
> 
...
> - Jack stashes away what he has been working on and cleans up
>   his mess.
> 
>   git diff >P.diff
>   git checkout HEAD A B C
...
> - Jack then reapplies what he stashed away with "git apply P.diff"
>   and keeps working.
> 
> Maybe "git stash" command that does "git diff --full-index" with
> some frills, and "git unstash" command which does an equivalent
> of "git am -3" would help this workflow (bare "git apply" does
> not do the three-way merge like am does).

Oh, I'd love to have a quick stash, that's what we actually ended up
doing a lot. Although I'd rather see a real implementation use a branch
and not just a diff file, but.. yes please.

Although, "git stash" and "git unstash" are yet another command to add
to the newbie set, and I just complained about the size of the set ;)

-- 
Inoi Oy, Tykistökatu 4 D (4. krs), FI-20520 Turku, Finland
http://www.inoi.fi/
Mobile +358 40 762 5656

  reply	other threads:[~2006-05-15  5:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-14 18:36 The git newbie experience Tommi Virtanen
2006-05-14 21:26 ` Junio C Hamano
2006-05-14 22:09 ` Junio C Hamano
2006-05-15  5:06   ` Tommi Virtanen [this message]
2006-05-15  5:18     ` Junio C Hamano
2006-05-15  5:31       ` Shawn Pearce
2006-05-15  8:39         ` Junio C Hamano
2006-05-15 16:46           ` Carl Baldwin
2006-05-15 20:47             ` Junio C Hamano
2006-05-15 20:42           ` Carl Worth
2006-05-15 21:10             ` Junio C Hamano
2006-05-15  5:27     ` Shawn Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44680C54.8040206@inoi.fi \
    --to=tv@inoi.fi \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.