Git development
 help / color / mirror / Atom feed
* Re: [PATCH (GIT-GUI,GITK) 6/8] gitk: Port new encoding logic from git-gui.
From: Johannes Sixt @ 2008-09-19 13:04 UTC (permalink / raw)
  To: Alexander Gavrilov; +Cc: git, Shawn O. Pearce, Paul Mackerras
In-Reply-To: <bb6f213e0809190538m5bbfeb38o5510d06fa6757dd1@mail.gmail.com>

Alexander Gavrilov schrieb:
> On Fri, Sep 19, 2008 at 4:10 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
>> If I run
>>
>>  $ LANG=C gitk 146ed90
>>
>> with this series on the git-gui repository, then I hoped to see the text
>> in the patches in the right encoding. But I understand that I expected too
>> much - the patch text is just a stream of bytes that comes from different
>> files, and the best you can do is to apply the system encoding.
>>
>> But if the view is switched to the tree view, and file contents are
>> inspected, then this patch should help. But it doesn't. If you look at
>> po/ja.po, it is appearent that the file was not read as UTF-8, which is
>> dictated by .gitattributes.
> 
> On my system everything works. You must have made a mistake somewhere.

Indeed. I was running above command form a git.git clone. Now, looking at
anything that is in 146ed90 produces paths like

   po/de.po
   po/ja.po

