git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Updated git HOWTO for kernel hackers
Date: Wed, 22 Jun 2005 19:28:45 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0506221915280.11175@ppc970.osdl.org> (raw)
In-Reply-To: <42BA18AF.2070406@pobox.com>



On Wed, 22 Jun 2005, Jeff Garzik wrote:
> 
> The output isn't terribly helpful:

Yeah. The good news is that if something bad happens, it surely lets you 
know, and it's very verbose about that.

I should probably remove the "Fragment applied at offset xx" thing, it was 
basically a debugging message to make sure that I applied patch fragments 
correctly even if the line offset given in the patch was sligthly off..

> Outputting the following (stolen from 'git commit') would be far more 
> useful:
> 
>        modified: Documentation/networking/cxgb.txt
>        modified: drivers/net/chelsio/Makefile
>        deleted:  drivers/net/chelsio/ch_ethtool.h
>        modified: drivers/net/chelsio/common.h
>        modified: drivers/net/chelsio/cphy.h
>        modified: drivers/net/chelsio/cpl5_cmd.h
>        modified: drivers/net/chelsio/cxgb2.c
>        deleted:  drivers/net/chelsio/cxgb2.h
>        modified: drivers/net/chelsio/elmer0.h
>        modified: drivers/net/chelsio/espi.c
>        modified: drivers/net/chelsio/espi.h
>        modified: drivers/net/chelsio/gmac.h
>        modified: drivers/net/chelsio/mv88x201x.c
>        deleted:  drivers/net/chelsio/osdep.h
>        modified: drivers/net/chelsio/pm3393.c
>        modified: drivers/net/chelsio/regs.h
>        modified: drivers/net/chelsio/sge.c
>        modified: drivers/net/chelsio/sge.h
>        modified: drivers/net/chelsio/subr.c
>        modified: drivers/net/chelsio/suni1x10gexp_regs.h
>        deleted:  drivers/net/chelsio/tp.c
>        deleted:  drivers/net/chelsio/tp.h
>        modified: include/linux/pci_ids.h

How about this patch? Then you can say

	git-apply --stat --summary --apply --index /tmp/my.patch

and it will not only apply the patch, but also give a diffstat and a
summary or renames etc..

This also removes the "Fragment.." debugging message.

Btw, "--stat" and "--summary" normally turn off the "apply" flag, so 
"--apply" has to come _after_ the stat/summary thing, fwiw:

diff --git a/apply.c b/apply.c
--- a/apply.c
+++ b/apply.c
@@ -860,7 +860,6 @@ static int find_offset(const char *buf, 
 		n = (i >> 1)+1;
 		if (i & 1)
 			n = -n;
-		fprintf(stderr, "Fragment applied at offset %d\n", n);
 		return try;
 	}
 
@@ -1434,6 +1433,10 @@ int main(int argc, char **argv)
 			check_index = 1;
 			continue;
 		}
+		if (!strcmp(arg, "--apply")) {
+			apply = 1;
+			continue;
+		}
 		if (!strcmp(arg, "--show-files")) {
 			show_files = 1;
 			continue;

> > Also, you can do
> > 
> > 	git commit <list-of-files-to-commit>
> > 
> > as a shorthand for
> > 
> > 	git-update-cache <list-of-files-to-commit>
> > 	git commit
> > 
> > which some people will probably find more natural.
> 
> It would be natural if it functioned like 'bk citool' ;-)
> 
> 	git commit --figure-out-for-me-what-files-changed
> 
> 'git diff' can do this, so it's certainly feasible.

Well, it _does_ do that. That's what the "git status" thing does, and look 
at the initial commit message comments that it prepares for you: it tells 
you which files are modified but haven't been marked for check-in etc.

But the thing is, you need to have a graphical tool for that. I don't want
to have some silly command line that asks for each modified file whether
you want to include that file in the commit or not.

So this is where "git" ends, and a nice user interface (written by 
somebody else than me) begins. Ie this is a cogito-like thing.

> > "git-whatchanged" is useful if you actually want to see what the commits 
> > _changed_, and then you often want to use the "-p" flag to see it as 
> > patches. Also, it's worth pointing out the fact that you can limit it to 
> > certain subdirectories (or individual files) etc, ie:
> > 
> > 	git-whatchanged -p drivers/net
> > 
> > since that is often what people want.
> > 
> > But if you just want the log, "git log" is faster and simpler and more 
> > correct.
> 
> I usually want just two things:
> 
> 1) browse the log
> 
> 2) list changes in local tree that are not in $remote_tree, a la
> 	bk changes -L ../linux-2.6
> 
> I agree that seeing the merge csets is useful, that is why [being 
> ignorant of 'git log'] I used git-changes-script.

For (1) "bk log" is good. For (2) you'll have to use your own script, or
just have the remote tree as a branch in the same tree, in which case you
can do

	git log remotebranch..mybranch

and it will do what you expect. In fact, since "HEAD" is the default 
branch for the final one, you can do

	git log remotebranch..

and you'll get the log of everything that is in your HEAD but it _not_ in 
the "remotebranch" branch.

Btw, if you have the remote as a branch in your own tree, you can also do

	gitk remotebranch..mybranch

