From: Joao Pinto <Joao.Pinto@synopsys.com>
To: Stefan Beller <sbeller@google.com>, Joao Pinto <Joao.Pinto@synopsys.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
"CARLOS.PALMINHA@synopsys.com" <CARLOS.PALMINHA@synopsys.com>
Subject: Re: Git: new feature suggestion
Date: Wed, 18 Jan 2017 19:04:43 +0000 [thread overview]
Message-ID: <21caed00-d103-5534-156c-0c19f25e0879@synopsys.com> (raw)
In-Reply-To: <CAGZ79kYXQcUB+rVkboY9fMqu6R3RoHEJ7BTJn_+-RScFDjEduA@mail.gmail.com>
Hi Stefan,
Às 6:50 PM de 1/18/2017, Stefan Beller escreveu:
> On Wed, Jan 18, 2017 at 2:40 AM, Joao Pinto <Joao.Pinto@synopsys.com> wrote:
>> Hello,
>>
>> My name is Joao Pinto, I work at Synopsys and I am a frequent Linux Kernel
>> contributor.
>>
>> Let me start by congratulate you for the fantastic work you have been doing with
>> Git which is an excellent tool.
>>
>> The Linux Kernel as all systems needs to be improved and re-organized to be
>> better prepared for future development and sometimes we need to change
>> folder/files names or even move things around.
>> I have seen a lot of Linux developers avoid this re-organization operations
>> because they would lose the renamed file history, because a new log is created
>> for the new file, even if it is a renamed version of itself.
>
> Well there are a couple of things to help with digging in the logs.
>
> git log:
> --follow
> Continue listing the history of a file beyond renames (works only
> for a single file).
>
> -M[<n>], --find-renames[=<n>]
> If generating diffs, detect and report renames for each commit. For
> following files across renames while traversing history, see
> --follow. If n is specified, it is a threshold on the similarity
> index (i.e. amount of addition/deletions compared to the file’s
> size). For example, -M90% means Git should consider a delete/add
> pair to be a rename if more than 90% of the file hasn’t changed.
> Without a % sign, the number is to be read as a fraction, with a
> decimal point before it. I.e., -M5 becomes 0.5, and is thus the
> same as -M50%. Similarly, -M05 is the same as -M5%. To limit
> detection to exact renames, use -M100%. The default similarity
> index is 50%.
>
> -C[<n>], --find-copies[=<n>]
> Detect copies as well as renames. See also --find-copies-harder. If
> n is specified, it has the same meaning as for -M<n>.
>
>
>
>> I am sending you this e-mail to suggest the creation of a new feature in Git:
>> when renamed, a file or folder should inherit his parent’s log and a “rename: …”
>> would be automatically created or have some kind of pointer to its “old” form to
>> make history analysis easier.
>
> How do you currently analyse history, which detailed feature is missing?
>
> Mind that in the Git data model we deliberately do not record the rename
> at commit time, but rather want to identify the renames at log time.
> This is because
> in the meantime between commit and log viewing someone could have written
> a better rename detection, whereas at commit time we'd be stuck with ancient
> cruft forever. ;)
>
>>
>> I volunteer to help in the new feature if you find it useful. I think it would
>> improve log history analysis and would enable developers to better organize old
>> code.
>
> IMHO complete renames (i.e. git mv path/a/file.c path/b/thing.c) are already
> covered quite well. Partial rename (e.g. moving code from one file into two
> separate files or vice versa) is still a bit hard.
>
> I started such a new feature, see
> https://urldefense.proofpoint.com/v2/url?u=https-3A__public-2Dinbox.org_git_20160903033120.20511-2D1-2Dsbeller-40google.com_&d=DwIFaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=s2fO0hii0OGNOv9qQy_HRXy-xAJUD1NNoEcc3io_kx0&m=BseICq5hy9UHxmX2XP8oPYLbn-HoEUlEuVUzqPHkX58&s=PybtKK0ELH3Nld_CQSYZnLqCQOWvnU4Fjj5iV_7EKqE&e=
> latest code is at https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_stefanbeller_git_commits_colored-5Fdiff12&d=DwIFaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=s2fO0hii0OGNOv9qQy_HRXy-xAJUD1NNoEcc3io_kx0&m=BseICq5hy9UHxmX2XP8oPYLbn-HoEUlEuVUzqPHkX58&s=pkTehcEmeHVLHdcNbUiU03meyH10cgUbGqLgOqXcL6w&e= ,
> but the latest two commits are bogus and need rewriting.
>
> I think this feature is not 100% what you are aiming at, but is very close.
>
> Thanks,
> Stefan
>
Great info, helps a lot! I am going to analyse and get back to you ASAP.
Thanks
next prev parent reply other threads:[~2017-01-18 19:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-18 10:40 Git: new feature suggestion Joao Pinto
2017-01-18 18:50 ` Stefan Beller
2017-01-18 19:04 ` Joao Pinto [this message]
2017-01-19 6:33 ` Konstantin Khomoutov
2017-01-19 17:55 ` Joao Pinto
2017-01-19 18:17 ` Junio C Hamano
2017-01-19 18:39 ` Linus Torvalds
2017-01-19 18:54 ` Joao Pinto
2017-01-19 19:16 ` Linus Torvalds
2017-01-19 21:51 ` Joao Pinto
2017-01-19 22:03 ` Stefan Beller
2017-01-20 10:44 ` Joao Pinto
2017-01-19 21:48 ` Jakub Narębski
2017-01-20 0:26 ` Linus Torvalds
2017-01-20 11:18 ` Jakub Narębski
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=21caed00-d103-5534-156c-0c19f25e0879@synopsys.com \
--to=joao.pinto@synopsys.com \
--cc=CARLOS.PALMINHA@synopsys.com \
--cc=git@vger.kernel.org \
--cc=sbeller@google.com \
--cc=torvalds@linux-foundation.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).