Yet, .gitattributes says this:

   /po/*.po    encoding=UTF-8

which does not match any of the *.po files because the *.po are one level
deeper inside git-gui/po/. The change below made a difference.
Everything's fine now!

diff --git a/git-gui/.gitattributes b/git-gui/.gitattributes
index f96112d..8ad5766 100644
--- a/git-gui/.gitattributes
+++ b/git-gui/.gitattributes
@@ -1,3 +1,3 @@
 *           encoding=US-ASCII
 git-gui.sh  encoding=UTF-8
-/po/*.po    encoding=UTF-8
+*.po        encoding=UTF-8

> Also, it should work in the patch mode as well: it reads the patch as
> binary, and decodes each line separately, based on the encoding
> determined for the current file.

This is great. But we'll have to see how this works on a multi-file diff
on Windows. (I sense slowness.)

Thanks,
-- Hannes

^ permalink raw reply related

* [PATCH] builtin-clone: fix typo
From: Fabrizio Chiarello @ 2008-09-19 12:07 UTC (permalink / raw)
  To: git; +Cc: gitster

Signed-off-by: Fabrizio Chiarello <ponch@autistici.org>
---
 builtin-clone.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-clone.c b/builtin-clone.c
index c843529..5b40e07 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -58,7 +58,7 @@ static struct option builtin_clone_options[] = {
 	OPT_STRING(0, "reference", &option_reference, "repo",
 		   "reference repository"),
 	OPT_STRING('o', "origin", &option_origin, "branch",
-		   "use <branch> instead or 'origin' to track upstream"),
+		   "use <branch> instead of 'origin' to track upstream"),
 	OPT_STRING('u', "upload-pack", &option_upload_pack, "path",
 		   "path to git-upload-pack on the remote"),
 	OPT_STRING(0, "depth", &option_depth, "depth",
-- 
1.5.6.5

^ permalink raw reply related

* Re: [PATCH (GIT-GUI,GITK) 6/8] gitk: Port new encoding logic from git-gui.
From: Alexander Gavrilov @ 2008-09-19 12:38 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: git, Shawn O. Pearce, Paul Mackerras
In-Reply-To: <48D396A8.4050607@viscovery.net>

On Fri, Sep 19, 2008 at 4:10 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> If I run
>
>  $ LANG=C gitk 146ed90
>
> with this series on the git-gui repository, then I hoped to see the text
> in the patches in the right encoding. But I understand that I expected too
> much - the patch text is just a stream of bytes that comes from different
> files, and the best you can do is to apply the system encoding.
>
> But if the view is switched to the tree view, and file contents are
> inspected, then this patch should help. But it doesn't. If you look at
> po/ja.po, it is appearent that the file was not read as UTF-8, which is
> dictated by .gitattributes.

On my system everything works. You must have made a mistake somewhere. Namely:

1) Did you apply ALL patches to gitk? The first one is absolutely
useless without the other two.
2) Did you install it? I.e. do you actually run the patched version?
3) Do you have .gitattributes checked out?

Also, it should work in the patch mode as well: it reads the patch as
binary, and decodes each line separately, based on the encoding
determined for the current file.

Alexander

^ permalink raw reply

* Re: Branches with git-svn
From: Michael J Gruber @ 2008-09-19 12:35 UTC (permalink / raw)
  To: Xavier Claessens; +Cc: git
In-Reply-To: <1221819302.6784.4.camel@zdra-laptop>

Xavier Claessens venit, vidit, dixit 19.09.2008 12:15:
> Hi,
> 
> I created a git repository using "git-svn clone <url>" a long time ago.
> But now I realise that I don't get SVN branches into my git repository.
> I see that the doc tells to use "git clone -t tags -b branches -T trunk
> <url>" to create the repository. If I create a new repository with that
> command, I get branches and tags.
> 
> However I have lots of contributors having branches based on my git
> repository. Is there a way to add SVN branch to my existing git repo?

If you haven't use those options back then, then what was the svn repo
structure - no trunk, just main?
Did you change the structure now?

If you git-svn fetch from that new structure then all your new branches
etc. will show up as subdirectories, which is most certainly not what
you want.

So, what was the structure in svn like before, and have your
contributors based their branches on the mis-imported new structure already?

Michael

^ permalink raw reply

* Re: [PATCH (GIT-GUI,GITK) 6/8] gitk: Port new encoding logic from git-gui.
From: Johannes Sixt @ 2008-09-19 12:10 UTC (permalink / raw)
  To: Alexander Gavrilov; +Cc: git, Shawn O. Pearce, Paul Mackerras
In-Reply-To: <1221685659-476-7-git-send-email-angavrilov@gmail.com>

Alexander Gavrilov schrieb:
> Add functions that implement the same logic for file
> contents encoding as git-gui uses:
> 
> - Defaults to the system encoding.
> - Overridden by setting the gui.encoding option.
> - Further overridden on per-file basis by gitattributes.
> 
> Also extends the range of supported encoding names.

If I run

  $ LANG=C gitk 146ed90

with this series on the git-gui repository, then I hoped to see the text
in the patches in the right encoding. But I understand that I expected too
much - the patch text is just a stream of bytes that comes from different
files, and the best you can do is to apply the system encoding.

But if the view is switched to the tree view, and file contents are
inspected, then this patch should help. But it doesn't. If you look at
po/ja.po, it is appearent that the file was not read as UTF-8, which is
dictated by .gitattributes.

-- Hannes

^ permalink raw reply

* Re: [TopGit PATCH] .gitignore += vim swap files
From: Bert Wesarg @ 2008-09-19 10:50 UTC (permalink / raw)
  To: Kirill Smelkov; +Cc: Daniel Barkalow, Petr Baudis, Git Mailing List
In-Reply-To: <20080919072851.GD4423@roro3>

On Fri, Sep 19, 2008 at 09:28, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> On Fri, Sep 19, 2008 at 09:10:24AM +0200, Bert Wesarg wrote:
>> On Fri, Sep 19, 2008 at 07:06, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>> > On Thu, Sep 18, 2008 at 03:30:35PM -0400, Daniel Barkalow wrote:
>> >> On Thu, 18 Sep 2008, Bert Wesarg wrote:
>> >>
>> >> > On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>> >> > > Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
>> >> > > ---
>> >> > >  .gitignore |    2 ++
>> >> > >  1 files changed, 2 insertions(+), 0 deletions(-)
>> >> > >
>> >> > > diff --git a/.gitignore b/.gitignore
>> >> > > index 8868f2d..aa39db4 100644
>> >> > > --- a/.gitignore
>> >> > > +++ b/.gitignore
>> >> > > @@ -18,3 +18,5 @@ tg-import.txt
>> >> > >  tg-remote
>> >> > >  tg-remote.txt
>> >> > >  tg
>> >> > > +
>> >> > > +*.swp
>> >> > can't you do this in your .git/info/excludes?
>> >>
>> >> It's generally better to put a core.excludesfile entry in your
>> >> ~/.gitconfig pointing to a ignore file with editor temporaries for the
>> >> editor(s) you personally use. This will then apply to all git projects you
>> >> work on.
>> >
>> > Yes, this makes sense, thanks.
>> >
>> > I've had to add the following to my ~/.gitconfig
>> >
>> > [core]
>> >    excludesfile= /home/kirr/.gitignore-kirr
>> >
>> >
>> > because it does not work when '~' is used for $HOME
>> >
>> > [core]
>> >    excludesfile= ~/.gitignore-kirr # does not work
>> Have you tried:
>>
>>   [core]
>>      excludesfile = .gitignore-kirr
>> There was a discussion about relative files in config. but I didn't tried this.
>
> It does not work for me -- it picks ./.gitignore-kirr instead of
> ~/.gitignore-kirr
I found the thread with exactly this problem:

http://thread.gmane.org/gmane.comp.version-control.git/93250

Bert

^ permalink raw reply

* Re: [TopGit RFC PATCH] tg mail: new command for mailing patches
From: Kirill Smelkov @ 2008-09-19 10:23 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Kirill Smelkov, Petr Baudis, Git Mailing List
In-Reply-To: <36ca99e90809190320l4765e50eqe38bf1d2672cfcca@mail.gmail.com>

On Fri, Sep 19, 2008 at 12:20:49PM +0200, Bert Wesarg wrote:
> On Fri, Sep 19, 2008 at 12:04, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> > On Fri, Sep 19, 2008 at 11:52:03AM +0200, Bert Wesarg wrote:
> >> On Fri, Sep 19, 2008 at 11:08, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> >> > Petr, since you've asked for help on this, here you are:
> >> >
> >> >    $ tg mail [NAME]
> >> >
> >> > a simple script to send one patch over email.
> >> >
> >> >
> >> > All it does is
> >> >
> >> >    - call `tg patch` for actual patch preparation
> >> >    - extract email addresses from whom and where to send a mail
> >> That shouldn't be needed. git send-email parses Cc: headers and the
> >
> > Exactly for this reason I do not extract Cc. And git send-mail does not
> > extract From: -- it just asks to confirm From is GIT_COMMITTER_IDENT,
> > and there is no option to stop it doing so except providing explicit
> > --from <someone> (maybe i'm missing something?).
> Ahh, my fault, I should take a break, sorry for the noise.

No problem, your "noise" is welcome :)

-- 
    Всего хорошего, Кирилл.

^ permalink raw reply

* Re: [TopGit RFC PATCH] tg mail: new command for mailing patches
From: Bert Wesarg @ 2008-09-19 10:20 UTC (permalink / raw)
  To: Kirill Smelkov; +Cc: Petr Baudis, Git Mailing List
In-Reply-To: <20080919100441.GF4423@roro3>

On Fri, Sep 19, 2008 at 12:04, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> On Fri, Sep 19, 2008 at 11:52:03AM +0200, Bert Wesarg wrote:
>> On Fri, Sep 19, 2008 at 11:08, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>> > Petr, since you've asked for help on this, here you are:
>> >
>> >    $ tg mail [NAME]
>> >
>> > a simple script to send one patch over email.
>> >
>> >
>> > All it does is
>> >
>> >    - call `tg patch` for actual patch preparation
>> >    - extract email addresses from whom and where to send a mail
>> That shouldn't be needed. git send-email parses Cc: headers and the
>
> Exactly for this reason I do not extract Cc. And git send-mail does not
> extract From: -- it just asks to confirm From is GIT_COMMITTER_IDENT,
> and there is no option to stop it doing so except providing explicit
> --from <someone> (maybe i'm missing something?).
Ahh, my fault, I should take a break, sorry for the noise.

>
>> To: comes from 'git config topgit.to', so you can re-use this.
>
> Yes, it comes directly to .topmsg when `tg create` is done, so I thought
> the main source of information is the patch itself -- users may want to
> edit that To: by hand or add another To: lines.
Yeah, my fault, I noticed this too, its just a template. better to
extract it from the patch.

>
> and what If a patch is already exported as a file, and I want to
> send/resend it upstream right from that file?
>
> We may want to look for topgit.to too though.
>
> --
>    Всего хорошего, Кирилл.
>

^ permalink raw reply

* Branches with git-svn
From: Xavier Claessens @ 2008-09-19 10:15 UTC (permalink / raw)
  To: git

Hi,

I created a git repository using "git-svn clone <url>" a long time ago.
But now I realise that I don't get SVN branches into my git repository.
I see that the doc tells to use "git clone -t tags -b branches -T trunk
<url>" to create the repository. If I create a new repository with that
command, I get branches and tags.

However I have lots of contributors having branches based on my git
repository. Is there a way to add SVN branch to my existing git repo?

Thanks!

Xavier Claessens.

^ permalink raw reply

* Re: [TopGit RFC PATCH] tg mail: new command for mailing patches
From: Kirill Smelkov @ 2008-09-19 10:04 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Kirill Smelkov, Petr Baudis, Git Mailing List
In-Reply-To: <36ca99e90809190252q45f01eb2xd02b62b88f0cf3a9@mail.gmail.com>

On Fri, Sep 19, 2008 at 11:52:03AM +0200, Bert Wesarg wrote:
> On Fri, Sep 19, 2008 at 11:08, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> > Petr, since you've asked for help on this, here you are:
> >
> >    $ tg mail [NAME]
> >
> > a simple script to send one patch over email.
> >
> >
> > All it does is
> >
> >    - call `tg patch` for actual patch preparation
> >    - extract email addresses from whom and where to send a mail
> That shouldn't be needed. git send-email parses Cc: headers and the

Exactly for this reason I do not extract Cc. And git send-mail does not
extract From: -- it just asks to confirm From is GIT_COMMITTER_IDENT,
and there is no option to stop it doing so except providing explicit
--from <someone> (maybe i'm missing something?).

> To: comes from 'git config topgit.to', so you can re-use this.

Yes, it comes directly to .topmsg when `tg create` is done, so I thought
the main source of information is the patch itself -- users may want to
edit that To: by hand or add another To: lines.

and what If a patch is already exported as a file, and I want to
send/resend it upstream right from that file?

We may want to look for topgit.to too though.

-- 
    Всего хорошего, Кирилл.

^ permalink raw reply

* Re: GitTogether topics status
From: Johannes Schindelin @ 2008-09-19 10:11 UTC (permalink / raw)
  To: Scott Chacon; +Cc: Christian Couder, Jakub Narebski, git, Shawn O. Pearce
In-Reply-To: <d411cc4a0809182303x365e2280r3fc8a9a3534d8890@mail.gmail.com>

Hi,

On Thu, 18 Sep 2008, Scott Chacon wrote:

> I very much want to see a library that provides basic Git object access 
> that we can use to write proper bindings in Ruby/Python/Perl.  If the 
> current Git code is too difficult to libify properly, then perhaps an 
> alternate C implementation that is built only for that purpose is 
> preferable to having a re-implementation in _every_ language.  Looking 
> forward to the discussion.

libgit-thin.  What is missing is somebody taking this forward (and this 
includes making it more public on the Git mailing list).

Hth,
Dscho

^ permalink raw reply

* [TopGit PATCH] tg-patch: add From/Date: line to header and print to file
From: Bert Wesarg @ 2008-09-19  9:55 UTC (permalink / raw)
  To: Petr Baudis, Petr Baudis; +Cc: Bert Wesarg, git
In-Reply-To: <1221818101-14333-1-git-send-email-bert.wesarg@googlemail.com>

To make this more similar to git format-patch, I added a 'From' and
a 'Date:' header and let 'tg patch' print to a file (which is shown as output).

Regards
Bert

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>

---
 tg-patch.sh |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/tg-patch.sh b/tg-patch.sh
index 7a24718..5fc5cfd 100644
--- a/tg-patch.sh
+++ b/tg-patch.sh
@@ -24,7 +24,26 @@ done
 base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" ||
 	die "not a TopGit-controlled branch"
 
-git cat-file blob "$name:.topmsg"
+subject="$(git cat-file blob "$name:.topmsg" | grep '^Subject: ' | sed -e 's/^Subject: //' -e 's/\[.*\] //')"
+file_name="$(echo "$subject" | tr -c '[[:alnum:]_.]' '_').patch"
+rev="$(git rev-parse --verify "refs/heads/$name" 2>/dev/null)"
+
+echo "$file_name"
+exec 3>&1
+exec 1>"$file_name"
+
+printf "From %s Mon Sep 17 00:00:00 2001\n" "$rev"
+now="$(date --rfc-2822)"
+git cat-file blob "$name:.topmsg" |
+	awk '
+		{
+			print
+			if (/^From:/ && !date_printed) {
+				printf "Date: %s\n", "'"$now"'"
+				date_printed = 1
+			}
+		}
+	'
 echo
 [ -n "$(git grep '^[-]--' "$name" -- ".topmsg")" ] || echo '---'
 
@@ -42,5 +61,9 @@ rm "$git_is_stupid"
 
 echo '-- '
 echo "tg: ($base_rev..) $name (depends on: $(git cat-file blob "$name:.topdeps" | paste -s -d' '))"
+
+exec 1>&3
+exec 3>&-
+
 branch_contains "$name" "$base_rev" ||
 	echo "tg: The patch is out-of-date wrt. the base! Run \`$tg update\`."
-- 
tg: (7ec3927..) t/patch (depends on: t/queue-movement)

^ permalink raw reply related

* [TopGit PATCH] prev/next/tsort: commands to explore dependencies
From: Bert Wesarg @ 2008-09-19  9:55 UTC (permalink / raw)
  To: Petr Baudis, Petr Baudis; +Cc: Bert Wesarg, git

I hacked 3 commands to explore the dependencies of TopGit patches:

  I) tg prev [NAME]
     outputs the dependencies of NAME

 II) tg next [NAME]
     outputs patches that depends on NAME

III) tg tsort [PATTERN]
     outputs a topological order of all patches starting with PATTERN

I'm more than open for improvments.

Regards
Bert
   
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>

---
 .gitignore  |    6 ++++++
 tg-next.sh  |   33 +++++++++++++++++++++++++++++++++
 tg-prev.sh  |   27 +++++++++++++++++++++++++++
 tg-tsort.sh |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 123 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8868f2d..b7fb70b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,9 @@ tg-import.txt
 tg-remote
 tg-remote.txt
 tg
+tg-next
+tg-next.txt
+tg-prev
+tg-prev.txt
+tg-tsort
+tg-tsort.txt
diff --git a/tg-next.sh b/tg-next.sh
new file mode 100644
index 0000000..8e17226
--- /dev/null
+++ b/tg-next.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# TopGit - A different patch queue manager
+# (c) Petr Baudis <pasky@suse.cz>  2008
+# GPLv2
+
+name=
+
+
+## Parse options
+
+while [ -n "$1" ]; do
+	arg="$1"; shift
+	case "$arg" in
+	-*)
+		echo "Usage: tg next [NAME]" >&2
+		exit 1;;
+	*)
+		[ -z "$name" ] || die "name already specified ($name)"
+		name="$arg";;
+	esac
+done
+
+[ -n "$name" ] || name="$(git symbolic-ref HEAD | sed 's#^refs/heads/##')"
+base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" ||
+	die "not a TopGit-controlled branch"
+
+git for-each-ref --format='%(refname)' refs/top-bases |
+	while read topic; do
+		topic="${topic#refs/top-bases/}"
+		if git show "${topic}":.topdeps 2>/dev/null | grep -q "^${name}\$"; then
+			echo "${topic}"
+		fi
+	done
diff --git a/tg-prev.sh b/tg-prev.sh
new file mode 100644
index 0000000..801fb3e
--- /dev/null
+++ b/tg-prev.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+# TopGit - A different patch queue manager
+# (c) Petr Baudis <pasky@suse.cz>  2008
+# GPLv2
+
+name=
+
+
+## Parse options
+
+while [ -n "$1" ]; do
+	arg="$1"; shift
+	case "$arg" in
+	-*)
+		echo "Usage: tg next [NAME]" >&2
+		exit 1;;
+	*)
+		[ -z "$name" ] || die "name already specified ($name)"
+		name="$arg";;
+	esac
+done
+
+[ -n "$name" ] || name="$(git symbolic-ref HEAD | sed 's#^refs/heads/##')"
+base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" ||
+	die "not a TopGit-controlled branch"
+
+git show "$name:.topdeps"
diff --git a/tg-tsort.sh b/tg-tsort.sh
new file mode 100644
index 0000000..8a7376a
--- /dev/null
+++ b/tg-tsort.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+# TopGit - A different patch queue manager
+# (c) Petr Baudis <pasky@suse.cz>  2008
+# GPLv2
+
+pattern=
+
+## Parse options
+
+while [ -n "$1" ]; do
+	arg="$1"; shift
+	case "$arg" in
+	-*)
+		echo "Usage: tg tsort [PATTERN]" >&2
+		exit 1;;
+	*)
+		[ -z "$pattern" ] || die "pattern already specified ($pattern)"
+		pattern="$arg";;
+	esac
+done
+
+# remove trailing /, they wont work with for-each-ref
+pattern="$(echo "refs/top-bases/$pattern" | sed -re 's#/+$##g')"
+
+name="$(git symbolic-ref HEAD | sed 's#^refs/heads/##')"
+base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" ||
+	die "not a TopGit-controlled branch"
+
+rev_map="$(mktemp)"
+rev_map_uniq="$(mktemp)"
+rev_map_sed="$(mktemp)"
+tsort_out="$(mktemp)"
+trap 'rm -f "$rev_map" "$rev_map_uniq" "$rev_map_sed" "$tsort_out"' EXIT
+
+(
+	exec 3>"$rev_map"
+	cd "$git_dir"
+	git for-each-ref --format='%(refname)' $pattern |
+		while read topic; do
+			topic="${topic#refs/top-bases/}"
+			topic_rev="$(git rev-parse --verify "${topic}" 2>/dev/null)"
+			printf "%s\t%q\n" "${topic_rev}" "${topic}" >&3
+			git show "${topic}":.topdeps 2>/dev/null |
+				while read dep; do
+					dep_rev="$(git rev-parse --verify "${dep}" 2>/dev/null)"
+					printf "%s\t%q\n" "${dep_rev}" "${dep}" >&3
+					printf "%s\t%s\n" "${topic_rev}" "${dep_rev}"
+				done
+		done
+) | tsort | tac > "$tsort_out"
+
+LC_ALL=C sort "$rev_map" | uniq > "$rev_map_uniq"
+while read sha1 rev; do
+	printf "s#%s#%s#\n" "$sha1" "$rev"
+done < "$rev_map_uniq" > "$rev_map_sed"
+
+sed -f "$rev_map_sed" "$tsort_out"
-- 
tg: (370a0fd..) t/queue-movement (depends on: master)

^ permalink raw reply related

* Re: [TopGit RFC PATCH] tg mail: new command for mailing patches
From: Bert Wesarg @ 2008-09-19  9:52 UTC (permalink / raw)
  To: Kirill Smelkov; +Cc: Petr Baudis, Git Mailing List
In-Reply-To: <1221815301-25090-1-git-send-email-kirr@landau.phys.spbu.ru>

On Fri, Sep 19, 2008 at 11:08, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> Petr, since you've asked for help on this, here you are:
>
>    $ tg mail [NAME]
>
> a simple script to send one patch over email.
>
>
> All it does is
>
>    - call `tg patch` for actual patch preparation
>    - extract email addresses from whom and where to send a mail
That shouldn't be needed. git send-email parses Cc: headers and the
To: comes from 'git config topgit.to', so you can re-use this.

Bert

^ permalink raw reply

* Re: failure doing massive revert
From: Mike Galbraith @ 2008-09-19  9:35 UTC (permalink / raw)
  To: Avery Pennarun; +Cc: git
In-Reply-To: <32541b130809181126v4ba4acd7pc5bda085740ab6ba@mail.gmail.com>

On Thu, 2008-09-18 at 14:26 -0400, Avery Pennarun wrote:
> On Thu, Sep 18, 2008 at 5:09 AM, Mike Galbraith <efault@gmx.de> wrote:
> > For reasons I'd rather not go into, I decided to create a merge free
> > tree to try to bisect.  I did this yesterday for a smaller range, and it
> > worked fine, and I was able to revert the reverts to re-apply.  Trying
> > to revert everything from v2.6.26..today croaked.
> >
> > for i in `git rev-list --no-merges v2.6.26..HEAD`; do git revert $i < /dev/null; done
> 
> Hmm, I don't think you can revert every single patch on a merged tree
> that way for the same reason you can't just rebase it: history wasn't
> linear.

Ok, nothing is broke, I just tripped over my white git-fu belt.

> I think something involving 'git rev-list --first-parent' and some
> variant of "git diff $i $i^ | git apply" might work better, as it
> would inherently squash merge commits, thus making them linearly
> reversible (although throwing away large parts of history).
> 
> Throwing away history might not be what you want, but then again,
> maybe it is.  It's the only way I know of to 100% reliably linearize
> the history, anyway.

Thanks, I'll save this reply in case I decide to resume hunt.

	-Mike 

^ permalink raw reply

* Re: How to remove a commit object?
From: Michael J Gruber @ 2008-09-19  9:16 UTC (permalink / raw)
  To: Steven Grimm; +Cc: Git Users List
In-Reply-To: <D53D127D-97DD-417C-9109-ABD46BBD4E18@midwinter.com>

Steven Grimm venit, vidit, dixit 19.09.2008 01:41:
> I maintain a shared repository a bunch of my coworkers push to for  
> code reviews. It has accumulated a lot of packfiles, so I want to  
> shrink it down a bit, but there's a problem:
> 
> % git repack -A -d
> Counting objects: ...
> error: Could not read 125bf191b65189aaec7a6aa24ff26460d141d587
> fatal: bad tree object 125bf191b65189aaec7a6aa24ff26460d141d587
> 
> "git fsck" confirms that the tree object is missing:
> 
> % git fsck
> broken link from  commit 1b2f0595bb4a6c2e17ca43a9cc41feec88c72a47
>                to    tree 125bf191b65189aaec7a6aa24ff26460d141d587
> ...
> missing tree 125bf191b65189aaec7a6aa24ff26460d141d587
> 
> This is a dangling commit, but that's fine; for this particular  
> repository we actually *want* lots of dangling commits since they  
> represent the history of people's code review requests. (Hence me  
> running git-repack with -A instead of -a.)
> 
> Given that it's dangling, it seems like it'd be safe to just remove  
> entirely (we lose that little bit of code-review history but we've  
> lost it already anyway with the tree object missing). But I'm not sure  
> how to do it. Is it possible to delete a commit object, and if so, how?
> 
> I don't know how the corruption happened in the first place. There was  
> a short time at one point where the permissions on the object  
> directories were inconsistent, so it's possible someone pushed during  
> that period and managed to create the commit object file in .git/ 
> objects but didn't have permission to create the tree object. That's  
> just speculation on my part, though. This is the only corrupt object  
> in the repository according to git-fsck, so at this point I just want  
> to know how to get rid of it so I can do the repack.

git prune should delete dangling commits. Is that commit already in a
pack? Then the -f option to repack may help.

Michael

^ permalink raw reply

* [TopGit RFC PATCH] tg mail: new command for mailing patches
From: Kirill Smelkov @ 2008-09-19  9:08 UTC (permalink / raw)
  To: Petr Baudis, Petr Baudis; +Cc: Kirill Smelkov, Git Mailing List

Petr, since you've asked for help on this, here you are:

    $ tg mail [NAME]

a simple script to send one patch over email.


All it does is

    - call `tg patch` for actual patch preparation
    - extract email addresses from whom and where to send a mail
    - boils down to `git send-email`


It is self-hosted -- this mail was send by me with

    $ tg mail t/tg-mail


P.S. I'm not a bash guy, please do not beat me too much...

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>

---
 .gitignore |    2 ++
 README     |   18 ++++++++++++++++++
 tg-mail.sh |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index aa39db4..df4a662 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,8 @@ tg-delete
 tg-delete.txt
 tg-info
 tg-info.txt
+tg-mail
+tg-mail.txt
 tg-patch
 tg-patch.txt
 tg-summary
diff --git a/README b/README
index b99b036..1a001a6 100644
--- a/README
+++ b/README
@@ -272,6 +272,24 @@ tg patch
 	TODO: tg patch -i to base at index instead of branch,
 		-w for working tree
 
+tg mail
+~~~~~~~
+	Send a patch from the current or specified topic branch as
+	email.
+
+	Takes the patch given on the command line and emails it out.
+	Destination addresses such as To, Cc and Bcc are taken from the
+	patch header.
+
+	Since it actually boils down to `git send-email` please refer to
+	it's documentation for details on how to setup email for git.
+
+
+	TODO: tg mail patchfile  to mail an already exported patch
+	TODO: mailing patch series
+	TODO: specifying additional options and addresses on command
+	      line
+
 tg remote
 ~~~~~~~~~
 	Register given remote as TopGit-controlled. This will create
diff --git a/tg-mail.sh b/tg-mail.sh
new file mode 100644
index 0000000..f3abd2c
--- /dev/null
+++ b/tg-mail.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+# TopGit - A different patch queue manager
+# GPLv2
+
+name=
+
+
+## Parse options
+
+while [ -n "$1" ]; do
+	arg="$1"; shift
+	case "$arg" in
+	-*)
+		echo "Usage: tg [...] mail [NAME]" >&2
+		exit 1;;
+	*)
+		[ -z "$name" ] || die "name already specified ($name)"
+		name="$arg";;
+	esac
+done
+
+# TODO refactor me into something common?
+[ -n "$name" ] || name="$(git symbolic-ref HEAD | sed 's#^refs/heads/##')"
+base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" ||
+	die "not a TopGit-controlled branch"
+
+
+patchfile="$(mktemp -t tg-mail.XXXXXX)"
+
+$tg patch $name >"$patchfile"
+
+hlines=$(grep -n -m 1 '^---' "$patchfile" | sed 's/:---//')
+header=$(head -$(($hlines - 1)) "$patchfile")
+
+
+
+from="$(echo "$header" | grep '^From:' | sed 's/From:\s*//')"
+to="$(echo "$header" | grep '^To:' | sed 's/To:\s*//')"
+
+
+# XXX I can't get quoting right without arrays
+[ -n "$from" ] && from=(--from "$from")
+[ -n "$to"   ] && to=(--to "$to") # FIXME there could be multimple To
+
+people=()
+[ -n "$from" ] && people=("${people[@]}" "${from[@]}")
+[ -n "$to" ]   && people=("${people[@]}" "${to[@]}")
+
+
+# NOTE git-send-email handles cc itself
+git send-email "${people[@]}" "$patchfile"
+
+rm "$patchfile"
-- 
tg: (6b5d0b8..) t/tg-mail (depends on: kirr)

^ permalink raw reply related

* Re: Get a copy of an old version of a file, using git gui/gitk
From: Björn Steinbrink @ 2008-09-19  9:12 UTC (permalink / raw)
  To: dhruva; +Cc: Peter Krefting, Git Mailing List
In-Reply-To: <884843.41605.qm@web95002.mail.in2.yahoo.com>

[Fixed that top-posting for you...]

On 2008.09.19 14:02:30 +0530, dhruva wrote:
> From: Björn Steinbrink <B.Steinbrink@gmx.de>
> > On 2008.09.19 08:58:04 +0100, Peter Krefting wrote:
> > > From the command line, I would try to find the SHA-1 and use git
> > > cat-file, but I can't figure out how to do it from the GUIs. Or, to
> > > fall back to the command-line, how to get the SHA-1 for the object out
> > > of git gui/gitk.
> > 
> > You don't need the sha1 of the blob object, just the revision and the
> > filename, and then you can reference the blob using the
> > :syntax.
> > 
> > For example:
> >     git cat-file blob HEAD^^^:some/file.c
> > or less plumb-ish:
> >     git show HEAD^^^:some/file.c
> > 
> > I've been told that neither cares about the CRLF conversion, and I don't
> > know if there's anything except "git checkout" that actually does care
> > about it. With checkout, you would do:
> > 
> > git checkout HEAD^^^ -- some/file.c
> > 
> > But that replaces the current version of that file in your working tree
> > and index with the version from the HEAD^^^ revision, so that might not
> > be exactly what you were looking for.
>
> Using gitk, you can branch at the change that has the file (and
> content, I am not using version as git does not version files) you
> want. Check out that branch and you will have that file (and all other
> files at that changeset). When you are done, you can just delete that
> branch... branching is _cheap_

