admin管理员组文章数量:1296922
We are using Visual Sutdio Data-tier Application, a.k.a. SQL Server Database Project, to control the SQL source code of our database, including the table definitions.
As an example, we are making changes as shown in the following screenshot of Visual Sutdio's "SQL Schema Compare".
When we click on the "Update" button to import the changes, Visual Studio will do cosmetic adjustments to the vertical alignment of the source code, as a result, the unchanged lines appear different in the text diff of Git because of the additional whitespace. See the following screenshot for Git's text diff.
diff --git a/mssql-project/schema/Tables/sales_order.sql b/mssql-project/schema/Tables/sales_order.sql
index 7c22249..25a1b75 100644
--- a/mssql-project/schema/Tables/sales_order.sql
+++ b/mssql-project/schema/Tables/sales_order.sql
@@ -1,172 +1,304 @@
CREATE TABLE [schema].[sales_order] (
- [entity_id] BIGINT IDENTITY (2956088, 1) NOT NULL,
- [state] NVARCHAR (32) DEFAULT (NULL) NULL,
- [status] NVARCHAR (32) DEFAULT (NULL) NULL,
- [coupon_code] NVARCHAR (255) DEFAULT (NULL) NULL,
- [protect_code] NVARCHAR (255) DEFAULT (NULL) NULL,
- [shipping_description] NVARCHAR (255) DEFAULT (NULL) NULL,
- [is_virtual] INT DEFAULT (NULL) NULL,
- [store_id] INT DEFAULT (NULL) NULL,
- [customer_id] BIGINT DEFAULT (NULL) NULL,
...
+ [entity_id] BIGINT IDENTITY (8191339, 1) NOT NULL,
+ [state] NVARCHAR (32) DEFAULT (NULL) NULL,
+ [status] NVARCHAR (32) DEFAULT (NULL) NULL,
+ [coupon_code] NVARCHAR (255) DEFAULT (NULL) NULL,
+ [protect_code] NVARCHAR (255) DEFAULT (NULL) NULL,
+ [shipping_description] NVARCHAR (255) DEFAULT (NULL) NULL,
+ [is_virtual] INT DEFAULT (NULL) NULL,
+ [store_id] INT DEFAULT (NULL) NULL,
+ [customer_id] BIGINT DEFAULT (NULL) NULL,
...
We wonder how to overcome the additonal whitespace, and let the text diff show more meaning results.
本文标签:
版权声明:本文标题:How to show more meaningful git differences despite of the source code vertical alignment changes of Visual Studio Data-tier App 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741644761a2390121.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论