which is a really nice way of graphically seeing "what is in 'mybranch' 
that is not in 'remotebranch'".

			Linus

  reply	other threads:[~2005-06-23  2:21 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-22 22:24 Updated git HOWTO for kernel hackers Jeff Garzik
2005-06-22 22:40 ` Dave Jones
2005-06-22 22:47   ` Jeff Garzik
2005-06-22 22:52     ` Dave Jones
2005-06-23  0:14       ` Jeff Garzik
2005-06-25  3:33   ` Jeff Garzik
2005-06-25 17:29     ` Dave Jones
2005-06-22 23:09 ` Greg KH
2005-06-22 23:25   ` Linus Torvalds
2005-06-23  0:05     ` Jeff Garzik
2005-06-23  0:29       ` Linus Torvalds
2005-06-23  1:47         ` Jeff Garzik
2005-06-23  1:56           ` Linus Torvalds
2005-06-23  2:16             ` Jeff Garzik
2005-06-23  2:39               ` Linus Torvalds
2005-06-23  3:06                 ` Jeff Garzik
2005-06-23  3:24                   ` Linus Torvalds
2005-06-23  5:16                     ` Jeff Garzik
2005-06-23  5:58                       ` Linus Torvalds
2005-06-23  6:20                         ` Greg KH
2005-06-23  6:51                           ` Linus Torvalds
2005-06-23  7:11                             ` Greg KH
2005-06-23  7:03                         ` Jeff Garzik
2005-06-23  7:38                         ` Petr Baudis
2005-06-23  8:18                           ` Martin Langhoff
2005-06-23  8:30                         ` Vojtech Pavlik
2005-06-23 14:31                       ` Horst von Brand
2005-06-22 23:16 ` Linus Torvalds
2005-06-23  0:15   ` Jeff Garzik
2005-06-23  1:53     ` Linus Torvalds
2005-06-23  7:06       ` Jeff Garzik
2005-06-23 15:29         ` Linus Torvalds
2005-06-23  0:33   ` Linus Torvalds
2005-06-23  2:04   ` Jeff Garzik
2005-06-23  2:28     ` Linus Torvalds [this message]
2005-06-23  3:52       ` Adam Kropelin
2005-06-23  4:54         ` Linus Torvalds
2005-06-23  5:35           ` Jeff Garzik
2005-06-23  6:37             ` Linus Torvalds
2005-06-23  6:07           ` Miles Bader
2005-06-23  7:15       ` Jeff Garzik
2005-06-23 16:06         ` Linus Torvalds
2005-06-23  8:01   ` Anton Altaparmakov
2005-06-23  4:23 ` Daniel Barkalow
2005-06-23 12:25 ` Dave Airlie
2005-06-23 23:56 ` Mercurial vs " Matt Mackall
2005-06-24  6:41   ` Petr Baudis
2005-06-24 12:38     ` Christopher Li
2005-06-28 15:00       ` Petr Baudis
2005-06-28 15:10         ` Andrew Thompson
2005-06-28 15:35           ` Petr Baudis
2005-06-28 21:54           ` Horst von Brand
2005-06-28 18:47             ` Christopher Li
2005-06-29  0:12             ` Kyle Moffett
2005-06-28 18:01         ` Matt Mackall
2005-06-28 20:27           ` Kyle Moffett
2005-06-28 20:45             ` Sean
2005-06-28 22:14               ` Matt Mackall
2005-06-28 22:23                 ` Sean
2005-06-28 22:47                   ` Kyle Moffett
2005-06-28 22:49                   ` Matt Mackall
2005-06-28 22:59                     ` Sean
2005-06-28 23:25                       ` Kyle Moffett
2005-06-28 23:37                         ` Sean
2005-06-29  0:08                           ` Kyle Moffett
2005-06-29  0:25                             ` Sean
2005-06-29  3:53                               ` Kyle Moffett
2005-06-29 10:27                                 ` Vojtech Pavlik
2005-06-28 23:29                       ` Matt Mackall
2005-06-29  6:32             ` Thomas Arendsen Hein
2005-06-24 13:06     ` Andrea Arcangeli
2005-06-24 13:39       ` Theodore Ts'o
2005-06-24 13:46         ` Paolo Ciarrocchi
2005-06-24 12:19           ` Christopher Li
2005-06-24 13:57       ` Kevin Smith
2005-06-24 18:03         ` Matt Mackall
2005-06-28 15:07         ` Petr Baudis
2005-06-28 15:15           ` Sven Verdoolaege
2005-06-28 15:34             ` Petr Baudis
2005-06-28 16:50           ` Cygwin and Native MS Windows (was: Mercurial vs Updated git HOWTO for kernel hackers) Kevin Smith
2005-06-28 16:51           ` Cogito vs. Git " Kevin Smith
2005-06-28 20:54             ` Petr Baudis
2005-06-24 13:16     ` Mercurial vs Updated git HOWTO for kernel hackers Matthias Urlichs
2005-06-24 19:00       ` Linus Torvalds
2005-06-24 19:25         ` John W. Linville
2005-06-24 22:38         ` Jeff Garzik
2005-06-24 21:11       ` Daniel Barkalow
2005-06-24 22:08       ` Should "git-read-tree -m -u" delete files? Junio C Hamano
2005-06-24 22:45     ` Mercurial vs Updated git HOWTO for kernel hackers Joel Becker
2005-06-24 23:08   ` Kyle Moffett
2005-06-27 18:31   ` Pavel Machek
2005-06-27 19:05     ` Kyle Moffett
2005-06-27 19:40     ` Matt Mackall
2005-06-27 19:51       ` Benjamin LaHaise
2005-06-27 20:51         ` Matt Mackall
2005-06-27 21:53         ` Ed Tomlinson
2005-07-08 15:18 ` Amin Azez
2005-07-11  8:56   ` Amin Azez

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0506221915280.11175@ppc970.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).