Yeah, that works, but only if you have no uncommitted changes (which
git would try to apply to the version you check out). And that obviously
replaces _all_ files in your working tree and index, so that doesn't
have any advantages compared to the "git checkout $commit -- file"
approach. The disadvantage is just shifted from "uncommitted changes to
that file are lost" to "uncommitted changes to that file are kept", so
you don't even get the actual version of that file that you wanted to
have in the first place.

Besides that, why even bother with branch creation at all? Just checkout
that revision (puts you on a detached HEAD), do whatever you want, and
checkout the branch you were working on again. No need to create a
branch if you don't intend to create commits you want to keep...

Björn

^ permalink raw reply

* Re: Get a copy of an old version of a file, using git gui/gitk
From: dhruva @ 2008-09-19  8:32 UTC (permalink / raw)
  To: Björn Steinbrink, Peter Krefting; +Cc: Git Mailing List

Using gitk, you can branch at the change that has the file (and content, I am not using version as git does not version files) you want. Check out that branch and you will have that file (and all other files at that changeset). When you are done, you can just delete that branch... branching is _cheap_

-dhruva



----- Original Message ----
> From: Björn Steinbrink <B.Steinbrink@gmx.de>
> To: Peter Krefting <peter@softwolves.pp.se>
> Cc: Git Mailing List <git@vger.kernel.org>
> Sent: Friday, 19 September, 2008 1:50:47 PM
> Subject: Re: Get a copy of an old version of a file, using git gui/gitk
> 
> On 2008.09.19 08:58:04 +0100, Peter Krefting wrote:
> > From the command line, I would try to find the SHA-1 and use git
> > cat-file, but I can't figure out how to do it from the GUIs. Or, to
> > fall back to the command-line, how to get the SHA-1 for the object out
> > of git gui/gitk.
> 
> You don't need the sha1 of the blob object, just the revision and the
> filename, and then you can reference the blob using the
> :syntax.
> 
> For example:
>     git cat-file blob HEAD^^^:some/file.c
> or less plumb-ish:
>     git show HEAD^^^:some/file.c
> 
> I've been told that neither cares about the CRLF conversion, and I don't
> know if there's anything except "git checkout" that actually does care
> about it. With checkout, you would do:
> 
> git checkout HEAD^^^ -- some/file.c
> 
> But that replaces the current version of that file in your working tree
> and index with the version from the HEAD^^^ revision, so that might not
> be exactly what you were looking for.
> 
> Björn
> --
> 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



      Did you know? You can CHAT without downloading messenger. Go to http://in.webmessenger.yahoo.com/

