* Re: [PATCH v2] diff: add option to show context between close hunks
From: Junio C Hamano @ 2008-12-29 9:05 UTC (permalink / raw)
To: René Scharfe
Cc: Git Mailing List, Jeff King, Davide Libenzi, Johannes Sixt
In-Reply-To: <1230489932.8791.25.camel@ubuntu.ubuntu-domain>
Thanks; will queue.
^ permalink raw reply
* Re: [PATCH] Documentation/diff-options.txt: unify options
From: Junio C Hamano @ 2008-12-29 9:10 UTC (permalink / raw)
To: jidanni; +Cc: git
In-Reply-To: <7vabafe5ai.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> That commentary above your S-o-b is not a proper commit log message, but
> I'll come up with something and apply.
Here is what I came up with and applied.
Documentation/diff-options.txt: unify options
Instead of listing short option (e.g. "-U<n>") as a shorthand for its
longer counterpart (e.g. "--unified=<n>"), list the synonyms together. It
saves one indirection to find what the reader wants.
Signed-off-by: jidanni <jidanni@jidanni.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thanks.
^ permalink raw reply
* [PATCH] t7500-commit.sh: do not call test_set_editor unnecessarily, it's confusing
From: Adeodato Simó @ 2008-12-29 9:24 UTC (permalink / raw)
To: git, gitster; +Cc: Adeodato Simó
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
I was reading this test case, and it took a small bit to figure out the
editor was not being used at all. I hope there was no hidden reason for
it to be there, and it can go away.
Cheers,
t/t7500-commit.sh | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index 6e18a96..5998baf 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -149,10 +149,7 @@ EOF
test_expect_success '--signoff' '
echo "yet another content *narf*" >> foo &&
- echo "zort" | (
- test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
- git commit -s -F - foo
- ) &&
+ echo "zort" | git commit -s -F - foo &&
git cat-file commit HEAD | sed "1,/^$/d" > output &&
test_cmp expect output
'
--
1.6.1.307.g07803
^ permalink raw reply related
* Re: [PATCH] t7500-commit.sh: do not call test_set_editor unnecessarily, it's confusing
From: Junio C Hamano @ 2008-12-29 9:46 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, Adeodato Simó
In-Reply-To: <1230542658-9758-1-git-send-email-dato@net.com.org.es>
Adeodato Simó <dato@net.com.org.es> writes:
> I was reading this test case, and it took a small bit to figure out the
> editor was not being used at all. I hope there was no hidden reason for
> it to be there, and it can go away.
That 'zort' came from 1320857 (builtin-commit: fix --signoff, 2007-11-11),
and I _think_ it is trying to make sure that presense of "-F -" makes the
editor not to trigger.
Dscho?
^ permalink raw reply
* Re: some git-commands --help don't act like git commands --help
From: Michael Gaber @ 2008-12-29 9:48 UTC (permalink / raw)
To: git
In-Reply-To: <20081229175305.6117@nanako3.lavabit.com>
[-- Attachment #1: Type: text/plain, Size: 816 bytes --]
Nanako Shiraishi schrieb:
> Quoting jidanni@jidanni.org:
>
>> Hmmm, some git-commands --help act just like git commands --help,
>> $ git commit --help 2>&1|wc -l
>> 336
>> $ git-commit --help 2>&1|wc -l
>> 336
>>
>> But others don't
>> $ git am --help 2>&1|wc -l
>> 152
>> $ git-am --help 2>&1|wc -l
>> 19
>
> Thank you for your observation; what do you want to do about it?
>
> Are you complaining that some commands do not have customized description that is not as long as the full manual page but not as terse as the short help "-h" output? Or are you complaining some other commands do not give you full manual pages for "--help"?
>
I think he just wantet to state that the output of git-command --help
and git command --help should be identical as the both do the same
thing, don't they?
Regards Michael
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3656 bytes --]
^ permalink raw reply
* Re: [PATCH] t7500-commit.sh: do not call test_set_editor unnecessarily, it's confusing
From: Adeodato Simó @ 2008-12-29 9:52 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Johannes Schindelin, git
In-Reply-To: <7vmyefco11.fsf@gitster.siamese.dyndns.org>
* Junio C Hamano [Mon, 29 Dec 2008 01:46:02 -0800]:
> Adeodato Simó <dato@net.com.org.es> writes:
> > I was reading this test case, and it took a small bit to figure out the
> > editor was not being used at all. I hope there was no hidden reason for
> > it to be there, and it can go away.
> That 'zort' came from 1320857 (builtin-commit: fix --signoff, 2007-11-11),
> and I _think_ it is trying to make sure that presense of "-F -" makes the
> editor not to trigger.
Hm. Well, if that is true, then IMHO it should be in a /separate/ test
case, for clarity. Probably in "message from stdin" test from t7501.
That's of course just my opinion, and I'll accept if you prefer to
maintain it the way it is now. I also volunteer to move it to t7501 if
that's what you prefer, just let me know.
Thanks,
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
Listening to: Justin Nozuka - I'm In Peace
^ permalink raw reply
* Re: some git-commands --help don't act like git commands --help
From: Junio C Hamano @ 2008-12-29 9:54 UTC (permalink / raw)
To: Nanako Shiraishi; +Cc: jidanni, git
In-Reply-To: <20081229175305.6117@nanako3.lavabit.com>
Nanako Shiraishi <nanako3@lavabit.com> writes:
> Quoting jidanni@jidanni.org:
>
>> Hmmm, some git-commands --help act just like git commands --help,
>> $ git commit --help 2>&1|wc -l
>> 336
>> $ git-commit --help 2>&1|wc -l
>> 336
>>
>> But others don't
>> $ git am --help 2>&1|wc -l
>> 152
>> $ git-am --help 2>&1|wc -l
>> 19
>
> Thank you for your observation; what do you want to do about it?
>
> Are you complaining that some commands do not have customized description that is not as long as the full manual page but not as terse as the short help "-h" output? Or are you complaining some other commands do not give you full manual pages for "--help"?
I think he is comparing "git am" and "git-am" the latter of which is now
deprecated and largely removed from the end user.
IOW, the seeming inconsistency is not an issue anymore in practice in the
post 1.6.0 era.
^ permalink raw reply
* Re: [PATCH] t7500-commit.sh: do not call test_set_editor unnecessarily, it's confusing
From: Junio C Hamano @ 2008-12-29 9:57 UTC (permalink / raw)
To: Adeodato Simó; +Cc: Johannes Schindelin, git
In-Reply-To: <20081229095220.GA26942@chistera.yi.org>
Adeodato Simó <dato@net.com.org.es> writes:
> * Junio C Hamano [Mon, 29 Dec 2008 01:46:02 -0800]:
> ...
>> That 'zort' came from 1320857 (builtin-commit: fix --signoff, 2007-11-11),
>> and I _think_ it is trying to make sure that presense of "-F -" makes the
>> editor not to trigger.
>
> Hm. Well, if that is true, then IMHO it should be in a /separate/ test
> case, for clarity. Probably in "message from stdin" test from t7501.
>
> That's of course just my opinion, and I'll accept if you prefer to
> maintain it the way it is now. I also volunteer to move it to t7501 if
> that's what you prefer, just let me know.
I underscored _think_ and CC'ed Dscho for a reason.
If "-F -" has a bug, and if you do not define GIT_EDITOR, your test may
not work unattended (i.e. neither succeed nor finish but gets stuck).
Perhaps that is the issue? I dunno.
^ permalink raw reply
* Re: some git-commands --help don't act like git commands --help
From: Nanako Shiraishi @ 2008-12-29 10:29 UTC (permalink / raw)
To: Junio C Hamano; +Cc: jidanni, git
Quoting Junio C Hamano <gitster@pobox.com>:
> I think he is comparing "git am" and "git-am" the latter of which is now
> deprecated and largely removed from the end user.
>
> IOW, the seeming inconsistency is not an issue anymore in practice in the
> post 1.6.0 era.
Ah, I misread that distinction in the OP's message.
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply
* [PATCH v3] Add a commit.signoff configuration option to always use --signoff in commit
From: Adeodato Simó @ 2008-12-29 11:16 UTC (permalink / raw)
To: git, gitster; +Cc: Adeodato Simó
In-Reply-To: <20081227120128.GA11322@chistera.yi.org>
The intent is that it only applies when the user runs `git commit`
themselves, hence a number of commands (rebase and revert/cherry-pick)
have started passing --no-signoff when invoking commit.
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
Hello, I've worked a bit more on this patch, and I'd like to know if
it's going in a good direction or not. Changes since v2:
t/t7500-commit.sh | 22 ++++++++++++++++++++++
* add tests to check that commit.signoff works correctly, and that
is overriden by --no-signoff
git-rebase.sh | 2 +-
t/t3402-rebase-merge.sh | 6 +++++-
* make git-rebase pass --no-signoff when invoking `git commit`, and
add a test for it
builtin-revert.c | 2 ++
* make revert/cherry-pick pass --no-signoff unless -s was given by
the user (missing test)
Documentation/config.txt | 4 ++--
* improve config.txt wording as per <20081227120128.GA11322@chistera.yi.org>
(I don't know if it's customary to send a diff from v2 to v3, if it is
please let me know.)
Thanks,
Documentation/config.txt | 9 +++++++++
Documentation/git-commit.txt | 3 ++-
builtin-commit.c | 5 +++++
builtin-revert.c | 2 ++
git-rebase.sh | 2 +-
t/t3402-rebase-merge.sh | 6 +++++-
t/t7500-commit.sh | 22 ++++++++++++++++++++++
7 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 52786c7..13f2200 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -591,6 +591,15 @@ color.ui::
commit.template::
Specify a file to use as the template for new commit messages.
+commit.signoff::
+ If set, 'git commit' will behave as if '-s' option was given.
+ Please use this option with care: by enabling it globally, you'd
+ be stating that all your commits will invariably meet the S-o-b
+ requirements for any project you send patches to. It's probably
+ best to only use it from your private repositories' .git/config
+ file, and only for projects who require a S-o-b as proof of
+ provenance of the patch, and not of its correctness or quality.
+
diff.autorefreshindex::
When using 'git-diff' to compare with work tree
files, do not consider stat-only change as changed.
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index b5d81be..abab839 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -96,7 +96,8 @@ OPTIONS
-s::
--signoff::
Add Signed-off-by line by the committer at the end of the commit
- log message.
+ log message. This overrides the `commit.signoff` configuration
+ variable.
-n::
--no-verify::
diff --git a/builtin-commit.c b/builtin-commit.c
index e88b78f..fc09539 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -929,6 +929,11 @@ static int git_commit_config(const char *k, const char *v, void *cb)
if (!strcmp(k, "commit.template"))
return git_config_string(&template_file, k, v);
+ if (!strcmp(k, "commit.signoff")) {
+ signoff = git_config_bool(k, v);
+ return 0;
+ }
+
return git_status_config(k, v, cb);
}
diff --git a/builtin-revert.c b/builtin-revert.c
index d48313c..395c7a5 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -429,6 +429,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)
args[i++] = "-n";
if (signoff)
args[i++] = "-s";
+ else
+ args[i++] = "--no-signoff";
if (!edit) {
args[i++] = "-F";
args[i++] = defmsg;
diff --git a/git-rebase.sh b/git-rebase.sh
index ebd4df3..bf520d0 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -63,7 +63,7 @@ continue_merge () {
cmt=`cat "$dotest/current"`
if ! git diff-index --quiet --ignore-submodules HEAD --
then
- if ! git commit --no-verify -C "$cmt"
+ if ! git commit --no-verify --no-signoff -C "$cmt"
then
echo "Commit failed, please do not call \"git commit\""
echo "directly, but instead do one of the following: "
diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh
index 7b7d072..bd2d08c 100755
--- a/t/t3402-rebase-merge.sh
+++ b/t/t3402-rebase-merge.sh
@@ -41,7 +41,8 @@ test_expect_success setup '
git branch test-rebase side &&
git branch test-rebase-pick side &&
git branch test-reference-pick side &&
- git checkout -b test-merge side
+ git checkout -b test-merge side &&
+ git config commit.signoff true
'
test_expect_success 'reference merge' '
@@ -54,6 +55,9 @@ test_expect_success rebase '
GIT_TRACE=1 git rebase --merge master
'
+test_expect_success 'rebase uses --no-signoff' '
+ !(git log | grep -q Signed-off-by)'
+
test_expect_success 'test-rebase@{1} is pre rebase' '
test $PRE_REBASE = $(git rev-parse test-rebase@{1})
'
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index 6e18a96..c7deb3e 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -147,6 +147,10 @@ zort
Signed-off-by: C O Mitter <committer@example.com>
EOF
+cat > expect_no_signoff << EOF
+zort
+EOF
+
test_expect_success '--signoff' '
echo "yet another content *narf*" >> foo &&
echo "zort" | (
@@ -157,6 +161,24 @@ test_expect_success '--signoff' '
test_cmp expect output
'
+test_expect_success 'commit.signoff' '
+ echo "and more content" >> foo &&
+ git config commit.signoff true &&
+ echo "zort" | git commit -F - foo &&
+ git config --unset commit.signoff &&
+ git cat-file commit HEAD | sed "1,/^$/d" > output &&
+ test_cmp expect output
+'
+
+test_expect_success '--no-signoff trumps commit.signoff' '
+ echo "and even more" >> foo &&
+ git config commit.signoff true &&
+ echo "zort" | git commit --no-signoff -F - foo &&
+ git config --unset commit.signoff &&
+ git cat-file commit HEAD | sed "1,/^$/d" > output &&
+ test_cmp expect_no_signoff output
+'
+
test_expect_success 'commit message from file (1)' '
mkdir subdir &&
echo "Log in top directory" >log &&
--
1.6.1.307.g07803
^ permalink raw reply related
* Re: [PATCH v3] Add a commit.signoff configuration option to always use --signoff in commit
From: Adeodato Simó @ 2008-12-29 11:18 UTC (permalink / raw)
To: git, gitster
In-Reply-To: <1230549405-10000-1-git-send-email-dato@net.com.org.es>
> Changes since v2:
(Updating git-rebase--interactive.sh is still missing, I know.)
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
He who has not a good memory should never take upon himself the trade of lying.
-- Michel de Montaigne
^ permalink raw reply
* Re: [PATCH] gitweb: Fix export check in git_get_projects_list
From: Jakub Narebski @ 2008-12-29 12:29 UTC (permalink / raw)
To: Devin Doucette; +Cc: git, Petr Baudis
In-Reply-To: <200812280312.02615.jnareb@gmail.com>
On Sun, 28 Dec 2008, Jakub Narebski wrote:
> On Sat, 27 Dec 2008, Devin Doucette wrote:
> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> > index 8f574c7..99f71b4 100755
> > --- a/gitweb/gitweb.perl
> > +++ b/gitweb/gitweb.perl
> > @@ -2147,8 +2147,9 @@ sub git_get_projects_list {
> >
> > my $subdir = substr($File::Find::name, $pfxlen + 1);
> > # we check related file in $projectroot
> > - if (check_export_ok("$projectroot/$filter/$subdir")) {
> > - push @list, { path => ($filter ? "$filter/" : '') . $subdir };
> > + my $path = ($filter ? "$filter/" : '') . $subdir;
>
> Nice and clear, but wouldn't be better to use slightly more effective
>
> + my $path = $filter ? "$filter/$subdir" : $subdir;
>
> Or even, taking care of the case when $filter eq '0'
>
> + my $path = defined $filter && $filter ne '' ? "$filter/$subdir" : $subdir;
Err, actually with "$filter ||= '';" earlier in git_get_projects_list
this is not necessary, and is not an improvement.
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [PATCH] doc/git-send-email: mention sendemail.cc config variable
From: Thomas Rast @ 2008-12-29 13:00 UTC (permalink / raw)
To: markus.heidelberg; +Cc: git, gitster
In-Reply-To: <200812290037.25890.markus.heidelberg@web.de>
[-- Attachment #1: Type: text/plain, Size: 643 bytes --]
Markus Heidelberg wrote:
> Specify a starting "Cc:" value for each email.
> + Default is the value of 'sendemail.cc'.
> +
> The --cc option must be repeated for each user you want on the cc list.
Judging from the source, this is not a default value that you can
override: any recipients listed in sendemail.cc configuration(s) are
always added to the Cc list. The same goes for --bcc and
sendemail.bcc however, which uses the exact same formulation.
Maybe something like
You can also add Cc recipients via 'sendemail.cc' configuration
settings.
would clarify?
--
Thomas Rast
trast@{inf,student}.ethz.ch
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH] doc/git-send-email: mention sendemail.cc config variable
From: Markus Heidelberg @ 2008-12-29 13:29 UTC (permalink / raw)
To: Thomas Rast; +Cc: git, gitster
In-Reply-To: <200812291400.08924.trast@student.ethz.ch>
Thomas Rast, 29.12.2008:
> Markus Heidelberg wrote:
> > Specify a starting "Cc:" value for each email.
> > + Default is the value of 'sendemail.cc'.
> > +
> > The --cc option must be repeated for each user you want on the cc list.
>
> Judging from the source, this is not a default value that you can
> override: any recipients listed in sendemail.cc configuration(s) are
> always added to the Cc list. The same goes for --bcc and
> sendemail.bcc however, which uses the exact same formulation.
OK, and --to and sendemail.to is also affected.
> Maybe something like
>
> You can also add Cc recipients via 'sendemail.cc' configuration
> settings.
>
> would clarify?
It is already in next, I think a following patch should be against next
now, shouldn't it?
Markus
^ permalink raw reply
* gitk "reset branch to here" bug in Cygwin
From: Hannu Koivisto @ 2008-12-29 13:41 UTC (permalink / raw)
To: git
Greetings,
First create a test repository with two commits:
mkdir gittest3
cd gittest3
git init
echo foo > foo
git add foo
git commit -m "Foo"
echo foo >> foo
git add foo
git commit -m "2nd. foo"
Now start gitk, point at the first commit and from the context menu
select "Reset master branch to here" and then "Hard:...".
The result is 'can not find channel named "1"'.
git reset --hard HEAD\^1 in the same repository works fine.
Tested with 159c88e5ae95c5b02298193c1658fac5919c8012 (1.6.1 plus a
few commits) on Windows XP.
--
Hannu
^ permalink raw reply
* Re: git clone - failing on cygwin with git:// but not with ssh://
From: Joe Casadonte @ 2008-12-29 14:54 UTC (permalink / raw)
To: git
In-Reply-To: <ud4fdxn08.fsf@terrapin.northbound-train.com>
Joe Casadonte <jcasadonte <at> northbound-train.com> writes:
> The same test machine has cloned from a different linux server via the
> git protocol just fine.
>
> Any ideas? Thanks for the help!
Does anyone know of more logging I can try to help diagnose the issue? Despite
the SSH work-around, this is really hampering me....
^ permalink raw reply
* [PATCH] bash: add '--merge' to 'git reset'
From: SZEDER Gábor @ 2008-12-29 15:05 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, SZEDER Gábor
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
contrib/completion/git-completion.bash | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 3491fd0..f6c3755 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1408,7 +1408,7 @@ _git_reset ()
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
- __gitcomp "--mixed --hard --soft"
+ __gitcomp "--merge --mixed --hard --soft"
return
;;
esac
--
1.6.1.57.gdceb8
^ permalink raw reply related
* turn off "LF will be replaced by CRLF" thingy
From: Zorba @ 2008-12-29 15:38 UTC (permalink / raw)
To: git
Dear All,
I was just in the process of creating our first live version on git (5k+
files), when I noticed this in the output of
$ git add .
being "Warning: LF will be replaced by CRLF in <filename>"
about 500 times !!
I'd rather not let git change any files, many of which are PHP that run on
Apache
I think I remember reading that this is a config option that gets swithced
on by default on windows (which we are running git on)
how do I switch it off ?
thanks
^ permalink raw reply
* Re: turn off "LF will be replaced by CRLF" thingy
From: Zorba @ 2008-12-29 15:55 UTC (permalink / raw)
To: git
In-Reply-To: <gjaqta$tg7$4@ger.gmane.org>
OK, lets be brave and see if I can work this out:
Tutorial says:
"The git configuration file contains a number of variables that affect the
git command's behavior. .git/config file for each repository is used to
store the information for that repository, and $HOME/.gitconfig is used to
store per user information to give fallback values for .git/config file. The
file /etc/gitconfig can be used to store system-wide defaults."
.git/config
======
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
$ echo $HOME
gives:
c\docs and settings\<my name>
$HOME\.gitconfig
=============
[gui]
recentrepo = C:/Documents and Settings/conorr/Desktop/TEMP
recentrepo = C:/Documents and Settings/conorr/Desktop/TEMP/swproj
[user]
email = cr@altmore.co.uk
name = Conor Rafferty
/etc/gitconfig (under Git installation)
===============================
[core]
symlinks = false
autocrlf = true
[color]
diff = auto
[pack]
packSizeLimit = 2g
[help]
format = html
Then tuturial -> the two settings are
core.autocrlf
and
core.safecrlf
So I should set the autocrlf=false in the etc/config file I'm guessing?
lets try that
"Zorba" <cr@altmore.co.uk> wrote in message
news:gjaqta$tg7$4@ger.gmane.org...
> Dear All,
>
> I was just in the process of creating our first live version on git (5k+
> files), when I noticed this in the output of
>
> $ git add .
>
> being "Warning: LF will be replaced by CRLF in <filename>"
> about 500 times !!
>
> I'd rather not let git change any files, many of which are PHP that run on
> Apache
> I think I remember reading that this is a config option that gets swithced
> on by default on windows (which we are running git on)
>
> how do I switch it off ?
>
> thanks
>
>
^ permalink raw reply
* Re: turn off "LF will be replaced by CRLF" thingy
From: Dmitry Potapov @ 2008-12-29 15:58 UTC (permalink / raw)
To: Zorba; +Cc: git
In-Reply-To: <gjaqta$tg7$4@ger.gmane.org>
> I'd rather not let git change any files, many of which are PHP that run on
> Apache
> I think I remember reading that this is a config option that gets swithced
> on by default on windows (which we are running git on)
>
> how do I switch it off ?
git config core.autocrlf false
or if you want to ensure that all your text files have only LF then
git config core.autocrlf input
or if you want to disable conversion for some specific files then you can
use 'crlf' attribute. See 'gitattributes' for more information.
http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
Dmitry
^ permalink raw reply
* Re: turn off "LF will be replaced by CRLF" thingy
From: Zorba @ 2008-12-29 16:18 UTC (permalink / raw)
To: git
In-Reply-To: <37fcd2780812290758q3ef989c0w5156da3098d06068@mail.gmail.com>
Thanks Dmitry,
So I have two options to do this - edit the files direct or issue a command,
thank you !
Now, my next problem is taking all my changes ($ git add . -> puts 5k files
into index, with LF in place of CRLF) out of the index.
Because I haven't committed anything in this repo yet...
$ git reset --hard
....falls over, as it has no HEAD to reset to
I think I read how to do this in a tutorial somewhere, maybe with
git-checkout, but I'm searching and can't find it.
Any kind soul can point me in the right direction ?
thanks !
"Dmitry Potapov" <dpotapov@gmail.com> wrote in message
news:37fcd2780812290758q3ef989c0w5156da3098d06068@mail.gmail.com...
>> I'd rather not let git change any files, many of which are PHP that run
>> on
>> Apache
>> I think I remember reading that this is a config option that gets
>> swithced
>> on by default on windows (which we are running git on)
>>
>> how do I switch it off ?
>
> git config core.autocrlf false
>
> or if you want to ensure that all your text files have only LF then
>
> git config core.autocrlf input
>
> or if you want to disable conversion for some specific files then you can
> use 'crlf' attribute. See 'gitattributes' for more information.
> http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
>
> Dmitry
^ permalink raw reply
* Re: turn off "LF will be replaced by CRLF" thingy
From: david @ 2008-12-29 17:29 UTC (permalink / raw)
To: Zorba; +Cc: git
In-Reply-To: <gjat90$5la$4@ger.gmane.org>
On Mon, 29 Dec 2008, Zorba wrote:
> Thanks Dmitry,
>
> So I have two options to do this - edit the files direct or issue a command,
> thank you !
>
> Now, my next problem is taking all my changes ($ git add . -> puts 5k files
> into index, with LF in place of CRLF) out of the index.
>
> Because I haven't committed anything in this repo yet...
I think if you just do a git add . again it will put the files into the
index without doing the conversion.
David Lang
> $ git reset --hard
>
> ....falls over, as it has no HEAD to reset to
>
> I think I read how to do this in a tutorial somewhere, maybe with
> git-checkout, but I'm searching and can't find it.
> Any kind soul can point me in the right direction ?
>
> thanks !
> "Dmitry Potapov" <dpotapov@gmail.com> wrote in message
> news:37fcd2780812290758q3ef989c0w5156da3098d06068@mail.gmail.com...
>>> I'd rather not let git change any files, many of which are PHP that run
>>> on
>>> Apache
>>> I think I remember reading that this is a config option that gets
>>> swithced
>>> on by default on windows (which we are running git on)
>>>
>>> how do I switch it off ?
>>
>> git config core.autocrlf false
>>
>> or if you want to ensure that all your text files have only LF then
>>
>> git config core.autocrlf input
>>
>> or if you want to disable conversion for some specific files then you can
>> use 'crlf' attribute. See 'gitattributes' for more information.
>> http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
>>
>> Dmitry
>
>
>
> --
> 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
* Re: user manual question
From: Zorba @ 2008-12-29 16:38 UTC (permalink / raw)
To: git
In-Reply-To: <slrnglg90m.olt.sitaramc@sitaramc.homelinux.net>
so a detached HEAD is just a HEAD that is not sitting on a tip ?
i.e. if I do $ git reset --hard HEAD^
...pointing HEAD to the previous committ
this is a detached HEAD
(I thought a detached HEAD was maybe a head somewhere on another branch not
"reachable", i.e. a sibling, not a ancestor...
or something like that)
thanks guys
"Sitaram Chamarty" <sitaramc@gmail.com> wrote in message
news:slrnglg90m.olt.sitaramc@sitaramc.homelinux.net...
> On 2008-12-29, Zorba <cr@altmore.co.uk> wrote:
>> Hi Sitaram!
>>
>> Thanks for clearing that one up.
>
> you're welcome; we've all done a bit of struggling I guess!
>
>> Also, I did wonder about HEAD and head. One can move, the other doesn't!
>> (well, acually it does - head moves "forward", as the tip of the branch
>> grows)
>
> Here's an extract from my notes/internal talks on this:
>
> === basic concepts
> * a branch is "an active line of development"
> * //master//: default branch in a project, by convention
> * //head//: tip of a branch
> * a repo can track many branches, but the working tree is associated
> with
> only one branch at a time
> * //HEAD//: tip of the branch associated with the working tree; this
> is
> where commits go
> ** except when it's "detached"
>
>> Thanks for your other post/reply too - I will be getting back to you on
>> that
>> one
>
> Glad to be of help. I don't consider myself a guru, and am
> constantly waiting for one of the real gurus to strike me
> down with a thunderbolt for saying something stupid :-)
>
^ permalink raw reply
* [PATCH 0/3] rebase --root
From: Thomas Rast @ 2008-12-29 16:45 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
Inspired by f95ebf7 (Allow cherry-picking root commits, 2008-07-04),
this teaches git rebase to rebase everything up to the root commit(s).
The main use-case for this is if you hack on new history, then later
notice that you want to unroll the commits "on" a git-svn branch to
dcommit them separately. (If you just want to squash them, a merge
will do fine.)
Note that --root (in both modes) requires --onto; you cannot rebase
"onto nothing" to edit the root commit. Such an option --onto-nothing
might be a worthwile feature however, since it would also allow
"detaching" a set of commits from their parent history.
BTW, while hacking this I noticed that there are two different tests
t3409:
t3409-rebase-hook.sh
t3409-rebase-preserve-merges.sh
Is this okay, or should one of them be renamed?
Thomas Rast (3):
rebase: learn to rebase root commit
rebase -i: learn to rebase root commit
rebase: update documentation for --root
Documentation/git-rebase.txt | 17 +++++++---
git-rebase--interactive.sh | 53 +++++++++++++++++++++++++--------
git-rebase.sh | 51 ++++++++++++++++++++++----------
t/t3412-rebase-root.sh | 66 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 153 insertions(+), 34 deletions(-)
create mode 100755 t/t3412-rebase-root.sh
^ permalink raw reply
* rebase -i: learn to rebase root commit
From: Thomas Rast @ 2008-12-29 16:45 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
In-Reply-To: <cover.1230569041.git.trast@student.ethz.ch>
Teach git-rebase -i a new option --root, which instructs it to rebase
the entire history leading up to <branch>. This is mainly for
symmetry with ordinary git-rebase; it cannot be used to edit the root
commit in-place (it requires --onto).
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
git-rebase--interactive.sh | 53 +++++++++++++++++++++++++++++++++----------
t/t3412-rebase-root.sh | 14 +++++++++++
2 files changed, 54 insertions(+), 13 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index c8b0861..f29b5ee 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -27,6 +27,7 @@ continue continue rebasing process
abort abort rebasing process and restore original branch
skip skip current patch and continue rebasing process
no-verify override pre-rebase hook from stopping the operation
+root rebase all reachable commmits up to the root(s)
"
. git-sh-setup
@@ -44,6 +45,7 @@ STRATEGY=
ONTO=
VERBOSE=
OK_TO_SKIP_PRE_REBASE=
+REBASE_ROOT=
GIT_CHERRY_PICK_HELP=" After resolving the conflicts,
mark the corrected paths with 'git add <paths>', and
@@ -154,6 +156,11 @@ pick_one () {
output git rev-parse --verify $sha1 || die "Invalid commit name: $sha1"
test -d "$REWRITTEN" &&
pick_one_preserving_merges "$@" && return
+ if test ! -z "$REBASE_ROOT"
+ then
+ output git cherry-pick "$@"
+ return
+ fi
parent_sha1=$(git rev-parse --verify $sha1^) ||
die "Could not get the parent of $sha1"
current_sha1=$(git rev-parse --verify HEAD)
@@ -443,6 +450,7 @@ get_saved_options () {
test -d "$REWRITTEN" && PRESERVE_MERGES=t
test -f "$DOTEST"/strategy && STRATEGY="$(cat "$DOTEST"/strategy)"
test -f "$DOTEST"/verbose && VERBOSE=t
+ test ! -s "$DOTEST"/upstream && REBASE_ROOT=t
}
while test $# != 0
@@ -547,6 +555,9 @@ first and then run 'git rebase --continue' again."
-i)
# yeah, we know
;;
+ --root)
+ REBASE_ROOT=t
+ ;;
--onto)
shift
ONTO=$(git rev-parse --verify "$1") ||
@@ -555,7 +566,7 @@ first and then run 'git rebase --continue' again."
--)
shift
run_pre_rebase_hook ${1+"$@"}
- test $# -eq 1 -o $# -eq 2 || usage
+ test ! -z "$REBASE_ROOT" -o $# -eq 1 -o $# -eq 2 || usage
test -d "$DOTEST" &&
die "Interactive rebase already started"
@@ -566,15 +577,22 @@ first and then run 'git rebase --continue' again."
require_clean_work_tree
- UPSTREAM=$(git rev-parse --verify "$1") || die "Invalid base"
- test -z "$ONTO" && ONTO=$UPSTREAM
+ if test -z "$REBASE_ROOT"
+ then
+ UPSTREAM=$(git rev-parse --verify "$1") || die "Invalid base"
+ test -z "$ONTO" && ONTO=$UPSTREAM
+ shift
+ else
+ test -z "$ONTO" &&
+ die "You must specify --onto when using --root"
+ fi
- if test ! -z "$2"
+ if test ! -z "$1"
then
- output git show-ref --verify --quiet "refs/heads/$2" ||
- die "Invalid branchname: $2"
- output git checkout "$2" ||
- die "Could not checkout $2"
+ output git show-ref --verify --quiet "refs/heads/$1" ||
+ die "Invalid branchname: $1"
+ output git checkout "$1" ||
+ die "Could not checkout $1"
fi
HEAD=$(git rev-parse --verify HEAD) || die "No HEAD?"
@@ -613,12 +631,21 @@ first and then run 'git rebase --continue' again."
MERGES_OPTION="--no-merges --cherry-pick"
fi
- SHORTUPSTREAM=$(git rev-parse --short $UPSTREAM)
SHORTHEAD=$(git rev-parse --short $HEAD)
SHORTONTO=$(git rev-parse --short $ONTO)
+ if test -z "$REBASE_ROOT"
+ # this is now equivalent to ! -z "$UPSTREAM"
+ then
+ SHORTUPSTREAM=$(git rev-parse --short $UPSTREAM)
+ REVISIONS=$UPSTREAM...$HEAD
+ SHORTREVISIONS=$SHORTUPSTREAM..$SHORTHEAD
+ else
+ REVISIONS=$HEAD
+ SHORTREVISIONS=$SHORTHEAD
+ fi
git rev-list $MERGES_OPTION --pretty=oneline --abbrev-commit \
--abbrev=7 --reverse --left-right --topo-order \
- $UPSTREAM...$HEAD | \
+ $REVISIONS | \
sed -n "s/^>//p" | while read shortsha1 rest
do
if test t != "$PRESERVE_MERGES"
@@ -647,11 +674,11 @@ first and then run 'git rebase --continue' again."
then
mkdir "$DROPPED"
# Save all non-cherry-picked changes
- git rev-list $UPSTREAM...$HEAD --left-right --cherry-pick | \
+ git rev-list $REVISIONS --left-right --cherry-pick | \
sed -n "s/^>//p" > "$DOTEST"/not-cherry-picks
# Now all commits and note which ones are missing in
# not-cherry-picks and hence being dropped
- git rev-list $UPSTREAM..$HEAD |
+ git rev-list $REVISIONS |
while read rev
do
if test -f "$REWRITTEN"/$rev -a "$(grep "$rev" "$DOTEST"/not-cherry-picks)" = ""
@@ -670,7 +697,7 @@ first and then run 'git rebase --continue' again."
test -s "$TODO" || echo noop >> "$TODO"
cat >> "$TODO" << EOF
-# Rebase $SHORTUPSTREAM..$SHORTHEAD onto $SHORTONTO
+# Rebase $SHORTREVISIONS onto $SHORTONTO
#
# Commands:
# p, pick = use commit
diff --git a/t/t3412-rebase-root.sh b/t/t3412-rebase-root.sh
index 63ec5e6..bb44a52 100755
--- a/t/t3412-rebase-root.sh
+++ b/t/t3412-rebase-root.sh
@@ -49,4 +49,18 @@ test_expect_success 'rebase --root --onto <newbase> <branch>' '
test_cmp expect rebased2
'
+test_expect_success 'rebase -i --root --onto <newbase>' '
+ git checkout -b work3 other &&
+ GIT_EDITOR=: git rebase -i --root --onto master &&
+ git log --pretty=tformat:"%s" > rebased3 &&
+ test_cmp expect rebased3
+'
+
+test_expect_success 'rebase -i --root --onto <newbase> <branch>' '
+ git branch work4 other &&
+ GIT_EDITOR=: git rebase -i --root --onto master work4 &&
+ git log --pretty=tformat:"%s" > rebased4 &&
+ test_cmp expect rebased4
+'
+
test_done
--
1.6.1.1.g4c1d9.dirty
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox