From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Mark Levedahl <mdl123@verizon.net>,
Mark Levedahl <mlevedahl@verizon.net>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: autoCRLF, git status, git-gui, what is the desired behavior?
Date: Mon, 26 Feb 2007 10:54:42 -0500 [thread overview]
Message-ID: <20070226155442.GA1639@spearce.org> (raw)
In-Reply-To: <7v649pr60q.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> "Shawn O. Pearce" <spearce@spearce.org> writes:
>
> > Hmm. Probably not. In pg I used to compare HEAD^{tree} to the
> > tree output by git-write-tree and refuse to make the commit if
> > they had the same value. git-gui just blindly assumes that if a
> > file is staged for committing then it won't make an empty commit;
> > this is also the behavior in git-commit.sh.
> >
> > Yet in the case of a merge you may want the same tree and not even
> > realize it...
>
> git-commit has been raised with all of these logic during its
> evolution. Is it a possibility to reuse it somehow?
Anything's possible. ;-)
I'd rather not reuse git-commit in git-gui. git-commit is strictly
porcelain-ish, while git-gui tries hard to only rely on the plumbing
layer[*1*], while also trying to autodetect and honor status data
used in the porcelain-ish (e.g. MERGE_HEAD, MERGE_MSG).
With the exception of this empty-commit case git-gui's commit
path is stable and doing the same actions as git-commit, only the
git-gui way. I'd rather not churn that code just to avoid an empty
commit case. Its easy enough to check the trees, and git-gui knows
if there are additional parents (and what those are) at the time of
commit, so its easy enough to not do the tree comparsion if there
is more than one parent.
I actually just found another way to make git-gui create an empty
commit. I'm going to patch it to check the trees - because this
shouldn't be allowed.
*1*: With the exception of git-fetch, git-push, git-merge and
git-repack. The latter two of which I would like to get
rewritten in pure Tcl, as I want more control over what
is happening.
--
Shawn.
prev parent reply other threads:[~2007-02-26 15:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-25 19:33 autoCRLF, git status, git-gui, what is the desired behavior? Mark Levedahl
2007-02-25 19:54 ` Junio C Hamano
2007-02-25 20:28 ` Junio C Hamano
2007-02-25 21:14 ` Mark Levedahl
2007-02-25 21:22 ` Junio C Hamano
2007-02-25 22:20 ` Mark Levedahl
2007-02-25 23:55 ` Mark Levedahl
2007-02-25 20:51 ` Mark Levedahl
2007-02-26 2:06 ` Shawn O. Pearce
2007-02-26 2:45 ` Junio C Hamano
2007-02-26 15:54 ` Shawn O. Pearce [this message]
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=20070226155442.GA1639@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=mdl123@verizon.net \
--cc=mlevedahl@verizon.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).