^ permalink raw reply

* Re: Get a copy of an old version of a file, using git gui/gitk
From: Björn Steinbrink @ 2008-09-19  8:20 UTC (permalink / raw)
  To: Peter Krefting; +Cc: Git Mailing List
In-Reply-To: <Pine.LNX.4.64.0809190855060.17960@ds9.cixit.se>

On 2008.09.19 08:58:04 +0100, Peter Krefting wrote:
> From the command line, I would try to find the SHA-1 and use git
> cat-file, but I can't figure out how to do it from the GUIs. Or, to
> fall back to the command-line, how to get the SHA-1 for the object out
> of git gui/gitk.

You don't need the sha1 of the blob object, just the revision and the
filename, and then you can reference the blob using the
<tree-ish>:<path> syntax.

For example:
	git cat-file blob HEAD^^^:some/file.c
or less plumb-ish:
	git show HEAD^^^:some/file.c

I've been told that neither cares about the CRLF conversion, and I don't
know if there's anything except "git checkout" that actually does care
about it. With checkout, you would do:

git checkout HEAD^^^ -- some/file.c

But that replaces the current version of that file in your working tree
and index with the version from the HEAD^^^ revision, so that might not
be exactly what you were looking for.

Björn

^ permalink raw reply

* Re: [TopGit PATCH] .gitignore += vim swap files
From: Kirill Smelkov @ 2008-09-19  7:52 UTC (permalink / raw)
  To: Andreas Ericsson
  Cc: Kirill Smelkov, Bert Wesarg, Daniel Barkalow, Petr Baudis,
	Git Mailing List
In-Reply-To: <48D359FD.90203@op5.se>

On Fri, Sep 19, 2008 at 09:51:25AM +0200, Andreas Ericsson wrote:
> Kirill Smelkov wrote:
>> On Fri, Sep 19, 2008 at 09:10:24AM +0200, Bert Wesarg wrote:
>>> On Fri, Sep 19, 2008 at 07:06, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>>>> On Thu, Sep 18, 2008 at 03:30:35PM -0400, Daniel Barkalow wrote:
>>>>> On Thu, 18 Sep 2008, Bert Wesarg wrote:
>>>>>
>>>>>> On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>>>>>>> Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
>>>>>>> ---
>>>>>>>  .gitignore |    2 ++
>>>>>>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>>>>>>
>>>>>>> diff --git a/.gitignore b/.gitignore
>>>>>>> index 8868f2d..aa39db4 100644
>>>>>>> --- a/.gitignore
>>>>>>> +++ b/.gitignore
>>>>>>> @@ -18,3 +18,5 @@ tg-import.txt
>>>>>>>  tg-remote
>>>>>>>  tg-remote.txt
>>>>>>>  tg
>>>>>>> +
>>>>>>> +*.swp
>>>>>> can't you do this in your .git/info/excludes?
>>>>> It's generally better to put a core.excludesfile entry in your
>>>>> ~/.gitconfig pointing to a ignore file with editor temporaries for the
>>>>> editor(s) you personally use. This will then apply to all git projects you
>>>>> work on.
>>>> Yes, this makes sense, thanks.
>>>>
>>>> I've had to add the following to my ~/.gitconfig
>>>>
>>>> [core]
>>>>    excludesfile= /home/kirr/.gitignore-kirr
>>>>
>>>>
>>>> because it does not work when '~' is used for $HOME
>>>>
>>>> [core]
>>>>    excludesfile= ~/.gitignore-kirr # does not work
>>> Have you tried:
>>>
>>>   [core]
>>>      excludesfile = .gitignore-kirr
>>> There was a discussion about relative files in config. but I didn't tried this.
>>
>> It does not work for me -- it picks ./.gitignore-kirr instead of
>> ~/.gitignore-kirr
>>
>>> Anyway, I think this is the best solution. Don't globber the repos with this.
>>
>> Don't you care more about machines than humans? :)
>>
>> I think when we work on a tree, all the autogenerated files should be
>> ignored. This includes *.o and friends for sure, but since we also use
>> editors, and most people use same editors it makes sense to tune repo to
>> be ready to hack on with common setups.
>>
>
> Most people do not use same editors. In our office there's 8 programmers
> and 6 editors in use (geany, jed, vim, nedit, zend studio, kate).
>
>> And I think this
>>
>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7088655477b51a5a248fa54190388e1283ba7ebf
>>
>> just justifies my words.
>>
>
> If topgit had 4374 contributors since 10 minor versions back, I'd be
> more inclined to agree with you. Even so, you'll have to accept that
> this patch gets dropped[1] and stop trying to argue for it after it's
> already been discussed (at length).
>
> [1]
> I'm not too sure who the topgit maintainer actually is, but the majority
> seem to be against this patch.

I'm ok with this patch being dropped.

-- 
    Всего хорошего, Кирилл.

^ permalink raw reply

* Get a copy of an old version of a file, using git gui/gitk
From: Peter Krefting @ 2008-09-19  7:58 UTC (permalink / raw)
  To: Git Mailing List

Hi!

I am trying to introduce new people to Git, and am primarily showing
how to use the GUI tools (git gui/gitk), since the project is running
on Windows. A question that I couldn't answer arose:

How do I save a copy of an older version of a file (one that has either
been modified locally, or an earlier version in the project history),
from git gui or gitk?

>From the command line, I would try to find the SHA-1 and use git
cat-file, but I can't figure out how to do it from the GUIs. Or, to
fall back to the command-line, how to get the SHA-1 for the object out
of git gui/gitk.

-- 
\\// Peter - http://www.softwolves.pp.se/

^ permalink raw reply

* Re: [TopGit PATCH] .gitignore += vim swap files
From: Andreas Ericsson @ 2008-09-19  7:51 UTC (permalink / raw)
  To: Kirill Smelkov
  Cc: Bert Wesarg, Daniel Barkalow, Petr Baudis, Git Mailing List
In-Reply-To: <20080919072851.GD4423@roro3>

Kirill Smelkov wrote:
> On Fri, Sep 19, 2008 at 09:10:24AM +0200, Bert Wesarg wrote:
>> On Fri, Sep 19, 2008 at 07:06, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>>> On Thu, Sep 18, 2008 at 03:30:35PM -0400, Daniel Barkalow wrote:
>>>> On Thu, 18 Sep 2008, Bert Wesarg wrote:
>>>>
>>>>> On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>>>>>> Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
>>>>>> ---
>>>>>>  .gitignore |    2 ++
>>>>>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>>>>>
>>>>>> diff --git a/.gitignore b/.gitignore
>>>>>> index 8868f2d..aa39db4 100644
>>>>>> --- a/.gitignore
>>>>>> +++ b/.gitignore
>>>>>> @@ -18,3 +18,5 @@ tg-import.txt
>>>>>>  tg-remote
>>>>>>  tg-remote.txt
>>>>>>  tg
>>>>>> +
>>>>>> +*.swp
>>>>> can't you do this in your .git/info/excludes?
>>>> It's generally better to put a core.excludesfile entry in your
>>>> ~/.gitconfig pointing to a ignore file with editor temporaries for the
>>>> editor(s) you personally use. This will then apply to all git projects you
>>>> work on.
>>> Yes, this makes sense, thanks.
>>>
>>> I've had to add the following to my ~/.gitconfig
>>>
>>> [core]
>>>    excludesfile= /home/kirr/.gitignore-kirr
>>>
>>>
>>> because it does not work when '~' is used for $HOME
>>>
>>> [core]
>>>    excludesfile= ~/.gitignore-kirr # does not work
>> Have you tried:
>>
>>   [core]
>>      excludesfile = .gitignore-kirr
>> There was a discussion about relative files in config. but I didn't tried this.
> 
> It does not work for me -- it picks ./.gitignore-kirr instead of
> ~/.gitignore-kirr
> 
>> Anyway, I think this is the best solution. Don't globber the repos with this.
> 
> Don't you care more about machines than humans? :)
> 
> I think when we work on a tree, all the autogenerated files should be
> ignored. This includes *.o and friends for sure, but since we also use
> editors, and most people use same editors it makes sense to tune repo to
> be ready to hack on with common setups.
> 

Most people do not use same editors. In our office there's 8 programmers
and 6 editors in use (geany, jed, vim, nedit, zend studio, kate).

> And I think this
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7088655477b51a5a248fa54190388e1283ba7ebf
> 
> just justifies my words.
> 

If topgit had 4374 contributors since 10 minor versions back, I'd be
more inclined to agree with you. Even so, you'll have to accept that
this patch gets dropped[1] and stop trying to argue for it after it's
already been discussed (at length).

[1]
I'm not too sure who the topgit maintainer actually is, but the majority
seem to be against this patch.

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

^ permalink raw reply

* Re: [TopGit PATCH] .gitignore += vim swap files
From: Kirill Smelkov @ 2008-09-19  7:28 UTC (permalink / raw)
  To: Bert Wesarg
  Cc: Kirill Smelkov, Daniel Barkalow, Petr Baudis, Git Mailing List
In-Reply-To: <36ca99e90809190010n40d0a4w26975e87e17a822e@mail.gmail.com>

On Fri, Sep 19, 2008 at 09:10:24AM +0200, Bert Wesarg wrote:
> On Fri, Sep 19, 2008 at 07:06, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> > On Thu, Sep 18, 2008 at 03:30:35PM -0400, Daniel Barkalow wrote:
> >> On Thu, 18 Sep 2008, Bert Wesarg wrote:
> >>
> >> > On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> >> > > Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
> >> > > ---
> >> > >  .gitignore |    2 ++
> >> > >  1 files changed, 2 insertions(+), 0 deletions(-)
> >> > >
> >> > > diff --git a/.gitignore b/.gitignore
> >> > > index 8868f2d..aa39db4 100644
> >> > > --- a/.gitignore
> >> > > +++ b/.gitignore
> >> > > @@ -18,3 +18,5 @@ tg-import.txt
> >> > >  tg-remote
> >> > >  tg-remote.txt
> >> > >  tg
> >> > > +
> >> > > +*.swp
> >> > can't you do this in your .git/info/excludes?
> >>
> >> It's generally better to put a core.excludesfile entry in your
> >> ~/.gitconfig pointing to a ignore file with editor temporaries for the
> >> editor(s) you personally use. This will then apply to all git projects you
> >> work on.
> >
> > Yes, this makes sense, thanks.
> >
> > I've had to add the following to my ~/.gitconfig
> >
> > [core]
> >    excludesfile= /home/kirr/.gitignore-kirr
> >
> >
> > because it does not work when '~' is used for $HOME
> >
> > [core]
> >    excludesfile= ~/.gitignore-kirr # does not work
> Have you tried:
> 
>   [core]
>      excludesfile = .gitignore-kirr
> There was a discussion about relative files in config. but I didn't tried this.

It does not work for me -- it picks ./.gitignore-kirr instead of
~/.gitignore-kirr

> Anyway, I think this is the best solution. Don't globber the repos with this.

Don't you care more about machines than humans? :)

I think when we work on a tree, all the autogenerated files should be
ignored. This includes *.o and friends for sure, but since we also use
editors, and most people use same editors it makes sense to tune repo to
be ready to hack on with common setups.

And I think this

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7088655477b51a5a248fa54190388e1283ba7ebf

just justifies my words.

-- 
    Всего хорошего, Кирилл.

^ permalink raw reply

* Re: [TopGit PATCH] .gitignore += vim swap files
From: Bert Wesarg @ 2008-09-19  7:10 UTC (permalink / raw)
  To: Kirill Smelkov; +Cc: Daniel Barkalow, Petr Baudis, Git Mailing List
In-Reply-To: <20080919050612.GA4423@roro3>

On Fri, Sep 19, 2008 at 07:06, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> On Thu, Sep 18, 2008 at 03:30:35PM -0400, Daniel Barkalow wrote:
>> On Thu, 18 Sep 2008, Bert Wesarg wrote:
>>
>> > On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>> > > Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
>> > > ---
>> > >  .gitignore |    2 ++
>> > >  1 files changed, 2 insertions(+), 0 deletions(-)
>> > >
>> > > diff --git a/.gitignore b/.gitignore
>> > > index 8868f2d..aa39db4 100644
>> > > --- a/.gitignore
>> > > +++ b/.gitignore
>> > > @@ -18,3 +18,5 @@ tg-import.txt
>> > >  tg-remote
>> > >  tg-remote.txt
>> > >  tg
>> > > +
>> > > +*.swp
>> > can't you do this in your .git/info/excludes?
>>
>> It's generally better to put a core.excludesfile entry in your
>> ~/.gitconfig pointing to a ignore file with editor temporaries for the
>> editor(s) you personally use. This will then apply to all git projects you
>> work on.
>
> Yes, this makes sense, thanks.
>
> I've had to add the following to my ~/.gitconfig
>
> [core]
>    excludesfile= /home/kirr/.gitignore-kirr
>
>
> because it does not work when '~' is used for $HOME
>
> [core]
>    excludesfile= ~/.gitignore-kirr # does not work
Have you tried:

  [core]
     excludesfile = .gitignore-kirr

There was a discussion about relative files in config. but I didn't tried this.

Anyway, I think this is the best solution. Don't globber the repos with this.

Bert

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox